diff --git a/.gitignore b/.gitignore index 2dc36f94..d2d605d0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ vendor/ bin/ composer.lock .vagrant +phpunit.xml +.phpunit.result.cache +.phpunit.coverage +.phpunit.coverage.* diff --git a/.jane-openapi b/.jane-openapi index 6822343e..07adee3c 100644 --- a/.jane-openapi +++ b/.jane-openapi @@ -3,5 +3,6 @@ return [ 'directory' => 'generated/', 'namespace' => 'Docker\\API', - 'openapi-file' => __DIR__ . '/docker-swagger.json', + 'strict' => false, + 'openapi-file' => __DIR__ . '/v1.47.yaml', ]; diff --git a/README.md b/README.md index 8d972660..e697f655 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Docker PHP **Docker PHP** (for lack of a better name) is a [Docker](http://docker.com/) client written in PHP. This library aim to reach 100% API support of the Docker Engine. -The test suite currently passes against the [Docker Remote API v1.24](http://docs.docker.com/reference/api/docker_remote_api_v1.24/). +The test suite currently passes against the [Docker Remote API v1.47](https://docs.docker.com/reference/api/engine/version/v1.47/). [![Documentation Status](https://readthedocs.org/projects/docker-php/badge/?version=latest)](http://docker-php.readthedocs.org/en/latest/) [![Latest Version](https://img.shields.io/github/release/plesk/docker-php.svg?style=flat-square)](https://github.com/plesk/docker-php/releases) @@ -77,13 +77,6 @@ Credits This README heavily inspired by [willdurand/Negotiation](https://github.com/willdurand/Negotiation) by @willdurand. This guy is pretty awesome. -Change of jane/open-api dependency ----------------------------------- - -Previous version of **Docker PHP** library had **"jane/open-api": "^1.3"** composer dependency. This project is deprecated and archived. -Authors suggest to use https://github.com/janephp/janephp but we used a few classes only so we rewrote them in this library (src/custom). -If some issues happen we should consider to use recommended library and rewrite this library in appropriate way which could be tricky task since code is completely different - License ------- diff --git a/composer.json b/composer.json index 2fa1b348..fcba0b29 100644 --- a/composer.json +++ b/composer.json @@ -17,22 +17,27 @@ "require": { "php": ">=8.2", "symfony/filesystem": "^6.3", - "symfony/process": "^6.3", - "php-http/client-common": "^2.5", - "php-http/message": "^1.16", + "symfony/process": "^6.3|^7.0", + "php-http/client-common": "^2.7", "guzzlehttp/psr7": "^2.6", "symfony/serializer": "^6.3", "symfony/options-resolver": "^6.3", - "php-http/message-factory": "^1.1" + "jane-php/open-api-runtime": "^7.8" }, "require-dev": { "phpunit/phpunit": "^10.4", - "friendsofphp/php-cs-fixer": "^3.35" + "friendsofphp/php-cs-fixer": "^3.35", + "jane-php/open-api-2": "^7.8" }, "scripts": { "test": "vendor/bin/phpunit", "test-ci": "vendor/bin/phpunit --coverage-clover build/coverage.xml" }, "prefer-stable": true, - "minimum-stability": "dev" + "minimum-stability": "dev", + "config": { + "allow-plugins": { + "php-http/discovery": false + } + } } diff --git a/docker-compose.yml b/docker-compose.yml index fc715ddb..205e1cf2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,26 +1,27 @@ -php54: - image: jolicode/php54 - command: sh -c 'cd /app && composer update && vendor/bin/phpunit' - user: root - volumes: - - ./:/app - - /var/run/docker.sock:/var/run/docker.sock -php55: - image: jolicode/php55 - command: sh -c 'cd /app && composer update && vendor/bin/phpunit' - user: root - volumes: - - ./:/app - - /var/run/docker.sock:/var/run/docker.sock -php56: - image: phundament/php-one:5.6-fpm - command: sh -c 'composer update && vendor/bin/phpunit' - volumes: - - ./:/app - - /var/run/docker.sock:/var/run/docker.sock -php70: - image: phundament/php-one:7.0-fpm - command: sh -c 'composer update && vendor/bin/phpunit' - volumes: - - ./:/app - - /var/run/docker.sock:/var/run/docker.sock +services: + php54: + image: jolicode/php54 + command: sh -c 'cd /app && composer update && vendor/bin/phpunit' + user: root + volumes: + - ./:/app + - /var/run/docker.sock:/var/run/docker.sock + php55: + image: jolicode/php55 + command: sh -c 'cd /app && composer update && vendor/bin/phpunit' + user: root + volumes: + - ./:/app + - /var/run/docker.sock:/var/run/docker.sock + php56: + image: phundament/php-one:5.6-fpm + command: sh -c 'composer update && vendor/bin/phpunit' + volumes: + - ./:/app + - /var/run/docker.sock:/var/run/docker.sock + php70: + image: phundament/php-one:7.0-fpm + command: sh -c 'composer update && vendor/bin/phpunit' + volumes: + - ./:/app + - /var/run/docker.sock:/var/run/docker.sock diff --git a/docker-swagger.json b/docker-swagger.json deleted file mode 100644 index eb982bbb..00000000 --- a/docker-swagger.json +++ /dev/null @@ -1,5261 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Docker Remote API", - "description": "The API for each docker installation.", - "termsOfService": "http://example.com/tos/", - "version": "v1.22" - }, - "host": "localhost", - "schemes": [ - "http", - "https" - ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "definitions": { - "Version": { - "type": "object", - "properties": { - "Version": { - "type": "string" - }, - "Os": { - "type": "string" - }, - "KernelVersion": { - "type": "string" - }, - "GoVersion": { - "type": "string" - }, - "GitCommit": { - "type": "string" - }, - "Arch": { - "type": "string" - }, - "ApiVersion": { - "type": "string" - }, - "Experimental": { - "type": "boolean" - }, - "BuildTime": { - "type": "string" - } - } - }, - "Port": { - "type": "object", - "properties": { - "PrivatePort": { - "type": "integer" - }, - "PublicPort": { - "type": "integer" - }, - "Type": { - "type": "string" - } - } - }, - "Mount": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Source": { - "type": "string" - }, - "Destination": { - "type": "string" - }, - "Driver": { - "type": "string" - }, - "Mode": { - "type": "string" - }, - "RW": { - "type": "boolean" - }, - "Propagation": { - "type": "string" - } - } - }, - "LogConfig": { - "type": "object", - "properties": { - "Type": { - "type": "string" - }, - "Config": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - } - } - }, - "Ulimit": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Soft": { - "type": "integer" - }, - "Hard": { - "type": "integer" - } - } - }, - "Device": { - "type": "object", - "properties": { - "PathOnHost": { - "type": "string" - }, - "PathInContainer": { - "type": "string" - }, - "CgroupPermissions": { - "type": "string" - } - } - }, - "RestartPolicy": { - "type": "object", - "properties": { - "Name": { - "type": "string", - "enum": ["always", "on-failure"] - }, - "MaximumRetryCount": { - "type": "integer" - } - }, - "default": {} - }, - "PortBinding": { - "type": "object", - "properties": { - "HostPort": { - "type": "string" - }, - "HostIp": { - "type": "string" - } - } - }, - "HostConfig": { - "type": "object", - "properties": { - "Binds": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "Tmpfs": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "Links": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "LxcConf": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "Memory": { - "type": "integer", - "default": 0 - }, - "MemorySwap": { - "type": "integer", - "default": 0 - }, - "MemoryReservation": { - "type": "integer" - }, - "KernelMemory": { - "type": "integer" - }, - "CpuShares": { - "type": "integer" - }, - "CpuPeriod": { - "type": "integer" - }, - "CpuQuota": { - "type": "integer" - }, - "CpusetCpus": { - "type": "string" - }, - "CpusetMems": { - "type": "string" - }, - "MaximumIOps": { - "type": "integer" - }, - "MaximumIOBps": { - "type": "integer" - }, - "BlkioWeight": { - "type": "integer" - }, - "BlkioWeightDevice": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/DeviceWeight" - } - }, - "BlkioDeviceReadBps": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/DeviceRate" - } - }, - "BlkioDeviceReadIOps": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/DeviceRate" - } - }, - "BlkioDeviceWriteBps": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/DeviceRate" - } - }, - "BlkioDeviceWriteIOps": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/DeviceRate" - } - }, - "MemorySwappiness": { - "type": "integer" - }, - "OomKillDisable": { - "type": "boolean" - }, - "OomScoreAdj": { - "type": "integer" - }, - "PidsLimit": { - "type": "integer" - }, - "PortBindings": { - "type": ["object", "null"], - "additionalProperties": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/PortBinding" - } - } - }, - "PublishAllPorts": { - "type": "boolean" - }, - "Privileged": { - "type": "boolean" - }, - "ReadonlyRootfs": { - "type": "boolean" - }, - "Sysctls": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "StorageOpt": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "Dns": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "DnsOptions": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "DnsSearch": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "ExtraHosts": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "VolumesFrom": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "CapAdd": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "CapDrop": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "GroupAdd": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "RestartPolicy": { - "$ref": "#/definitions/RestartPolicy" - }, - "UsernsMode": { - "type": "string" - }, - "NetworkMode": { - "type": "string" - }, - "Devices": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/Device" - } - }, - "Ulimits": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/Ulimit" - } - }, - "SecurityOpt": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "LogConfig": { - "$ref": "#/definitions/LogConfig" - }, - "CgroupParent": { - "type": "string" - }, - "VolumeDriver": { - "type": "string" - }, - "ShmSize": { - "type": "integer" - } - } - }, - "DeviceWeight": { - "type": "object", - "properties": { - "Path": { - "type": "string" - }, - "Weight": { - "type": "integer" - } - } - }, - "DeviceRate": { - "type": "object", - "properties": { - "Path": { - "type": "string" - }, - "Rate": { - "type": ["integer","string"] - } - } - }, - "ContainerInfo": { - "type": "object", - "properties": { - "Id": { - "type": "string" - }, - "Names": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "Image": { - "type": "string" - }, - "ImageID": { - "type": "string" - }, - "Command": { - "type": "string" - }, - "Created": { - "type": "integer" - }, - "State": { - "type": "string" - }, - "Status": { - "type": "string" - }, - "Ports": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/Port" - } - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "SizeRw": { - "type": "integer" - }, - "SizeRootFs": { - "type": "integer" - }, - "HostConfig": { - "$ref": "#/definitions/HostConfig" - }, - "NetworkSettings": { - "$ref": "#/definitions/NetworkConfig" - }, - "Mounts": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/Mount" - } - }, - "Node": { - "$ref": "#/definitions/ContainerNode" - } - } - }, - "ContainerConfig": { - "type": "object", - "properties": { - "Hostname": { - "type": "string" - }, - "Domainname": { - "type": "string" - }, - "User": { - "type": "string" - }, - "AttachStdin": { - "type": "boolean", - "default": false - }, - "AttachStdout": { - "type": "boolean", - "default": true - }, - "AttachStderr": { - "type": "boolean", - "default": true - }, - "Tty": { - "type": "boolean", - "default": false - }, - "OpenStdin": { - "type": "boolean", - "default": false - }, - "StdinOnce": { - "type": "boolean", - "default": false - }, - "Env": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "Cmd": { - "type": ["array", "string"], - "items": { - "type": "string" - } - }, - "Entrypoint": { - "type": ["array", "string"], - "items": { - "type": "string" - } - }, - "Image": { - "type": "string" - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "Volumes": { - "type": ["object", "null"], - "additionalProperties": { - "type": "object" - } - }, - "WorkingDir": { - "type": "string" - }, - "NetworkDisabled": { - "type": "boolean" - }, - "MacAddress": { - "type": "string" - }, - "ExposedPorts": { - "type": ["object", "null"], - "additionalProperties": { - "type": "object", - "enum": [{}], - "default": {} - } - }, - "StopSignal": { - "type": "string" - }, - "HostConfig": { - "$ref": "#/definitions/HostConfig" - }, - "NetworkingConfig": { - "$ref": "#/definitions/NetworkingConfig" - } - } - }, - "NetworkingConfig": { - "type": "object", - "properties": { - "EndpointsConfig": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/EndpointSettings" - } - } - } - }, - "EndpointSettings": { - "type": "object", - "properties": { - "IPAMConfig": { - "$ref": "#/definitions/EndpointIPAMConfig" - }, - "Links": { - "type": "array", - "items": { - "type": "string" - } - }, - "Aliases": { - "type": "array", - "items": { - "type": "string" - } - }, - "NetworkID": { - "type": "string" - }, - "EndpointID": { - "type": "string" - }, - "Gateway": { - "type": "string" - }, - "IPAddress": { - "type": "string" - }, - "IPPrefixLen": { - "type": "integer" - }, - "IPv6Gateway": { - "type": "string" - }, - "GlobalIPv6Address": { - "type": "string" - }, - "GlobalIPv6PrefixLen": { - "type": "integer" - }, - "MacAddress": { - "type": "string" - } - } - }, - "EndpointIPAMConfig": { - "type": "object", - "properties": { - "IPv4Address": { - "type": "string" - }, - "IPv6Address": { - "type": "string" - }, - "LinkLocalIPs": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "NetworkConfig": { - "type": "object", - "properties": { - "Bridge": { - "type": "string" - }, - "Gateway": { - "type": "string" - }, - "IPAddress": { - "type": "string" - }, - "IPPrefixLen": { - "type": "integer" - }, - "MacAddress": { - "type": "string" - }, - "PortMapping": { - "type": "string" - }, - "Networks": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ContainerNetwork" - } - }, - "Ports": { - "type": ["object", "null"], - "additionalProperties": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/PortBinding" - } - } - } - } - }, - "ContainerNetwork": { - "type": "object", - "properties": { - "NetworkID": { - "type": "string" - }, - "EndpointID": { - "type": "string" - }, - "Gateway": { - "type": "string" - }, - "IPAddress": { - "type": "string" - }, - "IPPrefixLen": { - "type": "integer" - }, - "IPv6Gateway": { - "type": "string" - }, - "GlobalIPv6Address": { - "type": "string" - }, - "GlobalIPv6PrefixLen": { - "type": "integer" - }, - "MacAddress": { - "type": "string" - } - } - }, - "ContainerState": { - "type": "object", - "properties": { - "Error": { - "type": "string" - }, - "ExitCode": { - "type": "integer" - }, - "FinishedAt": { - "type": "string" - }, - "OOMKilled": { - "type": "boolean" - }, - "Paused": { - "type": "boolean" - }, - "Pid": { - "type": "integer" - }, - "Restarting": { - "type": "boolean" - }, - "Running": { - "type": "boolean" - }, - "StartedAt": { - "type": "string" - } - } - }, - "Container": { - "type": "object", - "properties": { - "AppArmorProfile": { - "type": "string" - }, - "Args": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "Config": { - "$ref": "#/definitions/ContainerConfig" - }, - "Created": { - "type": "string" - }, - "Driver": { - "type": "string" - }, - "ExecDriver": { - "type": "string" - }, - "ExecIDs": { - "type": "string" - }, - "HostConfig": { - "$ref": "#/definitions/HostConfig" - }, - "HostnamePath": { - "type": "string" - }, - "HostsPath": { - "type": "string" - }, - "LogPath": { - "type": "string" - }, - "Id": { - "type": "string" - }, - "Image": { - "type": "string" - }, - "MountLabel": { - "type": "string" - }, - "Name": { - "type": "string" - }, - "NetworkSettings": { - "$ref": "#/definitions/NetworkConfig" - }, - "Path": { - "type": "string" - }, - "ProcessLabel": { - "type": "string" - }, - "ResolvConfPath": { - "type": "string" - }, - "RestartCount": { - "type": "integer" - }, - "State": { - "$ref": "#/definitions/ContainerState" - }, - "Mounts": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/Mount" - } - } - } - }, - "ContainerTop": { - "type": "object", - "properties": { - "Titles": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "Processes": { - "type": ["array", "null"], - "items": { - "type": ["array", "null"], - "items": { - "type": "string" - } - } - } - } - }, - "ContainerChange": { - "type": "object", - "properties": { - "Path": { - "type": "string" - }, - "Kind": { - "type": "integer" - } - } - }, - "ContainerWait": { - "type": "object", - "properties": { - "StatusCode": { - "type": "integer" - } - } - }, - "GraphDriver": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Data": { - "type": "object" - } - } - }, - "ImageItem": { - "type": "object", - "properties": { - "RepoTags": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "Id": { - "type": "string" - }, - "ParentId": { - "type": "string" - }, - "Created": { - "type": "integer" - }, - "Size": { - "type": "integer" - }, - "VirtualSize": { - "type": "integer" - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "RepoDigests": { - "type": ["array", "null"], - "items": { - "type": "string" - } - } - } - }, - "Image": { - "type": "object", - "properties": { - "Id": { - "type": "string" - }, - "Container": { - "type": "string" - }, - "Comment": { - "type": "string" - }, - "Os": { - "type": "string" - }, - "Architecture": { - "type": "string" - }, - "Parent": { - "type": "string" - }, - "ContainerConfig": { - "$ref": "#/definitions/ContainerConfig" - }, - "DockerVersion": { - "type": "string" - }, - "VirtualSize": { - "type": "integer" - }, - "Size": { - "type": "integer" - }, - "Author": { - "type": "string" - }, - "Created": { - "type": "string" - }, - "GraphDriver": { - "$ref": "#/definitions/GraphDriver" - }, - "RepoDigests": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "RepoTags": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "Config": { - "$ref": "#/definitions/ContainerConfig" - } - } - }, - "ImageHistoryItem": { - "type": "object", - "properties": { - "Id": { - "type": "string" - }, - "Created": { - "type": "integer" - }, - "CreatedBy": { - "type": "string" - }, - "Tags": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "Size": { - "type": "integer" - }, - "Comment": { - "type": "string" - } - } - }, - "ImageSearchResult": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "is_official": { - "type": "boolean" - }, - "is_automated": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "star_count": { - "type": "integer" - } - } - }, - "AuthConfig": { - "type": "object", - "properties": { - "username": { - "type": "string" - }, - "password": { - "type": "string" - }, - "email": { - "type": "string" - }, - "serveraddress": { - "type": "string" - }, - "registrytoken": { - "type": "string" - } - } - }, - "SystemInformation": { - "type": "object", - "properties": { - "Architecture": { - "type": "string" - }, - "ClusterStore": { - "type": "string" - }, - "CgroupDriver": { - "type": "string" - }, - "Containers": { - "type": "integer" - }, - "ContainersRunning": { - "type": "integer" - }, - "ContainersStopped": { - "type": "integer" - }, - "ContainersPaused": { - "type": "integer" - }, - "CpuCfsPeriod": { - "type": "boolean" - }, - "CpuCfsQuota": { - "type": "boolean" - }, - "Debug": { - "type": "boolean" - }, - "DiscoveryBackend": { - "type": "string" - }, - "DockerRootDir": { - "type": "string" - }, - "Driver": { - "type": "string" - }, - "DriverStatus": { - "type": ["array", "null"], - "items": { - "type": ["array", "null"], - "items": { - "type": "string" - } - } - }, - "SystemStatus": { - "type": ["array", "null"], - "items": { - "type": ["array", "null"], - "items": { - "type": "string" - } - } - }, - "ExperimentalBuild": { - "type": "boolean" - }, - "HttpProxy": { - "type": "string" - }, - "HttpsProxy": { - "type": "string" - }, - "ID": { - "type": "string" - }, - "IPv4Forwarding": { - "type": "boolean" - }, - "Images": { - "type": "integer" - }, - "IndexServerAddress": { - "type": "string" - }, - "InitPath": { - "type": "string" - }, - "InitSha1": { - "type": "string" - }, - "KernelMemory": { - "type": "boolean" - }, - "KernelVersion": { - "type": "string" - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "MemTotal": { - "type": "integer" - }, - "MemoryLimit": { - "type": "boolean" - }, - "NCPU": { - "type": "integer" - }, - "NEventsListener": { - "type": "integer" - }, - "NFd": { - "type": "integer" - }, - "NGoroutines": { - "type": "integer" - }, - "Name": { - "type": "string" - }, - "NoProxy": { - "type": "string" - }, - "OomKillDisable": { - "type": "boolean" - }, - "OSType": { - "type": "string" - }, - "OperatingSystem": { - "type": "string" - }, - "RegistryConfig": { - "$ref": "#/definitions/RegistryConfig" - }, - "SecurityOptions": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "SwapLimit": { - "type": "boolean" - }, - "SystemTime": { - "type": "string" - }, - "ServerVersion": { - "type": "string" - } - } - }, - "RegistryConfig": { - "type": "object", - "properties": { - "IndexConfigs": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Registry" - } - }, - "InsecureRegistryCIDRs": { - "type": ["array", "null"], - "items": { - "type": "string" - } - } - } - }, - "Registry": { - "type": "object", - "properties": { - "Mirrors": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "Name": { - "type": "string" - }, - "Official": { - "type": "boolean" - }, - "Secure": { - "type": "boolean" - } - } - }, - "CommitResult": { - "type": "object", - "properties": { - "Id": { - "type": "string" - } - } - }, - "ExecCreateResult": { - "type": "object", - "properties": { - "Id": { - "type": "string" - }, - "Warnings": { - "type": ["array", "null"], - "items": { - "type": "string" - } - } - } - }, - "ExecConfig": { - "type": "object", - "properties": { - "AttachStdin": { - "type": "boolean" - }, - "AttachStdout": { - "type": "boolean" - }, - "AttachStderr": { - "type": "boolean" - }, - "Tty": { - "type": "boolean" - }, - "Cmd": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "DetachKeys": { - "type": "string" - } - } - }, - "ExecStartConfig": { - "type": "object", - "properties": { - "Detach": { - "type": "boolean" - }, - "Tty": { - "type": "boolean" - } - } - }, - "ExecCommand": { - "type": "object", - "properties": { - "ID": { - "type": "string" - }, - "Running": { - "type": "boolean" - }, - "ExitCode": { - "type": "integer" - }, - "ProcessConfig": { - "$ref": "#/definitions/ProcessConfig" - }, - "OpenStdin": { - "type": "boolean" - }, - "OpenStderr": { - "type": "boolean" - }, - "OpenStdout": { - "type": "boolean" - }, - "Container": { - "$ref": "#/definitions/Container" - }, - "DetachKeys": { - "type": "string" - } - } - }, - "ProcessConfig": { - "type": "object", - "properties": { - "privileged": { - "type": "boolean" - }, - "user": { - "type": "string" - }, - "tty": { - "type": "boolean" - }, - "entrypoint": { - "type": "string" - }, - "arguments": { - "type": ["array", "null"], - "items": { - "type": "string" - } - } - } - }, - "VolumeList": { - "type": "object", - "properties": { - "Volumes": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/Volume" - } - } - } - }, - "Volume": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Driver": { - "type": "string" - }, - "Mountpoint": { - "type": "string" - } - } - }, - "VolumeConfig": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Driver": { - "type": "string" - }, - "DriverOpts": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "Network": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Id": { - "type": "string" - }, - "Scope": { - "type": "string" - }, - "Driver": { - "type": "string" - }, - "EnableIPv6": { - "type": "boolean" - }, - "IPAM": { - "$ref": "#/definitions/IPAM" - }, - "Internal": { - "type": "boolean" - }, - "Containers": { - "type": ["object", "null"], - "additionalProperties": { - "$ref": "#/definitions/NetworkContainer" - } - }, - "Options": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - } - } - }, - "IPAM": { - "type": "object", - "properties": { - "Driver": { - "type": "string" - }, - "Config": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/IPAMConfig" - } - }, - "Options": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - } - } - }, - "IPAMConfig": { - "type": "object", - "properties": { - "Subnet": { - "type": "string" - }, - "IPRange": { - "type": "string" - }, - "Gateway": { - "type": "string" - } - } - }, - "NetworkContainer": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "EndpointID": { - "type": "string" - }, - "MacAddress": { - "type": "string" - }, - "IPv4Address": { - "type": "string" - }, - "IPv6Address": { - "type": "string" - } - } - }, - "NetworkCreateResult": { - "type": "object", - "properties": { - "Id": { - "type": "string" - }, - "Warning": { - "type": "string" - } - } - }, - "NetworkCreateConfig": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "CheckDuplicate": { - "type": "boolean" - }, - "Driver": { - "type": "string" - }, - "EnableIPv6": { - "type": "boolean" - }, - "IPAM": { - "$ref": "#/definitions/IPAM" - }, - "Internal": { - "type": "boolean" - }, - "Options": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - } - } - }, - "ContainerConnect": { - "type": "object", - "properties": { - "Container": { - "type": "string" - }, - "EndpointConfig": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/EndpointConfig" - } - } - } - }, - "ContainerDisconnect": { - "type": "object", - "properties": { - "Container": { - "type": "string" - }, - "Force": { - "type": "boolean" - } - } - }, - "EndpointConfig": { - "type": "object", - "properties": { - "IPv4Address": { - "type": "string" - }, - "IPv6Address": { - "type": "string" - } - } - }, - "ContainerCreateResult": { - "type": "object", - "properties": { - "Id": { - "type": "string" - }, - "Warnings": { - "type": ["array", "null"], - "items": { - "type": "string" - } - } - } - }, - "BuildInfo": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "stream": { - "type": "string" - }, - "error": { - "type": "string" - }, - "errorDetail": { - "$ref": "#/definitions/ErrorDetail" - }, - "status": { - "type": "string" - }, - "progress": { - "type": "string" - }, - "progressDetail": { - "$ref": "#/definitions/ProgressDetail" - } - } - }, - "CreateImageInfo": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "error": { - "type": "string" - }, - "status": { - "type": "string" - }, - "progress": { - "type": "string" - }, - "progressDetail": { - "$ref": "#/definitions/ProgressDetail" - } - } - }, - "PushImageInfo": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "status": { - "type": "string" - }, - "progress": { - "type": "string" - }, - "progressDetail": { - "$ref": "#/definitions/ProgressDetail" - } - } - }, - "ErrorDetail": { - "type": "object", - "properties": { - "code": { - "type": "integer" - }, - "message": { - "type": "string" - } - } - }, - "ProgressDetail": { - "type": "object", - "properties": { - "code": { - "type": "integer" - }, - "message": { - "type": "integer" - }, - "current": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "Event": { - "type": "object", - "properties": { - "status": { - "type": "string" - }, - "id": { - "type": "string" - }, - "from": { - "type": "string" - }, - "time": { - "type": "integer" - }, - "timeNano": { - "type": "integer" - } - } - }, - "ResourceUpdate": { - "type": "object", - "properties": { - "BlkioWeight": { - "type": "integer" - }, - "CpuShares": { - "type": "integer" - }, - "CpuPeriod": { - "type": "integer" - }, - "CpuQuota": { - "type": "integer" - }, - "CpusetCpus": { - "type": "string" - }, - "CpusetMems": { - "type": "string" - }, - "Memory": { - "type": "integer" - }, - "MemorySwap": { - "type": "integer" - }, - "MemoryReservation": { - "type": "integer" - }, - "KernelMemory": { - "type": "integer" - }, - "RestartPolicy": { - "$ref": "#/definitions/RestartPolicy" - } - } - }, - "ContainerUpdateResult": { - "type": "object", - "properties": { - "Warnings": { - "type": ["array", "null"], - "items": { - "type": "string" - } - } - } - }, - "AuthResult": { - "type": "object", - "properties": { - "Status": { - "type": "string" - }, - "IdentityToken": { - "type": "string" - } - } - }, - "ContainerNode": { - "type": "object", - "properties": { - "Id": { - "type": "string" - }, - "Ip": { - "type": "string" - }, - "Addr": { - "type": "string" - }, - "Name": { - "type": "string" - } - } - }, - "Node": { - "type": "object", - "properties": { - "ID": { - "type": "string" - }, - "Version": { - "$ref": "#/definitions/NodeVersion" - }, - "CreatedAt": { - "type": "string", - "format": "date-time" - }, - "UpdatedAt": { - "type": "string", - "format": "date-time" - }, - "Spec": { - "$ref": "#/definitions/NodeSpec" - }, - "Description": { - "$ref": "#/definitions/NodeDescription" - }, - "Status": { - "$ref": "#/definitions/NodeStatus" - }, - "ManagerStatus": { - "$ref": "#/definitions/NodeManagerStatus" - } - } - }, - "NodeVersion": { - "type": "object", - "properties": { - "Index": { - "type": "string" - } - } - }, - "NodeSpec": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Role": { - "type": "string" - }, - "Availability": { - "type": "string" - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - } - } - }, - "NodeDescription": { - "type": "object", - "properties": { - "Hostname": { - "type": "string" - }, - "Platform": { - "$ref": "#/definitions/NodePlatform" - }, - "Resources": { - "$ref": "#/definitions/NodeResources" - }, - "Engine": { - "$ref": "#/definitions/NodeEngine" - } - } - }, - "NodeStatus": { - "type": "object", - "properties": { - "State": { - "type": "string" - } - } - }, - "NodeManagerStatus": { - "type": "object", - "properties": { - "Leader": { - "type": "boolean" - }, - "Reachability": { - "type": "string" - }, - "Addr": { - "type": "string" - } - } - }, - "NodePlatform": { - "type": "object", - "properties": { - "Architecture": { - "type": "string" - }, - "OS": { - "type": "string" - } - } - }, - "NodeResources": { - "type": "object", - "properties": { - "NanoCPUs": { - "type": "integer" - }, - "MemoryBytes": { - "type": "integer" - } - } - }, - "NodeEngine": { - "type": "object", - "properties": { - "EngineVersion": { - "type": "boolean" - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "Plugins": { - "type": "array", - "items": { - "$ref": "#/definitions/NodePlugin" - } - } - } - }, - "NodePlugin": { - "type": "object", - "properties": { - "Type": { - "type": "string" - }, - "Name": { - "type": "string" - } - } - }, - "SwarmConfig": { - "type": "object", - "properties": { - "ListenAddr": { - "type": "string" - }, - "AdvertiseAddr": { - "type": "string" - }, - "ForceNewCluster": { - "type": "boolean" - }, - "Spec": { - "$ref": "#/definitions/SwarmConfigSpec" - } - } - }, - "SwarmConfigSpec": { - "type": "object", - "properties": { - "Orchestration": { - "$ref": "#/definitions/SwarmConfigSpecOrchestration" - }, - "Raft": { - "$ref": "#/definitions/SwarmConfigSpecRaft" - }, - "Dispatcher": { - "$ref": "#/definitions/SwarmConfigSpecDispatcher" - }, - "CAConfig": { - "$ref": "#/definitions/SwarmConfigSpecCAConfig" - } - } - }, - "SwarmConfigSpecOrchestration": { - "type": "object", - "properties": { - "TaskHistoryRetentionLimit": { - "type": "integer" - } - } - }, - "SwarmConfigSpecRaft": { - "type": "object", - "properties": { - "SnapshotInterval": { - "type": "integer" - }, - "KeepOldSnapshots": { - "type": "integer" - }, - "LogEntriesForSlowFollowers": { - "type": "integer" - }, - "HeartbeatTick": { - "type": "integer" - }, - "ElectionTick": { - "type": "integer" - } - } - }, - "SwarmConfigSpecDispatcher": { - "type": "object", - "properties": { - "HeartbeatPeriod": { - "type": "integer" - } - } - }, - "SwarmConfigSpecCAConfig": { - "type": "object", - "properties": { - "NodeCertExpiry": { - "type": "boolean" - }, - "ExternalCA": { - "$ref": "#/definitions/SwarmConfigSpecCAConfigExternalCA" - } - } - }, - "SwarmConfigSpecCAConfigExternalCA": { - "type": "object", - "properties": { - "Protocol": { - "type": "string" - }, - "URL": { - "type": "string" - }, - "Options": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - } - } - }, - "SwarmJoinConfig": { - "type": "object", - "properties": { - "ListenAddr": { - "type": "string" - }, - "AdvertiseAddr": { - "type": "string" - }, - "RemoteAddrs": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "JoinToken": { - "type": "string" - } - } - }, - "SwarmUpdateConfig": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Orchestration": { - "$ref": "#/definitions/SwarmConfigSpecOrchestration" - }, - "Raft": { - "$ref": "#/definitions/SwarmConfigSpecRaft" - }, - "Dispatcher": { - "$ref": "#/definitions/SwarmConfigSpecDispatcher" - }, - "CAConfig": { - "$ref": "#/definitions/SwarmConfigSpecCAConfig" - }, - "JoinTokens": { - "$ref": "#/definitions/SwarmJoinTokens" - } - } - }, - "SwarmJoinTokens": { - "type": "object", - "properties": { - "Worker": { - "type": "string" - }, - "Manager": { - "type": "string" - } - } - }, - "Task": { - "type": "object", - "properties": { - "ID": { - "type": "string" - }, - "Version": { - "$ref": "#/definitions/NodeVersion" - }, - "CreatedAt": { - "type": "string", - "format": "date-time" - }, - "UpdatedAt": { - "type": "string", - "format": "date-time" - }, - "Name": { - "type": "string" - }, - "Spec": { - "$ref": "#/definitions/TaskSpec" - }, - "ServiceID": { - "type": "string" - }, - "Instance": { - "type": "integer" - }, - "NodeID": { - "type": "string" - }, - "ServiceAnnotations": { - "$ref": "#/definitions/Annotations" - }, - "Status": { - "$ref": "#/definitions/TaskStatus" - }, - "DesiredState": { - "type": "string" - }, - "NetworksAttachments": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/NetworkAttachment" - } - }, - "Endpoint": { - "$ref": "#/definitions/Endpoint" - } - } - }, - "TaskSpec": { - "type": "object", - "properties": { - "ContainerSpec": { - "$ref": "#/definitions/ContainerSpec" - }, - "Resources": { - "$ref": "#/definitions/TaskSpecResourceRequirements" - }, - "RestartPolicy": { - "$ref": "#/definitions/TaskSpecRestartPolicy" - }, - "Placement": { - "$ref": "#/definitions/TaskSpecPlacement" - } - } - }, - "TaskStatus": { - "type": "object", - "properties": { - "Timestamp": { - "type": "string" - }, - "State": { - "type": "string" - }, - "Message": { - "type": "string" - }, - "Err": { - "type": "string" - }, - "ContainerStatus": { - "$ref": "#/definitions/ContainerStatus" - } - } - }, - "NetworkAttachment": { - "type": "object", - "properties": { - "Network": { - "$ref": "#/definitions/SwarmNetwork" - }, - "Addresses": { - "type": ["array", "null"], - "items": { - "type": "string" - } - } - } - }, - "SwarmNetwork": { - "type": "object", - "properties": { - "ID": { - "type": "string" - }, - "Version": { - "$ref": "#/definitions/NodeVersion" - }, - "CreatedAt": { - "type": "string", - "format": "date-time" - }, - "UpdatedAt": { - "type": "string", - "format": "date-time" - }, - "Spec": { - "$ref": "#/definitions/SwarmNetworkSpec" - }, - "DriverState": { - "$ref": "#/definitions/Driver" - }, - "IPAM": { - "$ref": "#/definitions/SwarmIPAMOptions" - } - } - }, - "SwarmNetworkSpec": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "DriverConfiguration": { - "$ref": "#/definitions/Driver" - }, - "IPv6Enabled": { - "type": "boolean" - }, - "Internal": { - "type": "boolean" - }, - "IPAM": { - "$ref": "#/definitions/SwarmIPAMOptions" - } - } - }, - "SwarmIPAMOptions": { - "type": "object", - "properties": { - "Driver": { - "$ref": "#/definitions/Driver" - }, - "Configs": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/IPAMConfig" - } - } - } - }, - "TaskSpecResourceRequirements": { - "type": "object", - "properties": { - "Limits": { - "$ref": "#/definitions/NodeResources" - }, - "Reservations": { - "$ref": "#/definitions/NodeResources" - } - } - }, - "TaskSpecRestartPolicy": { - "type": "object", - "properties": { - "Condition": { - "type": "string" - }, - "Delay": { - "type": "integer" - }, - "MaxAttempts": { - "type": "integer" - }, - "Window": { - "type": "integer" - } - } - }, - "TaskSpecPlacement": { - "type": "object", - "properties": { - "Constraints": { - "type": ["array", "null"], - "items": { - "type": "string" - } - } - } - }, - "Annotations": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - } - } - }, - "Endpoint": { - "type": "object", - "properties": { - "Spec": { - "$ref": "#/definitions/EndpointSpec" - }, - "ExposedPorts": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/PortConfig" - } - }, - "VirtualIPs": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/EndpointVirtualIP" - } - } - } - }, - "EndpointSpec": { - "type": "object", - "properties": { - "Mode": { - "type": "string" - }, - "Ports": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/PortConfig" - } - } - } - }, - "PortConfig": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Protocol": { - "type": "string" - }, - "TargetPort": { - "type": "integer" - }, - "PublishedPort": { - "type": "integer" - } - } - }, - "EndpointVirtualIP": { - "type": "object", - "properties": { - "NetworkID": { - "type": "string" - }, - "Addr": { - "type": "string" - } - } - }, - "ContainerSpec": { - "type": "object", - "properties": { - "Image": { - "type": "string" - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "Command": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "Args": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "Env": { - "type": ["array", "null"], - "items": { - "type": "string" - } - }, - "Dir": { - "type": "string" - }, - "User": { - "type": "string" - }, - "Mounts": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/ContainerSpecMount" - } - }, - "StopGracePeriod": { - "type": "integer" - } - } - }, - "ContainerSpecMount": { - "type": "object", - "properties": { - "Type": { - "type": "string" - }, - "Source": { - "type": "string" - }, - "Target": { - "type": "string" - }, - "ReadOnly": { - "type": "boolean" - }, - "BindOptions": { - "$ref": "#/definitions/ContainerSpecMountBindOptions" - }, - "VolumeOptions": { - "$ref": "#/definitions/ContainerSpecMountVolumeOptions" - } - } - }, - "ContainerSpecMountBindOptions": { - "type": "object", - "properties": { - "Propagation": { - "type": "string" - } - } - }, - "ContainerSpecMountVolumeOptions": { - "type": "object", - "properties": { - "NoCopy": { - "type": "boolean" - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "DriverConfig": { - "$ref": "#/definitions/Driver" - } - } - }, - "ContainerStatus": { - "type": "object", - "properties": { - "ContainerID": { - "type": "string" - }, - "PID": { - "type": "integer" - }, - "ExitCode": { - "type": "integer" - } - } - }, - "Driver": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Options": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - } - } - }, - "Service": { - "type": "object", - "properties": { - "ID": { - "type": "string" - }, - "Version": { - "$ref": "#/definitions/NodeVersion" - }, - "CreatedAt": { - "type": "string", - "format": "date-time" - }, - "UpdatedAt": { - "type": "string", - "format": "date-time" - }, - "Spec": { - "$ref": "#/definitions/ServiceSpec" - }, - "Endpoint": { - "$ref": "#/definitions/Endpoint" - }, - "UpdateStatus": { - "$ref": "#/definitions/UpdateStatus" - } - } - }, - "UpdateStatus": { - "type": "object", - "properties": { - "State": { - "type": "string" - }, - "StartedAt": { - "type": "string", - "format": "date-time" - }, - "CompletedAt": { - "type": "string", - "format": "date-time" - }, - "Message": { - "type": "string" - } - } - }, - "ServiceSpec": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Labels": { - "type": ["object", "null"], - "additionalProperties": { - "type": "string" - } - }, - "TaskTemplate": { - "$ref": "#/definitions/TaskSpec" - }, - "Mode": { - "$ref": "#/definitions/ServiceSpecMode" - }, - "UpdateConfig": { - "$ref": "#/definitions/UpdateConfig" - }, - "Networks": { - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/NetworkAttachmentConfig" - } - }, - "EndpointSpec": { - "type": "string" - } - } - }, - "UpdateConfig": { - "type": "object", - "properties": { - "Parallelism": { - "type": "integer" - }, - "Delay": { - "type": "integer" - }, - "FailureAction": { - "type": "string" - } - } - }, - "NetworkAttachmentConfig": { - "type": "object", - "properties": { - "Target": { - "type": "string" - }, - "Aliases": { - "type": ["array", "null"], - "items": { - "type": "string" - } - } - } - }, - "ServiceSpecMode": { - "type": "object", - "properties": { - "Replicated": { - "$ref": "#/definitions/ReplicatedService" - }, - "Global": { - "$ref": "#/definitions/GlobalService" - } - } - }, - "ReplicatedService": { - "type": "object", - "properties": { - "Replicas": { - "type": "integer" - } - } - }, - "GlobalService": { - "type": "object", - "properties": {} - }, - "ServiceCreateResponse": { - "type": "object", - "properties": { - "Id": { - "type": "string" - } - } - } - }, - "paths": { - "/containers/json": { - "get": { - "summary": "List containers", - "description": "List containers", - "operationId": "findAll", - "parameters": [{ - "name": "all", - "in": "query", - "description": "Show all containers. Only running containers are shown by default (i.e., this defaults to false)", - "type": "boolean", - "default": false - }, { - "name": "limit", - "in": "query", - "description": "Show last created containers, include non-running ones.", - "type": "integer" - }, { - "name": "since", - "in": "query", - "description": "Show only containers created since Id, include non-running ones.", - "type": "string" - }, { - "name": "before", - "in": "query", - "description": "Show only containers created before Id, include non-running ones.", - "type": "string" - }, { - "name": "size", - "in": "query", - "description": "1/True/true or 0/False/false, Show the containers sizes.", - "type": "boolean" - }, { - "name": "filters", - "in": "query", - "description": "A JSON encoded value of the filters (a map[string][]string) to process on the containers list", - "type": "array", - "items": { - "type": "string" - } - }], - "responses": { - "200": { - "description": "no error", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ContainerInfo" - } - } - }, - "400": { - "description": "bad parameter" - }, - "500": { - "description": "server error" - } - }, - "tags": [ - "Container" - ] - } - }, - "/containers/create": { - "post": { - "summary": "Create a container", - "description": "Create a container", - "operationId": "create", - "parameters": [{ - "name": "name", - "in": "query", - "description": "Assign the specified name to the container. Must match /?[a-zA-Z0-9_-]+.", - "type": "string", - "pattern": "/?[a-zA-Z0-9_-]+" - }, { - "name": "container", - "in": "body", - "description": "Container to create", - "schema": { - "$ref": "#/definitions/ContainerConfig" - } - }, { - "name": "Content-Type", - "required": true, - "in": "header", - "type": "string", - "default": "application/json", - "description": "Content Type of input" - }], - "responses": { - "201": { - "description": "no error", - "schema": { - "$ref": "#/definitions/ContainerCreateResult" - } - }, - "400": { - "description": "bad parameter" - }, - "404": { - "description": "no such container" - }, - "406": { - "description": "impossible to attach" - }, - "500": { - "description": "server error" - } - }, - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/json": { - "get": { - "summary": "Inspect a container", - "description": "Return low-level information on the container id", - "operationId": "find", - "responses": { - "200": { - "description": "no error", - "schema": { - "$ref": "#/definitions/Container" - } - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/top": { - "get": { - "summary": "List processes running inside a container", - "description": "List processes running inside the container id", - "operationId": "listProcesses", - "responses": { - "200": { - "description": "no error", - "schema": { - "$ref": "#/definitions/ContainerTop" - } - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "ps_args", - "in": "query", - "description": "ps arguments to use (e.g., aux)", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/logs": { - "get": { - "summary": "Get container logs", - "description": "Get stdout and stderr logs from the container id. Note: This endpoint works only for containers with json-file logging driver.", - "operationId": "logs", - "responses": { - "101": { - "description": "no error, hints proxy about hijacking", - "schema": { - "type": "string" - } - }, - "200": { - "description": "no error, no upgrade header found", - "schema": { - "type": "string" - } - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "follow", - "in": "query", - "description": "1/True/true or 0/False/false, return stream. Default false.", - "type": "boolean", - "default": false - }, { - "name": "stdout", - "in": "query", - "description": "1/True/true or 0/False/false, show stdout log. Default false.", - "type": "boolean", - "default": false - }, { - "name": "stderr", - "in": "query", - "description": "1/True/true or 0/False/false, show stderr log. Default false.", - "type": "boolean", - "default": false - }, { - "name": "since", - "in": "query", - "description": "UNIX timestamp (integer) to filter logs. Specifying a timestamp will only output log-entries since that timestamp. Default: 0 (unfiltered)", - "type": "integer", - "default": 0 - }, { - "name": "timestamps", - "in": "query", - "description": "1/True/true or 0/False/false, print timestamps for every log line. ", - "type": "boolean", - "default": false - }, { - "name": "tail", - "in": "query", - "description": "Output specified number of lines at the end of logs: all or . Default all.", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/changes": { - "get": { - "summary": "Inspect changes on a container’s filesystem", - "description": "Inspect changes on a container’s filesystem", - "operationId": "changes", - "responses": { - "200": { - "description": "no error", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ContainerChange" - } - } - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "kind", - "in": "query", - "description": "Kind of changes", - "type": "integer", - "enum": [0, 1, 2] - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/export": { - "get": { - "summary": "Export a container", - "description": "Export the contents of container id", - "operationId": "export", - "responses": { - "200": { - "description": "no error", - "schema": { - "type": "string" - } - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/stats": { - "get": { - "summary": "Get container stats based on resource usage", - "description": "This endpoint returns a live stream of a container’s resource usage statistics.", - "operationId": "stats", - "responses": { - "200": { - "description": "no error", - "schema": { - "type": "object" - } - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "stream", - "in": "query", - "description": "Stream stats", - "type": "boolean" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/resize": { - "post": { - "summary": "Resize a container TTY", - "description": "Resize the TTY for container with id. The unit is number of characters. You must restart the container for the resize to take effect.", - "operationId": "resize", - "responses": { - "200": { - "description": "no error" - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "cannot resize container" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "h", - "in": "query", - "description": "Height of the tty session", - "type": "integer" - }, { - "name": "w", - "in": "query", - "description": "Width of the tty session", - "type": "integer" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/start": { - "post": { - "summary": "Start a container", - "description": "Start the container id", - "operationId": "start", - "responses": { - "204": { - "description": "no error" - }, - "304": { - "description": "container already started" - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "detachKeys", - "in": "query", - "description": "Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl- where is one of: a-z, @, ^, [, , or _.", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/stop": { - "post": { - "summary": "Stop a container", - "description": "Stop the container id", - "operationId": "stop", - "responses": { - "204": { - "description": "no error" - }, - "304": { - "description": "container already stopped" - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "t", - "in": "query", - "description": "number of seconds to wait before killing the container", - "type": "integer" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/restart": { - "post": { - "summary": "Restart a container", - "description": "Restart the container id", - "operationId": "restart", - "responses": { - "204": { - "description": "no error" - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "t", - "in": "query", - "description": "number of seconds to wait before killing the container", - "type": "integer" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/kill": { - "post": { - "summary": "Kill a container", - "description": "Send a posix signal to a container", - "operationId": "kill", - "responses": { - "204": { - "description": "no error" - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "signal", - "in": "query", - "description": "Signal to send to the container, integer or string like SIGINT, defaults to SIGKILL", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/update": { - "post": { - "summary": "Update a container", - "description": "Update resource configs of one or more containers.", - "operationId": "update", - "responses": { - "200": { - "description": "no error", - "schema": { - "$ref": "#/definitions/ContainerUpdateResult" - } - }, - "400": { - "description": "bad parameter" - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "resourceConfig", - "in": "body", - "description": "Resources to update on container", - "schema": { - "$ref": "#/definitions/ResourceUpdate" - } - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/rename": { - "post": { - "summary": "Rename a container", - "description": "Rename the container id to a new_name", - "operationId": "rename", - "responses": { - "204": { - "description": "no error" - }, - "404": { - "description": "no such container" - }, - "409": { - "description": "conflict, name already assigned" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "name", - "in": "query", - "required": true, - "description": "New name for the container", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/pause": { - "post": { - "summary": "Pause a container", - "description": "Pause the container id", - "operationId": "pause", - "responses": { - "204": { - "description": "no error" - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/unpause": { - "post": { - "summary": "Unpause a container", - "description": "Unpause the container id", - "operationId": "unpause", - "responses": { - "204": { - "description": "no error" - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/attach": { - "post": { - "summary": "Attach to a container", - "description": "Attach to the container id", - "operationId": "attach", - "responses": { - "200": { - "description": "no error" - }, - "400": { - "description": "bad parameter" - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "logs", - "in": "query", - "description": "1/True/true or 0/False/false, return logs. Default false", - "type": "string" - }, { - "name": "stream", - "in": "query", - "description": "1/True/true or 0/False/false, return stream. Default false", - "type": "string" - }, { - "name": "stdin", - "in": "query", - "description": "1/True/true or 0/False/false, if stream=true, attach to stdin. Default false.", - "type": "string" - }, { - "name": "stdout", - "in": "query", - "description": "1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false.", - "type": "string" - }, { - "name": "stderr", - "in": "query", - "description": "1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false.", - "type": "string" - }, { - "name": "detachKeys", - "in": "query", - "description": "Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl- where is one of: a-z, @, ^, [, , or _.", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/attach/ws": { - "get": { - "summary": "Attach to a container (websocket)", - "description": "Attach to the container id with a websocket.", - "operationId": "attachWebsocket", - "responses": { - "101": { - "description": "no error, hints proxy about hijacking" - }, - "200": { - "description": "no error, no upgrade header found" - }, - "400": { - "description": "bad parameter" - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "logs", - "in": "query", - "description": "1/True/true or 0/False/false, return logs. Default false", - "type": "string" - }, { - "name": "stream", - "in": "query", - "description": "1/True/true or 0/False/false, return stream. Default false", - "type": "string" - }, { - "name": "stdin", - "in": "query", - "description": "1/True/true or 0/False/false, if stream=true, attach to stdin. Default false.", - "type": "string" - }, { - "name": "stdout", - "in": "query", - "description": "1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false.", - "type": "string" - }, { - "name": "stderr", - "in": "query", - "description": "1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false.", - "type": "string" - }, { - "name": "detachKeys", - "in": "query", - "description": "Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl- where is one of: a-z, @, ^, [, , or _.", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/wait": { - "post": { - "summary": "Wait a container", - "description": "Block until container id stops, then returns the exit code", - "operationId": "wait", - "responses": { - "200": { - "description": "no error", - "schema": { - "$ref": "#/definitions/ContainerWait" - } - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}": { - "delete": { - "summary": "Remove a container", - "description": "Remove the container id from the filesystem", - "operationId": "remove", - "responses": { - "204": { - "description": "no error" - }, - "400": { - "description": "bad parameter" - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "v", - "in": "query", - "description": "1/True/true or 0/False/false, Remove the volumes associated to the container. Default false.", - "type": "string" - }, { - "name": "force", - "in": "query", - "description": "1/True/true or 0/False/false, Kill then remove the container. Default false.", - "type": "string" - }], - "tags": [ - "Container" - ] - } - }, - "/containers/{id}/archive": { - "head": { - "summary": "Retrieving information about files and folders in a container", - "description": "Retrieving information about files and folders in a container", - "operationId": "getArchiveInformation", - "responses": { - "204": { - "description": "no error" - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "path", - "in": "query", - "required": true, - "description": "Resource in the container’s filesystem to archive.", - "type": "string" - }], - "tags": [ - "Container" - ] - }, - "get": { - "summary": "Get an archive of a filesystem resource in a container", - "description": "Get an tar archive of a resource in the filesystem of container id.", - "operationId": "getArchive", - "responses": { - "200": { - "description": "no error" - }, - "400": { - "description": "client error, bad parameter, details in JSON response body, one of: must specify path parameter (path cannot be empty) not a directory (path was asserted to be a directory but exists as a file)" - }, - "404": { - "description": "no such container or path does not exist inside the container" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "path", - "in": "query", - "required": true, - "description": "Resource in the container’s filesystem to archive.", - "type": "string" - }], - "tags": [ - "Container" - ] - }, - "put": { - "summary": "Extract an archive of files or folders to a directory in a container", - "description": "Upload a tar archive to be extracted to a path in the filesystem of container id.", - "operationId": "putArchive", - "responses": { - "200": { - "description": "The content was extracted successfully" - }, - "400": { - "description": "Bad parameter" - }, - "403": { - "description": "Permission denied, the volume or container rootfs is marked as read-only." - }, - "404": { - "description": "No such container or path does not exist inside the container" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "required": true, - "description": "The container id or name", - "type": "string" - }, { - "name": "path", - "in": "query", - "required": true, - "description": "Path to a directory in the container to extract the archive’s contents into. ", - "type": "string" - }, { - "name": "noOverwriteDirNonDir", - "in": "query", - "description": "If “1”, “true”, or “True” then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa.", - "type": "string" - }, { - "name": "inputStream", - "in": "body", - "required": true, - "description": "The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.", - "schema": { - "type": "string" - } - }], - "tags": [ - "Container" - ] - } - }, - "/images/json": { - "get": { - "summary": "List Images", - "description": "List Images", - "operationId": "findAll", - "responses": { - "200": { - "description": "no error", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ImageItem" - } - } - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "all", - "in": "query", - "description": "Show all images. Only images from a final layer (no children) are shown by default.", - "type": "boolean", - "default": false - }, { - "name": "filters", - "in": "query", - "description": "A JSON encoded value of the filters (a map[string][]string) to process on the containers list", - "type": "string" - }, { - "name": "filter", - "in": "query", - "description": "Only return images with the specified name.", - "type": "string" - }, { - "name": "digests", - "in": "query", - "description": "Show digest information, default to false", - "type": "boolean" - }], - "tags": [ - "Image" - ] - } - }, - "/build": { - "post": { - "summary": "Build an image from Dockerfile via stdin", - "description": "Build an image from Dockerfile via stdin", - "operationId": "build", - "parameters": [{ - "name": "inputStream", - "in": "body", - "description": "The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.", - "schema": { - "type": "string" - } - }, { - "name": "dockerfile", - "in": "query", - "description": "Path within the build context to the Dockerfile. This is ignored if remote is specified and points to an individual filename.", - "type": "string" - }, { - "name": "t", - "in": "query", - "description": "A repository name (and optionally a tag) to apply to the resulting image in case of success.", - "type": "string" - }, { - "name": "remote", - "in": "query", - "description": "A Git repository URI or HTTP/HTTPS URI build source. If the URI specifies a filename, the file’s contents are placed into a file called Dockerfile.", - "type": "string" - }, { - "name": "q", - "in": "query", - "description": "Suppress verbose build output.", - "type": "boolean", - "default": false - }, { - "name": "nocache", - "in": "query", - "description": "Do not use the cache when building the image.", - "type": "boolean", - "default": false - }, { - "name": "pull", - "in": "query", - "description": "Attempt to pull the image even if an older image exists locally", - "type": "string" - }, { - "name": "rm", - "in": "query", - "description": "Remove intermediate containers after a successful build (default behavior).", - "type": "boolean", - "default": true - }, { - "name": "forcerm", - "in": "query", - "description": "always remove intermediate containers (includes rm)", - "type": "boolean", - "default": false - }, { - "name": "memory", - "in": "query", - "description": "Set memory limit for build.", - "type": "integer" - }, { - "name": "memswap", - "in": "query", - "description": "Total memory (memory + swap), -1 to disable swap.", - "type": "integer" - }, { - "name": "cpushares", - "in": "query", - "description": "CPU shares (relative weight).", - "type": "integer" - }, { - "name": "cpusetcpus", - "in": "query", - "description": "CPUs in which to allow execution (e.g., 0-3, 0,1).", - "type": "string" - }, { - "name": "cpuperiod", - "in": "query", - "description": "The length of a CPU period in microseconds.", - "type": "integer" - }, { - "name": "cpuquota", - "in": "query", - "description": "Microseconds of CPU time that the container can get in a CPU period.", - "type": "integer" - }, { - "name": "buildargs", - "in": "query", - "description": "Total memory (memory + swap), -1 to disable swap.", - "type": "integer" - }, { - "name": "Content-type", - "in": "header", - "description": " Set to 'application/tar'.", - "type": "string", - "enum": ["application/tar"], - "default": "application/tar" - }, { - "name": "X-Registry-Config", - "in": "header", - "description": "A base64-url-safe-encoded Registry Auth Config JSON object", - "type": "string" - }], - "responses": { - "200": { - "description": "no error" - }, - "500": { - "description": "server error" - } - }, - "tags": [ - "Image" - ] - } - }, - "/images/create": { - "post": { - "summary": "Create an image", - "description": "Create an image either by pulling it from the registry or by importing it", - "operationId": "create", - "responses": { - "200": { - "description": "no error" - }, - "404": { - "description": "'docker import' flow not implement" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "fromImage", - "in": "query", - "description": "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image.", - "type": "string" - }, { - "name": "fromSrc", - "in": "query", - "description": "Source to import. The value may be a URL from which the image can be retrieved or - to read the image from the request body. This parameter may only be used when importing an image.", - "type": "string" - }, { - "name": "repo", - "in": "query", - "description": "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image.", - "type": "string" - }, { - "name": "tag", - "in": "query", - "description": "Tag or digest.", - "type": "string" - }, { - "name": "inputImage", - "in": "body", - "description": "Image content if the value - has been specified in fromSrc query parameter", - "schema": { - "type": "string" - }, - "required": false - }, { - "name": "X-Registry-Auth", - "in": "header", - "description": "A base64-encoded AuthConfig object", - "type": "string" - }], - "tags": [ - "Image" - ] - } - }, - "/images/{name}/json": { - "get": { - "summary": "Inspect an image", - "description": "Return low-level information on the image name", - "operationId": "find", - "responses": { - "200": { - "description": "No error", - "schema": { - "$ref": "#/definitions/Image" - } - }, - "404": { - "description": "No such image" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "name", - "in": "path", - "description": "Image name or id", - "type": "string", - "required": true - }], - "tags": [ - "Image" - ] - } - }, - "/images/{name}/history": { - "get": { - "summary": "Get the history of an image", - "description": "Return the history of the image name", - "operationId": "history", - "responses": { - "200": { - "description": "No error", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ImageHistoryItem" - } - } - }, - "404": { - "description": "No such image" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "name", - "in": "path", - "description": "Image name or id", - "type": "string", - "required": true - }], - "tags": [ - "Image" - ] - } - }, - "/images/{name}/push": { - "post": { - "summary": "Push an image to the registry", - "description": "Push the image name on the registry", - "operationId": "push", - "responses": { - "200": { - "description": "No error" - }, - "404": { - "description": "No such image" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "name", - "in": "path", - "description": "Image name or id", - "type": "string", - "required": true - }, { - "name": "tag", - "in": "query", - "description": "The tag to associate with the image on the registry.", - "type": "string" - }, { - "name": "X-Registry-Auth", - "in": "header", - "description": "A base64-encoded AuthConfig object", - "type": "string", - "required": true - }], - "tags": [ - "Image" - ] - } - }, - "/images/{name}/tag": { - "post": { - "summary": "Tag an image into a repository", - "description": "Tag the image name into a repository", - "operationId": "tag", - "responses": { - "201": { - "description": "No error" - }, - "400": { - "description": "Bad parameter" - }, - "404": { - "description": "No such image" - }, - "409": { - "description": "Conflict" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "name", - "in": "path", - "description": "Image name or id", - "type": "string", - "required": true - }, { - "name": "repo", - "in": "query", - "description": "The repository to tag in.", - "type": "string" - }, { - "name": "tag", - "in": "query", - "description": "The new tag name.", - "type": "string" - }], - "tags": [ - "Image" - ] - } - }, - "/images/{name}": { - "delete": { - "summary": "Remove an image", - "description": "Remove the image name from the filesystem", - "operationId": "remove", - "responses": { - "200": { - "description": "No error" - }, - "404": { - "description": "No such image" - }, - "409": { - "description": "Conflict" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "name", - "in": "path", - "description": "Image name or id", - "type": "string", - "required": true - }, { - "name": "force", - "in": "query", - "description": "1/True/true or 0/False/false, default false", - "type": "string" - }, { - "name": "noprune", - "in": "query", - "description": "1/True/true or 0/False/false, default false.", - "type": "string" - }], - "tags": [ - "Image" - ] - } - }, - "/images/search": { - "get": { - "summary": "Search images", - "description": "Search for an image on Docker Hub.", - "operationId": "search", - "responses": { - "200": { - "description": "No error", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ImageSearchResult" - } - } - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "term", - "in": "query", - "description": "Term to search", - "type": "string" - }, { - "name": "limit", - "in": "query", - "description": "Maximum returned search results", - "type": "integer" - }, { - "name": "filters", - "in": "query", - "description": "A JSON encoded value of the filters (a map[string][]string) to process on the images list.", - "type": "string" - }], - "tags": [ - "Image" - ] - } - }, - "/auth": { - "post": { - "summary": "Check auth configuration", - "description": "Check auth configuration.", - "operationId": "checkAuthentication", - "responses": { - "200": { - "description": "No error", - "schema": { - "$ref": "#/definitions/AuthResult" - } - }, - "204": { - "description": "No error" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "authConfig", - "in": "body", - "description": "Authentication to check", - "schema": { - "$ref": "#/definitions/AuthConfig" - } - }], - "tags": [ - "Misc" - ] - } - }, - "/info": { - "get": { - "summary": "Display system-wide information", - "description": "Display system-wide information.", - "operationId": "getSystemInformation", - "responses": { - "200": { - "description": "No error", - "schema": { - "$ref": "#/definitions/SystemInformation" - } - }, - "500": { - "description": "Server error" - } - }, - "tags": [ - "Misc" - ] - } - }, - "/version": { - "get": { - "summary": "Show the docker version information", - "description": "Show the docker version information", - "operationId": "getVersion", - "responses": { - "200": { - "description": "no error", - "schema": { - "$ref": "#/definitions/Version" - } - }, - "500": { - "description": "server error" - } - }, - "tags": [ - "Misc" - ] - } - }, - "/_ping": { - "get": { - "summary": "Ping the docker server", - "description": "Ping the docker server", - "operationId": "ping", - "responses": { - "200": { - "description": "no error" - }, - "500": { - "description": "server error" - } - }, - "tags": [ - "Misc" - ] - } - }, - "/commit": { - "post": { - "summary": "Create a new image from a container’s changes", - "description": "Create a new image from a container’s changes", - "operationId": "commit", - "responses": { - "201": { - "description": "no error", - "schema": { - "$ref": "#/definitions/CommitResult" - } - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "containerConfig", - "in": "body", - "description": "The container configuration", - "schema": { - "$ref": "#/definitions/ContainerConfig" - } - }, { - "name": "container", - "in": "query", - "description": "Container id or name to commit", - "type": "string" - }, { - "name": "repo", - "in": "query", - "description": "Repository name for the created image", - "type": "string" - }, { - "name": "tag", - "in": "query", - "description": "Tag name for the create image", - "type": "string" - }, { - "name": "comment", - "in": "query", - "description": "Commit message", - "type": "string" - }, { - "name": "author", - "in": "query", - "description": "author (e.g., “John Hannibal Smith “)", - "type": "string" - }, { - "name": "pause", - "in": "query", - "description": "1/True/true or 0/False/false, whether to pause the container before committing", - "type": "string" - }, { - "name": "changes", - "in": "query", - "description": "Dockerfile instructions to apply while committing", - "type": "string" - }, { - "name": "Content-Type", - "required": true, - "in": "header", - "type": "string", - "default": "application/json", - "description": "Content Type of input" - }], - "tags": [ - "Image" - ] - } - }, - "/events": { - "get": { - "summary": "Monitor Docker’s events", - "description": "Get container events from docker, either in real time via streaming, or via polling (using since).", - "operationId": "getEvents", - "responses": { - "200": { - "description": "no error" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "since", - "in": "query", - "description": "Timestamp used for polling", - "type": "integer" - }, { - "name": "until", - "in": "query", - "description": "Timestamp used for polling", - "type": "integer" - }, { - "name": "filters", - "in": "query", - "description": "A json encoded value of the filters (a map[string][]string) to process on the event list.", - "type": "string" - }], - "tags": [ - "Misc" - ] - } - }, - "/images/{name}/get": { - "get": { - "summary": "Get a tarball containing all images in a repository", - "description": "Get a tarball containing all images and metadata for the repository specified by name.", - "operationId": "save", - "responses": { - "200": { - "description": "no error", - "schema": { - "type": "string" - } - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "name", - "in": "path", - "description": "Image name or id", - "type": "string", - "required": true - }], - "tags": [ - "Image" - ] - } - }, - "/images/get": { - "get": { - "summary": "Get a tarball containing all images.", - "description": "Get a tarball containing all images and metadata for one or more repositories.", - "operationId": "saveAll", - "responses": { - "200": { - "description": "no error", - "schema": { - "type": "string" - } - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "names", - "in": "query", - "description": "Image names to filter", - "type": "array", - "items": { - "type": "string" - } - }], - "tags": [ - "Image" - ] - } - }, - "/images/load": { - "post": { - "summary": "Load a tarball with a set of images and tags into docker.", - "description": "Load a set of images and tags into a Docker repository. See the image tarball format for more details.", - "operationId": "load", - "responses": { - "200": { - "description": "no error" - }, - "500": { - "description": "server error" - } - }, - "parameters": [{ - "name": "imagesTarball", - "in": "body", - "description": "Tar archive containing images", - "schema": { - "type": "string" - } - }], - "tags": [ - "Image" - ] - } - }, - "/containers/{id}/exec": { - "post": { - "summary": "Exec Create", - "description": "Sets up an exec instance in a running container id", - "operationId": "create", - "responses": { - "201": { - "description": "no error", - "schema": { - "$ref": "#/definitions/ExecCreateResult" - } - }, - "404": { - "description": "no such container" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "execConfig", - "in": "body", - "description": "Exec configuration", - "schema": { - "$ref": "#/definitions/ExecConfig" - }, - "required": true - }, { - "name": "Content-Type", - "in": "header", - "description": "Content Type Header", - "required": true, - "type": "string", - "default": "application/json" - }, { - "name": "id", - "in": "path", - "description": "Container name or id", - "type": "string", - "required": true - }], - "tags": [ - "Exec" - ] - } - }, - "/exec/{id}/start": { - "post": { - "summary": "Exec Start", - "description": "Starts a previously set up exec instance id. If detach is true, this API returns after starting the exec command. Otherwise, this API sets up an interactive session with the exec command.", - "operationId": "start", - "responses": { - "200": { - "description": "No error" - }, - "404": { - "description": "No such exec instance" - }, - "409": { - "description": "Container is stopped or paused" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "execStartConfig", - "in": "body", - "description": "Exec configuration", - "schema": { - "$ref": "#/definitions/ExecStartConfig" - } - }, { - "name": "Content-Type", - "in": "header", - "description": "Content Type Header", - "required": true, - "type": "string", - "default": "application/json" - }, { - "name": "id", - "in": "path", - "description": "Exec instance id", - "required": true, - "type": "string" - }], - "tags": [ - "Exec" - ] - } - }, - "/exec/{id}/resize": { - "post": { - "summary": "Exec Resize", - "description": "Resize the tty session used by the exec command id.", - "operationId": "resize", - "responses": { - "201": { - "description": "No error" - }, - "404": { - "description": "No such exec instance" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "description": "Exec instance id", - "required": true, - "type": "string" - }, { - "name": "h", - "in": "query", - "description": "Height of the tty session", - "type": "integer", - "format": "int64" - }, { - "name": "w", - "in": "query", - "description": "Width of the tty session", - "type": "integer", - "format": "int64" - }], - "tags": [ - "Exec" - ] - } - }, - "/exec/{id}/json": { - "get": { - "summary": "Exec Inspect", - "description": "Return low-level information about the exec command id.", - "operationId": "find", - "responses": { - "200": { - "description": "No error", - "schema": { - "$ref": "#/definitions/ExecCommand" - } - }, - "404": { - "description": "No such exec instance" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "description": "Exec instance id", - "required": true, - "type": "string" - }], - "tags": [ - "Exec" - ] - } - }, - "/volumes": { - "get": { - "summary": "List volumes", - "description": "List volumes.", - "operationId": "findAll", - "responses": { - "200": { - "description": "No error", - "schema": { - "$ref": "#/definitions/VolumeList" - } - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "filters", - "in": "query", - "description": "JSON encoded value of the filters (a map[string][]string) to process on the volumes list", - "type": "string" - }], - "tags": [ - "Volume" - ] - } - }, - "/volumes/create": { - "post": { - "summary": "Create a volume", - "description": "Create a volume.", - "operationId": "create", - "responses": { - "201": { - "description": "No error", - "schema": { - "$ref": "#/definitions/Volume" - } - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "volumeConfig", - "in": "body", - "required": true, - "description": "Volume configuration", - "schema": { - "$ref": "#/definitions/VolumeConfig" - } - }, { - "name": "Content-Type", - "required": true, - "in": "header", - "type": "string", - "default": "application/json", - "description": "Content Type of input" - }], - "tags": [ - "Volume" - ] - } - }, - "/volumes/{name}": { - "get": { - "summary": "Inspect a volume", - "description": "Inspect a volume.", - "operationId": "find", - "responses": { - "200": { - "description": "No error", - "schema": { - "$ref": "#/definitions/Volume" - } - }, - "404": { - "description": "No such volume" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "name", - "in": "path", - "required": true, - "description": "Volume name or id", - "type": "string" - }], - "tags": [ - "Volume" - ] - }, - "delete": { - "summary": "Remove a volume", - "description": "Instruct the driver to remove the volume.", - "operationId": "remove", - "responses": { - "204": { - "description": "No error" - }, - "404": { - "description": "No such volume or volume driver" - }, - "409": { - "description": "Volume is in use and cannot be removed" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "name", - "in": "path", - "required": true, - "description": "Volume name or id", - "type": "string" - }], - "tags": [ - "Volume" - ] - } - }, - "/networks": { - "get": { - "summary": "List networks", - "description": "List networks.", - "operationId": "findAll", - "responses": { - "200": { - "description": "No error", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Network" - } - } - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "filters", - "in": "query", - "description": "JSON encoded value of the filters (a map[string][]string) to process on the networks list.", - "type": "string" - }], - "tags": [ - "Network" - ] - } - }, - "/networks/{id}": { - "get": { - "summary": "Inspect network", - "description": "Inspect network.", - "operationId": "find", - "responses": { - "200": { - "description": "No error", - "schema": { - "$ref": "#/definitions/Network" - } - }, - "404": { - "description": "Network not found" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "description": "Network id or name", - "required": true, - "type": "string" - }], - "tags": [ - "Network" - ] - }, - "delete": { - "summary": "Remove a network", - "description": "Remove a network", - "operationId": "remove", - "responses": { - "204": { - "description": "No error" - }, - "404": { - "description": "Network not found" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "description": "Network id or name", - "required": true, - "type": "string" - }], - "tags": [ - "Network" - ] - } - }, - "/networks/create": { - "post": { - "summary": "Create network", - "description": "Create network.", - "operationId": "create", - "responses": { - "201": { - "description": "No error", - "schema": { - "$ref": "#/definitions/NetworkCreateResult" - } - }, - "404": { - "description": "Driver not found" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "networkConfig", - "in": "body", - "description": "Network configuration", - "required": true, - "schema": { - "$ref": "#/definitions/NetworkCreateConfig" - }}, - { - "name": "Content-Type", - "required": true, - "in": "header", - "type": "string", - "default": "application/json", - "description": "Content Type of input" - } - ], - "tags": [ - "Network" - ] - } - }, - "/networks/{id}/connect": { - "post": { - "summary": "Connect a container to a network", - "description": "Connect a container to a network.", - "operationId": "connect", - "responses": { - "201": { - "description": "No error" - }, - "403": { - "description": "Operation not supported for swarm scoped networks" - }, - "404": { - "description": "Network or container not found" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "description": "Network id or name", - "required": true, - "type": "string" - }, { - "name": "container", - "in": "body", - "description": "Container", - "required": true, - "schema": { - "$ref": "#/definitions/ContainerConnect" - } - }, { - "name": "Content-Type", - "required": true, - "in": "header", - "type": "string", - "default": "application/json", - "description": "Content Type of input" - }], - "tags": [ - "Network" - ] - } - }, - "/networks/{id}/disconnect": { - "post": { - "summary": "Disconnect a container to a network", - "description": "Disconnect a container to a network.", - "operationId": "disconnect", - "responses": { - "201": { - "description": "No error" - }, - "403": { - "description": "Operation not supported for swarm scoped networks" - }, - "404": { - "description": "Network or container not found" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "description": "Network id or name", - "required": true, - "type": "string" - }, { - "name": "container", - "in": "body", - "description": "Container", - "required": true, - "schema": { - "$ref": "#/definitions/ContainerDisconnect" - } - }, { - "name": "Content-Type", - "required": true, - "in": "header", - "type": "string", - "default": "application/json", - "description": "Content Type of input" - }], - "tags": [ - "Network" - ] - } - }, - "/nodes": { - "get": { - "summary": "List nodes", - "description": "List nodes.", - "operationId": "findAll", - "responses": { - "200": { - "description": "No error", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Node" - } - } - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "filters", - "in": "query", - "description": "A JSON encoded value of the filters (a map[string][]string) to process on the nodes list.", - "type": "array", - "items": { - "type": "string" - } - }], - "tags": [ - "Node" - ] - } - }, - "/nodes/{id}": { - "get": { - "summary": "Inspect a node", - "description": "Return low-level information on the node id.", - "operationId": "find", - "responses": { - "200": { - "description": "No error", - "schema": { - "$ref": "#/definitions/Node" - } - }, - "404": { - "description": "No such node" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "description": "Node id or name", - "required": true, - "type": "string" - }], - "tags": [ - "Node" - ] - } - }, - "/swarm/init": { - "post": { - "summary": "Initialize a new Swarm", - "description": "Initialize a new Swarm", - "operationId": "initialize", - "responses": { - "200": { - "description": "No error" - }, - "400": { - "description": "Bad parameter" - }, - "406": { - "description": "Node is already part of a Swarm" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "swarmConfig", - "in": "body", - "description": "Config for the Swarm", - "schema": { - "$ref": "#/definitions/SwarmConfig" - } - }], - "tags": [ - "Swarm" - ] - } - }, - "/swarm/join": { - "post": { - "summary": "Join an existing new Swarm", - "description": "Join an existing new Swarm", - "operationId": "join", - "responses": { - "200": { - "description": "No error" - }, - "400": { - "description": "Bad parameter" - }, - "406": { - "description": "Node is already part of a Swarm" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "swarmJoinConfig", - "in": "body", - "description": "Config for joining the Swarm", - "schema": { - "$ref": "#/definitions/SwarmJoinConfig" - } - }], - "tags": [ - "Swarm" - ] - } - }, - "/swarm/leave": { - "post": { - "summary": "Leave a Swarm", - "description": "Leave a Swarm", - "operationId": "leave", - "responses": { - "200": { - "description": "No error" - }, - "406": { - "description": "Node is not part of a Swarm" - }, - "500": { - "description": "Server error" - } - }, - "tags": [ - "Swarm" - ] - } - }, - "/swarm/update": { - "post": { - "summary": "Update a Swarm", - "description": "Update a Swarm", - "operationId": "update", - "responses": { - "200": { - "description": "No error" - }, - "406": { - "description": "Node is not part of a Swarm" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "swarmUpdateConfig", - "in": "body", - "description": "Config for updating the Swarm", - "schema": { - "$ref": "#/definitions/SwarmUpdateConfig" - } - }, { - "name": "version", - "in": "query", - "description": "The version number of the swarm object being updated. This is required to avoid conflicting writes.", - "required": true, - "type": "integer" - }, { - "name": "rotateWorkerToken", - "in": "query", - "description": "Set to true (or 1) to rotate the worker join token.", - "type": "boolean" - }, { - "name": "rotateManagerToken", - "in": "query", - "description": "Set to true (or 1) to rotate the manager join token.", - "type": "boolean" - }], - "tags": [ - "Swarm" - ] - } - }, - "/services": { - "get": { - "summary": "List services", - "description": "List services", - "operationId": "findAll", - "responses": { - "200": { - "description": "No error", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Service" - } - } - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "filters", - "in": "query", - "description": "A JSON encoded value of the filters (a map[string][]string) to process on the services list.", - "type": "array", - "items": { - "type": "string" - } - }], - "tags": [ - "Service" - ] - } - }, - "/services/create": { - "post": { - "summary": "Create a service", - "description": "Create a service", - "operationId": "create", - "responses": { - "201": { - "description": "No error", - "schema": { - "$ref": "#/definitions/ServiceCreateResponse" - } - }, - "406": { - "description": "Server error or node is not part of a Swarm" - }, - "409": { - "description": "Name conflicts with an existing object" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "serviceSpec", - "in": "body", - "description": "Service specification to create", - "schema": { - "$ref": "#/definitions/ServiceSpec" - } - }], - "tags": [ - "Service" - ] - } - }, - "/services/{id}": { - "delete": { - "summary": "Remove a service", - "description": "Stop and remove the service id", - "operationId": "remove", - "responses": { - "204": { - "description": "No error" - }, - "404": { - "description": "No such service" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "description": "Service id or name", - "required": true, - "type": "string" - }], - "tags": [ - "Service" - ] - }, - "get": { - "summary": "Inspect a service", - "description": "Get details on a service", - "operationId": "find", - "responses": { - "200": { - "description": "No error", - "schema": { - "$ref": "#/definitions/Service" - } - }, - "404": { - "description": "No such service" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "description": "Service id or name", - "required": true, - "type": "string" - }], - "tags": [ - "Service" - ] - } - }, - "/services/{id}/update": { - "post": { - "summary": "Update a service", - "description": "Update the service id.", - "operationId": "update", - "responses": { - "200": { - "description": "No error" - }, - "404": { - "description": "No such service" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "description": "Service id or name", - "required": true, - "type": "string" - }, { - "name": "version", - "in": "query", - "description": " The version number of the service object being updated. This is required to avoid conflicting writes.", - "required": true, - "type": "integer" - }, { - "name": "serviceSpec", - "in": "body", - "description": "Service specification to update", - "schema": { - "$ref": "#/definitions/ServiceSpec" - } - }], - "tags": [ - "Service" - ] - } - }, - "/tasks": { - "get": { - "summary": "List tasks", - "description": "List tasks", - "operationId": "findAll", - "responses": { - "200": { - "description": "No error", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Task" - } - } - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "filters", - "in": "query", - "description": "A JSON encoded value of the filters (a map[string][]string) to process on the tasks list.", - "type": "array", - "items": { - "type": "string" - } - }], - "tags": [ - "Task" - ] - } - }, - "/tasks/{id}": { - "get": { - "summary": "Inspect a task", - "description": "Get details on a task", - "operationId": "find", - "responses": { - "200": { - "description": "No error", - "schema": { - "$ref": "#/definitions/Task" - } - }, - "404": { - "description": "Unknown task" - }, - "500": { - "description": "Server error" - } - }, - "parameters": [{ - "name": "id", - "in": "path", - "description": "Task id or name", - "required": true, - "type": "string" - }], - "tags": [ - "Task" - ] - } - } - } -} - diff --git a/generate.sh b/generate.sh index 39e6312f..89935aa0 100755 --- a/generate.sh +++ b/generate.sh @@ -1,3 +1,3 @@ #!/bin/bash -./vendor/bin/jane-openapi generate docker-swagger.json 'Docker\API' generated +./vendor/bin/jane-openapi generate diff --git a/generated/Client.php b/generated/Client.php new file mode 100644 index 00000000..8f290afc --- /dev/null +++ b/generated/Client.php @@ -0,0 +1,2492 @@ +[:]`, ``, or ``) + - `before`=(`` or ``) + - `expose`=(`[/]`|`/[]`) + - `exited=` containers with exit code of `` + - `health`=(`starting`|`healthy`|`unhealthy`|`none`) + - `id=` a container's ID + - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + - `is-task=`(`true`|`false`) + - `label=key` or `label="key=value"` of a container label + - `name=` a container's name + - `network`=(`` or ``) + - `publish`=(`[/]`|`/[]`) + - `since`=(`` or ``) + - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) + - `volume`=(`` or ``) + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerListBadRequestException + * @throws \Docker\API\Exception\ContainerListInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainerSummary[]|\Psr\Http\Message\ResponseInterface + */ + public function containerList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerList($queryParameters), $fetch); + } + /** + * + * + * @param \Docker\API\Model\ContainersCreatePostBody $body Container to create + * @param array $queryParameters { + * @var string $name Assign the specified name to the container. Must match + `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`. + + * @var string $platform Platform in the format `os[/arch[/variant]]` used for image lookup. + + When specified, the daemon checks if the requested image is present + in the local image cache with the given OS and Architecture, and + otherwise returns a `404` status. + + If the option is not set, the host's native OS and Architecture are + used to look up the image in the image cache. However, if no platform + is passed and the given image does exist in the local image cache, + but its OS or architecture does not match, the container is created + with the available image, and a warning is added to the `Warnings` + field in the response, for example; + + WARNING: The requested image's platform (linux/arm64/v8) does not + match the detected host platform (linux/amd64) and no + specific platform was requested + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerCreateBadRequestException + * @throws \Docker\API\Exception\ContainerCreateNotFoundException + * @throws \Docker\API\Exception\ContainerCreateConflictException + * @throws \Docker\API\Exception\ContainerCreateInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainerCreateResponse|\Psr\Http\Message\ResponseInterface + */ + public function containerCreate(\Docker\API\Model\ContainersCreatePostBody $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerCreate($body, $queryParameters), $fetch); + } + /** + * Return low-level information about a container. + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var bool $size Return the size of container as fields `SizeRw` and `SizeRootFs` + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerInspectNotFoundException + * @throws \Docker\API\Exception\ContainerInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainersIdJsonGetResponse200|\Psr\Http\Message\ResponseInterface + */ + public function containerInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerInspect($id, $queryParameters), $fetch); + } + /** + * On Unix systems, this is done by running the `ps` command. This endpoint + is not supported on Windows. + + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var string $ps_args The arguments to pass to `ps`. For example, `aux` + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerTopNotFoundException + * @throws \Docker\API\Exception\ContainerTopInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainersIdTopGetResponse200|\Psr\Http\Message\ResponseInterface + */ + public function containerTop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerTop($id, $queryParameters), $fetch); + } + /** + * Get `stdout` and `stderr` logs from a container. + + Note: This endpoint works only for containers with the `json-file` or + `journald` logging driver. + + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var bool $follow Keep connection after returning logs. + * @var bool $stdout Return logs from `stdout` + * @var bool $stderr Return logs from `stderr` + * @var int $since Only return logs since this time, as a UNIX timestamp + * @var int $until Only return logs before this time, as a UNIX timestamp + * @var bool $timestamps Add timestamps to every log line + * @var string $tail Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerLogsNotFoundException + * @throws \Docker\API\Exception\ContainerLogsInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerLogs($id, $queryParameters), $fetch); + } + /** + * Returns which files in a container's filesystem have been added, deleted, + or modified. The `Kind` of modification can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + + * + * @param string $id ID or name of the container + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerChangesNotFoundException + * @throws \Docker\API\Exception\ContainerChangesInternalServerErrorException + * + * @return null|\Docker\API\Model\FilesystemChange[]|\Psr\Http\Message\ResponseInterface + */ + public function containerChanges(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerChanges($id), $fetch); + } + /** + * Export the contents of a container as a tarball. + * + * @param string $id ID or name of the container + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerExportNotFoundException + * @throws \Docker\API\Exception\ContainerExportInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerExport(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerExport($id), $fetch); + } + /** + * This endpoint returns a live stream of a container’s resource usage + statistics. + + The `precpu_stats` is the CPU statistic of the *previous* read, and is + used to calculate the CPU usage percentage. It is not an exact copy + of the `cpu_stats` field. + + If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is + nil then for compatibility with older daemons the length of the + corresponding `cpu_usage.percpu_usage` array should be used. + + On a cgroup v2 host, the following fields are not set + * `blkio_stats`: all fields other than `io_service_bytes_recursive` + * `cpu_stats`: `cpu_usage.percpu_usage` + * `memory_stats`: `max_usage` and `failcnt` + Also, `memory_stats.stats` fields are incompatible with cgroup v1. + + To calculate the values shown by the `stats` command of the docker cli tool + the following formulas can be used: + * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * available_memory = `memory_stats.limit` + * Memory usage % = `(used_memory / available_memory) * 100.0` + * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` + * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage` + * number_cpus = `length(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus` + * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0` + + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var bool $stream Stream the output. If false, the stats will be output once and then + it will disconnect. + + * @var bool $one-shot Only get a single stat instead of waiting for 2 cycles. Must be used + with `stream=false`. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerStatsNotFoundException + * @throws \Docker\API\Exception\ContainerStatsInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerStats(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerStats($id, $queryParameters), $fetch); + } + /** + * Resize the TTY for a container. + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var int $h Height of the TTY session in characters + * @var int $w Width of the TTY session in characters + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerResizeNotFoundException + * @throws \Docker\API\Exception\ContainerResizeInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerResize($id, $queryParameters), $fetch); + } + /** + * + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var string $detachKeys Override the key sequence for detaching a container. Format is a + single character `[a-Z]` or `ctrl-` where `` is one + of: `a-z`, `@`, `^`, `[`, `,` or `_`. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerStartNotFoundException + * @throws \Docker\API\Exception\ContainerStartInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerStart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerStart($id, $queryParameters), $fetch); + } + /** + * + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`). + * @var int $t Number of seconds to wait before killing the container + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerStopNotFoundException + * @throws \Docker\API\Exception\ContainerStopInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerStop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerStop($id, $queryParameters), $fetch); + } + /** + * + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`). + * @var int $t Number of seconds to wait before killing the container + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerRestartNotFoundException + * @throws \Docker\API\Exception\ContainerRestartInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerRestart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerRestart($id, $queryParameters), $fetch); + } + /** + * Send a POSIX signal to a container, defaulting to killing to the + container. + + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`). + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerKillNotFoundException + * @throws \Docker\API\Exception\ContainerKillConflictException + * @throws \Docker\API\Exception\ContainerKillInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerKill(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerKill($id, $queryParameters), $fetch); + } + /** + * Change various configuration options of a container without having to + recreate it. + + * + * @param string $id ID or name of the container + * @param \Docker\API\Model\ContainersIdUpdatePostBody $update + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerUpdateNotFoundException + * @throws \Docker\API\Exception\ContainerUpdateInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainersIdUpdatePostResponse200|\Psr\Http\Message\ResponseInterface + */ + public function containerUpdate(string $id, \Docker\API\Model\ContainersIdUpdatePostBody $update, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerUpdate($id, $update), $fetch); + } + /** + * + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var string $name New name for the container + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerRenameNotFoundException + * @throws \Docker\API\Exception\ContainerRenameConflictException + * @throws \Docker\API\Exception\ContainerRenameInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerRename(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerRename($id, $queryParameters), $fetch); + } + /** + * Use the freezer cgroup to suspend all processes in a container. + + Traditionally, when suspending a process the `SIGSTOP` signal is used, + which is observable by the process being suspended. With the freezer + cgroup the process is unaware, and unable to capture, that it is being + suspended, and subsequently resumed. + + * + * @param string $id ID or name of the container + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerPauseNotFoundException + * @throws \Docker\API\Exception\ContainerPauseInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerPause(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerPause($id), $fetch); + } + /** + * Resume a container which has been paused. + * + * @param string $id ID or name of the container + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerUnpauseNotFoundException + * @throws \Docker\API\Exception\ContainerUnpauseInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerUnpause(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerUnpause($id), $fetch); + } + /** + * Attach to a container to read its output or send it input. You can attach + to the same container multiple times and you can reattach to containers + that have been detached. + + Either the `stream` or `logs` parameter must be `true` for this endpoint + to do anything. + + See the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) + for more details. + + ### Hijacking + + This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, + and `stderr` on the same socket. + + This is the response from the daemon for an attach request: + + ``` + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + [STREAM] + ``` + + After the headers and two new lines, the TCP connection can now be used + for raw, bidirectional communication between the client and server. + + To hint potential proxies about connection hijacking, the Docker client + can also optionally send connection upgrade headers. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 + Upgrade: tcp + Connection: Upgrade + ``` + + The Docker daemon will respond with a `101 UPGRADED` response, and will + similarly follow with the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + [STREAM] + ``` + + ### Stream format + + When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), + the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream + and the stream over the hijacked connected is multiplexed to separate out + `stdout` and `stderr`. The stream consists of a series of frames, each + containing a header and a payload. + + The header contains the information which the stream writes (`stdout` or + `stderr`). It also contains the size of the associated frame encoded in + the last four bytes (`uint32`). + + It is encoded on the first eight bytes like this: + + ```go + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + ``` + + `STREAM_TYPE` can be: + + - 0: `stdin` (is written on `stdout`) + - 1: `stdout` + - 2: `stderr` + + `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size + encoded as big endian. + + Following the header is the payload, which is the specified number of + bytes of `STREAM_TYPE`. + + The simplest way to implement this protocol is the following: + + 1. Read 8 bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + + ### Stream format when using a TTY + + When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), + the stream is not multiplexed. The data exchanged over the hijacked + connection is simply the raw data from the process PTY and client's + `stdin`. + + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var string $detachKeys Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, + `@`, `^`, `[`, `,` or `_`. + + * @var bool $logs Replay previous logs from the container. + + This is useful for attaching to a container that has started and you + want to output everything since the container started. + + If `stream` is also enabled, once all the previous output has been + returned, it will seamlessly transition into streaming current + output. + + * @var bool $stream Stream attached streams from the time the request was made onwards. + + * @var bool $stdin Attach to `stdin` + * @var bool $stdout Attach to `stdout` + * @var bool $stderr Attach to `stderr` + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerAttachBadRequestException + * @throws \Docker\API\Exception\ContainerAttachNotFoundException + * @throws \Docker\API\Exception\ContainerAttachInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerAttach(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerAttach($id, $queryParameters), $fetch); + } + /** + * + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var string $detachKeys Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, + `@`, `^`, `[`, `,`, or `_`. + + * @var bool $logs Return logs + * @var bool $stream Return stream + * @var bool $stdin Attach to `stdin` + * @var bool $stdout Attach to `stdout` + * @var bool $stderr Attach to `stderr` + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerAttachWebsocketBadRequestException + * @throws \Docker\API\Exception\ContainerAttachWebsocketNotFoundException + * @throws \Docker\API\Exception\ContainerAttachWebsocketInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerAttachWebsocket(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerAttachWebsocket($id, $queryParameters), $fetch); + } + /** + * Block until a container stops, then returns the exit code. + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var string $condition Wait until a container state reaches the given condition. + + Defaults to `not-running` if omitted or empty. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerWaitBadRequestException + * @throws \Docker\API\Exception\ContainerWaitNotFoundException + * @throws \Docker\API\Exception\ContainerWaitInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainerWaitResponse|\Psr\Http\Message\ResponseInterface + */ + public function containerWait(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerWait($id, $queryParameters), $fetch); + } + /** + * + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var bool $v Remove anonymous volumes associated with the container. + * @var bool $force If the container is running, kill it before removing it. + * @var bool $link Remove the specified link associated with the container. + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerDeleteBadRequestException + * @throws \Docker\API\Exception\ContainerDeleteNotFoundException + * @throws \Docker\API\Exception\ContainerDeleteConflictException + * @throws \Docker\API\Exception\ContainerDeleteInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerDelete($id, $queryParameters), $fetch); + } + /** + * Get a tar archive of a resource in the filesystem of container id. + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var string $path Resource in the container’s filesystem to archive. + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerArchiveBadRequestException + * @throws \Docker\API\Exception\ContainerArchiveNotFoundException + * @throws \Docker\API\Exception\ContainerArchiveInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerArchive(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerArchive($id, $queryParameters), $fetch); + } + /** + * A response header `X-Docker-Container-Path-Stat` is returned, containing + a base64 - encoded JSON object with some filesystem header information + about the path. + + * + * @param string $id ID or name of the container + * @param array $queryParameters { + * @var string $path Resource in the container’s filesystem to archive. + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerArchiveInfoBadRequestException + * @throws \Docker\API\Exception\ContainerArchiveInfoNotFoundException + * @throws \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function containerArchiveInfo(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerArchiveInfo($id, $queryParameters), $fetch); + } + /** + * Upload a tar archive to be extracted to a path in the filesystem of container id. + `path` parameter is asserted to be a directory. If it exists as a file, 400 error + will be returned with message "not a directory". + + * + * @param string $id ID or name of the container + * @param string|resource|\Psr\Http\Message\StreamInterface $inputStream The input stream must be a tar archive compressed with one of the + following algorithms: `identity` (no compression), `gzip`, `bzip2`, + or `xz`. + + * @param array $queryParameters { + * @var string $path Path to a directory in the container to extract the archive’s contents into. + * @var string $noOverwriteDirNonDir If `1`, `true`, or `True` then it will be an error if unpacking the + given content would cause an existing directory to be replaced with + a non-directory and vice versa. + + * @var string $copyUIDGID If `1`, `true`, then it will copy UID/GID maps to the dest file or + dir + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\PutContainerArchiveBadRequestException + * @throws \Docker\API\Exception\PutContainerArchiveForbiddenException + * @throws \Docker\API\Exception\PutContainerArchiveNotFoundException + * @throws \Docker\API\Exception\PutContainerArchiveInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function putContainerArchive(string $id, $inputStream, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\PutContainerArchive($id, $inputStream, $queryParameters), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerPruneInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainersPrunePostResponse200|\Psr\Http\Message\ResponseInterface + */ + public function containerPrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerPrune($queryParameters), $fetch); + } + /** + * Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image. + * + * @param array $queryParameters { + * @var bool $all Show all images. Only images from a final layer (no children) are shown by default. + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + process on the images list. + + Available filters: + + - `before`=(`[:]`, `` or ``) + - `dangling=true` + - `label=key` or `label="key=value"` of an image label + - `reference`=(`[:]`) + - `since`=(`[:]`, `` or ``) + - `until=` + + * @var bool $shared-size Compute and show shared size as a `SharedSize` field on each image. + * @var bool $digests Show digest information as a `RepoDigests` field on each image. + * @var bool $manifests Include `Manifests` in the image summary. + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImageListInternalServerErrorException + * + * @return null|\Docker\API\Model\ImageSummary[]|\Psr\Http\Message\ResponseInterface + */ + public function imageList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageList($queryParameters), $fetch); + } + /** + * Build an image from a tar archive with a `Dockerfile` in it. + + The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). + + The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. + + The build is canceled if the client drops the connection by quitting or being killed. + + * + * @param string|resource|\Psr\Http\Message\StreamInterface $inputStream A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz. + * @param array $queryParameters { + * @var string $dockerfile Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`. + * @var string $t A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters. + * @var string $extrahosts Extra hosts to add to /etc/hosts + * @var string $remote A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball. + * @var bool $q Suppress verbose build output. + * @var bool $nocache Do not use the cache when building the image. + * @var string $cachefrom JSON array of images used for build cache resolution. + * @var string $pull Attempt to pull the image even if an older image exists locally. + * @var bool $rm Remove intermediate containers after a successful build. + * @var bool $forcerm Always remove intermediate containers, even upon failure. + * @var int $memory Set memory limit for build. + * @var int $memswap Total memory (memory + swap). Set as `-1` to disable swap. + * @var int $cpushares CPU shares (relative weight). + * @var string $cpusetcpus CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * @var int $cpuperiod The length of a CPU period in microseconds. + * @var int $cpuquota Microseconds of CPU time that the container can get in a CPU period. + * @var string $buildargs JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. + + For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded. + + [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) + + * @var int $shmsize Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. + * @var bool $squash Squash the resulting images layers into a single layer. *(Experimental release only.)* + * @var string $labels Arbitrary key/value labels to set on the image, as a JSON map of string pairs. + * @var string $networkmode Sets the networking mode for the run commands during build. Supported + standard values are: `bridge`, `host`, `none`, and `container:`. + Any other value is taken as a custom network's name or ID to which this + container should connect to. + + * @var string $platform Platform in the format os[/arch[/variant]] + * @var string $target Target build stage + * @var string $outputs BuildKit output configuration + * @var string $version Version of the builder backend to use. + + - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) + - `2` is [BuildKit](https://github.com/moby/buildkit) + + * } + * @param array $headerParameters { + * @var string $Content-type + * @var string $X-Registry-Config This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. + + The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: + + ``` + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + ``` + + Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImageBuildBadRequestException + * @throws \Docker\API\Exception\ImageBuildInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function imageBuild($inputStream, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageBuild($inputStream, $queryParameters, $headerParameters), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var int $keep-storage Amount of disk space in bytes to keep for cache + * @var bool $all Remove all types of build cache + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + process on the list of build cache objects. + + Available filters: + + - `until=` remove cache older than ``. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time. + - `id=` + - `parent=` + - `type=` + - `description=` + - `inuse` + - `shared` + - `private` + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\BuildPruneInternalServerErrorException + * + * @return null|\Docker\API\Model\BuildPrunePostResponse200|\Psr\Http\Message\ResponseInterface + */ + public function buildPrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\BuildPrune($queryParameters), $fetch); + } + /** + * Pull or import an image. + * + * @param string $inputImage Image content if the value `-` has been specified in fromSrc query parameter + * @param array $queryParameters { + * @var string $fromImage Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed. + * @var string $fromSrc Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image. + * @var string $repo Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image. + * @var string $tag Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled. + * @var string $message Set commit message for imported image. + * @var array $changes Apply `Dockerfile` instructions to the image that is created, + for example: `changes=ENV DEBUG=true`. + Note that `ENV DEBUG=true` should be URI component encoded. + + Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + + * @var string $platform Platform in the format os[/arch[/variant]]. + + When used in combination with the `fromImage` option, the daemon checks + if the given image is present in the local image cache with the given + OS and Architecture, and otherwise attempts to pull the image. If the + option is not set, the host's native OS and Architecture are used. + If the given image does not exist in the local image cache, the daemon + attempts to pull the image with the host's native OS and Architecture. + If the given image does exists in the local image cache, but its OS or + architecture does not match, a warning is produced. + + When used with the `fromSrc` option to import an image from an archive, + this option sets the platform information for the imported image. If + the option is not set, the host's native OS and Architecture are used + for the imported image. + + * } + * @param array $headerParameters { + * @var string $X-Registry-Auth A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImageCreateNotFoundException + * @throws \Docker\API\Exception\ImageCreateInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function imageCreate(string $inputImage, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageCreate($inputImage, $queryParameters, $headerParameters), $fetch); + } + /** + * Return low-level information about an image. + * + * @param string $name Image name or id + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImageInspectNotFoundException + * @throws \Docker\API\Exception\ImageInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\ImageInspect|\Psr\Http\Message\ResponseInterface + */ + public function imageInspect(string $name, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageInspect($name), $fetch); + } + /** + * Return parent layers of an image. + * + * @param string $name Image name or ID + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImageHistoryNotFoundException + * @throws \Docker\API\Exception\ImageHistoryInternalServerErrorException + * + * @return null|\Docker\API\Model\ImagesNameHistoryGetResponse200Item[]|\Psr\Http\Message\ResponseInterface + */ + public function imageHistory(string $name, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageHistory($name), $fetch); + } + /** + * Push an image to a registry. + + If you wish to push an image on to a private registry, that image must + already have a tag which references the registry. For example, + `registry.example.com/myimage:latest`. + + The push is cancelled if the HTTP connection is closed. + + * + * @param string $name Name of the image to push. For example, `registry.example.com/myimage`. + The image must be present in the local image store with the same name. + + The name should be provided without tag; if a tag is provided, it + is ignored. For example, `registry.example.com/myimage:latest` is + considered equivalent to `registry.example.com/myimage`. + + Use the `tag` parameter to specify the tag to push. + + * @param array $queryParameters { + * @var string $tag Tag of the image to push. For example, `latest`. If no tag is provided, + all tags of the given image that are present in the local image store + are pushed. + + * @var string $platform JSON-encoded OCI platform to select the platform-variant to push. + If not provided, all available variants will attempt to be pushed. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to push to the registry. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + + * } + * @param array $headerParameters { + * @var string $X-Registry-Auth A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImagePushNotFoundException + * @throws \Docker\API\Exception\ImagePushInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function imagePush(string $name, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImagePush($name, $queryParameters, $headerParameters), $fetch); + } + /** + * Tag an image so that it becomes part of a repository. + * + * @param string $name Image name or ID to tag. + * @param array $queryParameters { + * @var string $repo The repository to tag in. For example, `someuser/someimage`. + * @var string $tag The name of the new tag. + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImageTagBadRequestException + * @throws \Docker\API\Exception\ImageTagNotFoundException + * @throws \Docker\API\Exception\ImageTagConflictException + * @throws \Docker\API\Exception\ImageTagInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function imageTag(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageTag($name, $queryParameters), $fetch); + } + /** + * Remove an image, along with any untagged parent images that were + referenced by that image. + + Images can't be removed if they have descendant images, are being + used by a running container or are being used by a build. + + * + * @param string $name Image name or ID + * @param array $queryParameters { + * @var bool $force Remove the image even if it is being used by stopped containers or has other tags + * @var bool $noprune Do not delete untagged parent images + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImageDeleteNotFoundException + * @throws \Docker\API\Exception\ImageDeleteConflictException + * @throws \Docker\API\Exception\ImageDeleteInternalServerErrorException + * + * @return null|\Docker\API\Model\ImageDeleteResponseItem[]|\Psr\Http\Message\ResponseInterface + */ + public function imageDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageDelete($name, $queryParameters), $fetch); + } + /** + * Search for an image on Docker Hub. + * + * @param array $queryParameters { + * @var string $term Term to search + * @var int $limit Maximum number of results to return + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: + + - `is-official=(true|false)` + - `stars=` Matches images that has at least 'number' stars. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImageSearchInternalServerErrorException + * + * @return null|\Docker\API\Model\ImagesSearchGetResponse200Item[]|\Psr\Http\Message\ResponseInterface + */ + public function imageSearch(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageSearch($queryParameters), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: + + - `dangling=` When set to `true` (or `1`), prune only + unused *and* untagged images. When set to `false` + (or `0`), all unused images are pruned. + - `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImagePruneInternalServerErrorException + * + * @return null|\Docker\API\Model\ImagesPrunePostResponse200|\Psr\Http\Message\ResponseInterface + */ + public function imagePrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImagePrune($queryParameters), $fetch); + } + /** + * Validate credentials for a registry and, if available, get an identity + token for accessing the registry without password. + + * + * @param \Docker\API\Model\AuthConfig $authConfig Authentication to check + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SystemAuthUnauthorizedException + * @throws \Docker\API\Exception\SystemAuthInternalServerErrorException + * + * @return null|\Docker\API\Model\AuthPostResponse200|\Psr\Http\Message\ResponseInterface + */ + public function systemAuth(\Docker\API\Model\AuthConfig $authConfig, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SystemAuth($authConfig), $fetch); + } + /** + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SystemInfoInternalServerErrorException + * + * @return null|\Docker\API\Model\SystemInfo|\Psr\Http\Message\ResponseInterface + */ + public function systemInfo(string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SystemInfo(), $fetch); + } + /** + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SystemVersionInternalServerErrorException + * + * @return null|\Docker\API\Model\SystemVersion|\Psr\Http\Message\ResponseInterface + */ + public function systemVersion(string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SystemVersion(), $fetch); + } + /** + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SystemPingInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function systemPing(string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SystemPing(), $fetch); + } + /** + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SystemPingHeadInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function systemPingHead(string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SystemPingHead(), $fetch); + } + /** + * + * + * @param \Docker\API\Model\ContainerConfig $containerConfig The container configuration + * @param array $queryParameters { + * @var string $container The ID or name of the container to commit + * @var string $repo Repository name for the created image + * @var string $tag Tag name for the create image + * @var string $comment Commit message + * @var string $author Author of the image (e.g., `John Hannibal Smith `) + * @var bool $pause Whether to pause the container before committing + * @var string $changes `Dockerfile` instructions to apply while committing + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImageCommitNotFoundException + * @throws \Docker\API\Exception\ImageCommitInternalServerErrorException + * + * @return null|\Docker\API\Model\IdResponse|\Psr\Http\Message\ResponseInterface + */ + public function imageCommit(\Docker\API\Model\ContainerConfig $containerConfig, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageCommit($containerConfig, $queryParameters), $fetch); + } + /** + * Stream real-time events from the server. + + Various objects within Docker report events when something happens to them. + + Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` + + Images report these events: `create`, `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` + + Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` + + Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` + + The Docker daemon reports these events: `reload` + + Services report these events: `create`, `update`, and `remove` + + Nodes report these events: `create`, `update`, and `remove` + + Secrets report these events: `create`, `update`, and `remove` + + Configs report these events: `create`, `update`, and `remove` + + The Builder reports `prune` events + + * + * @param array $queryParameters { + * @var string $since Show events created since this timestamp then stream new events. + * @var string $until Show events created until this timestamp then stop streaming. + * @var string $filters A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: + + - `config=` config name or ID + - `container=` container name or ID + - `daemon=` daemon name or ID + - `event=` event type + - `image=` image name or ID + - `label=` image or container label + - `network=` network name or ID + - `node=` node ID + - `plugin`= plugin name or ID + - `scope`= local or swarm + - `secret=` secret name or ID + - `service=` service name or ID + - `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` + - `volume=` volume name + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SystemEventsBadRequestException + * @throws \Docker\API\Exception\SystemEventsInternalServerErrorException + * + * @return null|\Docker\API\Model\EventMessage|\Psr\Http\Message\ResponseInterface + */ + public function systemEvents(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SystemEvents($queryParameters), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var array $type Object types, for which to compute and return data. + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SystemDataUsageInternalServerErrorException + * + * @return null|\Docker\API\Model\SystemDfGetResponse200|\Psr\Http\Message\ResponseInterface + */ + public function systemDataUsage(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SystemDataUsage($queryParameters), $fetch); + } + /** + * Get a tarball containing all images and metadata for a repository. + + If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. + + ### Image tarball format + + An image tarball contains one directory per image layer (named using its long ID), each containing these files: + + - `VERSION`: currently `1.0` - the file format version + - `json`: detailed layer information, similar to `docker inspect layer_id` + - `layer.tar`: A tarfile containing the filesystem changes in this layer + + The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions. + + If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. + + ```json + { + "hello-world": { + "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" + } + } + ``` + + * + * @param string $name Image name or ID + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImageGetInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function imageGet(string $name, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageGet($name), $fetch); + } + /** + * Get a tarball containing all images and metadata for several image + repositories. + + For each value of the `names` parameter: if it is a specific name and + tag (e.g. `ubuntu:latest`), then only that image (and its parents) are + returned; if it is an image ID, similarly only that image (and its parents) + are returned and there would be no names referenced in the 'repositories' + file for this image ID. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + + * + * @param array $queryParameters { + * @var array $names Image names to filter by + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImageGetAllInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function imageGetAll(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageGetAll($queryParameters), $fetch); + } + /** + * Load a set of images and tags into a repository. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + + * + * @param string|resource|\Psr\Http\Message\StreamInterface $imagesTarball Tar archive containing images + * @param array $queryParameters { + * @var bool $quiet Suppress progress details during load. + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ImageLoadInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function imageLoad($imagesTarball, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageLoad($imagesTarball, $queryParameters), $fetch); + } + /** + * Run a command inside a running container. + * + * @param string $id ID or name of container + * @param \Docker\API\Model\ContainersIdExecPostBody $execConfig Exec configuration + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ContainerExecNotFoundException + * @throws \Docker\API\Exception\ContainerExecConflictException + * @throws \Docker\API\Exception\ContainerExecInternalServerErrorException + * + * @return null|\Docker\API\Model\IdResponse|\Psr\Http\Message\ResponseInterface + */ + public function containerExec(string $id, \Docker\API\Model\ContainersIdExecPostBody $execConfig, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerExec($id, $execConfig), $fetch); + } + /** + * Starts a previously set up exec instance. If detach is true, this endpoint + returns immediately after starting the command. Otherwise, it sets up an + interactive session with the command. + + * + * @param string $id Exec instance ID + * @param \Docker\API\Model\ExecIdStartPostBody $execStartConfig + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ExecStartNotFoundException + * @throws \Docker\API\Exception\ExecStartConflictException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function execStart(string $id, \Docker\API\Model\ExecIdStartPostBody $execStartConfig, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ExecStart($id, $execStartConfig), $fetch); + } + /** + * Resize the TTY session used by an exec instance. This endpoint only works + if `tty` was specified as part of creating and starting the exec instance. + + * + * @param string $id Exec instance ID + * @param array $queryParameters { + * @var int $h Height of the TTY session in characters + * @var int $w Width of the TTY session in characters + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ExecResizeBadRequestException + * @throws \Docker\API\Exception\ExecResizeNotFoundException + * @throws \Docker\API\Exception\ExecResizeInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function execResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ExecResize($id, $queryParameters), $fetch); + } + /** + * Return low-level information about an exec instance. + * + * @param string $id Exec instance ID + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ExecInspectNotFoundException + * @throws \Docker\API\Exception\ExecInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\ExecIdJsonGetResponse200|\Psr\Http\Message\ResponseInterface + */ + public function execInspect(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ExecInspect($id), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to + process on the volumes list. Available filters: + + - `dangling=` When set to `true` (or `1`), returns all + volumes that are not in use by a container. When set to `false` + (or `0`), only volumes that are in use by one or more + containers are returned. + - `driver=` Matches volumes based on their driver. + - `label=` or `label=:` Matches volumes based on + the presence of a `label` alone or a `label` and a value. + - `name=` Matches all or part of a volume name. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\VolumeListInternalServerErrorException + * + * @return null|\Docker\API\Model\VolumeListResponse|\Psr\Http\Message\ResponseInterface + */ + public function volumeList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\VolumeList($queryParameters), $fetch); + } + /** + * + * + * @param \Docker\API\Model\VolumeCreateOptions $volumeConfig Volume configuration + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\VolumeCreateInternalServerErrorException + * + * @return null|\Docker\API\Model\Volume|\Psr\Http\Message\ResponseInterface + */ + public function volumeCreate(\Docker\API\Model\VolumeCreateOptions $volumeConfig, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\VolumeCreate($volumeConfig), $fetch); + } + /** + * Instruct the driver to remove the volume. + * + * @param string $name Volume name or ID + * @param array $queryParameters { + * @var bool $force Force the removal of the volume + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\VolumeDeleteNotFoundException + * @throws \Docker\API\Exception\VolumeDeleteConflictException + * @throws \Docker\API\Exception\VolumeDeleteInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function volumeDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\VolumeDelete($name, $queryParameters), $fetch); + } + /** + * + * + * @param string $name Volume name or ID + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\VolumeInspectNotFoundException + * @throws \Docker\API\Exception\VolumeInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\Volume|\Psr\Http\Message\ResponseInterface + */ + public function volumeInspect(string $name, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\VolumeInspect($name), $fetch); + } + /** + * + * + * @param string $name The name or ID of the volume + * @param \Docker\API\Model\VolumesNamePutBody $body The spec of the volume to update. Currently, only Availability may + change. All other fields must remain unchanged. + + * @param array $queryParameters { + * @var int $version The version number of the volume being updated. This is required to + avoid conflicting writes. Found in the volume's `ClusterVolume` + field. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\VolumeUpdateBadRequestException + * @throws \Docker\API\Exception\VolumeUpdateNotFoundException + * @throws \Docker\API\Exception\VolumeUpdateInternalServerErrorException + * @throws \Docker\API\Exception\VolumeUpdateServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function volumeUpdate(string $name, \Docker\API\Model\VolumesNamePutBody $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\VolumeUpdate($name, $body, $queryParameters), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\VolumePruneInternalServerErrorException + * + * @return null|\Docker\API\Model\VolumesPrunePostResponse200|\Psr\Http\Message\ResponseInterface + */ + public function volumePrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\VolumePrune($queryParameters), $fetch); + } + /** + * Returns a list of networks. For details on the format, see the + [network inspect endpoint](#operation/NetworkInspect). + + Note that it uses a different, smaller representation of a network than + inspecting a single network. For example, the list of containers attached + to the network is not propagated in API versions 1.28 and up. + + * + * @param array $queryParameters { + * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to process + on the networks list. + + Available filters: + + - `dangling=` When set to `true` (or `1`), returns all + networks that are not in use by a container. When set to `false` + (or `0`), only networks that are in use by one or more + containers are returned. + - `driver=` Matches a network's driver. + - `id=` Matches all or part of a network ID. + - `label=` or `label==` of a network label. + - `name=` Matches all or part of a network name. + - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). + - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\NetworkListInternalServerErrorException + * + * @return null|\Docker\API\Model\Network[]|\Psr\Http\Message\ResponseInterface + */ + public function networkList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkList($queryParameters), $fetch); + } + /** + * + * + * @param string $id Network ID or name + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\NetworkDeleteForbiddenException + * @throws \Docker\API\Exception\NetworkDeleteNotFoundException + * @throws \Docker\API\Exception\NetworkDeleteInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function networkDelete(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkDelete($id), $fetch); + } + /** + * + * + * @param string $id Network ID or name + * @param array $queryParameters { + * @var bool $verbose Detailed inspect output for troubleshooting + * @var string $scope Filter the network by scope (swarm, global, or local) + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\NetworkInspectNotFoundException + * @throws \Docker\API\Exception\NetworkInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\Network|\Psr\Http\Message\ResponseInterface + */ + public function networkInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkInspect($id, $queryParameters), $fetch); + } + /** + * + * + * @param \Docker\API\Model\NetworksCreatePostBody $networkConfig Network configuration + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\NetworkCreateBadRequestException + * @throws \Docker\API\Exception\NetworkCreateForbiddenException + * @throws \Docker\API\Exception\NetworkCreateNotFoundException + * @throws \Docker\API\Exception\NetworkCreateInternalServerErrorException + * + * @return null|\Docker\API\Model\NetworkCreateResponse|\Psr\Http\Message\ResponseInterface + */ + public function networkCreate(\Docker\API\Model\NetworksCreatePostBody $networkConfig, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkCreate($networkConfig), $fetch); + } + /** + * The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container + * + * @param string $id Network ID or name + * @param \Docker\API\Model\NetworksIdConnectPostBody $container + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\NetworkConnectBadRequestException + * @throws \Docker\API\Exception\NetworkConnectForbiddenException + * @throws \Docker\API\Exception\NetworkConnectNotFoundException + * @throws \Docker\API\Exception\NetworkConnectInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function networkConnect(string $id, \Docker\API\Model\NetworksIdConnectPostBody $container, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkConnect($id, $container), $fetch); + } + /** + * + * + * @param string $id Network ID or name + * @param \Docker\API\Model\NetworksIdDisconnectPostBody $container + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\NetworkDisconnectForbiddenException + * @throws \Docker\API\Exception\NetworkDisconnectNotFoundException + * @throws \Docker\API\Exception\NetworkDisconnectInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function networkDisconnect(string $id, \Docker\API\Model\NetworksIdDisconnectPostBody $container, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkDisconnect($id, $container), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\NetworkPruneInternalServerErrorException + * + * @return null|\Docker\API\Model\NetworksPrunePostResponse200|\Psr\Http\Message\ResponseInterface + */ + public function networkPrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkPrune($queryParameters), $fetch); + } + /** + * Returns information about installed plugins. + * + * @param array $queryParameters { + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + process on the plugin list. + + Available filters: + + - `capability=` + - `enable=|` + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\PluginListInternalServerErrorException + * + * @return null|\Docker\API\Model\Plugin[]|\Psr\Http\Message\ResponseInterface + */ + public function pluginList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\PluginList($queryParameters), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var string $remote The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\GetPluginPrivilegesInternalServerErrorException + * + * @return null|\Docker\API\Model\PluginPrivilege[]|\Psr\Http\Message\ResponseInterface + */ + public function getPluginPrivileges(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\GetPluginPrivileges($queryParameters), $fetch); + } + /** + * Pulls and installs a plugin. After the plugin is installed, it can be + enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). + + * + * @param \Docker\API\Model\PluginPrivilege[] $body + * @param array $queryParameters { + * @var string $remote Remote reference for plugin to install. + + The `:latest` tag is optional, and is used as the default if omitted. + + * @var string $name Local name for the pulled plugin. + + The `:latest` tag is optional, and is used as the default if omitted. + + * } + * @param array $headerParameters { + * @var string $X-Registry-Auth A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\PluginPullInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function pluginPull(array $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\PluginPull($body, $queryParameters, $headerParameters), $fetch); + } + /** + * + * + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\PluginInspectNotFoundException + * @throws \Docker\API\Exception\PluginInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\Plugin|\Psr\Http\Message\ResponseInterface + */ + public function pluginInspect(string $name, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\PluginInspect($name), $fetch); + } + /** + * + * + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + + * @param array $queryParameters { + * @var bool $force Disable the plugin before removing. This may result in issues if the + plugin is in use by a container. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\PluginDeleteNotFoundException + * @throws \Docker\API\Exception\PluginDeleteInternalServerErrorException + * + * @return null|\Docker\API\Model\Plugin|\Psr\Http\Message\ResponseInterface + */ + public function pluginDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\PluginDelete($name, $queryParameters), $fetch); + } + /** + * + * + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + + * @param array $queryParameters { + * @var int $timeout Set the HTTP client timeout (in seconds) + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\PluginEnableNotFoundException + * @throws \Docker\API\Exception\PluginEnableInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function pluginEnable(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\PluginEnable($name, $queryParameters), $fetch); + } + /** + * + * + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + + * @param array $queryParameters { + * @var bool $force Force disable a plugin even if still in use. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\PluginDisableNotFoundException + * @throws \Docker\API\Exception\PluginDisableInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function pluginDisable(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\PluginDisable($name, $queryParameters), $fetch); + } + /** + * + * + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + + * @param \Docker\API\Model\PluginPrivilege[] $body + * @param array $queryParameters { + * @var string $remote Remote reference to upgrade to. + + The `:latest` tag is optional, and is used as the default if omitted. + + * } + * @param array $headerParameters { + * @var string $X-Registry-Auth A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\PluginUpgradeNotFoundException + * @throws \Docker\API\Exception\PluginUpgradeInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function pluginUpgrade(string $name, array $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\PluginUpgrade($name, $body, $queryParameters, $headerParameters), $fetch); + } + /** + * + * + * @param string|resource|\Psr\Http\Message\StreamInterface $tarContext Path to tar containing plugin rootfs and manifest + * @param array $queryParameters { + * @var string $name The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\PluginCreateInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function pluginCreate($tarContext, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\PluginCreate($tarContext, $queryParameters), $fetch); + } + /** + * Push a plugin to the registry. + + * + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\PluginPushNotFoundException + * @throws \Docker\API\Exception\PluginPushInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function pluginPush(string $name, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\PluginPush($name), $fetch); + } + /** + * + * + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + + * @param array $body + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\PluginSetNotFoundException + * @throws \Docker\API\Exception\PluginSetInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function pluginSet(string $name, array $body, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\PluginSet($name, $body), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var string $filters Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `id=` + - `label=` + - `membership=`(`accepted`|`pending`)` + - `name=` + - `node.label=` + - `role=`(`manager`|`worker`)` + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\NodeListInternalServerErrorException + * @throws \Docker\API\Exception\NodeListServiceUnavailableException + * + * @return null|\Docker\API\Model\Node[]|\Psr\Http\Message\ResponseInterface + */ + public function nodeList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\NodeList($queryParameters), $fetch); + } + /** + * + * + * @param string $id The ID or name of the node + * @param array $queryParameters { + * @var bool $force Force remove a node from the swarm + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\NodeDeleteNotFoundException + * @throws \Docker\API\Exception\NodeDeleteInternalServerErrorException + * @throws \Docker\API\Exception\NodeDeleteServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function nodeDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\NodeDelete($id, $queryParameters), $fetch); + } + /** + * + * + * @param string $id The ID or name of the node + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\NodeInspectNotFoundException + * @throws \Docker\API\Exception\NodeInspectInternalServerErrorException + * @throws \Docker\API\Exception\NodeInspectServiceUnavailableException + * + * @return null|\Docker\API\Model\Node|\Psr\Http\Message\ResponseInterface + */ + public function nodeInspect(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\NodeInspect($id), $fetch); + } + /** + * + * + * @param string $id The ID of the node + * @param \Docker\API\Model\NodeSpec $body + * @param array $queryParameters { + * @var int $version The version number of the node object being updated. This is required + to avoid conflicting writes. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\NodeUpdateBadRequestException + * @throws \Docker\API\Exception\NodeUpdateNotFoundException + * @throws \Docker\API\Exception\NodeUpdateInternalServerErrorException + * @throws \Docker\API\Exception\NodeUpdateServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function nodeUpdate(string $id, \Docker\API\Model\NodeSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\NodeUpdate($id, $body, $queryParameters), $fetch); + } + /** + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SwarmInspectNotFoundException + * @throws \Docker\API\Exception\SwarmInspectInternalServerErrorException + * @throws \Docker\API\Exception\SwarmInspectServiceUnavailableException + * + * @return null|\Docker\API\Model\Swarm|\Psr\Http\Message\ResponseInterface + */ + public function swarmInspect(string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmInspect(), $fetch); + } + /** + * + * + * @param \Docker\API\Model\SwarmInitPostBody $body + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SwarmInitBadRequestException + * @throws \Docker\API\Exception\SwarmInitInternalServerErrorException + * @throws \Docker\API\Exception\SwarmInitServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function swarmInit(\Docker\API\Model\SwarmInitPostBody $body, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmInit($body), $fetch); + } + /** + * + * + * @param \Docker\API\Model\SwarmJoinPostBody $body + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SwarmJoinBadRequestException + * @throws \Docker\API\Exception\SwarmJoinInternalServerErrorException + * @throws \Docker\API\Exception\SwarmJoinServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function swarmJoin(\Docker\API\Model\SwarmJoinPostBody $body, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmJoin($body), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var bool $force Force leave swarm, even if this is the last manager or that it will + break the cluster. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SwarmLeaveInternalServerErrorException + * @throws \Docker\API\Exception\SwarmLeaveServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function swarmLeave(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmLeave($queryParameters), $fetch); + } + /** + * + * + * @param \Docker\API\Model\SwarmSpec $body + * @param array $queryParameters { + * @var int $version The version number of the swarm object being updated. This is + required to avoid conflicting writes. + + * @var bool $rotateWorkerToken Rotate the worker join token. + * @var bool $rotateManagerToken Rotate the manager join token. + * @var bool $rotateManagerUnlockKey Rotate the manager unlock key. + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SwarmUpdateBadRequestException + * @throws \Docker\API\Exception\SwarmUpdateInternalServerErrorException + * @throws \Docker\API\Exception\SwarmUpdateServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function swarmUpdate(\Docker\API\Model\SwarmSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmUpdate($body, $queryParameters), $fetch); + } + /** + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SwarmUnlockkeyInternalServerErrorException + * @throws \Docker\API\Exception\SwarmUnlockkeyServiceUnavailableException + * + * @return null|\Docker\API\Model\SwarmUnlockkeyGetResponse200|\Psr\Http\Message\ResponseInterface + */ + public function swarmUnlockkey(string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmUnlockkey(), $fetch); + } + /** + * + * + * @param \Docker\API\Model\SwarmUnlockPostBody $body + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SwarmUnlockInternalServerErrorException + * @throws \Docker\API\Exception\SwarmUnlockServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function swarmUnlock(\Docker\API\Model\SwarmUnlockPostBody $body, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmUnlock($body), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + process on the services list. + + Available filters: + + - `id=` + - `label=` + - `mode=["replicated"|"global"]` + - `name=` + + * @var bool $status Include service status, with count of running and desired tasks. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ServiceListInternalServerErrorException + * @throws \Docker\API\Exception\ServiceListServiceUnavailableException + * + * @return null|\Docker\API\Model\Service[]|\Psr\Http\Message\ResponseInterface + */ + public function serviceList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceList($queryParameters), $fetch); + } + /** + * + * + * @param \Docker\API\Model\ServicesCreatePostBody $body + * @param array $headerParameters { + * @var string $X-Registry-Auth A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ServiceCreateBadRequestException + * @throws \Docker\API\Exception\ServiceCreateForbiddenException + * @throws \Docker\API\Exception\ServiceCreateConflictException + * @throws \Docker\API\Exception\ServiceCreateInternalServerErrorException + * @throws \Docker\API\Exception\ServiceCreateServiceUnavailableException + * + * @return null|\Docker\API\Model\ServiceCreateResponse|\Psr\Http\Message\ResponseInterface + */ + public function serviceCreate(\Docker\API\Model\ServicesCreatePostBody $body, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceCreate($body, $headerParameters), $fetch); + } + /** + * + * + * @param string $id ID or name of service. + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ServiceDeleteNotFoundException + * @throws \Docker\API\Exception\ServiceDeleteInternalServerErrorException + * @throws \Docker\API\Exception\ServiceDeleteServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function serviceDelete(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceDelete($id), $fetch); + } + /** + * + * + * @param string $id ID or name of service. + * @param array $queryParameters { + * @var bool $insertDefaults Fill empty fields with default values. + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ServiceInspectNotFoundException + * @throws \Docker\API\Exception\ServiceInspectInternalServerErrorException + * @throws \Docker\API\Exception\ServiceInspectServiceUnavailableException + * + * @return null|\Docker\API\Model\Service|\Psr\Http\Message\ResponseInterface + */ + public function serviceInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceInspect($id, $queryParameters), $fetch); + } + /** + * + * + * @param string $id ID or name of service. + * @param \Docker\API\Model\ServicesIdUpdatePostBody $body + * @param array $queryParameters { + * @var int $version The version number of the service object being updated. This is + required to avoid conflicting writes. + This version number should be the value as currently set on the + service *before* the update. You can find the current version by + calling `GET /services/{id}` + + * @var string $registryAuthFrom If the `X-Registry-Auth` header is not specified, this parameter + indicates where to find registry authorization credentials. + + * @var string $rollback Set to this parameter to `previous` to cause a server-side rollback + to the previous service spec. The supplied spec will be ignored in + this case. + + * } + * @param array $headerParameters { + * @var string $X-Registry-Auth A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ServiceUpdateBadRequestException + * @throws \Docker\API\Exception\ServiceUpdateNotFoundException + * @throws \Docker\API\Exception\ServiceUpdateInternalServerErrorException + * @throws \Docker\API\Exception\ServiceUpdateServiceUnavailableException + * + * @return null|\Docker\API\Model\ServiceUpdateResponse|\Psr\Http\Message\ResponseInterface + */ + public function serviceUpdate(string $id, \Docker\API\Model\ServicesIdUpdatePostBody $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceUpdate($id, $body, $queryParameters, $headerParameters), $fetch); + } + /** + * Get `stdout` and `stderr` logs from a service. See also + [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + + * + * @param string $id ID or name of the service + * @param array $queryParameters { + * @var bool $details Show service context and extra details provided to logs. + * @var bool $follow Keep connection after returning logs. + * @var bool $stdout Return logs from `stdout` + * @var bool $stderr Return logs from `stderr` + * @var int $since Only return logs since this time, as a UNIX timestamp + * @var bool $timestamps Add timestamps to every log line + * @var string $tail Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ServiceLogsNotFoundException + * @throws \Docker\API\Exception\ServiceLogsInternalServerErrorException + * @throws \Docker\API\Exception\ServiceLogsServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function serviceLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceLogs($id, $queryParameters), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + process on the tasks list. + + Available filters: + + - `desired-state=(running | shutdown | accepted)` + - `id=` + - `label=key` or `label="key=value"` + - `name=` + - `node=` + - `service=` + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\TaskListInternalServerErrorException + * @throws \Docker\API\Exception\TaskListServiceUnavailableException + * + * @return null|\Docker\API\Model\Task[]|\Psr\Http\Message\ResponseInterface + */ + public function taskList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\TaskList($queryParameters), $fetch); + } + /** + * + * + * @param string $id ID of the task + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\TaskInspectNotFoundException + * @throws \Docker\API\Exception\TaskInspectInternalServerErrorException + * @throws \Docker\API\Exception\TaskInspectServiceUnavailableException + * + * @return null|\Docker\API\Model\Task|\Psr\Http\Message\ResponseInterface + */ + public function taskInspect(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\TaskInspect($id), $fetch); + } + /** + * Get `stdout` and `stderr` logs from a task. + See also [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + + * + * @param string $id ID of the task + * @param array $queryParameters { + * @var bool $details Show task context and extra details provided to logs. + * @var bool $follow Keep connection after returning logs. + * @var bool $stdout Return logs from `stdout` + * @var bool $stderr Return logs from `stderr` + * @var int $since Only return logs since this time, as a UNIX timestamp + * @var bool $timestamps Add timestamps to every log line + * @var string $tail Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\TaskLogsNotFoundException + * @throws \Docker\API\Exception\TaskLogsInternalServerErrorException + * @throws \Docker\API\Exception\TaskLogsServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function taskLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\TaskLogs($id, $queryParameters), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + process on the secrets list. + + Available filters: + + - `id=` + - `label= or label==value` + - `name=` + - `names=` + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SecretListInternalServerErrorException + * @throws \Docker\API\Exception\SecretListServiceUnavailableException + * + * @return null|\Docker\API\Model\Secret[]|\Psr\Http\Message\ResponseInterface + */ + public function secretList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SecretList($queryParameters), $fetch); + } + /** + * + * + * @param \Docker\API\Model\SecretsCreatePostBody $body + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SecretCreateConflictException + * @throws \Docker\API\Exception\SecretCreateInternalServerErrorException + * @throws \Docker\API\Exception\SecretCreateServiceUnavailableException + * + * @return null|\Docker\API\Model\IdResponse|\Psr\Http\Message\ResponseInterface + */ + public function secretCreate(\Docker\API\Model\SecretsCreatePostBody $body, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SecretCreate($body), $fetch); + } + /** + * + * + * @param string $id ID of the secret + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SecretDeleteNotFoundException + * @throws \Docker\API\Exception\SecretDeleteInternalServerErrorException + * @throws \Docker\API\Exception\SecretDeleteServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function secretDelete(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SecretDelete($id), $fetch); + } + /** + * + * + * @param string $id ID of the secret + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SecretInspectNotFoundException + * @throws \Docker\API\Exception\SecretInspectInternalServerErrorException + * @throws \Docker\API\Exception\SecretInspectServiceUnavailableException + * + * @return null|\Docker\API\Model\Secret|\Psr\Http\Message\ResponseInterface + */ + public function secretInspect(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SecretInspect($id), $fetch); + } + /** + * + * + * @param string $id The ID or name of the secret + * @param \Docker\API\Model\SecretSpec $body The spec of the secret to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [SecretInspect endpoint](#operation/SecretInspect) response values. + + * @param array $queryParameters { + * @var int $version The version number of the secret object being updated. This is + required to avoid conflicting writes. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SecretUpdateBadRequestException + * @throws \Docker\API\Exception\SecretUpdateNotFoundException + * @throws \Docker\API\Exception\SecretUpdateInternalServerErrorException + * @throws \Docker\API\Exception\SecretUpdateServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function secretUpdate(string $id, \Docker\API\Model\SecretSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SecretUpdate($id, $body, $queryParameters), $fetch); + } + /** + * + * + * @param array $queryParameters { + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + process on the configs list. + + Available filters: + + - `id=` + - `label= or label==value` + - `name=` + - `names=` + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ConfigListInternalServerErrorException + * @throws \Docker\API\Exception\ConfigListServiceUnavailableException + * + * @return null|\Docker\API\Model\Config[]|\Psr\Http\Message\ResponseInterface + */ + public function configList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ConfigList($queryParameters), $fetch); + } + /** + * + * + * @param \Docker\API\Model\ConfigsCreatePostBody $body + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ConfigCreateConflictException + * @throws \Docker\API\Exception\ConfigCreateInternalServerErrorException + * @throws \Docker\API\Exception\ConfigCreateServiceUnavailableException + * + * @return null|\Docker\API\Model\IdResponse|\Psr\Http\Message\ResponseInterface + */ + public function configCreate(\Docker\API\Model\ConfigsCreatePostBody $body, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ConfigCreate($body), $fetch); + } + /** + * + * + * @param string $id ID of the config + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ConfigDeleteNotFoundException + * @throws \Docker\API\Exception\ConfigDeleteInternalServerErrorException + * @throws \Docker\API\Exception\ConfigDeleteServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function configDelete(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ConfigDelete($id), $fetch); + } + /** + * + * + * @param string $id ID of the config + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ConfigInspectNotFoundException + * @throws \Docker\API\Exception\ConfigInspectInternalServerErrorException + * @throws \Docker\API\Exception\ConfigInspectServiceUnavailableException + * + * @return null|\Docker\API\Model\Config|\Psr\Http\Message\ResponseInterface + */ + public function configInspect(string $id, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ConfigInspect($id), $fetch); + } + /** + * + * + * @param string $id The ID or name of the config + * @param \Docker\API\Model\ConfigSpec $body The spec of the config to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [ConfigInspect endpoint](#operation/ConfigInspect) response values. + + * @param array $queryParameters { + * @var int $version The version number of the config object being updated. This is + required to avoid conflicting writes. + + * } + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\ConfigUpdateBadRequestException + * @throws \Docker\API\Exception\ConfigUpdateNotFoundException + * @throws \Docker\API\Exception\ConfigUpdateInternalServerErrorException + * @throws \Docker\API\Exception\ConfigUpdateServiceUnavailableException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function configUpdate(string $id, \Docker\API\Model\ConfigSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ConfigUpdate($id, $body, $queryParameters), $fetch); + } + /** + * Return image digest and platform information by contacting the registry. + * + * @param string $name Image name or id + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\DistributionInspectUnauthorizedException + * @throws \Docker\API\Exception\DistributionInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\DistributionInspect|\Psr\Http\Message\ResponseInterface + */ + public function distributionInspect(string $name, string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\DistributionInspect($name), $fetch); + } + /** + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @throws \Docker\API\Exception\SessionBadRequestException + * @throws \Docker\API\Exception\SessionInternalServerErrorException + * + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function session(string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\Session(), $fetch); + } + public static function create($httpClient = null, array $additionalPlugins = [], array $additionalNormalizers = []) + { + if (null === $httpClient) { + $httpClient = \Http\Discovery\Psr18ClientDiscovery::find(); + $plugins = []; + if (count($additionalPlugins) > 0) { + $plugins = array_merge($plugins, $additionalPlugins); + } + $httpClient = new \Http\Client\Common\PluginClient($httpClient, $plugins); + } + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $streamFactory = \Http\Discovery\Psr17FactoryDiscovery::findStreamFactory(); + $normalizers = [new \Symfony\Component\Serializer\Normalizer\ArrayDenormalizer(), new \Docker\API\Normalizer\JaneObjectNormalizer()]; + if (count($additionalNormalizers) > 0) { + $normalizers = array_merge($normalizers, $additionalNormalizers); + } + $serializer = new \Symfony\Component\Serializer\Serializer($normalizers, [new \Symfony\Component\Serializer\Encoder\JsonEncoder(new \Symfony\Component\Serializer\Encoder\JsonEncode(), new \Symfony\Component\Serializer\Encoder\JsonDecode(['json_decode_associative' => true]))]); + return new static($httpClient, $requestFactory, $serializer, $streamFactory); + } +} \ No newline at end of file diff --git a/generated/Endpoint/BuildPrune.php b/generated/Endpoint/BuildPrune.php new file mode 100644 index 00000000..91f6a887 --- /dev/null +++ b/generated/Endpoint/BuildPrune.php @@ -0,0 +1,83 @@ +` remove cache older than ``. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time. + - `id=` + - `parent=` + - `type=` + - `description=` + - `inuse` + - `shared` + - `private` + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/build/prune'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['keep-storage', 'all', 'filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('keep-storage', ['int']); + $optionsResolver->addAllowedTypes('all', ['bool']); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\BuildPruneInternalServerErrorException + * + * @return null|\Docker\API\Model\BuildPrunePostResponse200 + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\BuildPrunePostResponse200', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\BuildPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ConfigCreate.php b/generated/Endpoint/ConfigCreate.php new file mode 100644 index 00000000..f15acc03 --- /dev/null +++ b/generated/Endpoint/ConfigCreate.php @@ -0,0 +1,63 @@ +body = $body; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/configs/create'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ConfigCreateConflictException + * @throws \Docker\API\Exception\ConfigCreateInternalServerErrorException + * @throws \Docker\API\Exception\ConfigCreateServiceUnavailableException + * + * @return null|\Docker\API\Model\IdResponse + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (201 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\IdResponse', 'json'); + } + if (409 === $status) { + throw new \Docker\API\Exception\ConfigCreateConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ConfigCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\ConfigCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ConfigDelete.php b/generated/Endpoint/ConfigDelete.php new file mode 100644 index 00000000..e6c3bae4 --- /dev/null +++ b/generated/Endpoint/ConfigDelete.php @@ -0,0 +1,64 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'DELETE'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/configs/{id}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ConfigDeleteNotFoundException + * @throws \Docker\API\Exception\ConfigDeleteInternalServerErrorException + * @throws \Docker\API\Exception\ConfigDeleteServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ConfigDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ConfigDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\ConfigDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ConfigInspect.php b/generated/Endpoint/ConfigInspect.php new file mode 100644 index 00000000..b450c11d --- /dev/null +++ b/generated/Endpoint/ConfigInspect.php @@ -0,0 +1,64 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/configs/{id}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ConfigInspectNotFoundException + * @throws \Docker\API\Exception\ConfigInspectInternalServerErrorException + * @throws \Docker\API\Exception\ConfigInspectServiceUnavailableException + * + * @return null|\Docker\API\Model\Config + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Config', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\ConfigInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ConfigInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\ConfigInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ConfigList.php b/generated/Endpoint/ConfigList.php new file mode 100644 index 00000000..8a4486ff --- /dev/null +++ b/generated/Endpoint/ConfigList.php @@ -0,0 +1,79 @@ +` + - `label= or label==value` + - `name=` + - `names=` + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/configs'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ConfigListInternalServerErrorException + * @throws \Docker\API\Exception\ConfigListServiceUnavailableException + * + * @return null|\Docker\API\Model\Config[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Config[]', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\ConfigListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\ConfigListServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ConfigUpdate.php b/generated/Endpoint/ConfigUpdate.php new file mode 100644 index 00000000..32fc00e0 --- /dev/null +++ b/generated/Endpoint/ConfigUpdate.php @@ -0,0 +1,88 @@ +id = $id; + $this->body = $body; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/configs/{id}/update'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['version']); + $optionsResolver->setRequired(['version']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('version', ['int']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ConfigUpdateBadRequestException + * @throws \Docker\API\Exception\ConfigUpdateNotFoundException + * @throws \Docker\API\Exception\ConfigUpdateInternalServerErrorException + * @throws \Docker\API\Exception\ConfigUpdateServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\ConfigUpdateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\ConfigUpdateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ConfigUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\ConfigUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerArchive.php b/generated/Endpoint/ContainerArchive.php new file mode 100644 index 00000000..f4f7251b --- /dev/null +++ b/generated/Endpoint/ContainerArchive.php @@ -0,0 +1,77 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/archive'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['path']); + $optionsResolver->setRequired(['path']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('path', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerArchiveBadRequestException + * @throws \Docker\API\Exception\ContainerArchiveNotFoundException + * @throws \Docker\API\Exception\ContainerArchiveInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\ContainerArchiveBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerArchiveNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerArchiveInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerArchiveInfo.php b/generated/Endpoint/ContainerArchiveInfo.php new file mode 100644 index 00000000..03bdbd97 --- /dev/null +++ b/generated/Endpoint/ContainerArchiveInfo.php @@ -0,0 +1,80 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'HEAD'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/archive'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['path']); + $optionsResolver->setRequired(['path']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('path', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerArchiveInfoBadRequestException + * @throws \Docker\API\Exception\ContainerArchiveInfoNotFoundException + * @throws \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\ContainerArchiveInfoBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerArchiveInfoNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerAttach.php b/generated/Endpoint/ContainerAttach.php new file mode 100644 index 00000000..4b8751af --- /dev/null +++ b/generated/Endpoint/ContainerAttach.php @@ -0,0 +1,196 @@ +` where `` is one of: `a-z`, + `@`, `^`, `[`, `,` or `_`. + + * @var bool $logs Replay previous logs from the container. + + This is useful for attaching to a container that has started and you + want to output everything since the container started. + + If `stream` is also enabled, once all the previous output has been + returned, it will seamlessly transition into streaming current + output. + + * @var bool $stream Stream attached streams from the time the request was made onwards. + + * @var bool $stdin Attach to `stdin` + * @var bool $stdout Attach to `stdout` + * @var bool $stderr Attach to `stderr` + * } + */ + public function __construct(string $id, array $queryParameters = []) + { + $this->id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/attach'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['detachKeys', 'logs', 'stream', 'stdin', 'stdout', 'stderr']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['logs' => false, 'stream' => false, 'stdin' => false, 'stdout' => false, 'stderr' => false]); + $optionsResolver->addAllowedTypes('detachKeys', ['string']); + $optionsResolver->addAllowedTypes('logs', ['bool']); + $optionsResolver->addAllowedTypes('stream', ['bool']); + $optionsResolver->addAllowedTypes('stdin', ['bool']); + $optionsResolver->addAllowedTypes('stdout', ['bool']); + $optionsResolver->addAllowedTypes('stderr', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerAttachBadRequestException + * @throws \Docker\API\Exception\ContainerAttachNotFoundException + * @throws \Docker\API\Exception\ContainerAttachInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (101 === $status) { + return null; + } + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\ContainerAttachBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerAttachNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerAttachInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerAttachWebsocket.php b/generated/Endpoint/ContainerAttachWebsocket.php new file mode 100644 index 00000000..fb526648 --- /dev/null +++ b/generated/Endpoint/ContainerAttachWebsocket.php @@ -0,0 +1,93 @@ +` where `` is one of: `a-z`, + `@`, `^`, `[`, `,`, or `_`. + + * @var bool $logs Return logs + * @var bool $stream Return stream + * @var bool $stdin Attach to `stdin` + * @var bool $stdout Attach to `stdout` + * @var bool $stderr Attach to `stderr` + * } + */ + public function __construct(string $id, array $queryParameters = []) + { + $this->id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/attach/ws'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['detachKeys', 'logs', 'stream', 'stdin', 'stdout', 'stderr']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['logs' => false, 'stream' => false, 'stdin' => false, 'stdout' => false, 'stderr' => false]); + $optionsResolver->addAllowedTypes('detachKeys', ['string']); + $optionsResolver->addAllowedTypes('logs', ['bool']); + $optionsResolver->addAllowedTypes('stream', ['bool']); + $optionsResolver->addAllowedTypes('stdin', ['bool']); + $optionsResolver->addAllowedTypes('stdout', ['bool']); + $optionsResolver->addAllowedTypes('stderr', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerAttachWebsocketBadRequestException + * @throws \Docker\API\Exception\ContainerAttachWebsocketNotFoundException + * @throws \Docker\API\Exception\ContainerAttachWebsocketInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (101 === $status) { + return null; + } + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\ContainerAttachWebsocketBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerAttachWebsocketNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerAttachWebsocketInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerChanges.php b/generated/Endpoint/ContainerChanges.php new file mode 100644 index 00000000..3f4a6cd8 --- /dev/null +++ b/generated/Endpoint/ContainerChanges.php @@ -0,0 +1,66 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/changes'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerChangesNotFoundException + * @throws \Docker\API\Exception\ContainerChangesInternalServerErrorException + * + * @return null|\Docker\API\Model\FilesystemChange[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\FilesystemChange[]', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerChangesNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerChangesInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerCreate.php b/generated/Endpoint/ContainerCreate.php new file mode 100644 index 00000000..0d35ac66 --- /dev/null +++ b/generated/Endpoint/ContainerCreate.php @@ -0,0 +1,100 @@ +body = $body; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/containers/create'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['name', 'platform']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['platform' => '']); + $optionsResolver->addAllowedTypes('name', ['string']); + $optionsResolver->addAllowedTypes('platform', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerCreateBadRequestException + * @throws \Docker\API\Exception\ContainerCreateNotFoundException + * @throws \Docker\API\Exception\ContainerCreateConflictException + * @throws \Docker\API\Exception\ContainerCreateInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainerCreateResponse + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (201 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainerCreateResponse', 'json'); + } + if (400 === $status) { + throw new \Docker\API\Exception\ContainerCreateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerCreateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (409 === $status) { + throw new \Docker\API\Exception\ContainerCreateConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerDelete.php b/generated/Endpoint/ContainerDelete.php new file mode 100644 index 00000000..6b2ed4f4 --- /dev/null +++ b/generated/Endpoint/ContainerDelete.php @@ -0,0 +1,85 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'DELETE'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['v', 'force', 'link']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['v' => false, 'force' => false, 'link' => false]); + $optionsResolver->addAllowedTypes('v', ['bool']); + $optionsResolver->addAllowedTypes('force', ['bool']); + $optionsResolver->addAllowedTypes('link', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerDeleteBadRequestException + * @throws \Docker\API\Exception\ContainerDeleteNotFoundException + * @throws \Docker\API\Exception\ContainerDeleteConflictException + * @throws \Docker\API\Exception\ContainerDeleteInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\ContainerDeleteBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (409 === $status) { + throw new \Docker\API\Exception\ContainerDeleteConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerExec.php b/generated/Endpoint/ContainerExec.php new file mode 100644 index 00000000..3f7a42b2 --- /dev/null +++ b/generated/Endpoint/ContainerExec.php @@ -0,0 +1,66 @@ +id = $id; + $this->body = $execConfig; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/exec'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerExecNotFoundException + * @throws \Docker\API\Exception\ContainerExecConflictException + * @throws \Docker\API\Exception\ContainerExecInternalServerErrorException + * + * @return null|\Docker\API\Model\IdResponse + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (201 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\IdResponse', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerExecNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (409 === $status) { + throw new \Docker\API\Exception\ContainerExecConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerExecInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerExport.php b/generated/Endpoint/ContainerExport.php new file mode 100644 index 00000000..31d99093 --- /dev/null +++ b/generated/Endpoint/ContainerExport.php @@ -0,0 +1,60 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/export'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerExportNotFoundException + * @throws \Docker\API\Exception\ContainerExportInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerExportNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerExportInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerInspect.php b/generated/Endpoint/ContainerInspect.php new file mode 100644 index 00000000..24c4b596 --- /dev/null +++ b/generated/Endpoint/ContainerInspect.php @@ -0,0 +1,73 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/json'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['size']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['size' => false]); + $optionsResolver->addAllowedTypes('size', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerInspectNotFoundException + * @throws \Docker\API\Exception\ContainerInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainersIdJsonGetResponse200 + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainersIdJsonGetResponse200', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerKill.php b/generated/Endpoint/ContainerKill.php new file mode 100644 index 00000000..3921da14 --- /dev/null +++ b/generated/Endpoint/ContainerKill.php @@ -0,0 +1,80 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/kill'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['signal']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['signal' => 'SIGKILL']); + $optionsResolver->addAllowedTypes('signal', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerKillNotFoundException + * @throws \Docker\API\Exception\ContainerKillConflictException + * @throws \Docker\API\Exception\ContainerKillInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerKillNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (409 === $status) { + throw new \Docker\API\Exception\ContainerKillConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerKillInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerList.php b/generated/Endpoint/ContainerList.php new file mode 100644 index 00000000..f3f91211 --- /dev/null +++ b/generated/Endpoint/ContainerList.php @@ -0,0 +1,107 @@ +[:]`, ``, or ``) + - `before`=(`` or ``) + - `expose`=(`[/]`|`/[]`) + - `exited=` containers with exit code of `` + - `health`=(`starting`|`healthy`|`unhealthy`|`none`) + - `id=` a container's ID + - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + - `is-task=`(`true`|`false`) + - `label=key` or `label="key=value"` of a container label + - `name=` a container's name + - `network`=(`` or ``) + - `publish`=(`[/]`|`/[]`) + - `since`=(`` or ``) + - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) + - `volume`=(`` or ``) + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/containers/json'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['all', 'limit', 'size', 'filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['all' => false, 'size' => false]); + $optionsResolver->addAllowedTypes('all', ['bool']); + $optionsResolver->addAllowedTypes('limit', ['int']); + $optionsResolver->addAllowedTypes('size', ['bool']); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerListBadRequestException + * @throws \Docker\API\Exception\ContainerListInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainerSummary[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainerSummary[]', 'json'); + } + if (400 === $status) { + throw new \Docker\API\Exception\ContainerListBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerLogs.php b/generated/Endpoint/ContainerLogs.php new file mode 100644 index 00000000..6d94f88a --- /dev/null +++ b/generated/Endpoint/ContainerLogs.php @@ -0,0 +1,91 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/logs'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['follow', 'stdout', 'stderr', 'since', 'until', 'timestamps', 'tail']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['follow' => false, 'stdout' => false, 'stderr' => false, 'since' => 0, 'until' => 0, 'timestamps' => false, 'tail' => 'all']); + $optionsResolver->addAllowedTypes('follow', ['bool']); + $optionsResolver->addAllowedTypes('stdout', ['bool']); + $optionsResolver->addAllowedTypes('stderr', ['bool']); + $optionsResolver->addAllowedTypes('since', ['int']); + $optionsResolver->addAllowedTypes('until', ['int']); + $optionsResolver->addAllowedTypes('timestamps', ['bool']); + $optionsResolver->addAllowedTypes('tail', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerLogsNotFoundException + * @throws \Docker\API\Exception\ContainerLogsInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return json_decode($body); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerLogsNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerLogsInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerPause.php b/generated/Endpoint/ContainerPause.php new file mode 100644 index 00000000..dbd13afa --- /dev/null +++ b/generated/Endpoint/ContainerPause.php @@ -0,0 +1,66 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/pause'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerPauseNotFoundException + * @throws \Docker\API\Exception\ContainerPauseInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerPauseNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerPauseInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerPrune.php b/generated/Endpoint/ContainerPrune.php new file mode 100644 index 00000000..60a57b5d --- /dev/null +++ b/generated/Endpoint/ContainerPrune.php @@ -0,0 +1,71 @@ +` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels. + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/containers/prune'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerPruneInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainersPrunePostResponse200 + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainersPrunePostResponse200', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerRename.php b/generated/Endpoint/ContainerRename.php new file mode 100644 index 00000000..04a9c17f --- /dev/null +++ b/generated/Endpoint/ContainerRename.php @@ -0,0 +1,77 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/rename'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['name']); + $optionsResolver->setRequired(['name']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('name', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerRenameNotFoundException + * @throws \Docker\API\Exception\ContainerRenameConflictException + * @throws \Docker\API\Exception\ContainerRenameInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerRenameNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (409 === $status) { + throw new \Docker\API\Exception\ContainerRenameConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerRenameInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerResize.php b/generated/Endpoint/ContainerResize.php new file mode 100644 index 00000000..58458768 --- /dev/null +++ b/generated/Endpoint/ContainerResize.php @@ -0,0 +1,75 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/resize'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['h', 'w']); + $optionsResolver->setRequired(['h', 'w']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('h', ['int']); + $optionsResolver->addAllowedTypes('w', ['int']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerResizeNotFoundException + * @throws \Docker\API\Exception\ContainerResizeInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerResizeNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerResizeInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerRestart.php b/generated/Endpoint/ContainerRestart.php new file mode 100644 index 00000000..9cb04cdb --- /dev/null +++ b/generated/Endpoint/ContainerRestart.php @@ -0,0 +1,75 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/restart'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['signal', 't']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('signal', ['string']); + $optionsResolver->addAllowedTypes('t', ['int']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerRestartNotFoundException + * @throws \Docker\API\Exception\ContainerRestartInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerRestartNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerRestartInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerStart.php b/generated/Endpoint/ContainerStart.php new file mode 100644 index 00000000..1fc3ef17 --- /dev/null +++ b/generated/Endpoint/ContainerStart.php @@ -0,0 +1,79 @@ +` where `` is one + of: `a-z`, `@`, `^`, `[`, `,` or `_`. + + * } + */ + public function __construct(string $id, array $queryParameters = []) + { + $this->id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/start'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['detachKeys']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('detachKeys', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerStartNotFoundException + * @throws \Docker\API\Exception\ContainerStartInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (304 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerStartNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerStartInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerStats.php b/generated/Endpoint/ContainerStats.php new file mode 100644 index 00000000..2eb8f38a --- /dev/null +++ b/generated/Endpoint/ContainerStats.php @@ -0,0 +1,105 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/stats'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['stream', 'one-shot']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['stream' => true, 'one-shot' => false]); + $optionsResolver->addAllowedTypes('stream', ['bool']); + $optionsResolver->addAllowedTypes('one-shot', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerStatsNotFoundException + * @throws \Docker\API\Exception\ContainerStatsInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return json_decode($body); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerStatsNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerStatsInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerStop.php b/generated/Endpoint/ContainerStop.php new file mode 100644 index 00000000..46294929 --- /dev/null +++ b/generated/Endpoint/ContainerStop.php @@ -0,0 +1,78 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/stop'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['signal', 't']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('signal', ['string']); + $optionsResolver->addAllowedTypes('t', ['int']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerStopNotFoundException + * @throws \Docker\API\Exception\ContainerStopInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (304 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerStopNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerStopInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerTop.php b/generated/Endpoint/ContainerTop.php new file mode 100644 index 00000000..f366126e --- /dev/null +++ b/generated/Endpoint/ContainerTop.php @@ -0,0 +1,75 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/top'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['ps_args']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['ps_args' => '-ef']); + $optionsResolver->addAllowedTypes('ps_args', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerTopNotFoundException + * @throws \Docker\API\Exception\ContainerTopInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainersIdTopGetResponse200 + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainersIdTopGetResponse200', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerTopNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerTopInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerUnpause.php b/generated/Endpoint/ContainerUnpause.php new file mode 100644 index 00000000..7babaad7 --- /dev/null +++ b/generated/Endpoint/ContainerUnpause.php @@ -0,0 +1,60 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/unpause'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerUnpauseNotFoundException + * @throws \Docker\API\Exception\ContainerUnpauseInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerUnpauseNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerUnpauseInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerUpdate.php b/generated/Endpoint/ContainerUpdate.php new file mode 100644 index 00000000..49ce443f --- /dev/null +++ b/generated/Endpoint/ContainerUpdate.php @@ -0,0 +1,64 @@ +id = $id; + $this->body = $update; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/update'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerUpdateNotFoundException + * @throws \Docker\API\Exception\ContainerUpdateInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainersIdUpdatePostResponse200 + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainersIdUpdatePostResponse200', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerUpdateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ContainerWait.php b/generated/Endpoint/ContainerWait.php new file mode 100644 index 00000000..84119800 --- /dev/null +++ b/generated/Endpoint/ContainerWait.php @@ -0,0 +1,80 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/wait'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['condition']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['condition' => 'not-running']); + $optionsResolver->addAllowedTypes('condition', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ContainerWaitBadRequestException + * @throws \Docker\API\Exception\ContainerWaitNotFoundException + * @throws \Docker\API\Exception\ContainerWaitInternalServerErrorException + * + * @return null|\Docker\API\Model\ContainerWaitResponse + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainerWaitResponse', 'json'); + } + if (400 === $status) { + throw new \Docker\API\Exception\ContainerWaitBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\ContainerWaitNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ContainerWaitInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/DistributionInspect.php b/generated/Endpoint/DistributionInspect.php new file mode 100644 index 00000000..050476e3 --- /dev/null +++ b/generated/Endpoint/DistributionInspect.php @@ -0,0 +1,60 @@ +name = $name; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/distribution/{name}/json'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\DistributionInspectUnauthorizedException + * @throws \Docker\API\Exception\DistributionInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\DistributionInspect + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\DistributionInspect', 'json'); + } + if (401 === $status) { + throw new \Docker\API\Exception\DistributionInspectUnauthorizedException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\DistributionInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ExecInspect.php b/generated/Endpoint/ExecInspect.php new file mode 100644 index 00000000..d3a0af34 --- /dev/null +++ b/generated/Endpoint/ExecInspect.php @@ -0,0 +1,60 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/exec/{id}/json'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ExecInspectNotFoundException + * @throws \Docker\API\Exception\ExecInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\ExecIdJsonGetResponse200 + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ExecIdJsonGetResponse200', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\ExecInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ExecInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ExecResize.php b/generated/Endpoint/ExecResize.php new file mode 100644 index 00000000..417bc6a8 --- /dev/null +++ b/generated/Endpoint/ExecResize.php @@ -0,0 +1,81 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/exec/{id}/resize'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['h', 'w']); + $optionsResolver->setRequired(['h', 'w']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('h', ['int']); + $optionsResolver->addAllowedTypes('w', ['int']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ExecResizeBadRequestException + * @throws \Docker\API\Exception\ExecResizeNotFoundException + * @throws \Docker\API\Exception\ExecResizeInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\ExecResizeBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\ExecResizeNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ExecResizeInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ExecStart.php b/generated/Endpoint/ExecStart.php new file mode 100644 index 00000000..00a5cb1a --- /dev/null +++ b/generated/Endpoint/ExecStart.php @@ -0,0 +1,65 @@ +id = $id; + $this->body = $execStartConfig; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/exec/{id}/start'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ExecStartNotFoundException + * @throws \Docker\API\Exception\ExecStartConflictException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ExecStartNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (409 === $status) { + throw new \Docker\API\Exception\ExecStartConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/GetPluginPrivileges.php b/generated/Endpoint/GetPluginPrivileges.php new file mode 100644 index 00000000..2faaa27a --- /dev/null +++ b/generated/Endpoint/GetPluginPrivileges.php @@ -0,0 +1,68 @@ +queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/plugins/privileges'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['remote']); + $optionsResolver->setRequired(['remote']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('remote', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\GetPluginPrivilegesInternalServerErrorException + * + * @return null|\Docker\API\Model\PluginPrivilege[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\PluginPrivilege[]', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\GetPluginPrivilegesInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImageBuild.php b/generated/Endpoint/ImageBuild.php new file mode 100644 index 00000000..fd01f5e4 --- /dev/null +++ b/generated/Endpoint/ImageBuild.php @@ -0,0 +1,173 @@ +`. + Any other value is taken as a custom network's name or ID to which this + container should connect to. + + * @var string $platform Platform in the format os[/arch[/variant]] + * @var string $target Target build stage + * @var string $outputs BuildKit output configuration + * @var string $version Version of the builder backend to use. + + - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) + - `2` is [BuildKit](https://github.com/moby/buildkit) + + * } + * @param array $headerParameters { + * @var string $Content-type + * @var string $X-Registry-Config This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. + + The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: + + ``` + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + ``` + + Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + + * } + */ + public function __construct($inputStream, array $queryParameters = [], array $headerParameters = []) + { + $this->body = $inputStream; + $this->queryParameters = $queryParameters; + $this->headerParameters = $headerParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/build'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], $this->body]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['dockerfile', 't', 'extrahosts', 'remote', 'q', 'nocache', 'cachefrom', 'pull', 'rm', 'forcerm', 'memory', 'memswap', 'cpushares', 'cpusetcpus', 'cpuperiod', 'cpuquota', 'buildargs', 'shmsize', 'squash', 'labels', 'networkmode', 'platform', 'target', 'outputs', 'version']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['dockerfile' => 'Dockerfile', 'q' => false, 'nocache' => false, 'rm' => true, 'forcerm' => false, 'platform' => '', 'target' => '', 'outputs' => '', 'version' => '1']); + $optionsResolver->addAllowedTypes('dockerfile', ['string']); + $optionsResolver->addAllowedTypes('t', ['string']); + $optionsResolver->addAllowedTypes('extrahosts', ['string']); + $optionsResolver->addAllowedTypes('remote', ['string']); + $optionsResolver->addAllowedTypes('q', ['bool']); + $optionsResolver->addAllowedTypes('nocache', ['bool']); + $optionsResolver->addAllowedTypes('cachefrom', ['string']); + $optionsResolver->addAllowedTypes('pull', ['string']); + $optionsResolver->addAllowedTypes('rm', ['bool']); + $optionsResolver->addAllowedTypes('forcerm', ['bool']); + $optionsResolver->addAllowedTypes('memory', ['int']); + $optionsResolver->addAllowedTypes('memswap', ['int']); + $optionsResolver->addAllowedTypes('cpushares', ['int']); + $optionsResolver->addAllowedTypes('cpusetcpus', ['string']); + $optionsResolver->addAllowedTypes('cpuperiod', ['int']); + $optionsResolver->addAllowedTypes('cpuquota', ['int']); + $optionsResolver->addAllowedTypes('buildargs', ['string']); + $optionsResolver->addAllowedTypes('shmsize', ['int']); + $optionsResolver->addAllowedTypes('squash', ['bool']); + $optionsResolver->addAllowedTypes('labels', ['string']); + $optionsResolver->addAllowedTypes('networkmode', ['string']); + $optionsResolver->addAllowedTypes('platform', ['string']); + $optionsResolver->addAllowedTypes('target', ['string']); + $optionsResolver->addAllowedTypes('outputs', ['string']); + $optionsResolver->addAllowedTypes('version', ['string']); + return $optionsResolver; + } + protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getHeadersOptionsResolver(); + $optionsResolver->setDefined(['Content-type', 'X-Registry-Config']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['Content-type' => 'application/x-tar']); + $optionsResolver->addAllowedTypes('Content-type', ['string']); + $optionsResolver->addAllowedTypes('X-Registry-Config', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImageBuildBadRequestException + * @throws \Docker\API\Exception\ImageBuildInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\ImageBuildBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImageBuildInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImageCommit.php b/generated/Endpoint/ImageCommit.php new file mode 100644 index 00000000..460a4150 --- /dev/null +++ b/generated/Endpoint/ImageCommit.php @@ -0,0 +1,84 @@ +`) + * @var bool $pause Whether to pause the container before committing + * @var string $changes `Dockerfile` instructions to apply while committing + * } + */ + public function __construct(\Docker\API\Model\ContainerConfig $containerConfig, array $queryParameters = []) + { + $this->body = $containerConfig; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/commit'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['container', 'repo', 'tag', 'comment', 'author', 'pause', 'changes']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['pause' => true]); + $optionsResolver->addAllowedTypes('container', ['string']); + $optionsResolver->addAllowedTypes('repo', ['string']); + $optionsResolver->addAllowedTypes('tag', ['string']); + $optionsResolver->addAllowedTypes('comment', ['string']); + $optionsResolver->addAllowedTypes('author', ['string']); + $optionsResolver->addAllowedTypes('pause', ['bool']); + $optionsResolver->addAllowedTypes('changes', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImageCommitNotFoundException + * @throws \Docker\API\Exception\ImageCommitInternalServerErrorException + * + * @return null|\Docker\API\Model\IdResponse + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (201 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\IdResponse', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\ImageCommitNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImageCommitInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImageCreate.php b/generated/Endpoint/ImageCreate.php new file mode 100644 index 00000000..ef35d8b1 --- /dev/null +++ b/generated/Endpoint/ImageCreate.php @@ -0,0 +1,122 @@ +body = $inputImage; + $this->queryParameters = $queryParameters; + $this->headerParameters = $headerParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/images/create'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], $this->body]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['fromImage', 'fromSrc', 'repo', 'tag', 'message', 'changes', 'platform']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['platform' => '']); + $optionsResolver->addAllowedTypes('fromImage', ['string']); + $optionsResolver->addAllowedTypes('fromSrc', ['string']); + $optionsResolver->addAllowedTypes('repo', ['string']); + $optionsResolver->addAllowedTypes('tag', ['string']); + $optionsResolver->addAllowedTypes('message', ['string']); + $optionsResolver->addAllowedTypes('changes', ['array']); + $optionsResolver->addAllowedTypes('platform', ['string']); + return $optionsResolver; + } + protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getHeadersOptionsResolver(); + $optionsResolver->setDefined(['X-Registry-Auth']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('X-Registry-Auth', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImageCreateNotFoundException + * @throws \Docker\API\Exception\ImageCreateInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ImageCreateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImageCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImageDelete.php b/generated/Endpoint/ImageDelete.php new file mode 100644 index 00000000..2173f51a --- /dev/null +++ b/generated/Endpoint/ImageDelete.php @@ -0,0 +1,84 @@ +name = $name; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'DELETE'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/images/{name}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['force', 'noprune']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['force' => false, 'noprune' => false]); + $optionsResolver->addAllowedTypes('force', ['bool']); + $optionsResolver->addAllowedTypes('noprune', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImageDeleteNotFoundException + * @throws \Docker\API\Exception\ImageDeleteConflictException + * @throws \Docker\API\Exception\ImageDeleteInternalServerErrorException + * + * @return null|\Docker\API\Model\ImageDeleteResponseItem[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ImageDeleteResponseItem[]', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\ImageDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (409 === $status) { + throw new \Docker\API\Exception\ImageDeleteConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImageDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImageGet.php b/generated/Endpoint/ImageGet.php new file mode 100644 index 00000000..4ef66cad --- /dev/null +++ b/generated/Endpoint/ImageGet.php @@ -0,0 +1,79 @@ +name = $name; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/images/{name}/get'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImageGetInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return json_decode($body); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImageGetInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImageGetAll.php b/generated/Endpoint/ImageGetAll.php new file mode 100644 index 00000000..d4a0b156 --- /dev/null +++ b/generated/Endpoint/ImageGetAll.php @@ -0,0 +1,76 @@ +queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/images/get'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['names']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('names', ['array']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImageGetAllInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return json_decode($body); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImageGetAllInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImageHistory.php b/generated/Endpoint/ImageHistory.php new file mode 100644 index 00000000..f36f4208 --- /dev/null +++ b/generated/Endpoint/ImageHistory.php @@ -0,0 +1,60 @@ +name = $name; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/images/{name}/history'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImageHistoryNotFoundException + * @throws \Docker\API\Exception\ImageHistoryInternalServerErrorException + * + * @return null|\Docker\API\Model\ImagesNameHistoryGetResponse200Item[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ImagesNameHistoryGetResponse200Item[]', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\ImageHistoryNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImageHistoryInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImageInspect.php b/generated/Endpoint/ImageInspect.php new file mode 100644 index 00000000..50b9396d --- /dev/null +++ b/generated/Endpoint/ImageInspect.php @@ -0,0 +1,60 @@ +name = $name; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/images/{name}/json'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImageInspectNotFoundException + * @throws \Docker\API\Exception\ImageInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\ImageInspect + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ImageInspect', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\ImageInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImageInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImageList.php b/generated/Endpoint/ImageList.php new file mode 100644 index 00000000..4b601192 --- /dev/null +++ b/generated/Endpoint/ImageList.php @@ -0,0 +1,85 @@ +[:]`, `` or ``) + - `dangling=true` + - `label=key` or `label="key=value"` of an image label + - `reference`=(`[:]`) + - `since`=(`[:]`, `` or ``) + - `until=` + + * @var bool $shared-size Compute and show shared size as a `SharedSize` field on each image. + * @var bool $digests Show digest information as a `RepoDigests` field on each image. + * @var bool $manifests Include `Manifests` in the image summary. + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/images/json'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['all', 'filters', 'shared-size', 'digests', 'manifests']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['all' => false, 'shared-size' => false, 'digests' => false, 'manifests' => false]); + $optionsResolver->addAllowedTypes('all', ['bool']); + $optionsResolver->addAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('shared-size', ['bool']); + $optionsResolver->addAllowedTypes('digests', ['bool']); + $optionsResolver->addAllowedTypes('manifests', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImageListInternalServerErrorException + * + * @return null|\Docker\API\Model\ImageSummary[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ImageSummary[]', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImageListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImageLoad.php b/generated/Endpoint/ImageLoad.php new file mode 100644 index 00000000..61cf5cf7 --- /dev/null +++ b/generated/Endpoint/ImageLoad.php @@ -0,0 +1,71 @@ +body = $imagesTarball; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/images/load'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], $this->body]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['quiet']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['quiet' => false]); + $optionsResolver->addAllowedTypes('quiet', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImageLoadInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (500 === $status) { + throw new \Docker\API\Exception\ImageLoadInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImagePrune.php b/generated/Endpoint/ImagePrune.php new file mode 100644 index 00000000..edbde96a --- /dev/null +++ b/generated/Endpoint/ImagePrune.php @@ -0,0 +1,73 @@ +` When set to `true` (or `1`), prune only + unused *and* untagged images. When set to `false` + (or `0`), all unused images are pruned. + - `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels. + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/images/prune'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImagePruneInternalServerErrorException + * + * @return null|\Docker\API\Model\ImagesPrunePostResponse200 + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ImagesPrunePostResponse200', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImagePruneInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImagePush.php b/generated/Endpoint/ImagePush.php new file mode 100644 index 00000000..3a0a2150 --- /dev/null +++ b/generated/Endpoint/ImagePush.php @@ -0,0 +1,119 @@ +name = $name; + $this->queryParameters = $queryParameters; + $this->headerParameters = $headerParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/images/{name}/push'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['tag', 'platform']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('tag', ['string']); + $optionsResolver->addAllowedTypes('platform', ['string']); + return $optionsResolver; + } + protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getHeadersOptionsResolver(); + $optionsResolver->setDefined(['X-Registry-Auth']); + $optionsResolver->setRequired(['X-Registry-Auth']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('X-Registry-Auth', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImagePushNotFoundException + * @throws \Docker\API\Exception\ImagePushInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ImagePushNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImagePushInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImageSearch.php b/generated/Endpoint/ImageSearch.php new file mode 100644 index 00000000..259facfe --- /dev/null +++ b/generated/Endpoint/ImageSearch.php @@ -0,0 +1,74 @@ +` Matches images that has at least 'number' stars. + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/images/search'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['term', 'limit', 'filters']); + $optionsResolver->setRequired(['term']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('term', ['string']); + $optionsResolver->addAllowedTypes('limit', ['int']); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImageSearchInternalServerErrorException + * + * @return null|\Docker\API\Model\ImagesSearchGetResponse200Item[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ImagesSearchGetResponse200Item[]', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImageSearchInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ImageTag.php b/generated/Endpoint/ImageTag.php new file mode 100644 index 00000000..ccc5f5b5 --- /dev/null +++ b/generated/Endpoint/ImageTag.php @@ -0,0 +1,83 @@ +name = $name; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/images/{name}/tag'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['repo', 'tag']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('repo', ['string']); + $optionsResolver->addAllowedTypes('tag', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ImageTagBadRequestException + * @throws \Docker\API\Exception\ImageTagNotFoundException + * @throws \Docker\API\Exception\ImageTagConflictException + * @throws \Docker\API\Exception\ImageTagInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (201 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\ImageTagBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\ImageTagNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (409 === $status) { + throw new \Docker\API\Exception\ImageTagConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ImageTagInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/NetworkConnect.php b/generated/Endpoint/NetworkConnect.php new file mode 100644 index 00000000..4714b3fe --- /dev/null +++ b/generated/Endpoint/NetworkConnect.php @@ -0,0 +1,70 @@ +id = $id; + $this->body = $container; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/networks/{id}/connect'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\NetworkConnectBadRequestException + * @throws \Docker\API\Exception\NetworkConnectForbiddenException + * @throws \Docker\API\Exception\NetworkConnectNotFoundException + * @throws \Docker\API\Exception\NetworkConnectInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\NetworkConnectBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (403 === $status) { + throw new \Docker\API\Exception\NetworkConnectForbiddenException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\NetworkConnectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\NetworkConnectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/NetworkCreate.php b/generated/Endpoint/NetworkCreate.php new file mode 100644 index 00000000..9144448c --- /dev/null +++ b/generated/Endpoint/NetworkCreate.php @@ -0,0 +1,67 @@ +body = $networkConfig; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/networks/create'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\NetworkCreateBadRequestException + * @throws \Docker\API\Exception\NetworkCreateForbiddenException + * @throws \Docker\API\Exception\NetworkCreateNotFoundException + * @throws \Docker\API\Exception\NetworkCreateInternalServerErrorException + * + * @return null|\Docker\API\Model\NetworkCreateResponse + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (201 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\NetworkCreateResponse', 'json'); + } + if (400 === $status) { + throw new \Docker\API\Exception\NetworkCreateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (403 === $status) { + throw new \Docker\API\Exception\NetworkCreateForbiddenException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\NetworkCreateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\NetworkCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/NetworkDelete.php b/generated/Endpoint/NetworkDelete.php new file mode 100644 index 00000000..6d2ebe2a --- /dev/null +++ b/generated/Endpoint/NetworkDelete.php @@ -0,0 +1,64 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'DELETE'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/networks/{id}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\NetworkDeleteForbiddenException + * @throws \Docker\API\Exception\NetworkDeleteNotFoundException + * @throws \Docker\API\Exception\NetworkDeleteInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (403 === $status) { + throw new \Docker\API\Exception\NetworkDeleteForbiddenException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\NetworkDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\NetworkDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/NetworkDisconnect.php b/generated/Endpoint/NetworkDisconnect.php new file mode 100644 index 00000000..089c7d35 --- /dev/null +++ b/generated/Endpoint/NetworkDisconnect.php @@ -0,0 +1,66 @@ +id = $id; + $this->body = $container; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/networks/{id}/disconnect'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\NetworkDisconnectForbiddenException + * @throws \Docker\API\Exception\NetworkDisconnectNotFoundException + * @throws \Docker\API\Exception\NetworkDisconnectInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (403 === $status) { + throw new \Docker\API\Exception\NetworkDisconnectForbiddenException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\NetworkDisconnectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\NetworkDisconnectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/NetworkInspect.php b/generated/Endpoint/NetworkInspect.php new file mode 100644 index 00000000..21657b1c --- /dev/null +++ b/generated/Endpoint/NetworkInspect.php @@ -0,0 +1,75 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/networks/{id}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['verbose', 'scope']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['verbose' => false]); + $optionsResolver->addAllowedTypes('verbose', ['bool']); + $optionsResolver->addAllowedTypes('scope', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\NetworkInspectNotFoundException + * @throws \Docker\API\Exception\NetworkInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\Network + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Network', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\NetworkInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\NetworkInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/NetworkList.php b/generated/Endpoint/NetworkList.php new file mode 100644 index 00000000..717df859 --- /dev/null +++ b/generated/Endpoint/NetworkList.php @@ -0,0 +1,87 @@ +` When set to `true` (or `1`), returns all + networks that are not in use by a container. When set to `false` + (or `0`), only networks that are in use by one or more + containers are returned. + - `driver=` Matches a network's driver. + - `id=` Matches all or part of a network ID. + - `label=` or `label==` of a network label. + - `name=` Matches all or part of a network name. + - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). + - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/networks'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\NetworkListInternalServerErrorException + * + * @return null|\Docker\API\Model\Network[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Network[]', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\NetworkListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/NetworkPrune.php b/generated/Endpoint/NetworkPrune.php new file mode 100644 index 00000000..9abe6515 --- /dev/null +++ b/generated/Endpoint/NetworkPrune.php @@ -0,0 +1,71 @@ +` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels. + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/networks/prune'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\NetworkPruneInternalServerErrorException + * + * @return null|\Docker\API\Model\NetworksPrunePostResponse200 + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\NetworksPrunePostResponse200', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\NetworkPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/NodeDelete.php b/generated/Endpoint/NodeDelete.php new file mode 100644 index 00000000..38018d87 --- /dev/null +++ b/generated/Endpoint/NodeDelete.php @@ -0,0 +1,77 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'DELETE'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/nodes/{id}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['force']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['force' => false]); + $optionsResolver->addAllowedTypes('force', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\NodeDeleteNotFoundException + * @throws \Docker\API\Exception\NodeDeleteInternalServerErrorException + * @throws \Docker\API\Exception\NodeDeleteServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\NodeDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\NodeDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\NodeDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/NodeInspect.php b/generated/Endpoint/NodeInspect.php new file mode 100644 index 00000000..c019d773 --- /dev/null +++ b/generated/Endpoint/NodeInspect.php @@ -0,0 +1,64 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/nodes/{id}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\NodeInspectNotFoundException + * @throws \Docker\API\Exception\NodeInspectInternalServerErrorException + * @throws \Docker\API\Exception\NodeInspectServiceUnavailableException + * + * @return null|\Docker\API\Model\Node + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Node', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\NodeInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\NodeInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\NodeInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/NodeList.php b/generated/Endpoint/NodeList.php new file mode 100644 index 00000000..15765095 --- /dev/null +++ b/generated/Endpoint/NodeList.php @@ -0,0 +1,79 @@ +` + - `label=` + - `membership=`(`accepted`|`pending`)` + - `name=` + - `node.label=` + - `role=`(`manager`|`worker`)` + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/nodes'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\NodeListInternalServerErrorException + * @throws \Docker\API\Exception\NodeListServiceUnavailableException + * + * @return null|\Docker\API\Model\Node[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Node[]', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\NodeListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\NodeListServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/NodeUpdate.php b/generated/Endpoint/NodeUpdate.php new file mode 100644 index 00000000..9b5f3033 --- /dev/null +++ b/generated/Endpoint/NodeUpdate.php @@ -0,0 +1,85 @@ +id = $id; + $this->body = $body; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/nodes/{id}/update'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['version']); + $optionsResolver->setRequired(['version']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('version', ['int']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\NodeUpdateBadRequestException + * @throws \Docker\API\Exception\NodeUpdateNotFoundException + * @throws \Docker\API\Exception\NodeUpdateInternalServerErrorException + * @throws \Docker\API\Exception\NodeUpdateServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\NodeUpdateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\NodeUpdateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\NodeUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\NodeUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/PluginCreate.php b/generated/Endpoint/PluginCreate.php new file mode 100644 index 00000000..276cda84 --- /dev/null +++ b/generated/Endpoint/PluginCreate.php @@ -0,0 +1,70 @@ +body = $tarContext; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/plugins/create'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], $this->body]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['name']); + $optionsResolver->setRequired(['name']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('name', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\PluginCreateInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (500 === $status) { + throw new \Docker\API\Exception\PluginCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/PluginDelete.php b/generated/Endpoint/PluginDelete.php new file mode 100644 index 00000000..27ebf937 --- /dev/null +++ b/generated/Endpoint/PluginDelete.php @@ -0,0 +1,77 @@ +name = $name; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'DELETE'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/plugins/{name}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['force']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['force' => false]); + $optionsResolver->addAllowedTypes('force', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\PluginDeleteNotFoundException + * @throws \Docker\API\Exception\PluginDeleteInternalServerErrorException + * + * @return null|\Docker\API\Model\Plugin + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Plugin', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\PluginDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\PluginDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/PluginDisable.php b/generated/Endpoint/PluginDisable.php new file mode 100644 index 00000000..b87afc67 --- /dev/null +++ b/generated/Endpoint/PluginDisable.php @@ -0,0 +1,76 @@ +name = $name; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/plugins/{name}/disable'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['force']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('force', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\PluginDisableNotFoundException + * @throws \Docker\API\Exception\PluginDisableInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\PluginDisableNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\PluginDisableInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/PluginEnable.php b/generated/Endpoint/PluginEnable.php new file mode 100644 index 00000000..63fc55dd --- /dev/null +++ b/generated/Endpoint/PluginEnable.php @@ -0,0 +1,75 @@ +name = $name; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/plugins/{name}/enable'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['timeout']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['timeout' => 0]); + $optionsResolver->addAllowedTypes('timeout', ['int']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\PluginEnableNotFoundException + * @throws \Docker\API\Exception\PluginEnableInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\PluginEnableNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\PluginEnableInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/PluginInspect.php b/generated/Endpoint/PluginInspect.php new file mode 100644 index 00000000..5c07d99e --- /dev/null +++ b/generated/Endpoint/PluginInspect.php @@ -0,0 +1,61 @@ +name = $name; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/plugins/{name}/json'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\PluginInspectNotFoundException + * @throws \Docker\API\Exception\PluginInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\Plugin + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Plugin', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\PluginInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\PluginInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/PluginList.php b/generated/Endpoint/PluginList.php new file mode 100644 index 00000000..5e2f8212 --- /dev/null +++ b/generated/Endpoint/PluginList.php @@ -0,0 +1,73 @@ +` + - `enable=|` + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/plugins'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\PluginListInternalServerErrorException + * + * @return null|\Docker\API\Model\Plugin[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Plugin[]', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\PluginListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/PluginPull.php b/generated/Endpoint/PluginPull.php new file mode 100644 index 00000000..f4e48e01 --- /dev/null +++ b/generated/Endpoint/PluginPull.php @@ -0,0 +1,96 @@ +body = $body; + $this->queryParameters = $queryParameters; + $this->headerParameters = $headerParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/plugins/pull'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['remote', 'name']); + $optionsResolver->setRequired(['remote']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('remote', ['string']); + $optionsResolver->addAllowedTypes('name', ['string']); + return $optionsResolver; + } + protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getHeadersOptionsResolver(); + $optionsResolver->setDefined(['X-Registry-Auth']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('X-Registry-Auth', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\PluginPullInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (500 === $status) { + throw new \Docker\API\Exception\PluginPullInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/PluginPush.php b/generated/Endpoint/PluginPush.php new file mode 100644 index 00000000..989ded72 --- /dev/null +++ b/generated/Endpoint/PluginPush.php @@ -0,0 +1,61 @@ +name = $name; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/plugins/{name}/push'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\PluginPushNotFoundException + * @throws \Docker\API\Exception\PluginPushInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\PluginPushNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\PluginPushInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/PluginSet.php b/generated/Endpoint/PluginSet.php new file mode 100644 index 00000000..0998ab85 --- /dev/null +++ b/generated/Endpoint/PluginSet.php @@ -0,0 +1,64 @@ +name = $name; + $this->body = $body; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/plugins/{name}/set'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\PluginSetNotFoundException + * @throws \Docker\API\Exception\PluginSetInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\PluginSetNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\PluginSetInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/PluginUpgrade.php b/generated/Endpoint/PluginUpgrade.php new file mode 100644 index 00000000..e40630ca --- /dev/null +++ b/generated/Endpoint/PluginUpgrade.php @@ -0,0 +1,98 @@ +name = $name; + $this->body = $body; + $this->queryParameters = $queryParameters; + $this->headerParameters = $headerParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/plugins/{name}/upgrade'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['remote']); + $optionsResolver->setRequired(['remote']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('remote', ['string']); + return $optionsResolver; + } + protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getHeadersOptionsResolver(); + $optionsResolver->setDefined(['X-Registry-Auth']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('X-Registry-Auth', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\PluginUpgradeNotFoundException + * @throws \Docker\API\Exception\PluginUpgradeInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\PluginUpgradeNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\PluginUpgradeInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/PutContainerArchive.php b/generated/Endpoint/PutContainerArchive.php new file mode 100644 index 00000000..4784e680 --- /dev/null +++ b/generated/Endpoint/PutContainerArchive.php @@ -0,0 +1,98 @@ +id = $id; + $this->body = $inputStream; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'PUT'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/containers/{id}/archive'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], $this->body]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['path', 'noOverwriteDirNonDir', 'copyUIDGID']); + $optionsResolver->setRequired(['path']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('path', ['string']); + $optionsResolver->addAllowedTypes('noOverwriteDirNonDir', ['string']); + $optionsResolver->addAllowedTypes('copyUIDGID', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\PutContainerArchiveBadRequestException + * @throws \Docker\API\Exception\PutContainerArchiveForbiddenException + * @throws \Docker\API\Exception\PutContainerArchiveNotFoundException + * @throws \Docker\API\Exception\PutContainerArchiveInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\PutContainerArchiveBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (403 === $status) { + throw new \Docker\API\Exception\PutContainerArchiveForbiddenException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\PutContainerArchiveNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\PutContainerArchiveInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SecretCreate.php b/generated/Endpoint/SecretCreate.php new file mode 100644 index 00000000..86058d11 --- /dev/null +++ b/generated/Endpoint/SecretCreate.php @@ -0,0 +1,63 @@ +body = $body; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/secrets/create'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SecretCreateConflictException + * @throws \Docker\API\Exception\SecretCreateInternalServerErrorException + * @throws \Docker\API\Exception\SecretCreateServiceUnavailableException + * + * @return null|\Docker\API\Model\IdResponse + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (201 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\IdResponse', 'json'); + } + if (409 === $status) { + throw new \Docker\API\Exception\SecretCreateConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\SecretCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\SecretCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SecretDelete.php b/generated/Endpoint/SecretDelete.php new file mode 100644 index 00000000..1217e891 --- /dev/null +++ b/generated/Endpoint/SecretDelete.php @@ -0,0 +1,64 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'DELETE'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/secrets/{id}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SecretDeleteNotFoundException + * @throws \Docker\API\Exception\SecretDeleteInternalServerErrorException + * @throws \Docker\API\Exception\SecretDeleteServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\SecretDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\SecretDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\SecretDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SecretInspect.php b/generated/Endpoint/SecretInspect.php new file mode 100644 index 00000000..a812480f --- /dev/null +++ b/generated/Endpoint/SecretInspect.php @@ -0,0 +1,64 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/secrets/{id}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SecretInspectNotFoundException + * @throws \Docker\API\Exception\SecretInspectInternalServerErrorException + * @throws \Docker\API\Exception\SecretInspectServiceUnavailableException + * + * @return null|\Docker\API\Model\Secret + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Secret', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\SecretInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\SecretInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\SecretInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SecretList.php b/generated/Endpoint/SecretList.php new file mode 100644 index 00000000..d80ff7c5 --- /dev/null +++ b/generated/Endpoint/SecretList.php @@ -0,0 +1,79 @@ +` + - `label= or label==value` + - `name=` + - `names=` + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/secrets'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SecretListInternalServerErrorException + * @throws \Docker\API\Exception\SecretListServiceUnavailableException + * + * @return null|\Docker\API\Model\Secret[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Secret[]', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\SecretListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\SecretListServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SecretUpdate.php b/generated/Endpoint/SecretUpdate.php new file mode 100644 index 00000000..e8a42f10 --- /dev/null +++ b/generated/Endpoint/SecretUpdate.php @@ -0,0 +1,88 @@ +id = $id; + $this->body = $body; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/secrets/{id}/update'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['version']); + $optionsResolver->setRequired(['version']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('version', ['int']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SecretUpdateBadRequestException + * @throws \Docker\API\Exception\SecretUpdateNotFoundException + * @throws \Docker\API\Exception\SecretUpdateInternalServerErrorException + * @throws \Docker\API\Exception\SecretUpdateServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\SecretUpdateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\SecretUpdateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\SecretUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\SecretUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ServiceCreate.php b/generated/Endpoint/ServiceCreate.php new file mode 100644 index 00000000..e5460151 --- /dev/null +++ b/generated/Endpoint/ServiceCreate.php @@ -0,0 +1,89 @@ +body = $body; + $this->headerParameters = $headerParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/services/create'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getHeadersOptionsResolver(); + $optionsResolver->setDefined(['X-Registry-Auth']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('X-Registry-Auth', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ServiceCreateBadRequestException + * @throws \Docker\API\Exception\ServiceCreateForbiddenException + * @throws \Docker\API\Exception\ServiceCreateConflictException + * @throws \Docker\API\Exception\ServiceCreateInternalServerErrorException + * @throws \Docker\API\Exception\ServiceCreateServiceUnavailableException + * + * @return null|\Docker\API\Model\ServiceCreateResponse + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (201 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ServiceCreateResponse', 'json'); + } + if (400 === $status) { + throw new \Docker\API\Exception\ServiceCreateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (403 === $status) { + throw new \Docker\API\Exception\ServiceCreateForbiddenException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (409 === $status) { + throw new \Docker\API\Exception\ServiceCreateConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ServiceCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\ServiceCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ServiceDelete.php b/generated/Endpoint/ServiceDelete.php new file mode 100644 index 00000000..9a36d0d4 --- /dev/null +++ b/generated/Endpoint/ServiceDelete.php @@ -0,0 +1,64 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'DELETE'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/services/{id}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ServiceDeleteNotFoundException + * @throws \Docker\API\Exception\ServiceDeleteInternalServerErrorException + * @throws \Docker\API\Exception\ServiceDeleteServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\ServiceDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ServiceDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\ServiceDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ServiceInspect.php b/generated/Endpoint/ServiceInspect.php new file mode 100644 index 00000000..baf0e13c --- /dev/null +++ b/generated/Endpoint/ServiceInspect.php @@ -0,0 +1,77 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/services/{id}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['insertDefaults']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['insertDefaults' => false]); + $optionsResolver->addAllowedTypes('insertDefaults', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ServiceInspectNotFoundException + * @throws \Docker\API\Exception\ServiceInspectInternalServerErrorException + * @throws \Docker\API\Exception\ServiceInspectServiceUnavailableException + * + * @return null|\Docker\API\Model\Service + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Service', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\ServiceInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ServiceInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\ServiceInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ServiceList.php b/generated/Endpoint/ServiceList.php new file mode 100644 index 00000000..26589d40 --- /dev/null +++ b/generated/Endpoint/ServiceList.php @@ -0,0 +1,82 @@ +` + - `label=` + - `mode=["replicated"|"global"]` + - `name=` + + * @var bool $status Include service status, with count of running and desired tasks. + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/services'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['filters', 'status']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('status', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ServiceListInternalServerErrorException + * @throws \Docker\API\Exception\ServiceListServiceUnavailableException + * + * @return null|\Docker\API\Model\Service[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Service[]', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\ServiceListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\ServiceListServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ServiceLogs.php b/generated/Endpoint/ServiceLogs.php new file mode 100644 index 00000000..6946456b --- /dev/null +++ b/generated/Endpoint/ServiceLogs.php @@ -0,0 +1,96 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/services/{id}/logs'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['details', 'follow', 'stdout', 'stderr', 'since', 'timestamps', 'tail']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['details' => false, 'follow' => false, 'stdout' => false, 'stderr' => false, 'since' => 0, 'timestamps' => false, 'tail' => 'all']); + $optionsResolver->addAllowedTypes('details', ['bool']); + $optionsResolver->addAllowedTypes('follow', ['bool']); + $optionsResolver->addAllowedTypes('stdout', ['bool']); + $optionsResolver->addAllowedTypes('stderr', ['bool']); + $optionsResolver->addAllowedTypes('since', ['int']); + $optionsResolver->addAllowedTypes('timestamps', ['bool']); + $optionsResolver->addAllowedTypes('tail', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ServiceLogsNotFoundException + * @throws \Docker\API\Exception\ServiceLogsInternalServerErrorException + * @throws \Docker\API\Exception\ServiceLogsServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return json_decode($body); + } + if (404 === $status) { + throw new \Docker\API\Exception\ServiceLogsNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ServiceLogsInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\ServiceLogsServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/ServiceUpdate.php b/generated/Endpoint/ServiceUpdate.php new file mode 100644 index 00000000..4a038843 --- /dev/null +++ b/generated/Endpoint/ServiceUpdate.php @@ -0,0 +1,115 @@ +id = $id; + $this->body = $body; + $this->queryParameters = $queryParameters; + $this->headerParameters = $headerParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/services/{id}/update'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['version', 'registryAuthFrom', 'rollback']); + $optionsResolver->setRequired(['version']); + $optionsResolver->setDefaults(['registryAuthFrom' => 'spec']); + $optionsResolver->addAllowedTypes('version', ['int']); + $optionsResolver->addAllowedTypes('registryAuthFrom', ['string']); + $optionsResolver->addAllowedTypes('rollback', ['string']); + return $optionsResolver; + } + protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getHeadersOptionsResolver(); + $optionsResolver->setDefined(['X-Registry-Auth']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('X-Registry-Auth', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\ServiceUpdateBadRequestException + * @throws \Docker\API\Exception\ServiceUpdateNotFoundException + * @throws \Docker\API\Exception\ServiceUpdateInternalServerErrorException + * @throws \Docker\API\Exception\ServiceUpdateServiceUnavailableException + * + * @return null|\Docker\API\Model\ServiceUpdateResponse + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\ServiceUpdateResponse', 'json'); + } + if (400 === $status) { + throw new \Docker\API\Exception\ServiceUpdateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\ServiceUpdateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\ServiceUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\ServiceUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/Session.php b/generated/Endpoint/Session.php new file mode 100644 index 00000000..5ba35f05 --- /dev/null +++ b/generated/Endpoint/Session.php @@ -0,0 +1,50 @@ + ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SessionBadRequestException + * @throws \Docker\API\Exception\SessionInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (101 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\SessionBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\SessionInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SwarmInit.php b/generated/Endpoint/SwarmInit.php new file mode 100644 index 00000000..5e542706 --- /dev/null +++ b/generated/Endpoint/SwarmInit.php @@ -0,0 +1,63 @@ +body = $body; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/swarm/init'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SwarmInitBadRequestException + * @throws \Docker\API\Exception\SwarmInitInternalServerErrorException + * @throws \Docker\API\Exception\SwarmInitServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return json_decode($body); + } + if (400 === $status) { + throw new \Docker\API\Exception\SwarmInitBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\SwarmInitInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\SwarmInitServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SwarmInspect.php b/generated/Endpoint/SwarmInspect.php new file mode 100644 index 00000000..ad8db202 --- /dev/null +++ b/generated/Endpoint/SwarmInspect.php @@ -0,0 +1,54 @@ + ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SwarmInspectNotFoundException + * @throws \Docker\API\Exception\SwarmInspectInternalServerErrorException + * @throws \Docker\API\Exception\SwarmInspectServiceUnavailableException + * + * @return null|\Docker\API\Model\Swarm + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Swarm', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\SwarmInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\SwarmInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\SwarmInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SwarmJoin.php b/generated/Endpoint/SwarmJoin.php new file mode 100644 index 00000000..dcfe6b80 --- /dev/null +++ b/generated/Endpoint/SwarmJoin.php @@ -0,0 +1,63 @@ +body = $body; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/swarm/join'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SwarmJoinBadRequestException + * @throws \Docker\API\Exception\SwarmJoinInternalServerErrorException + * @throws \Docker\API\Exception\SwarmJoinServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\SwarmJoinBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\SwarmJoinInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\SwarmJoinServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SwarmLeave.php b/generated/Endpoint/SwarmLeave.php new file mode 100644 index 00000000..0b0cc7ae --- /dev/null +++ b/generated/Endpoint/SwarmLeave.php @@ -0,0 +1,72 @@ +queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/swarm/leave'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['force']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['force' => false]); + $optionsResolver->addAllowedTypes('force', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SwarmLeaveInternalServerErrorException + * @throws \Docker\API\Exception\SwarmLeaveServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (500 === $status) { + throw new \Docker\API\Exception\SwarmLeaveInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\SwarmLeaveServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SwarmUnlock.php b/generated/Endpoint/SwarmUnlock.php new file mode 100644 index 00000000..f0f681d0 --- /dev/null +++ b/generated/Endpoint/SwarmUnlock.php @@ -0,0 +1,59 @@ +body = $body; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/swarm/unlock'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SwarmUnlockInternalServerErrorException + * @throws \Docker\API\Exception\SwarmUnlockServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (500 === $status) { + throw new \Docker\API\Exception\SwarmUnlockInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\SwarmUnlockServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SwarmUnlockkey.php b/generated/Endpoint/SwarmUnlockkey.php new file mode 100644 index 00000000..b61c7517 --- /dev/null +++ b/generated/Endpoint/SwarmUnlockkey.php @@ -0,0 +1,50 @@ + ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SwarmUnlockkeyInternalServerErrorException + * @throws \Docker\API\Exception\SwarmUnlockkeyServiceUnavailableException + * + * @return null|\Docker\API\Model\SwarmUnlockkeyGetResponse200 + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\SwarmUnlockkeyGetResponse200', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\SwarmUnlockkeyInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\SwarmUnlockkeyServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SwarmUpdate.php b/generated/Endpoint/SwarmUpdate.php new file mode 100644 index 00000000..346e2060 --- /dev/null +++ b/generated/Endpoint/SwarmUpdate.php @@ -0,0 +1,84 @@ +body = $body; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/swarm/update'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['version', 'rotateWorkerToken', 'rotateManagerToken', 'rotateManagerUnlockKey']); + $optionsResolver->setRequired(['version']); + $optionsResolver->setDefaults(['rotateWorkerToken' => false, 'rotateManagerToken' => false, 'rotateManagerUnlockKey' => false]); + $optionsResolver->addAllowedTypes('version', ['int']); + $optionsResolver->addAllowedTypes('rotateWorkerToken', ['bool']); + $optionsResolver->addAllowedTypes('rotateManagerToken', ['bool']); + $optionsResolver->addAllowedTypes('rotateManagerUnlockKey', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SwarmUpdateBadRequestException + * @throws \Docker\API\Exception\SwarmUpdateInternalServerErrorException + * @throws \Docker\API\Exception\SwarmUpdateServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\SwarmUpdateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\SwarmUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\SwarmUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SystemAuth.php b/generated/Endpoint/SystemAuth.php new file mode 100644 index 00000000..7603b5fd --- /dev/null +++ b/generated/Endpoint/SystemAuth.php @@ -0,0 +1,64 @@ +body = $authConfig; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/auth'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SystemAuthUnauthorizedException + * @throws \Docker\API\Exception\SystemAuthInternalServerErrorException + * + * @return null|\Docker\API\Model\AuthPostResponse200 + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\AuthPostResponse200', 'json'); + } + if (204 === $status) { + return null; + } + if (401 === $status) { + throw new \Docker\API\Exception\SystemAuthUnauthorizedException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\SystemAuthInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SystemDataUsage.php b/generated/Endpoint/SystemDataUsage.php new file mode 100644 index 00000000..6522301e --- /dev/null +++ b/generated/Endpoint/SystemDataUsage.php @@ -0,0 +1,66 @@ +queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/system/df'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['type']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('type', ['array']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SystemDataUsageInternalServerErrorException + * + * @return null|\Docker\API\Model\SystemDfGetResponse200 + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\SystemDfGetResponse200', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\SystemDataUsageInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SystemEvents.php b/generated/Endpoint/SystemEvents.php new file mode 100644 index 00000000..6e7895ca --- /dev/null +++ b/generated/Endpoint/SystemEvents.php @@ -0,0 +1,113 @@ +` config name or ID + - `container=` container name or ID + - `daemon=` daemon name or ID + - `event=` event type + - `image=` image name or ID + - `label=` image or container label + - `network=` network name or ID + - `node=` node ID + - `plugin`= plugin name or ID + - `scope`= local or swarm + - `secret=` secret name or ID + - `service=` service name or ID + - `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` + - `volume=` volume name + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/events'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['since', 'until', 'filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('since', ['string']); + $optionsResolver->addAllowedTypes('until', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SystemEventsBadRequestException + * @throws \Docker\API\Exception\SystemEventsInternalServerErrorException + * + * @return null|\Docker\API\Model\EventMessage + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\EventMessage', 'json'); + } + if (400 === $status) { + throw new \Docker\API\Exception\SystemEventsBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\SystemEventsInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SystemInfo.php b/generated/Endpoint/SystemInfo.php new file mode 100644 index 00000000..daf4ea04 --- /dev/null +++ b/generated/Endpoint/SystemInfo.php @@ -0,0 +1,46 @@ + ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SystemInfoInternalServerErrorException + * + * @return null|\Docker\API\Model\SystemInfo + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\SystemInfo', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\SystemInfoInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SystemPing.php b/generated/Endpoint/SystemPing.php new file mode 100644 index 00000000..9554df60 --- /dev/null +++ b/generated/Endpoint/SystemPing.php @@ -0,0 +1,46 @@ + ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SystemPingInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return json_decode($body); + } + if (500 === $status) { + throw new \Docker\API\Exception\SystemPingInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SystemPingHead.php b/generated/Endpoint/SystemPingHead.php new file mode 100644 index 00000000..4475b516 --- /dev/null +++ b/generated/Endpoint/SystemPingHead.php @@ -0,0 +1,46 @@ + ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SystemPingHeadInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return json_decode($body); + } + if (500 === $status) { + throw new \Docker\API\Exception\SystemPingHeadInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/SystemVersion.php b/generated/Endpoint/SystemVersion.php new file mode 100644 index 00000000..14036d3f --- /dev/null +++ b/generated/Endpoint/SystemVersion.php @@ -0,0 +1,46 @@ + ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\SystemVersionInternalServerErrorException + * + * @return null|\Docker\API\Model\SystemVersion + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\SystemVersion', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\SystemVersionInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/TaskInspect.php b/generated/Endpoint/TaskInspect.php new file mode 100644 index 00000000..975dc56c --- /dev/null +++ b/generated/Endpoint/TaskInspect.php @@ -0,0 +1,64 @@ +id = $id; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/tasks/{id}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\TaskInspectNotFoundException + * @throws \Docker\API\Exception\TaskInspectInternalServerErrorException + * @throws \Docker\API\Exception\TaskInspectServiceUnavailableException + * + * @return null|\Docker\API\Model\Task + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Task', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\TaskInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\TaskInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\TaskInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/TaskList.php b/generated/Endpoint/TaskList.php new file mode 100644 index 00000000..775e4974 --- /dev/null +++ b/generated/Endpoint/TaskList.php @@ -0,0 +1,81 @@ +` + - `label=key` or `label="key=value"` + - `name=` + - `node=` + - `service=` + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/tasks'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\TaskListInternalServerErrorException + * @throws \Docker\API\Exception\TaskListServiceUnavailableException + * + * @return null|\Docker\API\Model\Task[] + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Task[]', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\TaskListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\TaskListServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/TaskLogs.php b/generated/Endpoint/TaskLogs.php new file mode 100644 index 00000000..5ab68269 --- /dev/null +++ b/generated/Endpoint/TaskLogs.php @@ -0,0 +1,96 @@ +id = $id; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{id}'], [$this->id], '/tasks/{id}/logs'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['details', 'follow', 'stdout', 'stderr', 'since', 'timestamps', 'tail']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['details' => false, 'follow' => false, 'stdout' => false, 'stderr' => false, 'since' => 0, 'timestamps' => false, 'tail' => 'all']); + $optionsResolver->addAllowedTypes('details', ['bool']); + $optionsResolver->addAllowedTypes('follow', ['bool']); + $optionsResolver->addAllowedTypes('stdout', ['bool']); + $optionsResolver->addAllowedTypes('stderr', ['bool']); + $optionsResolver->addAllowedTypes('since', ['int']); + $optionsResolver->addAllowedTypes('timestamps', ['bool']); + $optionsResolver->addAllowedTypes('tail', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\TaskLogsNotFoundException + * @throws \Docker\API\Exception\TaskLogsInternalServerErrorException + * @throws \Docker\API\Exception\TaskLogsServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return json_decode($body); + } + if (404 === $status) { + throw new \Docker\API\Exception\TaskLogsNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\TaskLogsInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\TaskLogsServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/VolumeCreate.php b/generated/Endpoint/VolumeCreate.php new file mode 100644 index 00000000..2d205cbf --- /dev/null +++ b/generated/Endpoint/VolumeCreate.php @@ -0,0 +1,55 @@ +body = $volumeConfig; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/volumes/create'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\VolumeCreateInternalServerErrorException + * + * @return null|\Docker\API\Model\Volume + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (201 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Volume', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\VolumeCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/VolumeDelete.php b/generated/Endpoint/VolumeDelete.php new file mode 100644 index 00000000..9f345546 --- /dev/null +++ b/generated/Endpoint/VolumeDelete.php @@ -0,0 +1,77 @@ +name = $name; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'DELETE'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/volumes/{name}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['force']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults(['force' => false]); + $optionsResolver->addAllowedTypes('force', ['bool']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\VolumeDeleteNotFoundException + * @throws \Docker\API\Exception\VolumeDeleteConflictException + * @throws \Docker\API\Exception\VolumeDeleteInternalServerErrorException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (204 === $status) { + return null; + } + if (404 === $status) { + throw new \Docker\API\Exception\VolumeDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (409 === $status) { + throw new \Docker\API\Exception\VolumeDeleteConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\VolumeDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/VolumeInspect.php b/generated/Endpoint/VolumeInspect.php new file mode 100644 index 00000000..ef5bdba2 --- /dev/null +++ b/generated/Endpoint/VolumeInspect.php @@ -0,0 +1,60 @@ +name = $name; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/volumes/{name}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\VolumeInspectNotFoundException + * @throws \Docker\API\Exception\VolumeInspectInternalServerErrorException + * + * @return null|\Docker\API\Model\Volume + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\Volume', 'json'); + } + if (404 === $status) { + throw new \Docker\API\Exception\VolumeInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\VolumeInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/VolumeList.php b/generated/Endpoint/VolumeList.php new file mode 100644 index 00000000..2462c0e2 --- /dev/null +++ b/generated/Endpoint/VolumeList.php @@ -0,0 +1,77 @@ +` When set to `true` (or `1`), returns all + volumes that are not in use by a container. When set to `false` + (or `0`), only volumes that are in use by one or more + containers are returned. + - `driver=` Matches volumes based on their driver. + - `label=` or `label=:` Matches volumes based on + the presence of a `label` alone or a `label` and a value. + - `name=` Matches all or part of a volume name. + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'GET'; + } + public function getUri(): string + { + return '/volumes'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\VolumeListInternalServerErrorException + * + * @return null|\Docker\API\Model\VolumeListResponse + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\VolumeListResponse', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\VolumeListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/VolumePrune.php b/generated/Endpoint/VolumePrune.php new file mode 100644 index 00000000..97267751 --- /dev/null +++ b/generated/Endpoint/VolumePrune.php @@ -0,0 +1,71 @@ +`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'POST'; + } + public function getUri(): string + { + return '/volumes/prune'; + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('filters', ['string']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\VolumePruneInternalServerErrorException + * + * @return null|\Docker\API\Model\VolumesPrunePostResponse200 + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'Docker\API\Model\VolumesPrunePostResponse200', 'json'); + } + if (500 === $status) { + throw new \Docker\API\Exception\VolumePruneInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Endpoint/VolumeUpdate.php b/generated/Endpoint/VolumeUpdate.php new file mode 100644 index 00000000..9f94b5c5 --- /dev/null +++ b/generated/Endpoint/VolumeUpdate.php @@ -0,0 +1,88 @@ +name = $name; + $this->body = $body; + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod(): string + { + return 'PUT'; + } + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/volumes/{name}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['version']); + $optionsResolver->setRequired(['version']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('version', ['int']); + return $optionsResolver; + } + /** + * {@inheritdoc} + * + * @throws \Docker\API\Exception\VolumeUpdateBadRequestException + * @throws \Docker\API\Exception\VolumeUpdateNotFoundException + * @throws \Docker\API\Exception\VolumeUpdateInternalServerErrorException + * @throws \Docker\API\Exception\VolumeUpdateServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return null; + } + if (400 === $status) { + throw new \Docker\API\Exception\VolumeUpdateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (404 === $status) { + throw new \Docker\API\Exception\VolumeUpdateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (500 === $status) { + throw new \Docker\API\Exception\VolumeUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if (503 === $status) { + throw new \Docker\API\Exception\VolumeUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + public function getAuthenticationScopes(): array + { + return []; + } +} \ No newline at end of file diff --git a/generated/Exception/ApiException.php b/generated/Exception/ApiException.php new file mode 100644 index 00000000..78d25f80 --- /dev/null +++ b/generated/Exception/ApiException.php @@ -0,0 +1,7 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ClientException.php b/generated/Exception/ClientException.php new file mode 100644 index 00000000..dcb9abdf --- /dev/null +++ b/generated/Exception/ClientException.php @@ -0,0 +1,7 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigCreateInternalServerErrorException.php b/generated/Exception/ConfigCreateInternalServerErrorException.php new file mode 100644 index 00000000..53e7d7a0 --- /dev/null +++ b/generated/Exception/ConfigCreateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigCreateServiceUnavailableException.php b/generated/Exception/ConfigCreateServiceUnavailableException.php new file mode 100644 index 00000000..69dad49b --- /dev/null +++ b/generated/Exception/ConfigCreateServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigDeleteInternalServerErrorException.php b/generated/Exception/ConfigDeleteInternalServerErrorException.php new file mode 100644 index 00000000..1ee287be --- /dev/null +++ b/generated/Exception/ConfigDeleteInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigDeleteNotFoundException.php b/generated/Exception/ConfigDeleteNotFoundException.php new file mode 100644 index 00000000..4a8dab14 --- /dev/null +++ b/generated/Exception/ConfigDeleteNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigDeleteServiceUnavailableException.php b/generated/Exception/ConfigDeleteServiceUnavailableException.php new file mode 100644 index 00000000..35386ad1 --- /dev/null +++ b/generated/Exception/ConfigDeleteServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigInspectInternalServerErrorException.php b/generated/Exception/ConfigInspectInternalServerErrorException.php new file mode 100644 index 00000000..434f60e8 --- /dev/null +++ b/generated/Exception/ConfigInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigInspectNotFoundException.php b/generated/Exception/ConfigInspectNotFoundException.php new file mode 100644 index 00000000..0baa83d0 --- /dev/null +++ b/generated/Exception/ConfigInspectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigInspectServiceUnavailableException.php b/generated/Exception/ConfigInspectServiceUnavailableException.php new file mode 100644 index 00000000..0271d82c --- /dev/null +++ b/generated/Exception/ConfigInspectServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigListInternalServerErrorException.php b/generated/Exception/ConfigListInternalServerErrorException.php new file mode 100644 index 00000000..2b11a0f1 --- /dev/null +++ b/generated/Exception/ConfigListInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigListServiceUnavailableException.php b/generated/Exception/ConfigListServiceUnavailableException.php new file mode 100644 index 00000000..059e2bce --- /dev/null +++ b/generated/Exception/ConfigListServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigUpdateBadRequestException.php b/generated/Exception/ConfigUpdateBadRequestException.php new file mode 100644 index 00000000..e022954b --- /dev/null +++ b/generated/Exception/ConfigUpdateBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigUpdateInternalServerErrorException.php b/generated/Exception/ConfigUpdateInternalServerErrorException.php new file mode 100644 index 00000000..0fe7e160 --- /dev/null +++ b/generated/Exception/ConfigUpdateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigUpdateNotFoundException.php b/generated/Exception/ConfigUpdateNotFoundException.php new file mode 100644 index 00000000..ba78e5dd --- /dev/null +++ b/generated/Exception/ConfigUpdateNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConfigUpdateServiceUnavailableException.php b/generated/Exception/ConfigUpdateServiceUnavailableException.php new file mode 100644 index 00000000..dbc00770 --- /dev/null +++ b/generated/Exception/ConfigUpdateServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ConflictException.php b/generated/Exception/ConflictException.php new file mode 100644 index 00000000..ac1e03e5 --- /dev/null +++ b/generated/Exception/ConflictException.php @@ -0,0 +1,11 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerArchiveInfoBadRequestException.php b/generated/Exception/ContainerArchiveInfoBadRequestException.php new file mode 100644 index 00000000..f9fcad86 --- /dev/null +++ b/generated/Exception/ContainerArchiveInfoBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerArchiveInfoInternalServerErrorException.php b/generated/Exception/ContainerArchiveInfoInternalServerErrorException.php new file mode 100644 index 00000000..0701da3f --- /dev/null +++ b/generated/Exception/ContainerArchiveInfoInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerArchiveInfoNotFoundException.php b/generated/Exception/ContainerArchiveInfoNotFoundException.php new file mode 100644 index 00000000..0325bdf9 --- /dev/null +++ b/generated/Exception/ContainerArchiveInfoNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerArchiveInternalServerErrorException.php b/generated/Exception/ContainerArchiveInternalServerErrorException.php new file mode 100644 index 00000000..697e1c0b --- /dev/null +++ b/generated/Exception/ContainerArchiveInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerArchiveNotFoundException.php b/generated/Exception/ContainerArchiveNotFoundException.php new file mode 100644 index 00000000..a02ec858 --- /dev/null +++ b/generated/Exception/ContainerArchiveNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerAttachBadRequestException.php b/generated/Exception/ContainerAttachBadRequestException.php new file mode 100644 index 00000000..5dfc6396 --- /dev/null +++ b/generated/Exception/ContainerAttachBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerAttachInternalServerErrorException.php b/generated/Exception/ContainerAttachInternalServerErrorException.php new file mode 100644 index 00000000..2a11acd2 --- /dev/null +++ b/generated/Exception/ContainerAttachInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerAttachNotFoundException.php b/generated/Exception/ContainerAttachNotFoundException.php new file mode 100644 index 00000000..1d02192c --- /dev/null +++ b/generated/Exception/ContainerAttachNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerAttachWebsocketBadRequestException.php b/generated/Exception/ContainerAttachWebsocketBadRequestException.php new file mode 100644 index 00000000..e3cfcc8a --- /dev/null +++ b/generated/Exception/ContainerAttachWebsocketBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerAttachWebsocketInternalServerErrorException.php b/generated/Exception/ContainerAttachWebsocketInternalServerErrorException.php new file mode 100644 index 00000000..b0a1fd50 --- /dev/null +++ b/generated/Exception/ContainerAttachWebsocketInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerAttachWebsocketNotFoundException.php b/generated/Exception/ContainerAttachWebsocketNotFoundException.php new file mode 100644 index 00000000..df56e300 --- /dev/null +++ b/generated/Exception/ContainerAttachWebsocketNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerChangesInternalServerErrorException.php b/generated/Exception/ContainerChangesInternalServerErrorException.php new file mode 100644 index 00000000..c7031979 --- /dev/null +++ b/generated/Exception/ContainerChangesInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerChangesNotFoundException.php b/generated/Exception/ContainerChangesNotFoundException.php new file mode 100644 index 00000000..f436b937 --- /dev/null +++ b/generated/Exception/ContainerChangesNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerCreateBadRequestException.php b/generated/Exception/ContainerCreateBadRequestException.php new file mode 100644 index 00000000..31843254 --- /dev/null +++ b/generated/Exception/ContainerCreateBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerCreateConflictException.php b/generated/Exception/ContainerCreateConflictException.php new file mode 100644 index 00000000..13c86940 --- /dev/null +++ b/generated/Exception/ContainerCreateConflictException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerCreateInternalServerErrorException.php b/generated/Exception/ContainerCreateInternalServerErrorException.php new file mode 100644 index 00000000..fef993e6 --- /dev/null +++ b/generated/Exception/ContainerCreateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerCreateNotFoundException.php b/generated/Exception/ContainerCreateNotFoundException.php new file mode 100644 index 00000000..fde87b3a --- /dev/null +++ b/generated/Exception/ContainerCreateNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerDeleteBadRequestException.php b/generated/Exception/ContainerDeleteBadRequestException.php new file mode 100644 index 00000000..70c6cae9 --- /dev/null +++ b/generated/Exception/ContainerDeleteBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerDeleteConflictException.php b/generated/Exception/ContainerDeleteConflictException.php new file mode 100644 index 00000000..1c327bca --- /dev/null +++ b/generated/Exception/ContainerDeleteConflictException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerDeleteInternalServerErrorException.php b/generated/Exception/ContainerDeleteInternalServerErrorException.php new file mode 100644 index 00000000..f2b4ede3 --- /dev/null +++ b/generated/Exception/ContainerDeleteInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerDeleteNotFoundException.php b/generated/Exception/ContainerDeleteNotFoundException.php new file mode 100644 index 00000000..ec3ab52a --- /dev/null +++ b/generated/Exception/ContainerDeleteNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerExecConflictException.php b/generated/Exception/ContainerExecConflictException.php new file mode 100644 index 00000000..09aa1b97 --- /dev/null +++ b/generated/Exception/ContainerExecConflictException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerExecInternalServerErrorException.php b/generated/Exception/ContainerExecInternalServerErrorException.php new file mode 100644 index 00000000..bf7fa182 --- /dev/null +++ b/generated/Exception/ContainerExecInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerExecNotFoundException.php b/generated/Exception/ContainerExecNotFoundException.php new file mode 100644 index 00000000..8cf228a6 --- /dev/null +++ b/generated/Exception/ContainerExecNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerExportInternalServerErrorException.php b/generated/Exception/ContainerExportInternalServerErrorException.php new file mode 100644 index 00000000..b0831fb6 --- /dev/null +++ b/generated/Exception/ContainerExportInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerExportNotFoundException.php b/generated/Exception/ContainerExportNotFoundException.php new file mode 100644 index 00000000..4be0c7fb --- /dev/null +++ b/generated/Exception/ContainerExportNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerInspectInternalServerErrorException.php b/generated/Exception/ContainerInspectInternalServerErrorException.php new file mode 100644 index 00000000..cf9abddd --- /dev/null +++ b/generated/Exception/ContainerInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerInspectNotFoundException.php b/generated/Exception/ContainerInspectNotFoundException.php new file mode 100644 index 00000000..be34fb0b --- /dev/null +++ b/generated/Exception/ContainerInspectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerKillConflictException.php b/generated/Exception/ContainerKillConflictException.php new file mode 100644 index 00000000..22f8ecc3 --- /dev/null +++ b/generated/Exception/ContainerKillConflictException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerKillInternalServerErrorException.php b/generated/Exception/ContainerKillInternalServerErrorException.php new file mode 100644 index 00000000..42043a9e --- /dev/null +++ b/generated/Exception/ContainerKillInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerKillNotFoundException.php b/generated/Exception/ContainerKillNotFoundException.php new file mode 100644 index 00000000..a8901606 --- /dev/null +++ b/generated/Exception/ContainerKillNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerListBadRequestException.php b/generated/Exception/ContainerListBadRequestException.php new file mode 100644 index 00000000..16c7679a --- /dev/null +++ b/generated/Exception/ContainerListBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerListInternalServerErrorException.php b/generated/Exception/ContainerListInternalServerErrorException.php new file mode 100644 index 00000000..2758196b --- /dev/null +++ b/generated/Exception/ContainerListInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerLogsInternalServerErrorException.php b/generated/Exception/ContainerLogsInternalServerErrorException.php new file mode 100644 index 00000000..c05611fe --- /dev/null +++ b/generated/Exception/ContainerLogsInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerLogsNotFoundException.php b/generated/Exception/ContainerLogsNotFoundException.php new file mode 100644 index 00000000..5f7fdeab --- /dev/null +++ b/generated/Exception/ContainerLogsNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerPauseInternalServerErrorException.php b/generated/Exception/ContainerPauseInternalServerErrorException.php new file mode 100644 index 00000000..205b4969 --- /dev/null +++ b/generated/Exception/ContainerPauseInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerPauseNotFoundException.php b/generated/Exception/ContainerPauseNotFoundException.php new file mode 100644 index 00000000..955e7ad1 --- /dev/null +++ b/generated/Exception/ContainerPauseNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerPruneInternalServerErrorException.php b/generated/Exception/ContainerPruneInternalServerErrorException.php new file mode 100644 index 00000000..ba68d262 --- /dev/null +++ b/generated/Exception/ContainerPruneInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerRenameConflictException.php b/generated/Exception/ContainerRenameConflictException.php new file mode 100644 index 00000000..72e2cd77 --- /dev/null +++ b/generated/Exception/ContainerRenameConflictException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerRenameInternalServerErrorException.php b/generated/Exception/ContainerRenameInternalServerErrorException.php new file mode 100644 index 00000000..0a418d78 --- /dev/null +++ b/generated/Exception/ContainerRenameInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerRenameNotFoundException.php b/generated/Exception/ContainerRenameNotFoundException.php new file mode 100644 index 00000000..59005e25 --- /dev/null +++ b/generated/Exception/ContainerRenameNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerResizeInternalServerErrorException.php b/generated/Exception/ContainerResizeInternalServerErrorException.php new file mode 100644 index 00000000..2df2f568 --- /dev/null +++ b/generated/Exception/ContainerResizeInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerResizeNotFoundException.php b/generated/Exception/ContainerResizeNotFoundException.php new file mode 100644 index 00000000..4980721b --- /dev/null +++ b/generated/Exception/ContainerResizeNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerRestartInternalServerErrorException.php b/generated/Exception/ContainerRestartInternalServerErrorException.php new file mode 100644 index 00000000..e279045e --- /dev/null +++ b/generated/Exception/ContainerRestartInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerRestartNotFoundException.php b/generated/Exception/ContainerRestartNotFoundException.php new file mode 100644 index 00000000..ab2244c2 --- /dev/null +++ b/generated/Exception/ContainerRestartNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerStartInternalServerErrorException.php b/generated/Exception/ContainerStartInternalServerErrorException.php new file mode 100644 index 00000000..ff13b675 --- /dev/null +++ b/generated/Exception/ContainerStartInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerStartNotFoundException.php b/generated/Exception/ContainerStartNotFoundException.php new file mode 100644 index 00000000..31bac04f --- /dev/null +++ b/generated/Exception/ContainerStartNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerStatsInternalServerErrorException.php b/generated/Exception/ContainerStatsInternalServerErrorException.php new file mode 100644 index 00000000..9f48dbbf --- /dev/null +++ b/generated/Exception/ContainerStatsInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerStatsNotFoundException.php b/generated/Exception/ContainerStatsNotFoundException.php new file mode 100644 index 00000000..ab9f81a2 --- /dev/null +++ b/generated/Exception/ContainerStatsNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerStopInternalServerErrorException.php b/generated/Exception/ContainerStopInternalServerErrorException.php new file mode 100644 index 00000000..32ce9a33 --- /dev/null +++ b/generated/Exception/ContainerStopInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerStopNotFoundException.php b/generated/Exception/ContainerStopNotFoundException.php new file mode 100644 index 00000000..3a6ef9be --- /dev/null +++ b/generated/Exception/ContainerStopNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerTopInternalServerErrorException.php b/generated/Exception/ContainerTopInternalServerErrorException.php new file mode 100644 index 00000000..c9e7d835 --- /dev/null +++ b/generated/Exception/ContainerTopInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerTopNotFoundException.php b/generated/Exception/ContainerTopNotFoundException.php new file mode 100644 index 00000000..effffe31 --- /dev/null +++ b/generated/Exception/ContainerTopNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerUnpauseInternalServerErrorException.php b/generated/Exception/ContainerUnpauseInternalServerErrorException.php new file mode 100644 index 00000000..267e0862 --- /dev/null +++ b/generated/Exception/ContainerUnpauseInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerUnpauseNotFoundException.php b/generated/Exception/ContainerUnpauseNotFoundException.php new file mode 100644 index 00000000..355a2686 --- /dev/null +++ b/generated/Exception/ContainerUnpauseNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerUpdateInternalServerErrorException.php b/generated/Exception/ContainerUpdateInternalServerErrorException.php new file mode 100644 index 00000000..ff37c87c --- /dev/null +++ b/generated/Exception/ContainerUpdateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerUpdateNotFoundException.php b/generated/Exception/ContainerUpdateNotFoundException.php new file mode 100644 index 00000000..e6e61d5f --- /dev/null +++ b/generated/Exception/ContainerUpdateNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerWaitBadRequestException.php b/generated/Exception/ContainerWaitBadRequestException.php new file mode 100644 index 00000000..6e0ffec3 --- /dev/null +++ b/generated/Exception/ContainerWaitBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerWaitInternalServerErrorException.php b/generated/Exception/ContainerWaitInternalServerErrorException.php new file mode 100644 index 00000000..c22a4555 --- /dev/null +++ b/generated/Exception/ContainerWaitInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ContainerWaitNotFoundException.php b/generated/Exception/ContainerWaitNotFoundException.php new file mode 100644 index 00000000..495bc9f2 --- /dev/null +++ b/generated/Exception/ContainerWaitNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/DistributionInspectInternalServerErrorException.php b/generated/Exception/DistributionInspectInternalServerErrorException.php new file mode 100644 index 00000000..9b1834fb --- /dev/null +++ b/generated/Exception/DistributionInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/DistributionInspectUnauthorizedException.php b/generated/Exception/DistributionInspectUnauthorizedException.php new file mode 100644 index 00000000..8c2ae4bc --- /dev/null +++ b/generated/Exception/DistributionInspectUnauthorizedException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ExecInspectInternalServerErrorException.php b/generated/Exception/ExecInspectInternalServerErrorException.php new file mode 100644 index 00000000..c0317a69 --- /dev/null +++ b/generated/Exception/ExecInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ExecInspectNotFoundException.php b/generated/Exception/ExecInspectNotFoundException.php new file mode 100644 index 00000000..dfafe4d5 --- /dev/null +++ b/generated/Exception/ExecInspectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ExecResizeBadRequestException.php b/generated/Exception/ExecResizeBadRequestException.php new file mode 100644 index 00000000..d5d67469 --- /dev/null +++ b/generated/Exception/ExecResizeBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ExecResizeInternalServerErrorException.php b/generated/Exception/ExecResizeInternalServerErrorException.php new file mode 100644 index 00000000..4deac1bd --- /dev/null +++ b/generated/Exception/ExecResizeInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ExecResizeNotFoundException.php b/generated/Exception/ExecResizeNotFoundException.php new file mode 100644 index 00000000..06403089 --- /dev/null +++ b/generated/Exception/ExecResizeNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ExecStartConflictException.php b/generated/Exception/ExecStartConflictException.php new file mode 100644 index 00000000..98bb8bfa --- /dev/null +++ b/generated/Exception/ExecStartConflictException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ExecStartNotFoundException.php b/generated/Exception/ExecStartNotFoundException.php new file mode 100644 index 00000000..94c0e3f8 --- /dev/null +++ b/generated/Exception/ExecStartNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ForbiddenException.php b/generated/Exception/ForbiddenException.php new file mode 100644 index 00000000..988311b3 --- /dev/null +++ b/generated/Exception/ForbiddenException.php @@ -0,0 +1,11 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageBuildBadRequestException.php b/generated/Exception/ImageBuildBadRequestException.php new file mode 100644 index 00000000..414f71ef --- /dev/null +++ b/generated/Exception/ImageBuildBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageBuildInternalServerErrorException.php b/generated/Exception/ImageBuildInternalServerErrorException.php new file mode 100644 index 00000000..d099cfba --- /dev/null +++ b/generated/Exception/ImageBuildInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageCommitInternalServerErrorException.php b/generated/Exception/ImageCommitInternalServerErrorException.php new file mode 100644 index 00000000..04a2b4c2 --- /dev/null +++ b/generated/Exception/ImageCommitInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageCommitNotFoundException.php b/generated/Exception/ImageCommitNotFoundException.php new file mode 100644 index 00000000..5e41c1f9 --- /dev/null +++ b/generated/Exception/ImageCommitNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageCreateInternalServerErrorException.php b/generated/Exception/ImageCreateInternalServerErrorException.php new file mode 100644 index 00000000..377253cf --- /dev/null +++ b/generated/Exception/ImageCreateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageCreateNotFoundException.php b/generated/Exception/ImageCreateNotFoundException.php new file mode 100644 index 00000000..7248a40c --- /dev/null +++ b/generated/Exception/ImageCreateNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageDeleteConflictException.php b/generated/Exception/ImageDeleteConflictException.php new file mode 100644 index 00000000..1e8fe942 --- /dev/null +++ b/generated/Exception/ImageDeleteConflictException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageDeleteInternalServerErrorException.php b/generated/Exception/ImageDeleteInternalServerErrorException.php new file mode 100644 index 00000000..2b468c09 --- /dev/null +++ b/generated/Exception/ImageDeleteInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageDeleteNotFoundException.php b/generated/Exception/ImageDeleteNotFoundException.php new file mode 100644 index 00000000..cc1130e3 --- /dev/null +++ b/generated/Exception/ImageDeleteNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageGetAllInternalServerErrorException.php b/generated/Exception/ImageGetAllInternalServerErrorException.php new file mode 100644 index 00000000..390eb4a9 --- /dev/null +++ b/generated/Exception/ImageGetAllInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageGetInternalServerErrorException.php b/generated/Exception/ImageGetInternalServerErrorException.php new file mode 100644 index 00000000..87ab71bd --- /dev/null +++ b/generated/Exception/ImageGetInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageHistoryInternalServerErrorException.php b/generated/Exception/ImageHistoryInternalServerErrorException.php new file mode 100644 index 00000000..16a496fc --- /dev/null +++ b/generated/Exception/ImageHistoryInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageHistoryNotFoundException.php b/generated/Exception/ImageHistoryNotFoundException.php new file mode 100644 index 00000000..73b3d9d2 --- /dev/null +++ b/generated/Exception/ImageHistoryNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageInspectInternalServerErrorException.php b/generated/Exception/ImageInspectInternalServerErrorException.php new file mode 100644 index 00000000..ba9ddf36 --- /dev/null +++ b/generated/Exception/ImageInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageInspectNotFoundException.php b/generated/Exception/ImageInspectNotFoundException.php new file mode 100644 index 00000000..e4899cb0 --- /dev/null +++ b/generated/Exception/ImageInspectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageListInternalServerErrorException.php b/generated/Exception/ImageListInternalServerErrorException.php new file mode 100644 index 00000000..7ff140ff --- /dev/null +++ b/generated/Exception/ImageListInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageLoadInternalServerErrorException.php b/generated/Exception/ImageLoadInternalServerErrorException.php new file mode 100644 index 00000000..161fed4d --- /dev/null +++ b/generated/Exception/ImageLoadInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImagePruneInternalServerErrorException.php b/generated/Exception/ImagePruneInternalServerErrorException.php new file mode 100644 index 00000000..beeecb0d --- /dev/null +++ b/generated/Exception/ImagePruneInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImagePushInternalServerErrorException.php b/generated/Exception/ImagePushInternalServerErrorException.php new file mode 100644 index 00000000..21ca1133 --- /dev/null +++ b/generated/Exception/ImagePushInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImagePushNotFoundException.php b/generated/Exception/ImagePushNotFoundException.php new file mode 100644 index 00000000..0c5bfbd9 --- /dev/null +++ b/generated/Exception/ImagePushNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageSearchInternalServerErrorException.php b/generated/Exception/ImageSearchInternalServerErrorException.php new file mode 100644 index 00000000..7286ec97 --- /dev/null +++ b/generated/Exception/ImageSearchInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageTagBadRequestException.php b/generated/Exception/ImageTagBadRequestException.php new file mode 100644 index 00000000..84e8d36f --- /dev/null +++ b/generated/Exception/ImageTagBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageTagConflictException.php b/generated/Exception/ImageTagConflictException.php new file mode 100644 index 00000000..f5150e63 --- /dev/null +++ b/generated/Exception/ImageTagConflictException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageTagInternalServerErrorException.php b/generated/Exception/ImageTagInternalServerErrorException.php new file mode 100644 index 00000000..88d7eb0d --- /dev/null +++ b/generated/Exception/ImageTagInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ImageTagNotFoundException.php b/generated/Exception/ImageTagNotFoundException.php new file mode 100644 index 00000000..41804e38 --- /dev/null +++ b/generated/Exception/ImageTagNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/InternalServerErrorException.php b/generated/Exception/InternalServerErrorException.php new file mode 100644 index 00000000..5a5a47ef --- /dev/null +++ b/generated/Exception/InternalServerErrorException.php @@ -0,0 +1,11 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkConnectForbiddenException.php b/generated/Exception/NetworkConnectForbiddenException.php new file mode 100644 index 00000000..51e80857 --- /dev/null +++ b/generated/Exception/NetworkConnectForbiddenException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkConnectInternalServerErrorException.php b/generated/Exception/NetworkConnectInternalServerErrorException.php new file mode 100644 index 00000000..56e7db1b --- /dev/null +++ b/generated/Exception/NetworkConnectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkConnectNotFoundException.php b/generated/Exception/NetworkConnectNotFoundException.php new file mode 100644 index 00000000..c2d42e61 --- /dev/null +++ b/generated/Exception/NetworkConnectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkCreateBadRequestException.php b/generated/Exception/NetworkCreateBadRequestException.php new file mode 100644 index 00000000..5412090d --- /dev/null +++ b/generated/Exception/NetworkCreateBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkCreateForbiddenException.php b/generated/Exception/NetworkCreateForbiddenException.php new file mode 100644 index 00000000..48e90103 --- /dev/null +++ b/generated/Exception/NetworkCreateForbiddenException.php @@ -0,0 +1,31 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkCreateInternalServerErrorException.php b/generated/Exception/NetworkCreateInternalServerErrorException.php new file mode 100644 index 00000000..a065ef2f --- /dev/null +++ b/generated/Exception/NetworkCreateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkCreateNotFoundException.php b/generated/Exception/NetworkCreateNotFoundException.php new file mode 100644 index 00000000..d90f7f4f --- /dev/null +++ b/generated/Exception/NetworkCreateNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkDeleteForbiddenException.php b/generated/Exception/NetworkDeleteForbiddenException.php new file mode 100644 index 00000000..68e11566 --- /dev/null +++ b/generated/Exception/NetworkDeleteForbiddenException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkDeleteInternalServerErrorException.php b/generated/Exception/NetworkDeleteInternalServerErrorException.php new file mode 100644 index 00000000..f4c6c74b --- /dev/null +++ b/generated/Exception/NetworkDeleteInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkDeleteNotFoundException.php b/generated/Exception/NetworkDeleteNotFoundException.php new file mode 100644 index 00000000..37be2d23 --- /dev/null +++ b/generated/Exception/NetworkDeleteNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkDisconnectForbiddenException.php b/generated/Exception/NetworkDisconnectForbiddenException.php new file mode 100644 index 00000000..5799ca2a --- /dev/null +++ b/generated/Exception/NetworkDisconnectForbiddenException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkDisconnectInternalServerErrorException.php b/generated/Exception/NetworkDisconnectInternalServerErrorException.php new file mode 100644 index 00000000..c1e13e26 --- /dev/null +++ b/generated/Exception/NetworkDisconnectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkDisconnectNotFoundException.php b/generated/Exception/NetworkDisconnectNotFoundException.php new file mode 100644 index 00000000..eaac3a47 --- /dev/null +++ b/generated/Exception/NetworkDisconnectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkInspectInternalServerErrorException.php b/generated/Exception/NetworkInspectInternalServerErrorException.php new file mode 100644 index 00000000..e86b6903 --- /dev/null +++ b/generated/Exception/NetworkInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkInspectNotFoundException.php b/generated/Exception/NetworkInspectNotFoundException.php new file mode 100644 index 00000000..ae586eb6 --- /dev/null +++ b/generated/Exception/NetworkInspectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkListInternalServerErrorException.php b/generated/Exception/NetworkListInternalServerErrorException.php new file mode 100644 index 00000000..02554bb2 --- /dev/null +++ b/generated/Exception/NetworkListInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NetworkPruneInternalServerErrorException.php b/generated/Exception/NetworkPruneInternalServerErrorException.php new file mode 100644 index 00000000..18c0fe93 --- /dev/null +++ b/generated/Exception/NetworkPruneInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NodeDeleteInternalServerErrorException.php b/generated/Exception/NodeDeleteInternalServerErrorException.php new file mode 100644 index 00000000..3d1988ff --- /dev/null +++ b/generated/Exception/NodeDeleteInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NodeDeleteNotFoundException.php b/generated/Exception/NodeDeleteNotFoundException.php new file mode 100644 index 00000000..90a57e6c --- /dev/null +++ b/generated/Exception/NodeDeleteNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NodeDeleteServiceUnavailableException.php b/generated/Exception/NodeDeleteServiceUnavailableException.php new file mode 100644 index 00000000..353a61ba --- /dev/null +++ b/generated/Exception/NodeDeleteServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NodeInspectInternalServerErrorException.php b/generated/Exception/NodeInspectInternalServerErrorException.php new file mode 100644 index 00000000..bacff3cc --- /dev/null +++ b/generated/Exception/NodeInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NodeInspectNotFoundException.php b/generated/Exception/NodeInspectNotFoundException.php new file mode 100644 index 00000000..8923f3c7 --- /dev/null +++ b/generated/Exception/NodeInspectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NodeInspectServiceUnavailableException.php b/generated/Exception/NodeInspectServiceUnavailableException.php new file mode 100644 index 00000000..fdcdece2 --- /dev/null +++ b/generated/Exception/NodeInspectServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NodeListInternalServerErrorException.php b/generated/Exception/NodeListInternalServerErrorException.php new file mode 100644 index 00000000..e967eb76 --- /dev/null +++ b/generated/Exception/NodeListInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NodeListServiceUnavailableException.php b/generated/Exception/NodeListServiceUnavailableException.php new file mode 100644 index 00000000..43e35228 --- /dev/null +++ b/generated/Exception/NodeListServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NodeUpdateBadRequestException.php b/generated/Exception/NodeUpdateBadRequestException.php new file mode 100644 index 00000000..c677e05b --- /dev/null +++ b/generated/Exception/NodeUpdateBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NodeUpdateInternalServerErrorException.php b/generated/Exception/NodeUpdateInternalServerErrorException.php new file mode 100644 index 00000000..cca38107 --- /dev/null +++ b/generated/Exception/NodeUpdateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NodeUpdateNotFoundException.php b/generated/Exception/NodeUpdateNotFoundException.php new file mode 100644 index 00000000..c78b8344 --- /dev/null +++ b/generated/Exception/NodeUpdateNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NodeUpdateServiceUnavailableException.php b/generated/Exception/NodeUpdateServiceUnavailableException.php new file mode 100644 index 00000000..523078fe --- /dev/null +++ b/generated/Exception/NodeUpdateServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/NotFoundException.php b/generated/Exception/NotFoundException.php new file mode 100644 index 00000000..6a9bea3d --- /dev/null +++ b/generated/Exception/NotFoundException.php @@ -0,0 +1,11 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginDeleteInternalServerErrorException.php b/generated/Exception/PluginDeleteInternalServerErrorException.php new file mode 100644 index 00000000..75d76014 --- /dev/null +++ b/generated/Exception/PluginDeleteInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginDeleteNotFoundException.php b/generated/Exception/PluginDeleteNotFoundException.php new file mode 100644 index 00000000..a4fcf4a8 --- /dev/null +++ b/generated/Exception/PluginDeleteNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginDisableInternalServerErrorException.php b/generated/Exception/PluginDisableInternalServerErrorException.php new file mode 100644 index 00000000..f83c0cc3 --- /dev/null +++ b/generated/Exception/PluginDisableInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginDisableNotFoundException.php b/generated/Exception/PluginDisableNotFoundException.php new file mode 100644 index 00000000..99b906fa --- /dev/null +++ b/generated/Exception/PluginDisableNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginEnableInternalServerErrorException.php b/generated/Exception/PluginEnableInternalServerErrorException.php new file mode 100644 index 00000000..a52fe832 --- /dev/null +++ b/generated/Exception/PluginEnableInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginEnableNotFoundException.php b/generated/Exception/PluginEnableNotFoundException.php new file mode 100644 index 00000000..93aa9fc4 --- /dev/null +++ b/generated/Exception/PluginEnableNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginInspectInternalServerErrorException.php b/generated/Exception/PluginInspectInternalServerErrorException.php new file mode 100644 index 00000000..293a3914 --- /dev/null +++ b/generated/Exception/PluginInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginInspectNotFoundException.php b/generated/Exception/PluginInspectNotFoundException.php new file mode 100644 index 00000000..b811acdb --- /dev/null +++ b/generated/Exception/PluginInspectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginListInternalServerErrorException.php b/generated/Exception/PluginListInternalServerErrorException.php new file mode 100644 index 00000000..a67ecd63 --- /dev/null +++ b/generated/Exception/PluginListInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginPullInternalServerErrorException.php b/generated/Exception/PluginPullInternalServerErrorException.php new file mode 100644 index 00000000..3414a66e --- /dev/null +++ b/generated/Exception/PluginPullInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginPushInternalServerErrorException.php b/generated/Exception/PluginPushInternalServerErrorException.php new file mode 100644 index 00000000..82daed00 --- /dev/null +++ b/generated/Exception/PluginPushInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginPushNotFoundException.php b/generated/Exception/PluginPushNotFoundException.php new file mode 100644 index 00000000..0d342481 --- /dev/null +++ b/generated/Exception/PluginPushNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginSetInternalServerErrorException.php b/generated/Exception/PluginSetInternalServerErrorException.php new file mode 100644 index 00000000..d2b59afd --- /dev/null +++ b/generated/Exception/PluginSetInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginSetNotFoundException.php b/generated/Exception/PluginSetNotFoundException.php new file mode 100644 index 00000000..77c8e79f --- /dev/null +++ b/generated/Exception/PluginSetNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginUpgradeInternalServerErrorException.php b/generated/Exception/PluginUpgradeInternalServerErrorException.php new file mode 100644 index 00000000..d02a5c33 --- /dev/null +++ b/generated/Exception/PluginUpgradeInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PluginUpgradeNotFoundException.php b/generated/Exception/PluginUpgradeNotFoundException.php new file mode 100644 index 00000000..bc59a631 --- /dev/null +++ b/generated/Exception/PluginUpgradeNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PutContainerArchiveBadRequestException.php b/generated/Exception/PutContainerArchiveBadRequestException.php new file mode 100644 index 00000000..859175d2 --- /dev/null +++ b/generated/Exception/PutContainerArchiveBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PutContainerArchiveForbiddenException.php b/generated/Exception/PutContainerArchiveForbiddenException.php new file mode 100644 index 00000000..086e70b7 --- /dev/null +++ b/generated/Exception/PutContainerArchiveForbiddenException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PutContainerArchiveInternalServerErrorException.php b/generated/Exception/PutContainerArchiveInternalServerErrorException.php new file mode 100644 index 00000000..06b4fb44 --- /dev/null +++ b/generated/Exception/PutContainerArchiveInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/PutContainerArchiveNotFoundException.php b/generated/Exception/PutContainerArchiveNotFoundException.php new file mode 100644 index 00000000..c21f74c6 --- /dev/null +++ b/generated/Exception/PutContainerArchiveNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretCreateConflictException.php b/generated/Exception/SecretCreateConflictException.php new file mode 100644 index 00000000..21ff57ee --- /dev/null +++ b/generated/Exception/SecretCreateConflictException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretCreateInternalServerErrorException.php b/generated/Exception/SecretCreateInternalServerErrorException.php new file mode 100644 index 00000000..8ceeed85 --- /dev/null +++ b/generated/Exception/SecretCreateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretCreateServiceUnavailableException.php b/generated/Exception/SecretCreateServiceUnavailableException.php new file mode 100644 index 00000000..057e1491 --- /dev/null +++ b/generated/Exception/SecretCreateServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretDeleteInternalServerErrorException.php b/generated/Exception/SecretDeleteInternalServerErrorException.php new file mode 100644 index 00000000..77812f1f --- /dev/null +++ b/generated/Exception/SecretDeleteInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretDeleteNotFoundException.php b/generated/Exception/SecretDeleteNotFoundException.php new file mode 100644 index 00000000..2979b97a --- /dev/null +++ b/generated/Exception/SecretDeleteNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretDeleteServiceUnavailableException.php b/generated/Exception/SecretDeleteServiceUnavailableException.php new file mode 100644 index 00000000..139f44aa --- /dev/null +++ b/generated/Exception/SecretDeleteServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretInspectInternalServerErrorException.php b/generated/Exception/SecretInspectInternalServerErrorException.php new file mode 100644 index 00000000..cd343fc2 --- /dev/null +++ b/generated/Exception/SecretInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretInspectNotFoundException.php b/generated/Exception/SecretInspectNotFoundException.php new file mode 100644 index 00000000..c0b9876a --- /dev/null +++ b/generated/Exception/SecretInspectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretInspectServiceUnavailableException.php b/generated/Exception/SecretInspectServiceUnavailableException.php new file mode 100644 index 00000000..f8a9e34e --- /dev/null +++ b/generated/Exception/SecretInspectServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretListInternalServerErrorException.php b/generated/Exception/SecretListInternalServerErrorException.php new file mode 100644 index 00000000..efc1f4c6 --- /dev/null +++ b/generated/Exception/SecretListInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretListServiceUnavailableException.php b/generated/Exception/SecretListServiceUnavailableException.php new file mode 100644 index 00000000..25acc514 --- /dev/null +++ b/generated/Exception/SecretListServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretUpdateBadRequestException.php b/generated/Exception/SecretUpdateBadRequestException.php new file mode 100644 index 00000000..c2f975ce --- /dev/null +++ b/generated/Exception/SecretUpdateBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretUpdateInternalServerErrorException.php b/generated/Exception/SecretUpdateInternalServerErrorException.php new file mode 100644 index 00000000..04e855a0 --- /dev/null +++ b/generated/Exception/SecretUpdateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretUpdateNotFoundException.php b/generated/Exception/SecretUpdateNotFoundException.php new file mode 100644 index 00000000..b2311669 --- /dev/null +++ b/generated/Exception/SecretUpdateNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SecretUpdateServiceUnavailableException.php b/generated/Exception/SecretUpdateServiceUnavailableException.php new file mode 100644 index 00000000..4756f2d1 --- /dev/null +++ b/generated/Exception/SecretUpdateServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServerException.php b/generated/Exception/ServerException.php new file mode 100644 index 00000000..6c2c3fff --- /dev/null +++ b/generated/Exception/ServerException.php @@ -0,0 +1,7 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceCreateConflictException.php b/generated/Exception/ServiceCreateConflictException.php new file mode 100644 index 00000000..1ce00c5d --- /dev/null +++ b/generated/Exception/ServiceCreateConflictException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceCreateForbiddenException.php b/generated/Exception/ServiceCreateForbiddenException.php new file mode 100644 index 00000000..c2c48f6e --- /dev/null +++ b/generated/Exception/ServiceCreateForbiddenException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceCreateInternalServerErrorException.php b/generated/Exception/ServiceCreateInternalServerErrorException.php new file mode 100644 index 00000000..a55d221a --- /dev/null +++ b/generated/Exception/ServiceCreateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceCreateServiceUnavailableException.php b/generated/Exception/ServiceCreateServiceUnavailableException.php new file mode 100644 index 00000000..6a83715b --- /dev/null +++ b/generated/Exception/ServiceCreateServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceDeleteInternalServerErrorException.php b/generated/Exception/ServiceDeleteInternalServerErrorException.php new file mode 100644 index 00000000..ce42a047 --- /dev/null +++ b/generated/Exception/ServiceDeleteInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceDeleteNotFoundException.php b/generated/Exception/ServiceDeleteNotFoundException.php new file mode 100644 index 00000000..864294e8 --- /dev/null +++ b/generated/Exception/ServiceDeleteNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceDeleteServiceUnavailableException.php b/generated/Exception/ServiceDeleteServiceUnavailableException.php new file mode 100644 index 00000000..3853be86 --- /dev/null +++ b/generated/Exception/ServiceDeleteServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceInspectInternalServerErrorException.php b/generated/Exception/ServiceInspectInternalServerErrorException.php new file mode 100644 index 00000000..341387fb --- /dev/null +++ b/generated/Exception/ServiceInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceInspectNotFoundException.php b/generated/Exception/ServiceInspectNotFoundException.php new file mode 100644 index 00000000..e291185a --- /dev/null +++ b/generated/Exception/ServiceInspectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceInspectServiceUnavailableException.php b/generated/Exception/ServiceInspectServiceUnavailableException.php new file mode 100644 index 00000000..72f73b09 --- /dev/null +++ b/generated/Exception/ServiceInspectServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceListInternalServerErrorException.php b/generated/Exception/ServiceListInternalServerErrorException.php new file mode 100644 index 00000000..abde03c8 --- /dev/null +++ b/generated/Exception/ServiceListInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceListServiceUnavailableException.php b/generated/Exception/ServiceListServiceUnavailableException.php new file mode 100644 index 00000000..39ddc2c1 --- /dev/null +++ b/generated/Exception/ServiceListServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceLogsInternalServerErrorException.php b/generated/Exception/ServiceLogsInternalServerErrorException.php new file mode 100644 index 00000000..63cdbf61 --- /dev/null +++ b/generated/Exception/ServiceLogsInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceLogsNotFoundException.php b/generated/Exception/ServiceLogsNotFoundException.php new file mode 100644 index 00000000..b12e8993 --- /dev/null +++ b/generated/Exception/ServiceLogsNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceLogsServiceUnavailableException.php b/generated/Exception/ServiceLogsServiceUnavailableException.php new file mode 100644 index 00000000..f0b091d6 --- /dev/null +++ b/generated/Exception/ServiceLogsServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceUnavailableException.php b/generated/Exception/ServiceUnavailableException.php new file mode 100644 index 00000000..2d036d1d --- /dev/null +++ b/generated/Exception/ServiceUnavailableException.php @@ -0,0 +1,11 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceUpdateInternalServerErrorException.php b/generated/Exception/ServiceUpdateInternalServerErrorException.php new file mode 100644 index 00000000..9ce01a11 --- /dev/null +++ b/generated/Exception/ServiceUpdateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceUpdateNotFoundException.php b/generated/Exception/ServiceUpdateNotFoundException.php new file mode 100644 index 00000000..a1337f4d --- /dev/null +++ b/generated/Exception/ServiceUpdateNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/ServiceUpdateServiceUnavailableException.php b/generated/Exception/ServiceUpdateServiceUnavailableException.php new file mode 100644 index 00000000..76f4dbd7 --- /dev/null +++ b/generated/Exception/ServiceUpdateServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SessionBadRequestException.php b/generated/Exception/SessionBadRequestException.php new file mode 100644 index 00000000..71a2b2f1 --- /dev/null +++ b/generated/Exception/SessionBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SessionInternalServerErrorException.php b/generated/Exception/SessionInternalServerErrorException.php new file mode 100644 index 00000000..efc8e789 --- /dev/null +++ b/generated/Exception/SessionInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmInitBadRequestException.php b/generated/Exception/SwarmInitBadRequestException.php new file mode 100644 index 00000000..9979b094 --- /dev/null +++ b/generated/Exception/SwarmInitBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmInitInternalServerErrorException.php b/generated/Exception/SwarmInitInternalServerErrorException.php new file mode 100644 index 00000000..287fdd80 --- /dev/null +++ b/generated/Exception/SwarmInitInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmInitServiceUnavailableException.php b/generated/Exception/SwarmInitServiceUnavailableException.php new file mode 100644 index 00000000..732c97b5 --- /dev/null +++ b/generated/Exception/SwarmInitServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmInspectInternalServerErrorException.php b/generated/Exception/SwarmInspectInternalServerErrorException.php new file mode 100644 index 00000000..12342070 --- /dev/null +++ b/generated/Exception/SwarmInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmInspectNotFoundException.php b/generated/Exception/SwarmInspectNotFoundException.php new file mode 100644 index 00000000..3155bb55 --- /dev/null +++ b/generated/Exception/SwarmInspectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmInspectServiceUnavailableException.php b/generated/Exception/SwarmInspectServiceUnavailableException.php new file mode 100644 index 00000000..9ac9828e --- /dev/null +++ b/generated/Exception/SwarmInspectServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmJoinBadRequestException.php b/generated/Exception/SwarmJoinBadRequestException.php new file mode 100644 index 00000000..2d917081 --- /dev/null +++ b/generated/Exception/SwarmJoinBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmJoinInternalServerErrorException.php b/generated/Exception/SwarmJoinInternalServerErrorException.php new file mode 100644 index 00000000..35335c2a --- /dev/null +++ b/generated/Exception/SwarmJoinInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmJoinServiceUnavailableException.php b/generated/Exception/SwarmJoinServiceUnavailableException.php new file mode 100644 index 00000000..c56500da --- /dev/null +++ b/generated/Exception/SwarmJoinServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmLeaveInternalServerErrorException.php b/generated/Exception/SwarmLeaveInternalServerErrorException.php new file mode 100644 index 00000000..90fc4166 --- /dev/null +++ b/generated/Exception/SwarmLeaveInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmLeaveServiceUnavailableException.php b/generated/Exception/SwarmLeaveServiceUnavailableException.php new file mode 100644 index 00000000..4373d92c --- /dev/null +++ b/generated/Exception/SwarmLeaveServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmUnlockInternalServerErrorException.php b/generated/Exception/SwarmUnlockInternalServerErrorException.php new file mode 100644 index 00000000..aa7e85a3 --- /dev/null +++ b/generated/Exception/SwarmUnlockInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmUnlockServiceUnavailableException.php b/generated/Exception/SwarmUnlockServiceUnavailableException.php new file mode 100644 index 00000000..253a0e40 --- /dev/null +++ b/generated/Exception/SwarmUnlockServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmUnlockkeyInternalServerErrorException.php b/generated/Exception/SwarmUnlockkeyInternalServerErrorException.php new file mode 100644 index 00000000..26bf0c07 --- /dev/null +++ b/generated/Exception/SwarmUnlockkeyInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmUnlockkeyServiceUnavailableException.php b/generated/Exception/SwarmUnlockkeyServiceUnavailableException.php new file mode 100644 index 00000000..6a08a104 --- /dev/null +++ b/generated/Exception/SwarmUnlockkeyServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmUpdateBadRequestException.php b/generated/Exception/SwarmUpdateBadRequestException.php new file mode 100644 index 00000000..ea099715 --- /dev/null +++ b/generated/Exception/SwarmUpdateBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmUpdateInternalServerErrorException.php b/generated/Exception/SwarmUpdateInternalServerErrorException.php new file mode 100644 index 00000000..a747f221 --- /dev/null +++ b/generated/Exception/SwarmUpdateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SwarmUpdateServiceUnavailableException.php b/generated/Exception/SwarmUpdateServiceUnavailableException.php new file mode 100644 index 00000000..1af9c9a7 --- /dev/null +++ b/generated/Exception/SwarmUpdateServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SystemAuthInternalServerErrorException.php b/generated/Exception/SystemAuthInternalServerErrorException.php new file mode 100644 index 00000000..ad2bc981 --- /dev/null +++ b/generated/Exception/SystemAuthInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SystemAuthUnauthorizedException.php b/generated/Exception/SystemAuthUnauthorizedException.php new file mode 100644 index 00000000..e7ef22e1 --- /dev/null +++ b/generated/Exception/SystemAuthUnauthorizedException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SystemDataUsageInternalServerErrorException.php b/generated/Exception/SystemDataUsageInternalServerErrorException.php new file mode 100644 index 00000000..fb34466b --- /dev/null +++ b/generated/Exception/SystemDataUsageInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SystemEventsBadRequestException.php b/generated/Exception/SystemEventsBadRequestException.php new file mode 100644 index 00000000..996ff836 --- /dev/null +++ b/generated/Exception/SystemEventsBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SystemEventsInternalServerErrorException.php b/generated/Exception/SystemEventsInternalServerErrorException.php new file mode 100644 index 00000000..9f14bf46 --- /dev/null +++ b/generated/Exception/SystemEventsInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SystemInfoInternalServerErrorException.php b/generated/Exception/SystemInfoInternalServerErrorException.php new file mode 100644 index 00000000..831167ee --- /dev/null +++ b/generated/Exception/SystemInfoInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SystemPingHeadInternalServerErrorException.php b/generated/Exception/SystemPingHeadInternalServerErrorException.php new file mode 100644 index 00000000..29236e15 --- /dev/null +++ b/generated/Exception/SystemPingHeadInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SystemPingInternalServerErrorException.php b/generated/Exception/SystemPingInternalServerErrorException.php new file mode 100644 index 00000000..be6bebad --- /dev/null +++ b/generated/Exception/SystemPingInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/SystemVersionInternalServerErrorException.php b/generated/Exception/SystemVersionInternalServerErrorException.php new file mode 100644 index 00000000..9096e929 --- /dev/null +++ b/generated/Exception/SystemVersionInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/TaskInspectInternalServerErrorException.php b/generated/Exception/TaskInspectInternalServerErrorException.php new file mode 100644 index 00000000..fd93a3dd --- /dev/null +++ b/generated/Exception/TaskInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/TaskInspectNotFoundException.php b/generated/Exception/TaskInspectNotFoundException.php new file mode 100644 index 00000000..a8fa5006 --- /dev/null +++ b/generated/Exception/TaskInspectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/TaskInspectServiceUnavailableException.php b/generated/Exception/TaskInspectServiceUnavailableException.php new file mode 100644 index 00000000..d21cf962 --- /dev/null +++ b/generated/Exception/TaskInspectServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/TaskListInternalServerErrorException.php b/generated/Exception/TaskListInternalServerErrorException.php new file mode 100644 index 00000000..9308f9d8 --- /dev/null +++ b/generated/Exception/TaskListInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/TaskListServiceUnavailableException.php b/generated/Exception/TaskListServiceUnavailableException.php new file mode 100644 index 00000000..894d2aa7 --- /dev/null +++ b/generated/Exception/TaskListServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/TaskLogsInternalServerErrorException.php b/generated/Exception/TaskLogsInternalServerErrorException.php new file mode 100644 index 00000000..90b2830c --- /dev/null +++ b/generated/Exception/TaskLogsInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/TaskLogsNotFoundException.php b/generated/Exception/TaskLogsNotFoundException.php new file mode 100644 index 00000000..6f8d1bc9 --- /dev/null +++ b/generated/Exception/TaskLogsNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/TaskLogsServiceUnavailableException.php b/generated/Exception/TaskLogsServiceUnavailableException.php new file mode 100644 index 00000000..5fde2e30 --- /dev/null +++ b/generated/Exception/TaskLogsServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/UnauthorizedException.php b/generated/Exception/UnauthorizedException.php new file mode 100644 index 00000000..2209b5de --- /dev/null +++ b/generated/Exception/UnauthorizedException.php @@ -0,0 +1,11 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/VolumeDeleteConflictException.php b/generated/Exception/VolumeDeleteConflictException.php new file mode 100644 index 00000000..35197ca3 --- /dev/null +++ b/generated/Exception/VolumeDeleteConflictException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/VolumeDeleteInternalServerErrorException.php b/generated/Exception/VolumeDeleteInternalServerErrorException.php new file mode 100644 index 00000000..3de169ad --- /dev/null +++ b/generated/Exception/VolumeDeleteInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/VolumeDeleteNotFoundException.php b/generated/Exception/VolumeDeleteNotFoundException.php new file mode 100644 index 00000000..8d8f021e --- /dev/null +++ b/generated/Exception/VolumeDeleteNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/VolumeInspectInternalServerErrorException.php b/generated/Exception/VolumeInspectInternalServerErrorException.php new file mode 100644 index 00000000..5551e628 --- /dev/null +++ b/generated/Exception/VolumeInspectInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/VolumeInspectNotFoundException.php b/generated/Exception/VolumeInspectNotFoundException.php new file mode 100644 index 00000000..ed280dd7 --- /dev/null +++ b/generated/Exception/VolumeInspectNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/VolumeListInternalServerErrorException.php b/generated/Exception/VolumeListInternalServerErrorException.php new file mode 100644 index 00000000..a177c7ef --- /dev/null +++ b/generated/Exception/VolumeListInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/VolumePruneInternalServerErrorException.php b/generated/Exception/VolumePruneInternalServerErrorException.php new file mode 100644 index 00000000..50862ac0 --- /dev/null +++ b/generated/Exception/VolumePruneInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/VolumeUpdateBadRequestException.php b/generated/Exception/VolumeUpdateBadRequestException.php new file mode 100644 index 00000000..96e9edc1 --- /dev/null +++ b/generated/Exception/VolumeUpdateBadRequestException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/VolumeUpdateInternalServerErrorException.php b/generated/Exception/VolumeUpdateInternalServerErrorException.php new file mode 100644 index 00000000..f8d23fbc --- /dev/null +++ b/generated/Exception/VolumeUpdateInternalServerErrorException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/VolumeUpdateNotFoundException.php b/generated/Exception/VolumeUpdateNotFoundException.php new file mode 100644 index 00000000..49b6341d --- /dev/null +++ b/generated/Exception/VolumeUpdateNotFoundException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Exception/VolumeUpdateServiceUnavailableException.php b/generated/Exception/VolumeUpdateServiceUnavailableException.php new file mode 100644 index 00000000..ce105e47 --- /dev/null +++ b/generated/Exception/VolumeUpdateServiceUnavailableException.php @@ -0,0 +1,29 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} \ No newline at end of file diff --git a/generated/Model/Address.php b/generated/Model/Address.php new file mode 100644 index 00000000..d35a1f9f --- /dev/null +++ b/generated/Model/Address.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * IP address. + * + * @var string|null + */ + protected $addr; + /** + * Mask length of the IP address. + * + * @var int|null + */ + protected $prefixLen; + /** + * IP address. + * + * @return string|null + */ + public function getAddr(): ?string + { + return $this->addr; + } + /** + * IP address. + * + * @param string|null $addr + * + * @return self + */ + public function setAddr(?string $addr): self + { + $this->initialized['addr'] = true; + $this->addr = $addr; + return $this; + } + /** + * Mask length of the IP address. + * + * @return int|null + */ + public function getPrefixLen(): ?int + { + return $this->prefixLen; + } + /** + * Mask length of the IP address. + * + * @param int|null $prefixLen + * + * @return self + */ + public function setPrefixLen(?int $prefixLen): self + { + $this->initialized['prefixLen'] = true; + $this->prefixLen = $prefixLen; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Annotations.php b/generated/Model/Annotations.php deleted file mode 100644 index 2073eddb..00000000 --- a/generated/Model/Annotations.php +++ /dev/null @@ -1,55 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } - - /** - * @return string[]|null - */ - public function getLabels() - { - return $this->labels; - } - - /** - * @param string[]|null $labels - * - * @return self - */ - public function setLabels($labels = null) - { - $this->labels = $labels; - - return $this; - } -} diff --git a/generated/Model/AuthConfig.php b/generated/Model/AuthConfig.php index 44748820..6f8c2359 100644 --- a/generated/Model/AuthConfig.php +++ b/generated/Model/AuthConfig.php @@ -5,123 +5,123 @@ class AuthConfig { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var string|null */ protected $username; /** - * @var string + * + * + * @var string|null */ protected $password; /** - * @var string + * + * + * @var string|null */ protected $email; /** - * @var string + * + * + * @var string|null */ protected $serveraddress; /** - * @var string - */ - protected $registrytoken; - - /** - * @return string + * + * + * @return string|null */ - public function getUsername() + public function getUsername(): ?string { return $this->username; } - /** - * @param string $username + * + * + * @param string|null $username * * @return self */ - public function setUsername($username = null) + public function setUsername(?string $username): self { + $this->initialized['username'] = true; $this->username = $username; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getPassword() + public function getPassword(): ?string { return $this->password; } - /** - * @param string $password + * + * + * @param string|null $password * * @return self */ - public function setPassword($password = null) + public function setPassword(?string $password): self { + $this->initialized['password'] = true; $this->password = $password; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getEmail() + public function getEmail(): ?string { return $this->email; } - /** - * @param string $email + * + * + * @param string|null $email * * @return self */ - public function setEmail($email = null) + public function setEmail(?string $email): self { + $this->initialized['email'] = true; $this->email = $email; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getServeraddress() + public function getServeraddress(): ?string { return $this->serveraddress; } - /** - * @param string $serveraddress + * * - * @return self - */ - public function setServeraddress($serveraddress = null) - { - $this->serveraddress = $serveraddress; - - return $this; - } - - /** - * @return string - */ - public function getRegistrytoken() - { - return $this->registrytoken; - } - - /** - * @param string $registrytoken + * @param string|null $serveraddress * * @return self */ - public function setRegistrytoken($registrytoken = null) + public function setServeraddress(?string $serveraddress): self { - $this->registrytoken = $registrytoken; - + $this->initialized['serveraddress'] = true; + $this->serveraddress = $serveraddress; return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/AuthPostResponse200.php b/generated/Model/AuthPostResponse200.php new file mode 100644 index 00000000..9e89aa55 --- /dev/null +++ b/generated/Model/AuthPostResponse200.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * The status of the authentication + * + * @var string|null + */ + protected $status; + /** + * An opaque token used to authenticate a user after a successful login + * + * @var string|null + */ + protected $identityToken; + /** + * The status of the authentication + * + * @return string|null + */ + public function getStatus(): ?string + { + return $this->status; + } + /** + * The status of the authentication + * + * @param string|null $status + * + * @return self + */ + public function setStatus(?string $status): self + { + $this->initialized['status'] = true; + $this->status = $status; + return $this; + } + /** + * An opaque token used to authenticate a user after a successful login + * + * @return string|null + */ + public function getIdentityToken(): ?string + { + return $this->identityToken; + } + /** + * An opaque token used to authenticate a user after a successful login + * + * @param string|null $identityToken + * + * @return self + */ + public function setIdentityToken(?string $identityToken): self + { + $this->initialized['identityToken'] = true; + $this->identityToken = $identityToken; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/AuthResult.php b/generated/Model/AuthResult.php deleted file mode 100644 index 128f03da..00000000 --- a/generated/Model/AuthResult.php +++ /dev/null @@ -1,55 +0,0 @@ -status; - } - - /** - * @param string $status - * - * @return self - */ - public function setStatus($status = null) - { - $this->status = $status; - - return $this; - } - - /** - * @return string - */ - public function getIdentityToken() - { - return $this->identityToken; - } - - /** - * @param string $identityToken - * - * @return self - */ - public function setIdentityToken($identityToken = null) - { - $this->identityToken = $identityToken; - - return $this; - } -} diff --git a/generated/Model/BuildCache.php b/generated/Model/BuildCache.php new file mode 100644 index 00000000..50792993 --- /dev/null +++ b/generated/Model/BuildCache.php @@ -0,0 +1,344 @@ +initialized); + } + /** + * Unique ID of the build cache record. + * + * @var string|null + */ + protected $iD; + /** + * ID of the parent build cache record. + + > **Deprecated**: This field is deprecated, and omitted if empty. + + * + * @var string|null + */ + protected $parent; + /** + * List of parent build cache record IDs. + * + * @var list|null + */ + protected $parents; + /** + * Cache record type. + * + * @var string|null + */ + protected $type; + /** + * Description of the build-step that produced the build cache. + * + * @var string|null + */ + protected $description; + /** + * Indicates if the build cache is in use. + * + * @var bool|null + */ + protected $inUse; + /** + * Indicates if the build cache is shared. + * + * @var bool|null + */ + protected $shared; + /** + * Amount of disk space used by the build cache (in bytes). + * + * @var int|null + */ + protected $size; + /** + * Date and time at which the build cache was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @var string|null + */ + protected $createdAt; + /** + * Date and time at which the build cache was last used in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @var string|null + */ + protected $lastUsedAt; + /** + * + * + * @var int|null + */ + protected $usageCount; + /** + * Unique ID of the build cache record. + * + * @return string|null + */ + public function getID(): ?string + { + return $this->iD; + } + /** + * Unique ID of the build cache record. + * + * @param string|null $iD + * + * @return self + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } + /** + * ID of the parent build cache record. + + > **Deprecated**: This field is deprecated, and omitted if empty. + + * + * @return string|null + */ + public function getParent(): ?string + { + return $this->parent; + } + /** + * ID of the parent build cache record. + + > **Deprecated**: This field is deprecated, and omitted if empty. + + * + * @param string|null $parent + * + * @return self + */ + public function setParent(?string $parent): self + { + $this->initialized['parent'] = true; + $this->parent = $parent; + return $this; + } + /** + * List of parent build cache record IDs. + * + * @return list|null + */ + public function getParents(): ?array + { + return $this->parents; + } + /** + * List of parent build cache record IDs. + * + * @param list|null $parents + * + * @return self + */ + public function setParents(?array $parents): self + { + $this->initialized['parents'] = true; + $this->parents = $parents; + return $this; + } + /** + * Cache record type. + * + * @return string|null + */ + public function getType(): ?string + { + return $this->type; + } + /** + * Cache record type. + * + * @param string|null $type + * + * @return self + */ + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + return $this; + } + /** + * Description of the build-step that produced the build cache. + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + /** + * Description of the build-step that produced the build cache. + * + * @param string|null $description + * + * @return self + */ + public function setDescription(?string $description): self + { + $this->initialized['description'] = true; + $this->description = $description; + return $this; + } + /** + * Indicates if the build cache is in use. + * + * @return bool|null + */ + public function getInUse(): ?bool + { + return $this->inUse; + } + /** + * Indicates if the build cache is in use. + * + * @param bool|null $inUse + * + * @return self + */ + public function setInUse(?bool $inUse): self + { + $this->initialized['inUse'] = true; + $this->inUse = $inUse; + return $this; + } + /** + * Indicates if the build cache is shared. + * + * @return bool|null + */ + public function getShared(): ?bool + { + return $this->shared; + } + /** + * Indicates if the build cache is shared. + * + * @param bool|null $shared + * + * @return self + */ + public function setShared(?bool $shared): self + { + $this->initialized['shared'] = true; + $this->shared = $shared; + return $this; + } + /** + * Amount of disk space used by the build cache (in bytes). + * + * @return int|null + */ + public function getSize(): ?int + { + return $this->size; + } + /** + * Amount of disk space used by the build cache (in bytes). + * + * @param int|null $size + * + * @return self + */ + public function setSize(?int $size): self + { + $this->initialized['size'] = true; + $this->size = $size; + return $this; + } + /** + * Date and time at which the build cache was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @return string|null + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + /** + * Date and time at which the build cache was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @param string|null $createdAt + * + * @return self + */ + public function setCreatedAt(?string $createdAt): self + { + $this->initialized['createdAt'] = true; + $this->createdAt = $createdAt; + return $this; + } + /** + * Date and time at which the build cache was last used in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @return string|null + */ + public function getLastUsedAt(): ?string + { + return $this->lastUsedAt; + } + /** + * Date and time at which the build cache was last used in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @param string|null $lastUsedAt + * + * @return self + */ + public function setLastUsedAt(?string $lastUsedAt): self + { + $this->initialized['lastUsedAt'] = true; + $this->lastUsedAt = $lastUsedAt; + return $this; + } + /** + * + * + * @return int|null + */ + public function getUsageCount(): ?int + { + return $this->usageCount; + } + /** + * + * + * @param int|null $usageCount + * + * @return self + */ + public function setUsageCount(?int $usageCount): self + { + $this->initialized['usageCount'] = true; + $this->usageCount = $usageCount; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/BuildInfo.php b/generated/Model/BuildInfo.php index b14f6640..7201cbf2 100644 --- a/generated/Model/BuildInfo.php +++ b/generated/Model/BuildInfo.php @@ -5,171 +5,235 @@ class BuildInfo { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var string|null */ protected $id; /** - * @var string + * + * + * @var string|null */ protected $stream; /** - * @var string + * + * + * @var string|null */ protected $error; /** - * @var ErrorDetail + * + * + * @var ErrorDetail|null */ protected $errorDetail; /** - * @var string + * + * + * @var string|null */ protected $status; /** - * @var string + * + * + * @var string|null */ protected $progress; /** - * @var ProgressDetail + * + * + * @var ProgressDetail|null */ protected $progressDetail; - /** - * @return string + * Image ID or Digest + * + * @var ImageID|null + */ + protected $aux; + /** + * + * + * @return string|null */ - public function getId() + public function getId(): ?string { return $this->id; } - /** - * @param string $id + * + * + * @param string|null $id * * @return self */ - public function setId($id = null) + public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getStream() + public function getStream(): ?string { return $this->stream; } - /** - * @param string $stream + * + * + * @param string|null $stream * * @return self */ - public function setStream($stream = null) + public function setStream(?string $stream): self { + $this->initialized['stream'] = true; $this->stream = $stream; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getError() + public function getError(): ?string { return $this->error; } - /** - * @param string $error + * + * + * @param string|null $error * * @return self */ - public function setError($error = null) + public function setError(?string $error): self { + $this->initialized['error'] = true; $this->error = $error; - return $this; } - /** - * @return ErrorDetail + * + * + * @return ErrorDetail|null */ - public function getErrorDetail() + public function getErrorDetail(): ?ErrorDetail { return $this->errorDetail; } - /** - * @param ErrorDetail $errorDetail + * + * + * @param ErrorDetail|null $errorDetail * * @return self */ - public function setErrorDetail(?ErrorDetail $errorDetail = null) + public function setErrorDetail(?ErrorDetail $errorDetail): self { + $this->initialized['errorDetail'] = true; $this->errorDetail = $errorDetail; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getStatus() + public function getStatus(): ?string { return $this->status; } - /** - * @param string $status + * + * + * @param string|null $status * * @return self */ - public function setStatus($status = null) + public function setStatus(?string $status): self { + $this->initialized['status'] = true; $this->status = $status; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getProgress() + public function getProgress(): ?string { return $this->progress; } - /** - * @param string $progress + * + * + * @param string|null $progress * * @return self */ - public function setProgress($progress = null) + public function setProgress(?string $progress): self { + $this->initialized['progress'] = true; $this->progress = $progress; - return $this; } - /** - * @return ProgressDetail + * + * + * @return ProgressDetail|null */ - public function getProgressDetail() + public function getProgressDetail(): ?ProgressDetail { return $this->progressDetail; } - /** - * @param ProgressDetail $progressDetail + * + * + * @param ProgressDetail|null $progressDetail * * @return self */ - public function setProgressDetail(?ProgressDetail $progressDetail = null) + public function setProgressDetail(?ProgressDetail $progressDetail): self { + $this->initialized['progressDetail'] = true; $this->progressDetail = $progressDetail; - return $this; } -} + /** + * Image ID or Digest + * + * @return ImageID|null + */ + public function getAux(): ?ImageID + { + return $this->aux; + } + /** + * Image ID or Digest + * + * @param ImageID|null $aux + * + * @return self + */ + public function setAux(?ImageID $aux): self + { + $this->initialized['aux'] = true; + $this->aux = $aux; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/BuildPrunePostResponse200.php b/generated/Model/BuildPrunePostResponse200.php new file mode 100644 index 00000000..1f1600ed --- /dev/null +++ b/generated/Model/BuildPrunePostResponse200.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var list|null + */ + protected $cachesDeleted; + /** + * Disk space reclaimed in bytes + * + * @var int|null + */ + protected $spaceReclaimed; + /** + * + * + * @return list|null + */ + public function getCachesDeleted(): ?array + { + return $this->cachesDeleted; + } + /** + * + * + * @param list|null $cachesDeleted + * + * @return self + */ + public function setCachesDeleted(?array $cachesDeleted): self + { + $this->initialized['cachesDeleted'] = true; + $this->cachesDeleted = $cachesDeleted; + return $this; + } + /** + * Disk space reclaimed in bytes + * + * @return int|null + */ + public function getSpaceReclaimed(): ?int + { + return $this->spaceReclaimed; + } + /** + * Disk space reclaimed in bytes + * + * @param int|null $spaceReclaimed + * + * @return self + */ + public function setSpaceReclaimed(?int $spaceReclaimed): self + { + $this->initialized['spaceReclaimed'] = true; + $this->spaceReclaimed = $spaceReclaimed; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ClusterInfo.php b/generated/Model/ClusterInfo.php new file mode 100644 index 00000000..42be6fa6 --- /dev/null +++ b/generated/Model/ClusterInfo.php @@ -0,0 +1,364 @@ +initialized); + } + /** + * The ID of the swarm. + * + * @var string|null + */ + protected $iD; + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @var ObjectVersion|null + */ + protected $version; + /** + * Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @var string|null + */ + protected $createdAt; + /** + * Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @var string|null + */ + protected $updatedAt; + /** + * User modifiable swarm configuration. + * + * @var SwarmSpec|null + */ + protected $spec; + /** + * Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + + * + * @var TLSInfo|null + */ + protected $tLSInfo; + /** + * Whether there is currently a root CA rotation in progress for the swarm + * + * @var bool|null + */ + protected $rootRotationInProgress; + /** + * DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + + * + * @var int|null + */ + protected $dataPathPort = 4789; + /** + * Default Address Pool specifies default subnet pools for global scope + networks. + + * + * @var list|null + */ + protected $defaultAddrPool; + /** + * SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + + * + * @var int|null + */ + protected $subnetSize = 24; + /** + * The ID of the swarm. + * + * @return string|null + */ + public function getID(): ?string + { + return $this->iD; + } + /** + * The ID of the swarm. + * + * @param string|null $iD + * + * @return self + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @return ObjectVersion|null + */ + public function getVersion(): ?ObjectVersion + { + return $this->version; + } + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @param ObjectVersion|null $version + * + * @return self + */ + public function setVersion(?ObjectVersion $version): self + { + $this->initialized['version'] = true; + $this->version = $version; + return $this; + } + /** + * Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @return string|null + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + /** + * Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @param string|null $createdAt + * + * @return self + */ + public function setCreatedAt(?string $createdAt): self + { + $this->initialized['createdAt'] = true; + $this->createdAt = $createdAt; + return $this; + } + /** + * Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @return string|null + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + /** + * Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @param string|null $updatedAt + * + * @return self + */ + public function setUpdatedAt(?string $updatedAt): self + { + $this->initialized['updatedAt'] = true; + $this->updatedAt = $updatedAt; + return $this; + } + /** + * User modifiable swarm configuration. + * + * @return SwarmSpec|null + */ + public function getSpec(): ?SwarmSpec + { + return $this->spec; + } + /** + * User modifiable swarm configuration. + * + * @param SwarmSpec|null $spec + * + * @return self + */ + public function setSpec(?SwarmSpec $spec): self + { + $this->initialized['spec'] = true; + $this->spec = $spec; + return $this; + } + /** + * Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + + * + * @return TLSInfo|null + */ + public function getTLSInfo(): ?TLSInfo + { + return $this->tLSInfo; + } + /** + * Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + + * + * @param TLSInfo|null $tLSInfo + * + * @return self + */ + public function setTLSInfo(?TLSInfo $tLSInfo): self + { + $this->initialized['tLSInfo'] = true; + $this->tLSInfo = $tLSInfo; + return $this; + } + /** + * Whether there is currently a root CA rotation in progress for the swarm + * + * @return bool|null + */ + public function getRootRotationInProgress(): ?bool + { + return $this->rootRotationInProgress; + } + /** + * Whether there is currently a root CA rotation in progress for the swarm + * + * @param bool|null $rootRotationInProgress + * + * @return self + */ + public function setRootRotationInProgress(?bool $rootRotationInProgress): self + { + $this->initialized['rootRotationInProgress'] = true; + $this->rootRotationInProgress = $rootRotationInProgress; + return $this; + } + /** + * DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + + * + * @return int|null + */ + public function getDataPathPort(): ?int + { + return $this->dataPathPort; + } + /** + * DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + + * + * @param int|null $dataPathPort + * + * @return self + */ + public function setDataPathPort(?int $dataPathPort): self + { + $this->initialized['dataPathPort'] = true; + $this->dataPathPort = $dataPathPort; + return $this; + } + /** + * Default Address Pool specifies default subnet pools for global scope + networks. + + * + * @return list|null + */ + public function getDefaultAddrPool(): ?array + { + return $this->defaultAddrPool; + } + /** + * Default Address Pool specifies default subnet pools for global scope + networks. + + * + * @param list|null $defaultAddrPool + * + * @return self + */ + public function setDefaultAddrPool(?array $defaultAddrPool): self + { + $this->initialized['defaultAddrPool'] = true; + $this->defaultAddrPool = $defaultAddrPool; + return $this; + } + /** + * SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + + * + * @return int|null + */ + public function getSubnetSize(): ?int + { + return $this->subnetSize; + } + /** + * SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + + * + * @param int|null $subnetSize + * + * @return self + */ + public function setSubnetSize(?int $subnetSize): self + { + $this->initialized['subnetSize'] = true; + $this->subnetSize = $subnetSize; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ClusterVolume.php b/generated/Model/ClusterVolume.php new file mode 100644 index 00000000..77cf91c9 --- /dev/null +++ b/generated/Model/ClusterVolume.php @@ -0,0 +1,256 @@ +initialized); + } + /** + * The Swarm ID of this volume. Because cluster volumes are Swarm + objects, they have an ID, unlike non-cluster volumes. This ID can + be used to refer to the Volume instead of the name. + + * + * @var string|null + */ + protected $iD; + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @var ObjectVersion|null + */ + protected $version; + /** + * + * + * @var string|null + */ + protected $createdAt; + /** + * + * + * @var string|null + */ + protected $updatedAt; + /** + * Cluster-specific options used to create the volume. + * + * @var ClusterVolumeSpec|null + */ + protected $spec; + /** + * Information about the global status of the volume. + * + * @var ClusterVolumeInfo|null + */ + protected $info; + /** + * The status of the volume as it pertains to its publishing and use on + specific nodes + + * + * @var list|null + */ + protected $publishStatus; + /** + * The Swarm ID of this volume. Because cluster volumes are Swarm + objects, they have an ID, unlike non-cluster volumes. This ID can + be used to refer to the Volume instead of the name. + + * + * @return string|null + */ + public function getID(): ?string + { + return $this->iD; + } + /** + * The Swarm ID of this volume. Because cluster volumes are Swarm + objects, they have an ID, unlike non-cluster volumes. This ID can + be used to refer to the Volume instead of the name. + + * + * @param string|null $iD + * + * @return self + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @return ObjectVersion|null + */ + public function getVersion(): ?ObjectVersion + { + return $this->version; + } + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @param ObjectVersion|null $version + * + * @return self + */ + public function setVersion(?ObjectVersion $version): self + { + $this->initialized['version'] = true; + $this->version = $version; + return $this; + } + /** + * + * + * @return string|null + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + /** + * + * + * @param string|null $createdAt + * + * @return self + */ + public function setCreatedAt(?string $createdAt): self + { + $this->initialized['createdAt'] = true; + $this->createdAt = $createdAt; + return $this; + } + /** + * + * + * @return string|null + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + /** + * + * + * @param string|null $updatedAt + * + * @return self + */ + public function setUpdatedAt(?string $updatedAt): self + { + $this->initialized['updatedAt'] = true; + $this->updatedAt = $updatedAt; + return $this; + } + /** + * Cluster-specific options used to create the volume. + * + * @return ClusterVolumeSpec|null + */ + public function getSpec(): ?ClusterVolumeSpec + { + return $this->spec; + } + /** + * Cluster-specific options used to create the volume. + * + * @param ClusterVolumeSpec|null $spec + * + * @return self + */ + public function setSpec(?ClusterVolumeSpec $spec): self + { + $this->initialized['spec'] = true; + $this->spec = $spec; + return $this; + } + /** + * Information about the global status of the volume. + * + * @return ClusterVolumeInfo|null + */ + public function getInfo(): ?ClusterVolumeInfo + { + return $this->info; + } + /** + * Information about the global status of the volume. + * + * @param ClusterVolumeInfo|null $info + * + * @return self + */ + public function setInfo(?ClusterVolumeInfo $info): self + { + $this->initialized['info'] = true; + $this->info = $info; + return $this; + } + /** + * The status of the volume as it pertains to its publishing and use on + specific nodes + + * + * @return list|null + */ + public function getPublishStatus(): ?array + { + return $this->publishStatus; + } + /** + * The status of the volume as it pertains to its publishing and use on + specific nodes + + * + * @param list|null $publishStatus + * + * @return self + */ + public function setPublishStatus(?array $publishStatus): self + { + $this->initialized['publishStatus'] = true; + $this->publishStatus = $publishStatus; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ClusterVolumeInfo.php b/generated/Model/ClusterVolumeInfo.php new file mode 100644 index 00000000..daf58d94 --- /dev/null +++ b/generated/Model/ClusterVolumeInfo.php @@ -0,0 +1,154 @@ +initialized); + } + /** + * The capacity of the volume in bytes. A value of 0 indicates that + the capacity is unknown. + + * + * @var int|null + */ + protected $capacityBytes; + /** + * A map of strings to strings returned from the storage plugin when + the volume is created. + + * + * @var array|null + */ + protected $volumeContext; + /** + * The ID of the volume as returned by the CSI storage plugin. This + is distinct from the volume's ID as provided by Docker. This ID + is never used by the user when communicating with Docker to refer + to this volume. If the ID is blank, then the Volume has not been + successfully created in the plugin yet. + + * + * @var string|null + */ + protected $volumeID; + /** + * The topology this volume is actually accessible from. + * + * @var list>|null + */ + protected $accessibleTopology; + /** + * The capacity of the volume in bytes. A value of 0 indicates that + the capacity is unknown. + + * + * @return int|null + */ + public function getCapacityBytes(): ?int + { + return $this->capacityBytes; + } + /** + * The capacity of the volume in bytes. A value of 0 indicates that + the capacity is unknown. + + * + * @param int|null $capacityBytes + * + * @return self + */ + public function setCapacityBytes(?int $capacityBytes): self + { + $this->initialized['capacityBytes'] = true; + $this->capacityBytes = $capacityBytes; + return $this; + } + /** + * A map of strings to strings returned from the storage plugin when + the volume is created. + + * + * @return array|null + */ + public function getVolumeContext(): ?iterable + { + return $this->volumeContext; + } + /** + * A map of strings to strings returned from the storage plugin when + the volume is created. + + * + * @param array|null $volumeContext + * + * @return self + */ + public function setVolumeContext(?iterable $volumeContext): self + { + $this->initialized['volumeContext'] = true; + $this->volumeContext = $volumeContext; + return $this; + } + /** + * The ID of the volume as returned by the CSI storage plugin. This + is distinct from the volume's ID as provided by Docker. This ID + is never used by the user when communicating with Docker to refer + to this volume. If the ID is blank, then the Volume has not been + successfully created in the plugin yet. + + * + * @return string|null + */ + public function getVolumeID(): ?string + { + return $this->volumeID; + } + /** + * The ID of the volume as returned by the CSI storage plugin. This + is distinct from the volume's ID as provided by Docker. This ID + is never used by the user when communicating with Docker to refer + to this volume. If the ID is blank, then the Volume has not been + successfully created in the plugin yet. + + * + * @param string|null $volumeID + * + * @return self + */ + public function setVolumeID(?string $volumeID): self + { + $this->initialized['volumeID'] = true; + $this->volumeID = $volumeID; + return $this; + } + /** + * The topology this volume is actually accessible from. + * + * @return list>|null + */ + public function getAccessibleTopology(): ?array + { + return $this->accessibleTopology; + } + /** + * The topology this volume is actually accessible from. + * + * @param list>|null $accessibleTopology + * + * @return self + */ + public function setAccessibleTopology(?array $accessibleTopology): self + { + $this->initialized['accessibleTopology'] = true; + $this->accessibleTopology = $accessibleTopology; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ClusterVolumePublishStatusItem.php b/generated/Model/ClusterVolumePublishStatusItem.php new file mode 100644 index 00000000..e9ee69b2 --- /dev/null +++ b/generated/Model/ClusterVolumePublishStatusItem.php @@ -0,0 +1,120 @@ +initialized); + } + /** + * The ID of the Swarm node the volume is published on. + * + * @var string|null + */ + protected $nodeID; + /** + * The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + + * + * @var string|null + */ + protected $state; + /** + * A map of strings to strings returned by the CSI controller + plugin when a volume is published. + + * + * @var array|null + */ + protected $publishContext; + /** + * The ID of the Swarm node the volume is published on. + * + * @return string|null + */ + public function getNodeID(): ?string + { + return $this->nodeID; + } + /** + * The ID of the Swarm node the volume is published on. + * + * @param string|null $nodeID + * + * @return self + */ + public function setNodeID(?string $nodeID): self + { + $this->initialized['nodeID'] = true; + $this->nodeID = $nodeID; + return $this; + } + /** + * The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + + * + * @return string|null + */ + public function getState(): ?string + { + return $this->state; + } + /** + * The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + + * + * @param string|null $state + * + * @return self + */ + public function setState(?string $state): self + { + $this->initialized['state'] = true; + $this->state = $state; + return $this; + } + /** + * A map of strings to strings returned by the CSI controller + plugin when a volume is published. + + * + * @return array|null + */ + public function getPublishContext(): ?iterable + { + return $this->publishContext; + } + /** + * A map of strings to strings returned by the CSI controller + plugin when a volume is published. + + * + * @param array|null $publishContext + * + * @return self + */ + public function setPublishContext(?iterable $publishContext): self + { + $this->initialized['publishContext'] = true; + $this->publishContext = $publishContext; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ClusterVolumeSpec.php b/generated/Model/ClusterVolumeSpec.php new file mode 100644 index 00000000..af3d4a96 --- /dev/null +++ b/generated/Model/ClusterVolumeSpec.php @@ -0,0 +1,89 @@ +initialized); + } + /** + * Group defines the volume group of this volume. Volumes belonging to + the same group can be referred to by group name when creating + Services. Referring to a volume by group instructs Swarm to treat + volumes in that group interchangeably for the purpose of scheduling. + Volumes with an empty string for a group technically all belong to + the same, emptystring group. + + * + * @var string|null + */ + protected $group; + /** + * Defines how the volume is used by tasks. + * + * @var ClusterVolumeSpecAccessMode|null + */ + protected $accessMode; + /** + * Group defines the volume group of this volume. Volumes belonging to + the same group can be referred to by group name when creating + Services. Referring to a volume by group instructs Swarm to treat + volumes in that group interchangeably for the purpose of scheduling. + Volumes with an empty string for a group technically all belong to + the same, emptystring group. + + * + * @return string|null + */ + public function getGroup(): ?string + { + return $this->group; + } + /** + * Group defines the volume group of this volume. Volumes belonging to + the same group can be referred to by group name when creating + Services. Referring to a volume by group instructs Swarm to treat + volumes in that group interchangeably for the purpose of scheduling. + Volumes with an empty string for a group technically all belong to + the same, emptystring group. + + * + * @param string|null $group + * + * @return self + */ + public function setGroup(?string $group): self + { + $this->initialized['group'] = true; + $this->group = $group; + return $this; + } + /** + * Defines how the volume is used by tasks. + * + * @return ClusterVolumeSpecAccessMode|null + */ + public function getAccessMode(): ?ClusterVolumeSpecAccessMode + { + return $this->accessMode; + } + /** + * Defines how the volume is used by tasks. + * + * @param ClusterVolumeSpecAccessMode|null $accessMode + * + * @return self + */ + public function setAccessMode(?ClusterVolumeSpecAccessMode $accessMode): self + { + $this->initialized['accessMode'] = true; + $this->accessMode = $accessMode; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ClusterVolumeSpecAccessMode.php b/generated/Model/ClusterVolumeSpecAccessMode.php new file mode 100644 index 00000000..39436e7a --- /dev/null +++ b/generated/Model/ClusterVolumeSpecAccessMode.php @@ -0,0 +1,334 @@ +initialized); + } + /** + * The set of nodes this volume can be used on at one time. + - `single` The volume may only be scheduled to one node at a time. + - `multi` the volume may be scheduled to any supported number of nodes at a time. + + * + * @var string|null + */ + protected $scope = 'single'; + /** + * The number and way that different tasks can use this volume + at one time. + - `none` The volume may only be used by one task at a time. + - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + - `all` The volume may have any number of readers and writers. + + * + * @var string|null + */ + protected $sharing = 'none'; + /** + * Options for using this volume as a Mount-type volume. + + Either MountVolume or BlockVolume, but not both, must be + present. + properties: + FsType: + type: "string" + description: | + Specifies the filesystem type for the mount volume. + Optional. + MountFlags: + type: "array" + description: | + Flags to pass when mounting the volume. Optional. + items: + type: "string" + BlockVolume: + type: "object" + description: | + Options for using this volume as a Block-type volume. + Intentionally empty. + + * + * @var mixed|null + */ + protected $mountVolume; + /** + * Swarm Secrets that are passed to the CSI storage plugin when + operating on this volume. + + * + * @var list|null + */ + protected $secrets; + /** + * Requirements for the accessible topology of the volume. These + fields are optional. For an in-depth description of what these + fields mean, see the CSI specification. + + * + * @var ClusterVolumeSpecAccessModeAccessibilityRequirements|null + */ + protected $accessibilityRequirements; + /** + * The desired capacity that the volume should be created with. If + empty, the plugin will decide the capacity. + + * + * @var ClusterVolumeSpecAccessModeCapacityRange|null + */ + protected $capacityRange; + /** + * The availability of the volume for use in tasks. + - `active` The volume is fully available for scheduling on the cluster + - `pause` No new workloads should use the volume, but existing workloads are not stopped. + - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + + * + * @var string|null + */ + protected $availability = 'active'; + /** + * The set of nodes this volume can be used on at one time. + - `single` The volume may only be scheduled to one node at a time. + - `multi` the volume may be scheduled to any supported number of nodes at a time. + + * + * @return string|null + */ + public function getScope(): ?string + { + return $this->scope; + } + /** + * The set of nodes this volume can be used on at one time. + - `single` The volume may only be scheduled to one node at a time. + - `multi` the volume may be scheduled to any supported number of nodes at a time. + + * + * @param string|null $scope + * + * @return self + */ + public function setScope(?string $scope): self + { + $this->initialized['scope'] = true; + $this->scope = $scope; + return $this; + } + /** + * The number and way that different tasks can use this volume + at one time. + - `none` The volume may only be used by one task at a time. + - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + - `all` The volume may have any number of readers and writers. + + * + * @return string|null + */ + public function getSharing(): ?string + { + return $this->sharing; + } + /** + * The number and way that different tasks can use this volume + at one time. + - `none` The volume may only be used by one task at a time. + - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + - `all` The volume may have any number of readers and writers. + + * + * @param string|null $sharing + * + * @return self + */ + public function setSharing(?string $sharing): self + { + $this->initialized['sharing'] = true; + $this->sharing = $sharing; + return $this; + } + /** + * Options for using this volume as a Mount-type volume. + + Either MountVolume or BlockVolume, but not both, must be + present. + properties: + FsType: + type: "string" + description: | + Specifies the filesystem type for the mount volume. + Optional. + MountFlags: + type: "array" + description: | + Flags to pass when mounting the volume. Optional. + items: + type: "string" + BlockVolume: + type: "object" + description: | + Options for using this volume as a Block-type volume. + Intentionally empty. + + * + * @return mixed + */ + public function getMountVolume() + { + return $this->mountVolume; + } + /** + * Options for using this volume as a Mount-type volume. + + Either MountVolume or BlockVolume, but not both, must be + present. + properties: + FsType: + type: "string" + description: | + Specifies the filesystem type for the mount volume. + Optional. + MountFlags: + type: "array" + description: | + Flags to pass when mounting the volume. Optional. + items: + type: "string" + BlockVolume: + type: "object" + description: | + Options for using this volume as a Block-type volume. + Intentionally empty. + + * + * @param mixed $mountVolume + * + * @return self + */ + public function setMountVolume($mountVolume): self + { + $this->initialized['mountVolume'] = true; + $this->mountVolume = $mountVolume; + return $this; + } + /** + * Swarm Secrets that are passed to the CSI storage plugin when + operating on this volume. + + * + * @return list|null + */ + public function getSecrets(): ?array + { + return $this->secrets; + } + /** + * Swarm Secrets that are passed to the CSI storage plugin when + operating on this volume. + + * + * @param list|null $secrets + * + * @return self + */ + public function setSecrets(?array $secrets): self + { + $this->initialized['secrets'] = true; + $this->secrets = $secrets; + return $this; + } + /** + * Requirements for the accessible topology of the volume. These + fields are optional. For an in-depth description of what these + fields mean, see the CSI specification. + + * + * @return ClusterVolumeSpecAccessModeAccessibilityRequirements|null + */ + public function getAccessibilityRequirements(): ?ClusterVolumeSpecAccessModeAccessibilityRequirements + { + return $this->accessibilityRequirements; + } + /** + * Requirements for the accessible topology of the volume. These + fields are optional. For an in-depth description of what these + fields mean, see the CSI specification. + + * + * @param ClusterVolumeSpecAccessModeAccessibilityRequirements|null $accessibilityRequirements + * + * @return self + */ + public function setAccessibilityRequirements(?ClusterVolumeSpecAccessModeAccessibilityRequirements $accessibilityRequirements): self + { + $this->initialized['accessibilityRequirements'] = true; + $this->accessibilityRequirements = $accessibilityRequirements; + return $this; + } + /** + * The desired capacity that the volume should be created with. If + empty, the plugin will decide the capacity. + + * + * @return ClusterVolumeSpecAccessModeCapacityRange|null + */ + public function getCapacityRange(): ?ClusterVolumeSpecAccessModeCapacityRange + { + return $this->capacityRange; + } + /** + * The desired capacity that the volume should be created with. If + empty, the plugin will decide the capacity. + + * + * @param ClusterVolumeSpecAccessModeCapacityRange|null $capacityRange + * + * @return self + */ + public function setCapacityRange(?ClusterVolumeSpecAccessModeCapacityRange $capacityRange): self + { + $this->initialized['capacityRange'] = true; + $this->capacityRange = $capacityRange; + return $this; + } + /** + * The availability of the volume for use in tasks. + - `active` The volume is fully available for scheduling on the cluster + - `pause` No new workloads should use the volume, but existing workloads are not stopped. + - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + + * + * @return string|null + */ + public function getAvailability(): ?string + { + return $this->availability; + } + /** + * The availability of the volume for use in tasks. + - `active` The volume is fully available for scheduling on the cluster + - `pause` No new workloads should use the volume, but existing workloads are not stopped. + - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + + * + * @param string|null $availability + * + * @return self + */ + public function setAvailability(?string $availability): self + { + $this->initialized['availability'] = true; + $this->availability = $availability; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ClusterVolumeSpecAccessModeAccessibilityRequirements.php b/generated/Model/ClusterVolumeSpecAccessModeAccessibilityRequirements.php new file mode 100644 index 00000000..ad8f333a --- /dev/null +++ b/generated/Model/ClusterVolumeSpecAccessModeAccessibilityRequirements.php @@ -0,0 +1,83 @@ +initialized); + } + /** + * A list of required topologies, at least one of which the + volume must be accessible from. + + * + * @var list>|null + */ + protected $requisite; + /** + * A list of topologies that the volume should attempt to be + provisioned in. + + * + * @var list>|null + */ + protected $preferred; + /** + * A list of required topologies, at least one of which the + volume must be accessible from. + + * + * @return list>|null + */ + public function getRequisite(): ?array + { + return $this->requisite; + } + /** + * A list of required topologies, at least one of which the + volume must be accessible from. + + * + * @param list>|null $requisite + * + * @return self + */ + public function setRequisite(?array $requisite): self + { + $this->initialized['requisite'] = true; + $this->requisite = $requisite; + return $this; + } + /** + * A list of topologies that the volume should attempt to be + provisioned in. + + * + * @return list>|null + */ + public function getPreferred(): ?array + { + return $this->preferred; + } + /** + * A list of topologies that the volume should attempt to be + provisioned in. + + * + * @param list>|null $preferred + * + * @return self + */ + public function setPreferred(?array $preferred): self + { + $this->initialized['preferred'] = true; + $this->preferred = $preferred; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ClusterVolumeSpecAccessModeCapacityRange.php b/generated/Model/ClusterVolumeSpecAccessModeCapacityRange.php new file mode 100644 index 00000000..16728909 --- /dev/null +++ b/generated/Model/ClusterVolumeSpecAccessModeCapacityRange.php @@ -0,0 +1,83 @@ +initialized); + } + /** + * The volume must be at least this big. The value of 0 + indicates an unspecified minimum + + * + * @var int|null + */ + protected $requiredBytes; + /** + * The volume must not be bigger than this. The value of 0 + indicates an unspecified maximum. + + * + * @var int|null + */ + protected $limitBytes; + /** + * The volume must be at least this big. The value of 0 + indicates an unspecified minimum + + * + * @return int|null + */ + public function getRequiredBytes(): ?int + { + return $this->requiredBytes; + } + /** + * The volume must be at least this big. The value of 0 + indicates an unspecified minimum + + * + * @param int|null $requiredBytes + * + * @return self + */ + public function setRequiredBytes(?int $requiredBytes): self + { + $this->initialized['requiredBytes'] = true; + $this->requiredBytes = $requiredBytes; + return $this; + } + /** + * The volume must not be bigger than this. The value of 0 + indicates an unspecified maximum. + + * + * @return int|null + */ + public function getLimitBytes(): ?int + { + return $this->limitBytes; + } + /** + * The volume must not be bigger than this. The value of 0 + indicates an unspecified maximum. + + * + * @param int|null $limitBytes + * + * @return self + */ + public function setLimitBytes(?int $limitBytes): self + { + $this->initialized['limitBytes'] = true; + $this->limitBytes = $limitBytes; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ClusterVolumeSpecAccessModeSecretsItem.php b/generated/Model/ClusterVolumeSpecAccessModeSecretsItem.php new file mode 100644 index 00000000..cf7e23a6 --- /dev/null +++ b/generated/Model/ClusterVolumeSpecAccessModeSecretsItem.php @@ -0,0 +1,89 @@ +initialized); + } + /** + * Key is the name of the key of the key-value pair passed to + the plugin. + + * + * @var string|null + */ + protected $key; + /** + * Secret is the swarm Secret object from which to read data. + This can be a Secret name or ID. The Secret data is + retrieved by swarm and used as the value of the key-value + pair passed to the plugin. + + * + * @var string|null + */ + protected $secret; + /** + * Key is the name of the key of the key-value pair passed to + the plugin. + + * + * @return string|null + */ + public function getKey(): ?string + { + return $this->key; + } + /** + * Key is the name of the key of the key-value pair passed to + the plugin. + + * + * @param string|null $key + * + * @return self + */ + public function setKey(?string $key): self + { + $this->initialized['key'] = true; + $this->key = $key; + return $this; + } + /** + * Secret is the swarm Secret object from which to read data. + This can be a Secret name or ID. The Secret data is + retrieved by swarm and used as the value of the key-value + pair passed to the plugin. + + * + * @return string|null + */ + public function getSecret(): ?string + { + return $this->secret; + } + /** + * Secret is the swarm Secret object from which to read data. + This can be a Secret name or ID. The Secret data is + retrieved by swarm and used as the value of the key-value + pair passed to the plugin. + + * + * @param string|null $secret + * + * @return self + */ + public function setSecret(?string $secret): self + { + $this->initialized['secret'] = true; + $this->secret = $secret; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Commit.php b/generated/Model/Commit.php new file mode 100644 index 00000000..3fb16778 --- /dev/null +++ b/generated/Model/Commit.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * Actual commit ID of external tool. + * + * @var string|null + */ + protected $iD; + /** + * Commit ID of external tool expected by dockerd as set at build time. + * + * @var string|null + */ + protected $expected; + /** + * Actual commit ID of external tool. + * + * @return string|null + */ + public function getID(): ?string + { + return $this->iD; + } + /** + * Actual commit ID of external tool. + * + * @param string|null $iD + * + * @return self + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } + /** + * Commit ID of external tool expected by dockerd as set at build time. + * + * @return string|null + */ + public function getExpected(): ?string + { + return $this->expected; + } + /** + * Commit ID of external tool expected by dockerd as set at build time. + * + * @param string|null $expected + * + * @return self + */ + public function setExpected(?string $expected): self + { + $this->initialized['expected'] = true; + $this->expected = $expected; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/CommitResult.php b/generated/Model/CommitResult.php deleted file mode 100644 index fa699937..00000000 --- a/generated/Model/CommitResult.php +++ /dev/null @@ -1,31 +0,0 @@ -id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId($id = null) - { - $this->id = $id; - - return $this; - } -} diff --git a/generated/Model/Config.php b/generated/Model/Config.php new file mode 100644 index 00000000..a7808ac9 --- /dev/null +++ b/generated/Model/Config.php @@ -0,0 +1,185 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $iD; + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @var ObjectVersion|null + */ + protected $version; + /** + * + * + * @var string|null + */ + protected $createdAt; + /** + * + * + * @var string|null + */ + protected $updatedAt; + /** + * + * + * @var ConfigSpec|null + */ + protected $spec; + /** + * + * + * @return string|null + */ + public function getID(): ?string + { + return $this->iD; + } + /** + * + * + * @param string|null $iD + * + * @return self + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @return ObjectVersion|null + */ + public function getVersion(): ?ObjectVersion + { + return $this->version; + } + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @param ObjectVersion|null $version + * + * @return self + */ + public function setVersion(?ObjectVersion $version): self + { + $this->initialized['version'] = true; + $this->version = $version; + return $this; + } + /** + * + * + * @return string|null + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + /** + * + * + * @param string|null $createdAt + * + * @return self + */ + public function setCreatedAt(?string $createdAt): self + { + $this->initialized['createdAt'] = true; + $this->createdAt = $createdAt; + return $this; + } + /** + * + * + * @return string|null + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + /** + * + * + * @param string|null $updatedAt + * + * @return self + */ + public function setUpdatedAt(?string $updatedAt): self + { + $this->initialized['updatedAt'] = true; + $this->updatedAt = $updatedAt; + return $this; + } + /** + * + * + * @return ConfigSpec|null + */ + public function getSpec(): ?ConfigSpec + { + return $this->spec; + } + /** + * + * + * @param ConfigSpec|null $spec + * + * @return self + */ + public function setSpec(?ConfigSpec $spec): self + { + $this->initialized['spec'] = true; + $this->spec = $spec; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ConfigReference.php b/generated/Model/ConfigReference.php new file mode 100644 index 00000000..030f2f51 --- /dev/null +++ b/generated/Model/ConfigReference.php @@ -0,0 +1,52 @@ +initialized); + } + /** + * The name of the config-only network that provides the network's + configuration. The specified network must be an existing config-only + network. Only network names are allowed, not network IDs. + + * + * @var string|null + */ + protected $network; + /** + * The name of the config-only network that provides the network's + configuration. The specified network must be an existing config-only + network. Only network names are allowed, not network IDs. + + * + * @return string|null + */ + public function getNetwork(): ?string + { + return $this->network; + } + /** + * The name of the config-only network that provides the network's + configuration. The specified network must be an existing config-only + network. Only network names are allowed, not network IDs. + + * + * @param string|null $network + * + * @return self + */ + public function setNetwork(?string $network): self + { + $this->initialized['network'] = true; + $this->network = $network; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ConfigSpec.php b/generated/Model/ConfigSpec.php new file mode 100644 index 00000000..d25a76ec --- /dev/null +++ b/generated/Model/ConfigSpec.php @@ -0,0 +1,133 @@ +initialized); + } + /** + * User-defined name of the config. + * + * @var string|null + */ + protected $name; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + config data. + + * + * @var string|null + */ + protected $data; + /** + * Driver represents a driver (network, logging, secrets). + * + * @var Driver|null + */ + protected $templating; + /** + * User-defined name of the config. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * User-defined name of the config. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + config data. + + * + * @return string|null + */ + public function getData(): ?string + { + return $this->data; + } + /** + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + config data. + + * + * @param string|null $data + * + * @return self + */ + public function setData(?string $data): self + { + $this->initialized['data'] = true; + $this->data = $data; + return $this; + } + /** + * Driver represents a driver (network, logging, secrets). + * + * @return Driver|null + */ + public function getTemplating(): ?Driver + { + return $this->templating; + } + /** + * Driver represents a driver (network, logging, secrets). + * + * @param Driver|null $templating + * + * @return self + */ + public function setTemplating(?Driver $templating): self + { + $this->initialized['templating'] = true; + $this->templating = $templating; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ConfigsCreatePostBody.php b/generated/Model/ConfigsCreatePostBody.php new file mode 100644 index 00000000..a3d513a2 --- /dev/null +++ b/generated/Model/ConfigsCreatePostBody.php @@ -0,0 +1,133 @@ +initialized); + } + /** + * User-defined name of the config. + * + * @var string|null + */ + protected $name; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + config data. + + * + * @var string|null + */ + protected $data; + /** + * Driver represents a driver (network, logging, secrets). + * + * @var Driver|null + */ + protected $templating; + /** + * User-defined name of the config. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * User-defined name of the config. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + config data. + + * + * @return string|null + */ + public function getData(): ?string + { + return $this->data; + } + /** + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + config data. + + * + * @param string|null $data + * + * @return self + */ + public function setData(?string $data): self + { + $this->initialized['data'] = true; + $this->data = $data; + return $this; + } + /** + * Driver represents a driver (network, logging, secrets). + * + * @return Driver|null + */ + public function getTemplating(): ?Driver + { + return $this->templating; + } + /** + * Driver represents a driver (network, logging, secrets). + * + * @param Driver|null $templating + * + * @return self + */ + public function setTemplating(?Driver $templating): self + { + $this->initialized['templating'] = true; + $this->templating = $templating; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Container.php b/generated/Model/Container.php deleted file mode 100644 index aeb6a67e..00000000 --- a/generated/Model/Container.php +++ /dev/null @@ -1,535 +0,0 @@ -appArmorProfile; - } - - /** - * @param string $appArmorProfile - * - * @return self - */ - public function setAppArmorProfile($appArmorProfile = null) - { - $this->appArmorProfile = $appArmorProfile; - - return $this; - } - - /** - * @return string[]|null - */ - public function getArgs() - { - return $this->args; - } - - /** - * @param string[]|null $args - * - * @return self - */ - public function setArgs($args = null) - { - $this->args = $args; - - return $this; - } - - /** - * @return ContainerConfig - */ - public function getConfig() - { - return $this->config; - } - - /** - * @param ContainerConfig $config - * - * @return self - */ - public function setConfig(?ContainerConfig $config = null) - { - $this->config = $config; - - return $this; - } - - /** - * @return string - */ - public function getCreated() - { - return $this->created; - } - - /** - * @param string $created - * - * @return self - */ - public function setCreated($created = null) - { - $this->created = $created; - - return $this; - } - - /** - * @return string - */ - public function getDriver() - { - return $this->driver; - } - - /** - * @param string $driver - * - * @return self - */ - public function setDriver($driver = null) - { - $this->driver = $driver; - - return $this; - } - - /** - * @return string - */ - public function getExecDriver() - { - return $this->execDriver; - } - - /** - * @param string $execDriver - * - * @return self - */ - public function setExecDriver($execDriver = null) - { - $this->execDriver = $execDriver; - - return $this; - } - - /** - * @return string - */ - public function getExecIDs() - { - return $this->execIDs; - } - - /** - * @param string $execIDs - * - * @return self - */ - public function setExecIDs($execIDs = null) - { - $this->execIDs = $execIDs; - - return $this; - } - - /** - * @return HostConfig - */ - public function getHostConfig() - { - return $this->hostConfig; - } - - /** - * @param HostConfig $hostConfig - * - * @return self - */ - public function setHostConfig(?HostConfig $hostConfig = null) - { - $this->hostConfig = $hostConfig; - - return $this; - } - - /** - * @return string - */ - public function getHostnamePath() - { - return $this->hostnamePath; - } - - /** - * @param string $hostnamePath - * - * @return self - */ - public function setHostnamePath($hostnamePath = null) - { - $this->hostnamePath = $hostnamePath; - - return $this; - } - - /** - * @return string - */ - public function getHostsPath() - { - return $this->hostsPath; - } - - /** - * @param string $hostsPath - * - * @return self - */ - public function setHostsPath($hostsPath = null) - { - $this->hostsPath = $hostsPath; - - return $this; - } - - /** - * @return string - */ - public function getLogPath() - { - return $this->logPath; - } - - /** - * @param string $logPath - * - * @return self - */ - public function setLogPath($logPath = null) - { - $this->logPath = $logPath; - - return $this; - } - - /** - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId($id = null) - { - $this->id = $id; - - return $this; - } - - /** - * @return string - */ - public function getImage() - { - return $this->image; - } - - /** - * @param string $image - * - * @return self - */ - public function setImage($image = null) - { - $this->image = $image; - - return $this; - } - - /** - * @return string - */ - public function getMountLabel() - { - return $this->mountLabel; - } - - /** - * @param string $mountLabel - * - * @return self - */ - public function setMountLabel($mountLabel = null) - { - $this->mountLabel = $mountLabel; - - return $this; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } - - /** - * @return NetworkConfig - */ - public function getNetworkSettings() - { - return $this->networkSettings; - } - - /** - * @param NetworkConfig $networkSettings - * - * @return self - */ - public function setNetworkSettings(?NetworkConfig $networkSettings = null) - { - $this->networkSettings = $networkSettings; - - return $this; - } - - /** - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * @param string $path - * - * @return self - */ - public function setPath($path = null) - { - $this->path = $path; - - return $this; - } - - /** - * @return string - */ - public function getProcessLabel() - { - return $this->processLabel; - } - - /** - * @param string $processLabel - * - * @return self - */ - public function setProcessLabel($processLabel = null) - { - $this->processLabel = $processLabel; - - return $this; - } - - /** - * @return string - */ - public function getResolvConfPath() - { - return $this->resolvConfPath; - } - - /** - * @param string $resolvConfPath - * - * @return self - */ - public function setResolvConfPath($resolvConfPath = null) - { - $this->resolvConfPath = $resolvConfPath; - - return $this; - } - - /** - * @return int - */ - public function getRestartCount() - { - return $this->restartCount; - } - - /** - * @param int $restartCount - * - * @return self - */ - public function setRestartCount($restartCount = null) - { - $this->restartCount = $restartCount; - - return $this; - } - - /** - * @return ContainerState - */ - public function getState() - { - return $this->state; - } - - /** - * @param ContainerState $state - * - * @return self - */ - public function setState(?ContainerState $state = null) - { - $this->state = $state; - - return $this; - } - - /** - * @return Mount[]|null - */ - public function getMounts() - { - return $this->mounts; - } - - /** - * @param Mount[]|null $mounts - * - * @return self - */ - public function setMounts($mounts = null) - { - $this->mounts = $mounts; - - return $this; - } -} diff --git a/generated/Model/ContainerChange.php b/generated/Model/ContainerChange.php deleted file mode 100644 index 0756004b..00000000 --- a/generated/Model/ContainerChange.php +++ /dev/null @@ -1,55 +0,0 @@ -path; - } - - /** - * @param string $path - * - * @return self - */ - public function setPath($path = null) - { - $this->path = $path; - - return $this; - } - - /** - * @return int - */ - public function getKind() - { - return $this->kind; - } - - /** - * @param int $kind - * - * @return self - */ - public function setKind($kind = null) - { - $this->kind = $kind; - - return $this; - } -} diff --git a/generated/Model/ContainerConfig.php b/generated/Model/ContainerConfig.php index f8710408..2471c2ed 100644 --- a/generated/Model/ContainerConfig.php +++ b/generated/Model/ContainerConfig.php @@ -5,531 +5,765 @@ class ContainerConfig { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * The hostname to use for the container, as a valid RFC 1123 hostname. + * + * @var string|null */ protected $hostname; /** - * @var string + * The domain name to use for the container. + * + * @var string|null */ protected $domainname; /** - * @var string + * The user that commands are run as inside the container. + * + * @var string|null */ protected $user; /** - * @var bool + * Whether to attach to `stdin`. + * + * @var bool|null */ - protected $attachStdin; + protected $attachStdin = false; /** - * @var bool + * Whether to attach to `stdout`. + * + * @var bool|null */ - protected $attachStdout; + protected $attachStdout = true; /** - * @var bool + * Whether to attach to `stderr`. + * + * @var bool|null */ - protected $attachStderr; + protected $attachStderr = true; /** - * @var bool - */ - protected $tty; + * An object mapping ports to an empty object in the form: + + `{"/": {}}` + + * + * @var array|null + */ + protected $exposedPorts; /** - * @var bool + * Attach standard streams to a TTY, including `stdin` if it is not closed. + * + * @var bool|null */ - protected $openStdin; + protected $tty = false; /** - * @var bool + * Open `stdin` + * + * @var bool|null */ - protected $stdinOnce; + protected $openStdin = false; /** - * @var string[]|null + * Close `stdin` after one attached client disconnects + * + * @var bool|null */ + protected $stdinOnce = false; + /** + * A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + + * + * @var list|null + */ protected $env; /** - * @var string[]|string + * Command to run specified as a string or an array of strings. + * + * @var list|null */ protected $cmd; /** - * @var string[]|string + * A test to perform to check that the container is healthy. + * + * @var HealthConfig|null */ - protected $entrypoint; + protected $healthcheck; /** - * @var string + * Command is already escaped (Windows only) + * + * @var bool|null */ - protected $image; + protected $argsEscaped = false; /** - * @var string[]|null - */ - protected $labels; + * The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + + * + * @var string|null + */ + protected $image; /** - * @var mixed[]|null - */ + * An object mapping mount point paths inside the container to empty + objects. + + * + * @var array|null + */ protected $volumes; /** - * @var string + * The working directory for commands to run in. + * + * @var string|null */ protected $workingDir; /** - * @var bool + * The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + + * + * @var list|null + */ + protected $entrypoint; + /** + * Disable networking for the container. + * + * @var bool|null */ protected $networkDisabled; /** - * @var string - */ + * MAC address of the container. + + Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. + + * + * @var string|null + */ protected $macAddress; /** - * @var mixed[]|null + * `ONBUILD` metadata that were defined in the image's `Dockerfile`. + * + * @var list|null + */ + protected $onBuild; + /** + * User-defined key/value metadata. + * + * @var array|null */ - protected $exposedPorts; + protected $labels; /** - * @var string + * Signal to stop a container as a string or unsigned integer. + * + * @var string|null */ protected $stopSignal; /** - * @var HostConfig + * Timeout to stop a container in seconds. + * + * @var int|null */ - protected $hostConfig; + protected $stopTimeout = 10; /** - * @var NetworkingConfig + * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + * + * @var list|null */ - protected $networkingConfig; - + protected $shell; /** - * @return string + * The hostname to use for the container, as a valid RFC 1123 hostname. + * + * @return string|null */ - public function getHostname() + public function getHostname(): ?string { return $this->hostname; } - /** - * @param string $hostname + * The hostname to use for the container, as a valid RFC 1123 hostname. + * + * @param string|null $hostname * * @return self */ - public function setHostname($hostname = null) + public function setHostname(?string $hostname): self { + $this->initialized['hostname'] = true; $this->hostname = $hostname; - return $this; } - /** - * @return string + * The domain name to use for the container. + * + * @return string|null */ - public function getDomainname() + public function getDomainname(): ?string { return $this->domainname; } - /** - * @param string $domainname + * The domain name to use for the container. + * + * @param string|null $domainname * * @return self */ - public function setDomainname($domainname = null) + public function setDomainname(?string $domainname): self { + $this->initialized['domainname'] = true; $this->domainname = $domainname; - return $this; } - /** - * @return string + * The user that commands are run as inside the container. + * + * @return string|null */ - public function getUser() + public function getUser(): ?string { return $this->user; } - /** - * @param string $user + * The user that commands are run as inside the container. + * + * @param string|null $user * * @return self */ - public function setUser($user = null) + public function setUser(?string $user): self { + $this->initialized['user'] = true; $this->user = $user; - return $this; } - /** - * @return bool + * Whether to attach to `stdin`. + * + * @return bool|null */ - public function getAttachStdin() + public function getAttachStdin(): ?bool { return $this->attachStdin; } - /** - * @param bool $attachStdin + * Whether to attach to `stdin`. + * + * @param bool|null $attachStdin * * @return self */ - public function setAttachStdin($attachStdin = null) + public function setAttachStdin(?bool $attachStdin): self { + $this->initialized['attachStdin'] = true; $this->attachStdin = $attachStdin; - return $this; } - /** - * @return bool + * Whether to attach to `stdout`. + * + * @return bool|null */ - public function getAttachStdout() + public function getAttachStdout(): ?bool { return $this->attachStdout; } - /** - * @param bool $attachStdout + * Whether to attach to `stdout`. + * + * @param bool|null $attachStdout * * @return self */ - public function setAttachStdout($attachStdout = null) + public function setAttachStdout(?bool $attachStdout): self { + $this->initialized['attachStdout'] = true; $this->attachStdout = $attachStdout; - return $this; } - /** - * @return bool + * Whether to attach to `stderr`. + * + * @return bool|null */ - public function getAttachStderr() + public function getAttachStderr(): ?bool { return $this->attachStderr; } - /** - * @param bool $attachStderr + * Whether to attach to `stderr`. + * + * @param bool|null $attachStderr * * @return self */ - public function setAttachStderr($attachStderr = null) + public function setAttachStderr(?bool $attachStderr): self { + $this->initialized['attachStderr'] = true; $this->attachStderr = $attachStderr; - return $this; } - /** - * @return bool + * An object mapping ports to an empty object in the form: + + `{"/": {}}` + + * + * @return array|null + */ + public function getExposedPorts(): ?iterable + { + return $this->exposedPorts; + } + /** + * An object mapping ports to an empty object in the form: + + `{"/": {}}` + + * + * @param array|null $exposedPorts + * + * @return self + */ + public function setExposedPorts(?iterable $exposedPorts): self + { + $this->initialized['exposedPorts'] = true; + $this->exposedPorts = $exposedPorts; + return $this; + } + /** + * Attach standard streams to a TTY, including `stdin` if it is not closed. + * + * @return bool|null */ - public function getTty() + public function getTty(): ?bool { return $this->tty; } - /** - * @param bool $tty + * Attach standard streams to a TTY, including `stdin` if it is not closed. + * + * @param bool|null $tty * * @return self */ - public function setTty($tty = null) + public function setTty(?bool $tty): self { + $this->initialized['tty'] = true; $this->tty = $tty; - return $this; } - /** - * @return bool + * Open `stdin` + * + * @return bool|null */ - public function getOpenStdin() + public function getOpenStdin(): ?bool { return $this->openStdin; } - /** - * @param bool $openStdin + * Open `stdin` + * + * @param bool|null $openStdin * * @return self */ - public function setOpenStdin($openStdin = null) + public function setOpenStdin(?bool $openStdin): self { + $this->initialized['openStdin'] = true; $this->openStdin = $openStdin; - return $this; } - /** - * @return bool + * Close `stdin` after one attached client disconnects + * + * @return bool|null */ - public function getStdinOnce() + public function getStdinOnce(): ?bool { return $this->stdinOnce; } - /** - * @param bool $stdinOnce + * Close `stdin` after one attached client disconnects + * + * @param bool|null $stdinOnce * * @return self */ - public function setStdinOnce($stdinOnce = null) + public function setStdinOnce(?bool $stdinOnce): self { + $this->initialized['stdinOnce'] = true; $this->stdinOnce = $stdinOnce; - return $this; } - /** - * @return string[]|null - */ - public function getEnv() + * A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + + * + * @return list|null + */ + public function getEnv(): ?array { return $this->env; } - /** - * @param string[]|null $env - * - * @return self - */ - public function setEnv($env = null) + * A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + + * + * @param list|null $env + * + * @return self + */ + public function setEnv(?array $env): self { + $this->initialized['env'] = true; $this->env = $env; - return $this; } - /** - * @return string[]|string + * Command to run specified as a string or an array of strings. + * + * @return list|null */ - public function getCmd() + public function getCmd(): ?array { return $this->cmd; } - /** - * @param string[]|string $cmd + * Command to run specified as a string or an array of strings. + * + * @param list|null $cmd * * @return self */ - public function setCmd($cmd = null) + public function setCmd(?array $cmd): self { + $this->initialized['cmd'] = true; $this->cmd = $cmd; - return $this; } - /** - * @return string[]|string + * A test to perform to check that the container is healthy. + * + * @return HealthConfig|null */ - public function getEntrypoint() + public function getHealthcheck(): ?HealthConfig { - return $this->entrypoint; + return $this->healthcheck; } - /** - * @param string[]|string $entrypoint + * A test to perform to check that the container is healthy. + * + * @param HealthConfig|null $healthcheck * * @return self */ - public function setEntrypoint($entrypoint = null) + public function setHealthcheck(?HealthConfig $healthcheck): self { - $this->entrypoint = $entrypoint; - + $this->initialized['healthcheck'] = true; + $this->healthcheck = $healthcheck; return $this; } - /** - * @return string + * Command is already escaped (Windows only) + * + * @return bool|null */ - public function getImage() + public function getArgsEscaped(): ?bool { - return $this->image; + return $this->argsEscaped; } - /** - * @param string $image + * Command is already escaped (Windows only) + * + * @param bool|null $argsEscaped * * @return self */ - public function setImage($image = null) + public function setArgsEscaped(?bool $argsEscaped): self { - $this->image = $image; - + $this->initialized['argsEscaped'] = true; + $this->argsEscaped = $argsEscaped; return $this; } - /** - * @return string[]|null - */ - public function getLabels() + * The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + + * + * @return string|null + */ + public function getImage(): ?string { - return $this->labels; + return $this->image; } - /** - * @param string[]|null $labels - * - * @return self - */ - public function setLabels($labels = null) + * The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + + * + * @param string|null $image + * + * @return self + */ + public function setImage(?string $image): self { - $this->labels = $labels; - + $this->initialized['image'] = true; + $this->image = $image; return $this; } - /** - * @return mixed[]|null - */ - public function getVolumes() + * An object mapping mount point paths inside the container to empty + objects. + + * + * @return array|null + */ + public function getVolumes(): ?iterable { return $this->volumes; } - /** - * @param mixed[]|null $volumes - * - * @return self - */ - public function setVolumes($volumes = null) + * An object mapping mount point paths inside the container to empty + objects. + + * + * @param array|null $volumes + * + * @return self + */ + public function setVolumes(?iterable $volumes): self { + $this->initialized['volumes'] = true; $this->volumes = $volumes; - return $this; } - /** - * @return string + * The working directory for commands to run in. + * + * @return string|null */ - public function getWorkingDir() + public function getWorkingDir(): ?string { return $this->workingDir; } - /** - * @param string $workingDir + * The working directory for commands to run in. + * + * @param string|null $workingDir * * @return self */ - public function setWorkingDir($workingDir = null) + public function setWorkingDir(?string $workingDir): self { + $this->initialized['workingDir'] = true; $this->workingDir = $workingDir; - return $this; } - /** - * @return bool + * The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + + * + * @return list|null + */ + public function getEntrypoint(): ?array + { + return $this->entrypoint; + } + /** + * The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + + * + * @param list|null $entrypoint + * + * @return self + */ + public function setEntrypoint(?array $entrypoint): self + { + $this->initialized['entrypoint'] = true; + $this->entrypoint = $entrypoint; + return $this; + } + /** + * Disable networking for the container. + * + * @return bool|null */ - public function getNetworkDisabled() + public function getNetworkDisabled(): ?bool { return $this->networkDisabled; } - /** - * @param bool $networkDisabled + * Disable networking for the container. + * + * @param bool|null $networkDisabled * * @return self */ - public function setNetworkDisabled($networkDisabled = null) + public function setNetworkDisabled(?bool $networkDisabled): self { + $this->initialized['networkDisabled'] = true; $this->networkDisabled = $networkDisabled; - return $this; } - /** - * @return string - */ - public function getMacAddress() + * MAC address of the container. + + Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. + + * + * @return string|null + */ + public function getMacAddress(): ?string { return $this->macAddress; } - /** - * @param string $macAddress + * MAC address of the container. + + Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. + + * + * @param string|null $macAddress + * + * @return self + */ + public function setMacAddress(?string $macAddress): self + { + $this->initialized['macAddress'] = true; + $this->macAddress = $macAddress; + return $this; + } + /** + * `ONBUILD` metadata that were defined in the image's `Dockerfile`. + * + * @return list|null + */ + public function getOnBuild(): ?array + { + return $this->onBuild; + } + /** + * `ONBUILD` metadata that were defined in the image's `Dockerfile`. + * + * @param list|null $onBuild * * @return self */ - public function setMacAddress($macAddress = null) + public function setOnBuild(?array $onBuild): self { - $this->macAddress = $macAddress; - + $this->initialized['onBuild'] = true; + $this->onBuild = $onBuild; return $this; } - /** - * @return mixed[]|null + * User-defined key/value metadata. + * + * @return array|null */ - public function getExposedPorts() + public function getLabels(): ?iterable { - return $this->exposedPorts; + return $this->labels; } - /** - * @param mixed[]|null $exposedPorts + * User-defined key/value metadata. + * + * @param array|null $labels * * @return self */ - public function setExposedPorts($exposedPorts = null) + public function setLabels(?iterable $labels): self { - $this->exposedPorts = $exposedPorts; - + $this->initialized['labels'] = true; + $this->labels = $labels; return $this; } - /** - * @return string + * Signal to stop a container as a string or unsigned integer. + * + * @return string|null */ - public function getStopSignal() + public function getStopSignal(): ?string { return $this->stopSignal; } - /** - * @param string $stopSignal + * Signal to stop a container as a string or unsigned integer. + * + * @param string|null $stopSignal * * @return self */ - public function setStopSignal($stopSignal = null) + public function setStopSignal(?string $stopSignal): self { + $this->initialized['stopSignal'] = true; $this->stopSignal = $stopSignal; - return $this; } - /** - * @return HostConfig + * Timeout to stop a container in seconds. + * + * @return int|null */ - public function getHostConfig() + public function getStopTimeout(): ?int { - return $this->hostConfig; + return $this->stopTimeout; } - /** - * @param HostConfig $hostConfig + * Timeout to stop a container in seconds. + * + * @param int|null $stopTimeout * * @return self */ - public function setHostConfig(?HostConfig $hostConfig = null) + public function setStopTimeout(?int $stopTimeout): self { - $this->hostConfig = $hostConfig; - + $this->initialized['stopTimeout'] = true; + $this->stopTimeout = $stopTimeout; return $this; } - /** - * @return NetworkingConfig + * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + * + * @return list|null */ - public function getNetworkingConfig() + public function getShell(): ?array { - return $this->networkingConfig; + return $this->shell; } - /** - * @param NetworkingConfig $networkingConfig + * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + * + * @param list|null $shell * * @return self */ - public function setNetworkingConfig(?NetworkingConfig $networkingConfig = null) + public function setShell(?array $shell): self { - $this->networkingConfig = $networkingConfig; - + $this->initialized['shell'] = true; + $this->shell = $shell; return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/ContainerConnect.php b/generated/Model/ContainerConnect.php deleted file mode 100644 index aee79143..00000000 --- a/generated/Model/ContainerConnect.php +++ /dev/null @@ -1,55 +0,0 @@ -container; - } - - /** - * @param string $container - * - * @return self - */ - public function setContainer($container = null) - { - $this->container = $container; - - return $this; - } - - /** - * @return EndpointConfig[] - */ - public function getEndpointConfig() - { - return $this->endpointConfig; - } - - /** - * @param EndpointConfig[] $endpointConfig - * - * @return self - */ - public function setEndpointConfig(?\ArrayObject $endpointConfig = null) - { - $this->endpointConfig = $endpointConfig; - - return $this; - } -} diff --git a/generated/Model/ContainerCreateResponse.php b/generated/Model/ContainerCreateResponse.php new file mode 100644 index 00000000..94d1b22a --- /dev/null +++ b/generated/Model/ContainerCreateResponse.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * The ID of the created container + * + * @var string|null + */ + protected $id; + /** + * Warnings encountered when creating the container + * + * @var list|null + */ + protected $warnings; + /** + * The ID of the created container + * + * @return string|null + */ + public function getId(): ?string + { + return $this->id; + } + /** + * The ID of the created container + * + * @param string|null $id + * + * @return self + */ + public function setId(?string $id): self + { + $this->initialized['id'] = true; + $this->id = $id; + return $this; + } + /** + * Warnings encountered when creating the container + * + * @return list|null + */ + public function getWarnings(): ?array + { + return $this->warnings; + } + /** + * Warnings encountered when creating the container + * + * @param list|null $warnings + * + * @return self + */ + public function setWarnings(?array $warnings): self + { + $this->initialized['warnings'] = true; + $this->warnings = $warnings; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainerCreateResult.php b/generated/Model/ContainerCreateResult.php deleted file mode 100644 index c3fb9a05..00000000 --- a/generated/Model/ContainerCreateResult.php +++ /dev/null @@ -1,55 +0,0 @@ -id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId($id = null) - { - $this->id = $id; - - return $this; - } - - /** - * @return string[]|null - */ - public function getWarnings() - { - return $this->warnings; - } - - /** - * @param string[]|null $warnings - * - * @return self - */ - public function setWarnings($warnings = null) - { - $this->warnings = $warnings; - - return $this; - } -} diff --git a/generated/Model/ContainerDisconnect.php b/generated/Model/ContainerDisconnect.php deleted file mode 100644 index 3a857e28..00000000 --- a/generated/Model/ContainerDisconnect.php +++ /dev/null @@ -1,55 +0,0 @@ -container; - } - - /** - * @param string $container - * - * @return self - */ - public function setContainer($container = null) - { - $this->container = $container; - - return $this; - } - - /** - * @return bool - */ - public function getForce() - { - return $this->force; - } - - /** - * @param bool $force - * - * @return self - */ - public function setForce($force = null) - { - $this->force = $force; - - return $this; - } -} diff --git a/generated/Model/ContainerInfo.php b/generated/Model/ContainerInfo.php deleted file mode 100644 index 001eac17..00000000 --- a/generated/Model/ContainerInfo.php +++ /dev/null @@ -1,391 +0,0 @@ -id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId($id = null) - { - $this->id = $id; - - return $this; - } - - /** - * @return string[]|null - */ - public function getNames() - { - return $this->names; - } - - /** - * @param string[]|null $names - * - * @return self - */ - public function setNames($names = null) - { - $this->names = $names; - - return $this; - } - - /** - * @return string - */ - public function getImage() - { - return $this->image; - } - - /** - * @param string $image - * - * @return self - */ - public function setImage($image = null) - { - $this->image = $image; - - return $this; - } - - /** - * @return string - */ - public function getImageID() - { - return $this->imageID; - } - - /** - * @param string $imageID - * - * @return self - */ - public function setImageID($imageID = null) - { - $this->imageID = $imageID; - - return $this; - } - - /** - * @return string - */ - public function getCommand() - { - return $this->command; - } - - /** - * @param string $command - * - * @return self - */ - public function setCommand($command = null) - { - $this->command = $command; - - return $this; - } - - /** - * @return int - */ - public function getCreated() - { - return $this->created; - } - - /** - * @param int $created - * - * @return self - */ - public function setCreated($created = null) - { - $this->created = $created; - - return $this; - } - - /** - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * @param string $state - * - * @return self - */ - public function setState($state = null) - { - $this->state = $state; - - return $this; - } - - /** - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * @param string $status - * - * @return self - */ - public function setStatus($status = null) - { - $this->status = $status; - - return $this; - } - - /** - * @return Port[]|null - */ - public function getPorts() - { - return $this->ports; - } - - /** - * @param Port[]|null $ports - * - * @return self - */ - public function setPorts($ports = null) - { - $this->ports = $ports; - - return $this; - } - - /** - * @return string[]|null - */ - public function getLabels() - { - return $this->labels; - } - - /** - * @param string[]|null $labels - * - * @return self - */ - public function setLabels($labels = null) - { - $this->labels = $labels; - - return $this; - } - - /** - * @return int - */ - public function getSizeRw() - { - return $this->sizeRw; - } - - /** - * @param int $sizeRw - * - * @return self - */ - public function setSizeRw($sizeRw = null) - { - $this->sizeRw = $sizeRw; - - return $this; - } - - /** - * @return int - */ - public function getSizeRootFs() - { - return $this->sizeRootFs; - } - - /** - * @param int $sizeRootFs - * - * @return self - */ - public function setSizeRootFs($sizeRootFs = null) - { - $this->sizeRootFs = $sizeRootFs; - - return $this; - } - - /** - * @return HostConfig - */ - public function getHostConfig() - { - return $this->hostConfig; - } - - /** - * @param HostConfig $hostConfig - * - * @return self - */ - public function setHostConfig(?HostConfig $hostConfig = null) - { - $this->hostConfig = $hostConfig; - - return $this; - } - - /** - * @return NetworkConfig - */ - public function getNetworkSettings() - { - return $this->networkSettings; - } - - /** - * @param NetworkConfig $networkSettings - * - * @return self - */ - public function setNetworkSettings(?NetworkConfig $networkSettings = null) - { - $this->networkSettings = $networkSettings; - - return $this; - } - - /** - * @return Mount[]|null - */ - public function getMounts() - { - return $this->mounts; - } - - /** - * @param Mount[]|null $mounts - * - * @return self - */ - public function setMounts($mounts = null) - { - $this->mounts = $mounts; - - return $this; - } - - /** - * @return ContainerNode - */ - public function getNode() - { - return $this->node; - } - - /** - * @param ContainerNode $node - * - * @return self - */ - public function setNode(?ContainerNode $node = null) - { - $this->node = $node; - - return $this; - } -} diff --git a/generated/Model/ContainerNetwork.php b/generated/Model/ContainerNetwork.php deleted file mode 100644 index 905c95c5..00000000 --- a/generated/Model/ContainerNetwork.php +++ /dev/null @@ -1,223 +0,0 @@ -networkID; - } - - /** - * @param string $networkID - * - * @return self - */ - public function setNetworkID($networkID = null) - { - $this->networkID = $networkID; - - return $this; - } - - /** - * @return string - */ - public function getEndpointID() - { - return $this->endpointID; - } - - /** - * @param string $endpointID - * - * @return self - */ - public function setEndpointID($endpointID = null) - { - $this->endpointID = $endpointID; - - return $this; - } - - /** - * @return string - */ - public function getGateway() - { - return $this->gateway; - } - - /** - * @param string $gateway - * - * @return self - */ - public function setGateway($gateway = null) - { - $this->gateway = $gateway; - - return $this; - } - - /** - * @return string - */ - public function getIPAddress() - { - return $this->iPAddress; - } - - /** - * @param string $iPAddress - * - * @return self - */ - public function setIPAddress($iPAddress = null) - { - $this->iPAddress = $iPAddress; - - return $this; - } - - /** - * @return int - */ - public function getIPPrefixLen() - { - return $this->iPPrefixLen; - } - - /** - * @param int $iPPrefixLen - * - * @return self - */ - public function setIPPrefixLen($iPPrefixLen = null) - { - $this->iPPrefixLen = $iPPrefixLen; - - return $this; - } - - /** - * @return string - */ - public function getIPv6Gateway() - { - return $this->iPv6Gateway; - } - - /** - * @param string $iPv6Gateway - * - * @return self - */ - public function setIPv6Gateway($iPv6Gateway = null) - { - $this->iPv6Gateway = $iPv6Gateway; - - return $this; - } - - /** - * @return string - */ - public function getGlobalIPv6Address() - { - return $this->globalIPv6Address; - } - - /** - * @param string $globalIPv6Address - * - * @return self - */ - public function setGlobalIPv6Address($globalIPv6Address = null) - { - $this->globalIPv6Address = $globalIPv6Address; - - return $this; - } - - /** - * @return int - */ - public function getGlobalIPv6PrefixLen() - { - return $this->globalIPv6PrefixLen; - } - - /** - * @param int $globalIPv6PrefixLen - * - * @return self - */ - public function setGlobalIPv6PrefixLen($globalIPv6PrefixLen = null) - { - $this->globalIPv6PrefixLen = $globalIPv6PrefixLen; - - return $this; - } - - /** - * @return string - */ - public function getMacAddress() - { - return $this->macAddress; - } - - /** - * @param string $macAddress - * - * @return self - */ - public function setMacAddress($macAddress = null) - { - $this->macAddress = $macAddress; - - return $this; - } -} diff --git a/generated/Model/ContainerNode.php b/generated/Model/ContainerNode.php deleted file mode 100644 index ce9398d7..00000000 --- a/generated/Model/ContainerNode.php +++ /dev/null @@ -1,103 +0,0 @@ -id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId($id = null) - { - $this->id = $id; - - return $this; - } - - /** - * @return string - */ - public function getIp() - { - return $this->ip; - } - - /** - * @param string $ip - * - * @return self - */ - public function setIp($ip = null) - { - $this->ip = $ip; - - return $this; - } - - /** - * @return string - */ - public function getAddr() - { - return $this->addr; - } - - /** - * @param string $addr - * - * @return self - */ - public function setAddr($addr = null) - { - $this->addr = $addr; - - return $this; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } -} diff --git a/generated/Model/ContainerSpec.php b/generated/Model/ContainerSpec.php deleted file mode 100644 index b9fe015e..00000000 --- a/generated/Model/ContainerSpec.php +++ /dev/null @@ -1,223 +0,0 @@ -image; - } - - /** - * @param string $image - * - * @return self - */ - public function setImage($image = null) - { - $this->image = $image; - - return $this; - } - - /** - * @return string[]|null - */ - public function getLabels() - { - return $this->labels; - } - - /** - * @param string[]|null $labels - * - * @return self - */ - public function setLabels($labels = null) - { - $this->labels = $labels; - - return $this; - } - - /** - * @return string[]|null - */ - public function getCommand() - { - return $this->command; - } - - /** - * @param string[]|null $command - * - * @return self - */ - public function setCommand($command = null) - { - $this->command = $command; - - return $this; - } - - /** - * @return string[]|null - */ - public function getArgs() - { - return $this->args; - } - - /** - * @param string[]|null $args - * - * @return self - */ - public function setArgs($args = null) - { - $this->args = $args; - - return $this; - } - - /** - * @return string[]|null - */ - public function getEnv() - { - return $this->env; - } - - /** - * @param string[]|null $env - * - * @return self - */ - public function setEnv($env = null) - { - $this->env = $env; - - return $this; - } - - /** - * @return string - */ - public function getDir() - { - return $this->dir; - } - - /** - * @param string $dir - * - * @return self - */ - public function setDir($dir = null) - { - $this->dir = $dir; - - return $this; - } - - /** - * @return string - */ - public function getUser() - { - return $this->user; - } - - /** - * @param string $user - * - * @return self - */ - public function setUser($user = null) - { - $this->user = $user; - - return $this; - } - - /** - * @return ContainerSpecMount[]|null - */ - public function getMounts() - { - return $this->mounts; - } - - /** - * @param ContainerSpecMount[]|null $mounts - * - * @return self - */ - public function setMounts($mounts = null) - { - $this->mounts = $mounts; - - return $this; - } - - /** - * @return int - */ - public function getStopGracePeriod() - { - return $this->stopGracePeriod; - } - - /** - * @param int $stopGracePeriod - * - * @return self - */ - public function setStopGracePeriod($stopGracePeriod = null) - { - $this->stopGracePeriod = $stopGracePeriod; - - return $this; - } -} diff --git a/generated/Model/ContainerSpecMount.php b/generated/Model/ContainerSpecMount.php deleted file mode 100644 index 24568eb9..00000000 --- a/generated/Model/ContainerSpecMount.php +++ /dev/null @@ -1,151 +0,0 @@ -type; - } - - /** - * @param string $type - * - * @return self - */ - public function setType($type = null) - { - $this->type = $type; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->source; - } - - /** - * @param string $source - * - * @return self - */ - public function setSource($source = null) - { - $this->source = $source; - - return $this; - } - - /** - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * @param string $target - * - * @return self - */ - public function setTarget($target = null) - { - $this->target = $target; - - return $this; - } - - /** - * @return bool - */ - public function getReadOnly() - { - return $this->readOnly; - } - - /** - * @param bool $readOnly - * - * @return self - */ - public function setReadOnly($readOnly = null) - { - $this->readOnly = $readOnly; - - return $this; - } - - /** - * @return ContainerSpecMountBindOptions - */ - public function getBindOptions() - { - return $this->bindOptions; - } - - /** - * @param ContainerSpecMountBindOptions $bindOptions - * - * @return self - */ - public function setBindOptions(?ContainerSpecMountBindOptions $bindOptions = null) - { - $this->bindOptions = $bindOptions; - - return $this; - } - - /** - * @return ContainerSpecMountVolumeOptions - */ - public function getVolumeOptions() - { - return $this->volumeOptions; - } - - /** - * @param ContainerSpecMountVolumeOptions $volumeOptions - * - * @return self - */ - public function setVolumeOptions(?ContainerSpecMountVolumeOptions $volumeOptions = null) - { - $this->volumeOptions = $volumeOptions; - - return $this; - } -} diff --git a/generated/Model/ContainerSpecMountBindOptions.php b/generated/Model/ContainerSpecMountBindOptions.php deleted file mode 100644 index 4256dddb..00000000 --- a/generated/Model/ContainerSpecMountBindOptions.php +++ /dev/null @@ -1,31 +0,0 @@ -propagation; - } - - /** - * @param string $propagation - * - * @return self - */ - public function setPropagation($propagation = null) - { - $this->propagation = $propagation; - - return $this; - } -} diff --git a/generated/Model/ContainerSpecMountVolumeOptions.php b/generated/Model/ContainerSpecMountVolumeOptions.php deleted file mode 100644 index 72e7f0d3..00000000 --- a/generated/Model/ContainerSpecMountVolumeOptions.php +++ /dev/null @@ -1,79 +0,0 @@ -noCopy; - } - - /** - * @param bool $noCopy - * - * @return self - */ - public function setNoCopy($noCopy = null) - { - $this->noCopy = $noCopy; - - return $this; - } - - /** - * @return string[]|null - */ - public function getLabels() - { - return $this->labels; - } - - /** - * @param string[]|null $labels - * - * @return self - */ - public function setLabels($labels = null) - { - $this->labels = $labels; - - return $this; - } - - /** - * @return Driver - */ - public function getDriverConfig() - { - return $this->driverConfig; - } - - /** - * @param Driver $driverConfig - * - * @return self - */ - public function setDriverConfig(?Driver $driverConfig = null) - { - $this->driverConfig = $driverConfig; - - return $this; - } -} diff --git a/generated/Model/ContainerState.php b/generated/Model/ContainerState.php index e5231591..4ea6c325 100644 --- a/generated/Model/ContainerState.php +++ b/generated/Model/ContainerState.php @@ -5,219 +5,389 @@ class ContainerState { /** - * @var string + * @var array */ - protected $error; + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } /** - * @var int - */ - protected $exitCode; + * String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + + * + * @var string|null + */ + protected $status; /** - * @var string + * Whether this container is running. + + Note that a running container can be _paused_. The `Running` and `Paused` + booleans are not mutually exclusive: + + When pausing a container (on Linux), the freezer cgroup is used to suspend + all processes in the container. Freezing the process requires the process to + be running. As a result, paused containers are both `Running` _and_ `Paused`. + + Use the `Status` field instead to determine if a container's state is "running". + + * + * @var bool|null + */ + protected $running; + /** + * Whether this container is paused. + * + * @var bool|null */ - protected $finishedAt; + protected $paused; /** - * @var bool + * Whether this container is restarting. + * + * @var bool|null */ + protected $restarting; + /** + * Whether a process within this container has been killed because it ran + out of memory since the container was last started. + + * + * @var bool|null + */ protected $oOMKilled; /** - * @var bool + * + * + * @var bool|null */ - protected $paused; + protected $dead; /** - * @var int + * The process ID of this container + * + * @var int|null */ protected $pid; /** - * @var bool + * The last exit code of this container + * + * @var int|null */ - protected $restarting; + protected $exitCode; /** - * @var bool + * + * + * @var string|null */ - protected $running; + protected $error; /** - * @var string + * The time when this container was last started. + * + * @var string|null */ protected $startedAt; - /** - * @return string + * The time when this container last exited. + * + * @var string|null + */ + protected $finishedAt; + /** + * Health stores information about the container's healthcheck results. + * + * @var Health|null */ - public function getError() + protected $health; + /** + * String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + + * + * @return string|null + */ + public function getStatus(): ?string { - return $this->error; + return $this->status; + } + /** + * String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + + * + * @param string|null $status + * + * @return self + */ + public function setStatus(?string $status): self + { + $this->initialized['status'] = true; + $this->status = $status; + return $this; } - /** - * @param string $error + * Whether this container is running. + + Note that a running container can be _paused_. The `Running` and `Paused` + booleans are not mutually exclusive: + + When pausing a container (on Linux), the freezer cgroup is used to suspend + all processes in the container. Freezing the process requires the process to + be running. As a result, paused containers are both `Running` _and_ `Paused`. + + Use the `Status` field instead to determine if a container's state is "running". + + * + * @return bool|null + */ + public function getRunning(): ?bool + { + return $this->running; + } + /** + * Whether this container is running. + + Note that a running container can be _paused_. The `Running` and `Paused` + booleans are not mutually exclusive: + + When pausing a container (on Linux), the freezer cgroup is used to suspend + all processes in the container. Freezing the process requires the process to + be running. As a result, paused containers are both `Running` _and_ `Paused`. + + Use the `Status` field instead to determine if a container's state is "running". + + * + * @param bool|null $running + * + * @return self + */ + public function setRunning(?bool $running): self + { + $this->initialized['running'] = true; + $this->running = $running; + return $this; + } + /** + * Whether this container is paused. + * + * @return bool|null + */ + public function getPaused(): ?bool + { + return $this->paused; + } + /** + * Whether this container is paused. + * + * @param bool|null $paused * * @return self */ - public function setError($error = null) + public function setPaused(?bool $paused): self { - $this->error = $error; - + $this->initialized['paused'] = true; + $this->paused = $paused; return $this; } - /** - * @return int + * Whether this container is restarting. + * + * @return bool|null */ - public function getExitCode() + public function getRestarting(): ?bool { - return $this->exitCode; + return $this->restarting; } - /** - * @param int $exitCode + * Whether this container is restarting. + * + * @param bool|null $restarting * * @return self */ - public function setExitCode($exitCode = null) + public function setRestarting(?bool $restarting): self { - $this->exitCode = $exitCode; - + $this->initialized['restarting'] = true; + $this->restarting = $restarting; return $this; } - /** - * @return string + * Whether a process within this container has been killed because it ran + out of memory since the container was last started. + + * + * @return bool|null + */ + public function getOOMKilled(): ?bool + { + return $this->oOMKilled; + } + /** + * Whether a process within this container has been killed because it ran + out of memory since the container was last started. + + * + * @param bool|null $oOMKilled + * + * @return self + */ + public function setOOMKilled(?bool $oOMKilled): self + { + $this->initialized['oOMKilled'] = true; + $this->oOMKilled = $oOMKilled; + return $this; + } + /** + * + * + * @return bool|null */ - public function getFinishedAt() + public function getDead(): ?bool { - return $this->finishedAt; + return $this->dead; } - /** - * @param string $finishedAt + * + * + * @param bool|null $dead * * @return self */ - public function setFinishedAt($finishedAt = null) + public function setDead(?bool $dead): self { - $this->finishedAt = $finishedAt; - + $this->initialized['dead'] = true; + $this->dead = $dead; return $this; } - /** - * @return bool + * The process ID of this container + * + * @return int|null */ - public function getOOMKilled() + public function getPid(): ?int { - return $this->oOMKilled; + return $this->pid; } - /** - * @param bool $oOMKilled + * The process ID of this container + * + * @param int|null $pid * * @return self */ - public function setOOMKilled($oOMKilled = null) + public function setPid(?int $pid): self { - $this->oOMKilled = $oOMKilled; - + $this->initialized['pid'] = true; + $this->pid = $pid; return $this; } - /** - * @return bool + * The last exit code of this container + * + * @return int|null */ - public function getPaused() + public function getExitCode(): ?int { - return $this->paused; + return $this->exitCode; } - /** - * @param bool $paused + * The last exit code of this container + * + * @param int|null $exitCode * * @return self */ - public function setPaused($paused = null) + public function setExitCode(?int $exitCode): self { - $this->paused = $paused; - + $this->initialized['exitCode'] = true; + $this->exitCode = $exitCode; return $this; } - /** - * @return int + * + * + * @return string|null */ - public function getPid() + public function getError(): ?string { - return $this->pid; + return $this->error; } - /** - * @param int $pid + * + * + * @param string|null $error * * @return self */ - public function setPid($pid = null) + public function setError(?string $error): self { - $this->pid = $pid; - + $this->initialized['error'] = true; + $this->error = $error; return $this; } - /** - * @return bool + * The time when this container was last started. + * + * @return string|null */ - public function getRestarting() + public function getStartedAt(): ?string { - return $this->restarting; + return $this->startedAt; } - /** - * @param bool $restarting + * The time when this container was last started. + * + * @param string|null $startedAt * * @return self */ - public function setRestarting($restarting = null) + public function setStartedAt(?string $startedAt): self { - $this->restarting = $restarting; - + $this->initialized['startedAt'] = true; + $this->startedAt = $startedAt; return $this; } - /** - * @return bool + * The time when this container last exited. + * + * @return string|null */ - public function getRunning() + public function getFinishedAt(): ?string { - return $this->running; + return $this->finishedAt; } - /** - * @param bool $running + * The time when this container last exited. + * + * @param string|null $finishedAt * * @return self */ - public function setRunning($running = null) + public function setFinishedAt(?string $finishedAt): self { - $this->running = $running; - + $this->initialized['finishedAt'] = true; + $this->finishedAt = $finishedAt; return $this; } - /** - * @return string + * Health stores information about the container's healthcheck results. + * + * @return Health|null */ - public function getStartedAt() + public function getHealth(): ?Health { - return $this->startedAt; + return $this->health; } - /** - * @param string $startedAt + * Health stores information about the container's healthcheck results. + * + * @param Health|null $health * * @return self */ - public function setStartedAt($startedAt = null) + public function setHealth(?Health $health): self { - $this->startedAt = $startedAt; - + $this->initialized['health'] = true; + $this->health = $health; return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/ContainerStatus.php b/generated/Model/ContainerStatus.php index 05c529f1..2af76a75 100644 --- a/generated/Model/ContainerStatus.php +++ b/generated/Model/ContainerStatus.php @@ -5,75 +5,95 @@ class ContainerStatus { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var string|null */ protected $containerID; /** - * @var int + * + * + * @var int|null */ protected $pID; /** - * @var int + * + * + * @var int|null */ protected $exitCode; - /** - * @return string + * + * + * @return string|null */ - public function getContainerID() + public function getContainerID(): ?string { return $this->containerID; } - /** - * @param string $containerID + * + * + * @param string|null $containerID * * @return self */ - public function setContainerID($containerID = null) + public function setContainerID(?string $containerID): self { + $this->initialized['containerID'] = true; $this->containerID = $containerID; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getPID() + public function getPID(): ?int { return $this->pID; } - /** - * @param int $pID + * + * + * @param int|null $pID * * @return self */ - public function setPID($pID = null) + public function setPID(?int $pID): self { + $this->initialized['pID'] = true; $this->pID = $pID; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getExitCode() + public function getExitCode(): ?int { return $this->exitCode; } - /** - * @param int $exitCode + * + * + * @param int|null $exitCode * * @return self */ - public function setExitCode($exitCode = null) + public function setExitCode(?int $exitCode): self { + $this->initialized['exitCode'] = true; $this->exitCode = $exitCode; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/ContainerSummary.php b/generated/Model/ContainerSummary.php new file mode 100644 index 00000000..4b76d8df --- /dev/null +++ b/generated/Model/ContainerSummary.php @@ -0,0 +1,435 @@ +initialized); + } + /** + * The ID of this container + * + * @var string|null + */ + protected $id; + /** + * The names that this container has been given + * + * @var list|null + */ + protected $names; + /** + * The name of the image used when creating this container + * + * @var string|null + */ + protected $image; + /** + * The ID of the image that this container was created from + * + * @var string|null + */ + protected $imageID; + /** + * Command to run when starting the container + * + * @var string|null + */ + protected $command; + /** + * When the container was created + * + * @var int|null + */ + protected $created; + /** + * The ports exposed by this container + * + * @var list|null + */ + protected $ports; + /** + * The size of files that have been created or changed by this container + * + * @var int|null + */ + protected $sizeRw; + /** + * The total size of all the files in this container + * + * @var int|null + */ + protected $sizeRootFs; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * The state of this container (e.g. `Exited`) + * + * @var string|null + */ + protected $state; + /** + * Additional human-readable status of this container (e.g. `Exit 0`) + * + * @var string|null + */ + protected $status; + /** + * + * + * @var ContainerSummaryHostConfig|null + */ + protected $hostConfig; + /** + * A summary of the container's network settings + * + * @var ContainerSummaryNetworkSettings|null + */ + protected $networkSettings; + /** + * + * + * @var list|null + */ + protected $mounts; + /** + * The ID of this container + * + * @return string|null + */ + public function getId(): ?string + { + return $this->id; + } + /** + * The ID of this container + * + * @param string|null $id + * + * @return self + */ + public function setId(?string $id): self + { + $this->initialized['id'] = true; + $this->id = $id; + return $this; + } + /** + * The names that this container has been given + * + * @return list|null + */ + public function getNames(): ?array + { + return $this->names; + } + /** + * The names that this container has been given + * + * @param list|null $names + * + * @return self + */ + public function setNames(?array $names): self + { + $this->initialized['names'] = true; + $this->names = $names; + return $this; + } + /** + * The name of the image used when creating this container + * + * @return string|null + */ + public function getImage(): ?string + { + return $this->image; + } + /** + * The name of the image used when creating this container + * + * @param string|null $image + * + * @return self + */ + public function setImage(?string $image): self + { + $this->initialized['image'] = true; + $this->image = $image; + return $this; + } + /** + * The ID of the image that this container was created from + * + * @return string|null + */ + public function getImageID(): ?string + { + return $this->imageID; + } + /** + * The ID of the image that this container was created from + * + * @param string|null $imageID + * + * @return self + */ + public function setImageID(?string $imageID): self + { + $this->initialized['imageID'] = true; + $this->imageID = $imageID; + return $this; + } + /** + * Command to run when starting the container + * + * @return string|null + */ + public function getCommand(): ?string + { + return $this->command; + } + /** + * Command to run when starting the container + * + * @param string|null $command + * + * @return self + */ + public function setCommand(?string $command): self + { + $this->initialized['command'] = true; + $this->command = $command; + return $this; + } + /** + * When the container was created + * + * @return int|null + */ + public function getCreated(): ?int + { + return $this->created; + } + /** + * When the container was created + * + * @param int|null $created + * + * @return self + */ + public function setCreated(?int $created): self + { + $this->initialized['created'] = true; + $this->created = $created; + return $this; + } + /** + * The ports exposed by this container + * + * @return list|null + */ + public function getPorts(): ?array + { + return $this->ports; + } + /** + * The ports exposed by this container + * + * @param list|null $ports + * + * @return self + */ + public function setPorts(?array $ports): self + { + $this->initialized['ports'] = true; + $this->ports = $ports; + return $this; + } + /** + * The size of files that have been created or changed by this container + * + * @return int|null + */ + public function getSizeRw(): ?int + { + return $this->sizeRw; + } + /** + * The size of files that have been created or changed by this container + * + * @param int|null $sizeRw + * + * @return self + */ + public function setSizeRw(?int $sizeRw): self + { + $this->initialized['sizeRw'] = true; + $this->sizeRw = $sizeRw; + return $this; + } + /** + * The total size of all the files in this container + * + * @return int|null + */ + public function getSizeRootFs(): ?int + { + return $this->sizeRootFs; + } + /** + * The total size of all the files in this container + * + * @param int|null $sizeRootFs + * + * @return self + */ + public function setSizeRootFs(?int $sizeRootFs): self + { + $this->initialized['sizeRootFs'] = true; + $this->sizeRootFs = $sizeRootFs; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * The state of this container (e.g. `Exited`) + * + * @return string|null + */ + public function getState(): ?string + { + return $this->state; + } + /** + * The state of this container (e.g. `Exited`) + * + * @param string|null $state + * + * @return self + */ + public function setState(?string $state): self + { + $this->initialized['state'] = true; + $this->state = $state; + return $this; + } + /** + * Additional human-readable status of this container (e.g. `Exit 0`) + * + * @return string|null + */ + public function getStatus(): ?string + { + return $this->status; + } + /** + * Additional human-readable status of this container (e.g. `Exit 0`) + * + * @param string|null $status + * + * @return self + */ + public function setStatus(?string $status): self + { + $this->initialized['status'] = true; + $this->status = $status; + return $this; + } + /** + * + * + * @return ContainerSummaryHostConfig|null + */ + public function getHostConfig(): ?ContainerSummaryHostConfig + { + return $this->hostConfig; + } + /** + * + * + * @param ContainerSummaryHostConfig|null $hostConfig + * + * @return self + */ + public function setHostConfig(?ContainerSummaryHostConfig $hostConfig): self + { + $this->initialized['hostConfig'] = true; + $this->hostConfig = $hostConfig; + return $this; + } + /** + * A summary of the container's network settings + * + * @return ContainerSummaryNetworkSettings|null + */ + public function getNetworkSettings(): ?ContainerSummaryNetworkSettings + { + return $this->networkSettings; + } + /** + * A summary of the container's network settings + * + * @param ContainerSummaryNetworkSettings|null $networkSettings + * + * @return self + */ + public function setNetworkSettings(?ContainerSummaryNetworkSettings $networkSettings): self + { + $this->initialized['networkSettings'] = true; + $this->networkSettings = $networkSettings; + return $this; + } + /** + * + * + * @return list|null + */ + public function getMounts(): ?array + { + return $this->mounts; + } + /** + * + * + * @param list|null $mounts + * + * @return self + */ + public function setMounts(?array $mounts): self + { + $this->initialized['mounts'] = true; + $this->mounts = $mounts; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainerSummaryHostConfig.php b/generated/Model/ContainerSummaryHostConfig.php new file mode 100644 index 00000000..cbc7b0c3 --- /dev/null +++ b/generated/Model/ContainerSummaryHostConfig.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $networkMode; + /** + * Arbitrary key-value metadata attached to container + * + * @var array|null + */ + protected $annotations; + /** + * + * + * @return string|null + */ + public function getNetworkMode(): ?string + { + return $this->networkMode; + } + /** + * + * + * @param string|null $networkMode + * + * @return self + */ + public function setNetworkMode(?string $networkMode): self + { + $this->initialized['networkMode'] = true; + $this->networkMode = $networkMode; + return $this; + } + /** + * Arbitrary key-value metadata attached to container + * + * @return array|null + */ + public function getAnnotations(): ?iterable + { + return $this->annotations; + } + /** + * Arbitrary key-value metadata attached to container + * + * @param array|null $annotations + * + * @return self + */ + public function setAnnotations(?iterable $annotations): self + { + $this->initialized['annotations'] = true; + $this->annotations = $annotations; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainerSummaryNetworkSettings.php b/generated/Model/ContainerSummaryNetworkSettings.php new file mode 100644 index 00000000..b08c11d9 --- /dev/null +++ b/generated/Model/ContainerSummaryNetworkSettings.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * + * + * @var array|null + */ + protected $networks; + /** + * + * + * @return array|null + */ + public function getNetworks(): ?iterable + { + return $this->networks; + } + /** + * + * + * @param array|null $networks + * + * @return self + */ + public function setNetworks(?iterable $networks): self + { + $this->initialized['networks'] = true; + $this->networks = $networks; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainerTop.php b/generated/Model/ContainerTop.php deleted file mode 100644 index 2f3482f4..00000000 --- a/generated/Model/ContainerTop.php +++ /dev/null @@ -1,55 +0,0 @@ -titles; - } - - /** - * @param string[]|null $titles - * - * @return self - */ - public function setTitles($titles = null) - { - $this->titles = $titles; - - return $this; - } - - /** - * @return string[][]|null[]|null - */ - public function getProcesses() - { - return $this->processes; - } - - /** - * @param string[][]|null[]|null $processes - * - * @return self - */ - public function setProcesses($processes = null) - { - $this->processes = $processes; - - return $this; - } -} diff --git a/generated/Model/ContainerUpdateResult.php b/generated/Model/ContainerUpdateResult.php deleted file mode 100644 index f95bc308..00000000 --- a/generated/Model/ContainerUpdateResult.php +++ /dev/null @@ -1,31 +0,0 @@ -warnings; - } - - /** - * @param string[]|null $warnings - * - * @return self - */ - public function setWarnings($warnings = null) - { - $this->warnings = $warnings; - - return $this; - } -} diff --git a/generated/Model/ContainerWait.php b/generated/Model/ContainerWait.php deleted file mode 100644 index aa9a19b1..00000000 --- a/generated/Model/ContainerWait.php +++ /dev/null @@ -1,31 +0,0 @@ -statusCode; - } - - /** - * @param int $statusCode - * - * @return self - */ - public function setStatusCode($statusCode = null) - { - $this->statusCode = $statusCode; - - return $this; - } -} diff --git a/generated/Model/ContainerWaitExitError.php b/generated/Model/ContainerWaitExitError.php new file mode 100644 index 00000000..212a552c --- /dev/null +++ b/generated/Model/ContainerWaitExitError.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * Details of an error + * + * @var string|null + */ + protected $message; + /** + * Details of an error + * + * @return string|null + */ + public function getMessage(): ?string + { + return $this->message; + } + /** + * Details of an error + * + * @param string|null $message + * + * @return self + */ + public function setMessage(?string $message): self + { + $this->initialized['message'] = true; + $this->message = $message; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainerWaitResponse.php b/generated/Model/ContainerWaitResponse.php new file mode 100644 index 00000000..3b6c684e --- /dev/null +++ b/generated/Model/ContainerWaitResponse.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * Exit code of the container + * + * @var int|null + */ + protected $statusCode; + /** + * container waiting error, if any + * + * @var ContainerWaitExitError|null + */ + protected $error; + /** + * Exit code of the container + * + * @return int|null + */ + public function getStatusCode(): ?int + { + return $this->statusCode; + } + /** + * Exit code of the container + * + * @param int|null $statusCode + * + * @return self + */ + public function setStatusCode(?int $statusCode): self + { + $this->initialized['statusCode'] = true; + $this->statusCode = $statusCode; + return $this; + } + /** + * container waiting error, if any + * + * @return ContainerWaitExitError|null + */ + public function getError(): ?ContainerWaitExitError + { + return $this->error; + } + /** + * container waiting error, if any + * + * @param ContainerWaitExitError|null $error + * + * @return self + */ + public function setError(?ContainerWaitExitError $error): self + { + $this->initialized['error'] = true; + $this->error = $error; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainerdInfo.php b/generated/Model/ContainerdInfo.php new file mode 100644 index 00000000..49bf5ecb --- /dev/null +++ b/generated/Model/ContainerdInfo.php @@ -0,0 +1,101 @@ +initialized); + } + /** + * The address of the containerd socket. + * + * @var string|null + */ + protected $address; + /** + * The namespaces that the daemon uses for running containers and + plugins in containerd. These namespaces can be configured in the + daemon configuration, and are considered to be used exclusively + by the daemon, Tampering with the containerd instance may cause + unexpected behavior. + + As these namespaces are considered to be exclusively accessed + by the daemon, it is not recommended to change these values, + or to change them to a value that is used by other systems, + such as cri-containerd. + + * + * @var ContainerdInfoNamespaces|null + */ + protected $namespaces; + /** + * The address of the containerd socket. + * + * @return string|null + */ + public function getAddress(): ?string + { + return $this->address; + } + /** + * The address of the containerd socket. + * + * @param string|null $address + * + * @return self + */ + public function setAddress(?string $address): self + { + $this->initialized['address'] = true; + $this->address = $address; + return $this; + } + /** + * The namespaces that the daemon uses for running containers and + plugins in containerd. These namespaces can be configured in the + daemon configuration, and are considered to be used exclusively + by the daemon, Tampering with the containerd instance may cause + unexpected behavior. + + As these namespaces are considered to be exclusively accessed + by the daemon, it is not recommended to change these values, + or to change them to a value that is used by other systems, + such as cri-containerd. + + * + * @return ContainerdInfoNamespaces|null + */ + public function getNamespaces(): ?ContainerdInfoNamespaces + { + return $this->namespaces; + } + /** + * The namespaces that the daemon uses for running containers and + plugins in containerd. These namespaces can be configured in the + daemon configuration, and are considered to be used exclusively + by the daemon, Tampering with the containerd instance may cause + unexpected behavior. + + As these namespaces are considered to be exclusively accessed + by the daemon, it is not recommended to change these values, + or to change them to a value that is used by other systems, + such as cri-containerd. + + * + * @param ContainerdInfoNamespaces|null $namespaces + * + * @return self + */ + public function setNamespaces(?ContainerdInfoNamespaces $namespaces): self + { + $this->initialized['namespaces'] = true; + $this->namespaces = $namespaces; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainerdInfoNamespaces.php b/generated/Model/ContainerdInfoNamespaces.php new file mode 100644 index 00000000..877c8aca --- /dev/null +++ b/generated/Model/ContainerdInfoNamespaces.php @@ -0,0 +1,113 @@ +initialized); + } + /** + * The default containerd namespace used for containers managed + by the daemon. + + The default namespace for containers is "moby", but will be + suffixed with the `.` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + + * + * @var string|null + */ + protected $containers = 'moby'; + /** + * The default containerd namespace used for plugins managed by + the daemon. + + The default namespace for plugins is "plugins.moby", but will be + suffixed with the `.` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + + * + * @var string|null + */ + protected $plugins = 'plugins.moby'; + /** + * The default containerd namespace used for containers managed + by the daemon. + + The default namespace for containers is "moby", but will be + suffixed with the `.` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + + * + * @return string|null + */ + public function getContainers(): ?string + { + return $this->containers; + } + /** + * The default containerd namespace used for containers managed + by the daemon. + + The default namespace for containers is "moby", but will be + suffixed with the `.` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + + * + * @param string|null $containers + * + * @return self + */ + public function setContainers(?string $containers): self + { + $this->initialized['containers'] = true; + $this->containers = $containers; + return $this; + } + /** + * The default containerd namespace used for plugins managed by + the daemon. + + The default namespace for plugins is "plugins.moby", but will be + suffixed with the `.` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + + * + * @return string|null + */ + public function getPlugins(): ?string + { + return $this->plugins; + } + /** + * The default containerd namespace used for plugins managed by + the daemon. + + The default namespace for plugins is "plugins.moby", but will be + suffixed with the `.` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + + * + * @param string|null $plugins + * + * @return self + */ + public function setPlugins(?string $plugins): self + { + $this->initialized['plugins'] = true; + $this->plugins = $plugins; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainersCreatePostBody.php b/generated/Model/ContainersCreatePostBody.php new file mode 100644 index 00000000..b0e9e38e --- /dev/null +++ b/generated/Model/ContainersCreatePostBody.php @@ -0,0 +1,837 @@ +initialized); + } + /** + * The hostname to use for the container, as a valid RFC 1123 hostname. + * + * @var string|null + */ + protected $hostname; + /** + * The domain name to use for the container. + * + * @var string|null + */ + protected $domainname; + /** + * The user that commands are run as inside the container. + * + * @var string|null + */ + protected $user; + /** + * Whether to attach to `stdin`. + * + * @var bool|null + */ + protected $attachStdin = false; + /** + * Whether to attach to `stdout`. + * + * @var bool|null + */ + protected $attachStdout = true; + /** + * Whether to attach to `stderr`. + * + * @var bool|null + */ + protected $attachStderr = true; + /** + * An object mapping ports to an empty object in the form: + + `{"/": {}}` + + * + * @var array|null + */ + protected $exposedPorts; + /** + * Attach standard streams to a TTY, including `stdin` if it is not closed. + * + * @var bool|null + */ + protected $tty = false; + /** + * Open `stdin` + * + * @var bool|null + */ + protected $openStdin = false; + /** + * Close `stdin` after one attached client disconnects + * + * @var bool|null + */ + protected $stdinOnce = false; + /** + * A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + + * + * @var list|null + */ + protected $env; + /** + * Command to run specified as a string or an array of strings. + * + * @var list|null + */ + protected $cmd; + /** + * A test to perform to check that the container is healthy. + * + * @var HealthConfig|null + */ + protected $healthcheck; + /** + * Command is already escaped (Windows only) + * + * @var bool|null + */ + protected $argsEscaped = false; + /** + * The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + + * + * @var string|null + */ + protected $image; + /** + * An object mapping mount point paths inside the container to empty + objects. + + * + * @var array|null + */ + protected $volumes; + /** + * The working directory for commands to run in. + * + * @var string|null + */ + protected $workingDir; + /** + * The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + + * + * @var list|null + */ + protected $entrypoint; + /** + * Disable networking for the container. + * + * @var bool|null + */ + protected $networkDisabled; + /** + * MAC address of the container. + + Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. + + * + * @var string|null + */ + protected $macAddress; + /** + * `ONBUILD` metadata that were defined in the image's `Dockerfile`. + * + * @var list|null + */ + protected $onBuild; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * Signal to stop a container as a string or unsigned integer. + * + * @var string|null + */ + protected $stopSignal; + /** + * Timeout to stop a container in seconds. + * + * @var int|null + */ + protected $stopTimeout = 10; + /** + * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + * + * @var list|null + */ + protected $shell; + /** + * Container configuration that depends on the host we are running on + * + * @var HostConfig|null + */ + protected $hostConfig; + /** + * NetworkingConfig represents the container's networking configuration for + each of its interfaces. + It is used for the networking configs specified in the `docker create` + and `docker network connect` commands. + + * + * @var NetworkingConfig|null + */ + protected $networkingConfig; + /** + * The hostname to use for the container, as a valid RFC 1123 hostname. + * + * @return string|null + */ + public function getHostname(): ?string + { + return $this->hostname; + } + /** + * The hostname to use for the container, as a valid RFC 1123 hostname. + * + * @param string|null $hostname + * + * @return self + */ + public function setHostname(?string $hostname): self + { + $this->initialized['hostname'] = true; + $this->hostname = $hostname; + return $this; + } + /** + * The domain name to use for the container. + * + * @return string|null + */ + public function getDomainname(): ?string + { + return $this->domainname; + } + /** + * The domain name to use for the container. + * + * @param string|null $domainname + * + * @return self + */ + public function setDomainname(?string $domainname): self + { + $this->initialized['domainname'] = true; + $this->domainname = $domainname; + return $this; + } + /** + * The user that commands are run as inside the container. + * + * @return string|null + */ + public function getUser(): ?string + { + return $this->user; + } + /** + * The user that commands are run as inside the container. + * + * @param string|null $user + * + * @return self + */ + public function setUser(?string $user): self + { + $this->initialized['user'] = true; + $this->user = $user; + return $this; + } + /** + * Whether to attach to `stdin`. + * + * @return bool|null + */ + public function getAttachStdin(): ?bool + { + return $this->attachStdin; + } + /** + * Whether to attach to `stdin`. + * + * @param bool|null $attachStdin + * + * @return self + */ + public function setAttachStdin(?bool $attachStdin): self + { + $this->initialized['attachStdin'] = true; + $this->attachStdin = $attachStdin; + return $this; + } + /** + * Whether to attach to `stdout`. + * + * @return bool|null + */ + public function getAttachStdout(): ?bool + { + return $this->attachStdout; + } + /** + * Whether to attach to `stdout`. + * + * @param bool|null $attachStdout + * + * @return self + */ + public function setAttachStdout(?bool $attachStdout): self + { + $this->initialized['attachStdout'] = true; + $this->attachStdout = $attachStdout; + return $this; + } + /** + * Whether to attach to `stderr`. + * + * @return bool|null + */ + public function getAttachStderr(): ?bool + { + return $this->attachStderr; + } + /** + * Whether to attach to `stderr`. + * + * @param bool|null $attachStderr + * + * @return self + */ + public function setAttachStderr(?bool $attachStderr): self + { + $this->initialized['attachStderr'] = true; + $this->attachStderr = $attachStderr; + return $this; + } + /** + * An object mapping ports to an empty object in the form: + + `{"/": {}}` + + * + * @return array|null + */ + public function getExposedPorts(): ?iterable + { + return $this->exposedPorts; + } + /** + * An object mapping ports to an empty object in the form: + + `{"/": {}}` + + * + * @param array|null $exposedPorts + * + * @return self + */ + public function setExposedPorts(?iterable $exposedPorts): self + { + $this->initialized['exposedPorts'] = true; + $this->exposedPorts = $exposedPorts; + return $this; + } + /** + * Attach standard streams to a TTY, including `stdin` if it is not closed. + * + * @return bool|null + */ + public function getTty(): ?bool + { + return $this->tty; + } + /** + * Attach standard streams to a TTY, including `stdin` if it is not closed. + * + * @param bool|null $tty + * + * @return self + */ + public function setTty(?bool $tty): self + { + $this->initialized['tty'] = true; + $this->tty = $tty; + return $this; + } + /** + * Open `stdin` + * + * @return bool|null + */ + public function getOpenStdin(): ?bool + { + return $this->openStdin; + } + /** + * Open `stdin` + * + * @param bool|null $openStdin + * + * @return self + */ + public function setOpenStdin(?bool $openStdin): self + { + $this->initialized['openStdin'] = true; + $this->openStdin = $openStdin; + return $this; + } + /** + * Close `stdin` after one attached client disconnects + * + * @return bool|null + */ + public function getStdinOnce(): ?bool + { + return $this->stdinOnce; + } + /** + * Close `stdin` after one attached client disconnects + * + * @param bool|null $stdinOnce + * + * @return self + */ + public function setStdinOnce(?bool $stdinOnce): self + { + $this->initialized['stdinOnce'] = true; + $this->stdinOnce = $stdinOnce; + return $this; + } + /** + * A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + + * + * @return list|null + */ + public function getEnv(): ?array + { + return $this->env; + } + /** + * A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + + * + * @param list|null $env + * + * @return self + */ + public function setEnv(?array $env): self + { + $this->initialized['env'] = true; + $this->env = $env; + return $this; + } + /** + * Command to run specified as a string or an array of strings. + * + * @return list|null + */ + public function getCmd(): ?array + { + return $this->cmd; + } + /** + * Command to run specified as a string or an array of strings. + * + * @param list|null $cmd + * + * @return self + */ + public function setCmd(?array $cmd): self + { + $this->initialized['cmd'] = true; + $this->cmd = $cmd; + return $this; + } + /** + * A test to perform to check that the container is healthy. + * + * @return HealthConfig|null + */ + public function getHealthcheck(): ?HealthConfig + { + return $this->healthcheck; + } + /** + * A test to perform to check that the container is healthy. + * + * @param HealthConfig|null $healthcheck + * + * @return self + */ + public function setHealthcheck(?HealthConfig $healthcheck): self + { + $this->initialized['healthcheck'] = true; + $this->healthcheck = $healthcheck; + return $this; + } + /** + * Command is already escaped (Windows only) + * + * @return bool|null + */ + public function getArgsEscaped(): ?bool + { + return $this->argsEscaped; + } + /** + * Command is already escaped (Windows only) + * + * @param bool|null $argsEscaped + * + * @return self + */ + public function setArgsEscaped(?bool $argsEscaped): self + { + $this->initialized['argsEscaped'] = true; + $this->argsEscaped = $argsEscaped; + return $this; + } + /** + * The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + + * + * @return string|null + */ + public function getImage(): ?string + { + return $this->image; + } + /** + * The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + + * + * @param string|null $image + * + * @return self + */ + public function setImage(?string $image): self + { + $this->initialized['image'] = true; + $this->image = $image; + return $this; + } + /** + * An object mapping mount point paths inside the container to empty + objects. + + * + * @return array|null + */ + public function getVolumes(): ?iterable + { + return $this->volumes; + } + /** + * An object mapping mount point paths inside the container to empty + objects. + + * + * @param array|null $volumes + * + * @return self + */ + public function setVolumes(?iterable $volumes): self + { + $this->initialized['volumes'] = true; + $this->volumes = $volumes; + return $this; + } + /** + * The working directory for commands to run in. + * + * @return string|null + */ + public function getWorkingDir(): ?string + { + return $this->workingDir; + } + /** + * The working directory for commands to run in. + * + * @param string|null $workingDir + * + * @return self + */ + public function setWorkingDir(?string $workingDir): self + { + $this->initialized['workingDir'] = true; + $this->workingDir = $workingDir; + return $this; + } + /** + * The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + + * + * @return list|null + */ + public function getEntrypoint(): ?array + { + return $this->entrypoint; + } + /** + * The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + + * + * @param list|null $entrypoint + * + * @return self + */ + public function setEntrypoint(?array $entrypoint): self + { + $this->initialized['entrypoint'] = true; + $this->entrypoint = $entrypoint; + return $this; + } + /** + * Disable networking for the container. + * + * @return bool|null + */ + public function getNetworkDisabled(): ?bool + { + return $this->networkDisabled; + } + /** + * Disable networking for the container. + * + * @param bool|null $networkDisabled + * + * @return self + */ + public function setNetworkDisabled(?bool $networkDisabled): self + { + $this->initialized['networkDisabled'] = true; + $this->networkDisabled = $networkDisabled; + return $this; + } + /** + * MAC address of the container. + + Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. + + * + * @return string|null + */ + public function getMacAddress(): ?string + { + return $this->macAddress; + } + /** + * MAC address of the container. + + Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. + + * + * @param string|null $macAddress + * + * @return self + */ + public function setMacAddress(?string $macAddress): self + { + $this->initialized['macAddress'] = true; + $this->macAddress = $macAddress; + return $this; + } + /** + * `ONBUILD` metadata that were defined in the image's `Dockerfile`. + * + * @return list|null + */ + public function getOnBuild(): ?array + { + return $this->onBuild; + } + /** + * `ONBUILD` metadata that were defined in the image's `Dockerfile`. + * + * @param list|null $onBuild + * + * @return self + */ + public function setOnBuild(?array $onBuild): self + { + $this->initialized['onBuild'] = true; + $this->onBuild = $onBuild; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * Signal to stop a container as a string or unsigned integer. + * + * @return string|null + */ + public function getStopSignal(): ?string + { + return $this->stopSignal; + } + /** + * Signal to stop a container as a string or unsigned integer. + * + * @param string|null $stopSignal + * + * @return self + */ + public function setStopSignal(?string $stopSignal): self + { + $this->initialized['stopSignal'] = true; + $this->stopSignal = $stopSignal; + return $this; + } + /** + * Timeout to stop a container in seconds. + * + * @return int|null + */ + public function getStopTimeout(): ?int + { + return $this->stopTimeout; + } + /** + * Timeout to stop a container in seconds. + * + * @param int|null $stopTimeout + * + * @return self + */ + public function setStopTimeout(?int $stopTimeout): self + { + $this->initialized['stopTimeout'] = true; + $this->stopTimeout = $stopTimeout; + return $this; + } + /** + * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + * + * @return list|null + */ + public function getShell(): ?array + { + return $this->shell; + } + /** + * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + * + * @param list|null $shell + * + * @return self + */ + public function setShell(?array $shell): self + { + $this->initialized['shell'] = true; + $this->shell = $shell; + return $this; + } + /** + * Container configuration that depends on the host we are running on + * + * @return HostConfig|null + */ + public function getHostConfig(): ?HostConfig + { + return $this->hostConfig; + } + /** + * Container configuration that depends on the host we are running on + * + * @param HostConfig|null $hostConfig + * + * @return self + */ + public function setHostConfig(?HostConfig $hostConfig): self + { + $this->initialized['hostConfig'] = true; + $this->hostConfig = $hostConfig; + return $this; + } + /** + * NetworkingConfig represents the container's networking configuration for + each of its interfaces. + It is used for the networking configs specified in the `docker create` + and `docker network connect` commands. + + * + * @return NetworkingConfig|null + */ + public function getNetworkingConfig(): ?NetworkingConfig + { + return $this->networkingConfig; + } + /** + * NetworkingConfig represents the container's networking configuration for + each of its interfaces. + It is used for the networking configs specified in the `docker create` + and `docker network connect` commands. + + * + * @param NetworkingConfig|null $networkingConfig + * + * @return self + */ + public function setNetworkingConfig(?NetworkingConfig $networkingConfig): self + { + $this->initialized['networkingConfig'] = true; + $this->networkingConfig = $networkingConfig; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainersIdExecPostBody.php b/generated/Model/ContainersIdExecPostBody.php new file mode 100644 index 00000000..6ab86fd8 --- /dev/null +++ b/generated/Model/ContainersIdExecPostBody.php @@ -0,0 +1,341 @@ +initialized); + } + /** + * Attach to `stdin` of the exec command. + * + * @var bool|null + */ + protected $attachStdin; + /** + * Attach to `stdout` of the exec command. + * + * @var bool|null + */ + protected $attachStdout; + /** + * Attach to `stderr` of the exec command. + * + * @var bool|null + */ + protected $attachStderr; + /** + * Initial console size, as an `[height, width]` array. + * + * @var list|null + */ + protected $consoleSize; + /** + * Override the key sequence for detaching a container. Format is + a single character `[a-Z]` or `ctrl-` where `` + is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + + * + * @var string|null + */ + protected $detachKeys; + /** + * Allocate a pseudo-TTY. + * + * @var bool|null + */ + protected $tty; + /** + * A list of environment variables in the form `["VAR=value", ...]`. + * + * @var list|null + */ + protected $env; + /** + * Command to run, as a string or array of strings. + * + * @var list|null + */ + protected $cmd; + /** + * Runs the exec process with extended privileges. + * + * @var bool|null + */ + protected $privileged = false; + /** + * The user, and optionally, group to run the exec process inside + the container. Format is one of: `user`, `user:group`, `uid`, + or `uid:gid`. + + * + * @var string|null + */ + protected $user; + /** + * The working directory for the exec process inside the container. + * + * @var string|null + */ + protected $workingDir; + /** + * Attach to `stdin` of the exec command. + * + * @return bool|null + */ + public function getAttachStdin(): ?bool + { + return $this->attachStdin; + } + /** + * Attach to `stdin` of the exec command. + * + * @param bool|null $attachStdin + * + * @return self + */ + public function setAttachStdin(?bool $attachStdin): self + { + $this->initialized['attachStdin'] = true; + $this->attachStdin = $attachStdin; + return $this; + } + /** + * Attach to `stdout` of the exec command. + * + * @return bool|null + */ + public function getAttachStdout(): ?bool + { + return $this->attachStdout; + } + /** + * Attach to `stdout` of the exec command. + * + * @param bool|null $attachStdout + * + * @return self + */ + public function setAttachStdout(?bool $attachStdout): self + { + $this->initialized['attachStdout'] = true; + $this->attachStdout = $attachStdout; + return $this; + } + /** + * Attach to `stderr` of the exec command. + * + * @return bool|null + */ + public function getAttachStderr(): ?bool + { + return $this->attachStderr; + } + /** + * Attach to `stderr` of the exec command. + * + * @param bool|null $attachStderr + * + * @return self + */ + public function setAttachStderr(?bool $attachStderr): self + { + $this->initialized['attachStderr'] = true; + $this->attachStderr = $attachStderr; + return $this; + } + /** + * Initial console size, as an `[height, width]` array. + * + * @return list|null + */ + public function getConsoleSize(): ?array + { + return $this->consoleSize; + } + /** + * Initial console size, as an `[height, width]` array. + * + * @param list|null $consoleSize + * + * @return self + */ + public function setConsoleSize(?array $consoleSize): self + { + $this->initialized['consoleSize'] = true; + $this->consoleSize = $consoleSize; + return $this; + } + /** + * Override the key sequence for detaching a container. Format is + a single character `[a-Z]` or `ctrl-` where `` + is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + + * + * @return string|null + */ + public function getDetachKeys(): ?string + { + return $this->detachKeys; + } + /** + * Override the key sequence for detaching a container. Format is + a single character `[a-Z]` or `ctrl-` where `` + is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + + * + * @param string|null $detachKeys + * + * @return self + */ + public function setDetachKeys(?string $detachKeys): self + { + $this->initialized['detachKeys'] = true; + $this->detachKeys = $detachKeys; + return $this; + } + /** + * Allocate a pseudo-TTY. + * + * @return bool|null + */ + public function getTty(): ?bool + { + return $this->tty; + } + /** + * Allocate a pseudo-TTY. + * + * @param bool|null $tty + * + * @return self + */ + public function setTty(?bool $tty): self + { + $this->initialized['tty'] = true; + $this->tty = $tty; + return $this; + } + /** + * A list of environment variables in the form `["VAR=value", ...]`. + * + * @return list|null + */ + public function getEnv(): ?array + { + return $this->env; + } + /** + * A list of environment variables in the form `["VAR=value", ...]`. + * + * @param list|null $env + * + * @return self + */ + public function setEnv(?array $env): self + { + $this->initialized['env'] = true; + $this->env = $env; + return $this; + } + /** + * Command to run, as a string or array of strings. + * + * @return list|null + */ + public function getCmd(): ?array + { + return $this->cmd; + } + /** + * Command to run, as a string or array of strings. + * + * @param list|null $cmd + * + * @return self + */ + public function setCmd(?array $cmd): self + { + $this->initialized['cmd'] = true; + $this->cmd = $cmd; + return $this; + } + /** + * Runs the exec process with extended privileges. + * + * @return bool|null + */ + public function getPrivileged(): ?bool + { + return $this->privileged; + } + /** + * Runs the exec process with extended privileges. + * + * @param bool|null $privileged + * + * @return self + */ + public function setPrivileged(?bool $privileged): self + { + $this->initialized['privileged'] = true; + $this->privileged = $privileged; + return $this; + } + /** + * The user, and optionally, group to run the exec process inside + the container. Format is one of: `user`, `user:group`, `uid`, + or `uid:gid`. + + * + * @return string|null + */ + public function getUser(): ?string + { + return $this->user; + } + /** + * The user, and optionally, group to run the exec process inside + the container. Format is one of: `user`, `user:group`, `uid`, + or `uid:gid`. + + * + * @param string|null $user + * + * @return self + */ + public function setUser(?string $user): self + { + $this->initialized['user'] = true; + $this->user = $user; + return $this; + } + /** + * The working directory for the exec process inside the container. + * + * @return string|null + */ + public function getWorkingDir(): ?string + { + return $this->workingDir; + } + /** + * The working directory for the exec process inside the container. + * + * @param string|null $workingDir + * + * @return self + */ + public function setWorkingDir(?string $workingDir): self + { + $this->initialized['workingDir'] = true; + $this->workingDir = $workingDir; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainersIdJsonGetResponse200.php b/generated/Model/ContainersIdJsonGetResponse200.php new file mode 100644 index 00000000..e4524d2b --- /dev/null +++ b/generated/Model/ContainersIdJsonGetResponse200.php @@ -0,0 +1,733 @@ +initialized); + } + /** + * The ID of the container + * + * @var string|null + */ + protected $id; + /** + * The time the container was created + * + * @var string|null + */ + protected $created; + /** + * The path to the command being run + * + * @var string|null + */ + protected $path; + /** + * The arguments to the command being run + * + * @var list|null + */ + protected $args; + /** + * ContainerState stores container's running state. It's part of ContainerJSONBase + and will be returned by the "inspect" command. + + * + * @var ContainerState|null + */ + protected $state; + /** + * The container's image ID + * + * @var string|null + */ + protected $image; + /** + * + * + * @var string|null + */ + protected $resolvConfPath; + /** + * + * + * @var string|null + */ + protected $hostnamePath; + /** + * + * + * @var string|null + */ + protected $hostsPath; + /** + * + * + * @var string|null + */ + protected $logPath; + /** + * + * + * @var string|null + */ + protected $name; + /** + * + * + * @var int|null + */ + protected $restartCount; + /** + * + * + * @var string|null + */ + protected $driver; + /** + * + * + * @var string|null + */ + protected $platform; + /** + * + * + * @var string|null + */ + protected $mountLabel; + /** + * + * + * @var string|null + */ + protected $processLabel; + /** + * + * + * @var string|null + */ + protected $appArmorProfile; + /** + * IDs of exec instances that are running in the container. + * + * @var list|null + */ + protected $execIDs; + /** + * Container configuration that depends on the host we are running on + * + * @var HostConfig|null + */ + protected $hostConfig; + /** + * Information about the storage driver used to store the container's and + image's filesystem. + + * + * @var DriverData|null + */ + protected $graphDriver; + /** + * The size of files that have been created or changed by this + container. + + * + * @var int|null + */ + protected $sizeRw; + /** + * The total size of all the files in this container. + * + * @var int|null + */ + protected $sizeRootFs; + /** + * + * + * @var list|null + */ + protected $mounts; + /** + * Configuration for a container that is portable between hosts. + * + * @var ContainerConfig|null + */ + protected $config; + /** + * NetworkSettings exposes the network settings in the API + * + * @var NetworkSettings|null + */ + protected $networkSettings; + /** + * The ID of the container + * + * @return string|null + */ + public function getId(): ?string + { + return $this->id; + } + /** + * The ID of the container + * + * @param string|null $id + * + * @return self + */ + public function setId(?string $id): self + { + $this->initialized['id'] = true; + $this->id = $id; + return $this; + } + /** + * The time the container was created + * + * @return string|null + */ + public function getCreated(): ?string + { + return $this->created; + } + /** + * The time the container was created + * + * @param string|null $created + * + * @return self + */ + public function setCreated(?string $created): self + { + $this->initialized['created'] = true; + $this->created = $created; + return $this; + } + /** + * The path to the command being run + * + * @return string|null + */ + public function getPath(): ?string + { + return $this->path; + } + /** + * The path to the command being run + * + * @param string|null $path + * + * @return self + */ + public function setPath(?string $path): self + { + $this->initialized['path'] = true; + $this->path = $path; + return $this; + } + /** + * The arguments to the command being run + * + * @return list|null + */ + public function getArgs(): ?array + { + return $this->args; + } + /** + * The arguments to the command being run + * + * @param list|null $args + * + * @return self + */ + public function setArgs(?array $args): self + { + $this->initialized['args'] = true; + $this->args = $args; + return $this; + } + /** + * ContainerState stores container's running state. It's part of ContainerJSONBase + and will be returned by the "inspect" command. + + * + * @return ContainerState|null + */ + public function getState(): ?ContainerState + { + return $this->state; + } + /** + * ContainerState stores container's running state. It's part of ContainerJSONBase + and will be returned by the "inspect" command. + + * + * @param ContainerState|null $state + * + * @return self + */ + public function setState(?ContainerState $state): self + { + $this->initialized['state'] = true; + $this->state = $state; + return $this; + } + /** + * The container's image ID + * + * @return string|null + */ + public function getImage(): ?string + { + return $this->image; + } + /** + * The container's image ID + * + * @param string|null $image + * + * @return self + */ + public function setImage(?string $image): self + { + $this->initialized['image'] = true; + $this->image = $image; + return $this; + } + /** + * + * + * @return string|null + */ + public function getResolvConfPath(): ?string + { + return $this->resolvConfPath; + } + /** + * + * + * @param string|null $resolvConfPath + * + * @return self + */ + public function setResolvConfPath(?string $resolvConfPath): self + { + $this->initialized['resolvConfPath'] = true; + $this->resolvConfPath = $resolvConfPath; + return $this; + } + /** + * + * + * @return string|null + */ + public function getHostnamePath(): ?string + { + return $this->hostnamePath; + } + /** + * + * + * @param string|null $hostnamePath + * + * @return self + */ + public function setHostnamePath(?string $hostnamePath): self + { + $this->initialized['hostnamePath'] = true; + $this->hostnamePath = $hostnamePath; + return $this; + } + /** + * + * + * @return string|null + */ + public function getHostsPath(): ?string + { + return $this->hostsPath; + } + /** + * + * + * @param string|null $hostsPath + * + * @return self + */ + public function setHostsPath(?string $hostsPath): self + { + $this->initialized['hostsPath'] = true; + $this->hostsPath = $hostsPath; + return $this; + } + /** + * + * + * @return string|null + */ + public function getLogPath(): ?string + { + return $this->logPath; + } + /** + * + * + * @param string|null $logPath + * + * @return self + */ + public function setLogPath(?string $logPath): self + { + $this->initialized['logPath'] = true; + $this->logPath = $logPath; + return $this; + } + /** + * + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * + * + * @return int|null + */ + public function getRestartCount(): ?int + { + return $this->restartCount; + } + /** + * + * + * @param int|null $restartCount + * + * @return self + */ + public function setRestartCount(?int $restartCount): self + { + $this->initialized['restartCount'] = true; + $this->restartCount = $restartCount; + return $this; + } + /** + * + * + * @return string|null + */ + public function getDriver(): ?string + { + return $this->driver; + } + /** + * + * + * @param string|null $driver + * + * @return self + */ + public function setDriver(?string $driver): self + { + $this->initialized['driver'] = true; + $this->driver = $driver; + return $this; + } + /** + * + * + * @return string|null + */ + public function getPlatform(): ?string + { + return $this->platform; + } + /** + * + * + * @param string|null $platform + * + * @return self + */ + public function setPlatform(?string $platform): self + { + $this->initialized['platform'] = true; + $this->platform = $platform; + return $this; + } + /** + * + * + * @return string|null + */ + public function getMountLabel(): ?string + { + return $this->mountLabel; + } + /** + * + * + * @param string|null $mountLabel + * + * @return self + */ + public function setMountLabel(?string $mountLabel): self + { + $this->initialized['mountLabel'] = true; + $this->mountLabel = $mountLabel; + return $this; + } + /** + * + * + * @return string|null + */ + public function getProcessLabel(): ?string + { + return $this->processLabel; + } + /** + * + * + * @param string|null $processLabel + * + * @return self + */ + public function setProcessLabel(?string $processLabel): self + { + $this->initialized['processLabel'] = true; + $this->processLabel = $processLabel; + return $this; + } + /** + * + * + * @return string|null + */ + public function getAppArmorProfile(): ?string + { + return $this->appArmorProfile; + } + /** + * + * + * @param string|null $appArmorProfile + * + * @return self + */ + public function setAppArmorProfile(?string $appArmorProfile): self + { + $this->initialized['appArmorProfile'] = true; + $this->appArmorProfile = $appArmorProfile; + return $this; + } + /** + * IDs of exec instances that are running in the container. + * + * @return list|null + */ + public function getExecIDs(): ?array + { + return $this->execIDs; + } + /** + * IDs of exec instances that are running in the container. + * + * @param list|null $execIDs + * + * @return self + */ + public function setExecIDs(?array $execIDs): self + { + $this->initialized['execIDs'] = true; + $this->execIDs = $execIDs; + return $this; + } + /** + * Container configuration that depends on the host we are running on + * + * @return HostConfig|null + */ + public function getHostConfig(): ?HostConfig + { + return $this->hostConfig; + } + /** + * Container configuration that depends on the host we are running on + * + * @param HostConfig|null $hostConfig + * + * @return self + */ + public function setHostConfig(?HostConfig $hostConfig): self + { + $this->initialized['hostConfig'] = true; + $this->hostConfig = $hostConfig; + return $this; + } + /** + * Information about the storage driver used to store the container's and + image's filesystem. + + * + * @return DriverData|null + */ + public function getGraphDriver(): ?DriverData + { + return $this->graphDriver; + } + /** + * Information about the storage driver used to store the container's and + image's filesystem. + + * + * @param DriverData|null $graphDriver + * + * @return self + */ + public function setGraphDriver(?DriverData $graphDriver): self + { + $this->initialized['graphDriver'] = true; + $this->graphDriver = $graphDriver; + return $this; + } + /** + * The size of files that have been created or changed by this + container. + + * + * @return int|null + */ + public function getSizeRw(): ?int + { + return $this->sizeRw; + } + /** + * The size of files that have been created or changed by this + container. + + * + * @param int|null $sizeRw + * + * @return self + */ + public function setSizeRw(?int $sizeRw): self + { + $this->initialized['sizeRw'] = true; + $this->sizeRw = $sizeRw; + return $this; + } + /** + * The total size of all the files in this container. + * + * @return int|null + */ + public function getSizeRootFs(): ?int + { + return $this->sizeRootFs; + } + /** + * The total size of all the files in this container. + * + * @param int|null $sizeRootFs + * + * @return self + */ + public function setSizeRootFs(?int $sizeRootFs): self + { + $this->initialized['sizeRootFs'] = true; + $this->sizeRootFs = $sizeRootFs; + return $this; + } + /** + * + * + * @return list|null + */ + public function getMounts(): ?array + { + return $this->mounts; + } + /** + * + * + * @param list|null $mounts + * + * @return self + */ + public function setMounts(?array $mounts): self + { + $this->initialized['mounts'] = true; + $this->mounts = $mounts; + return $this; + } + /** + * Configuration for a container that is portable between hosts. + * + * @return ContainerConfig|null + */ + public function getConfig(): ?ContainerConfig + { + return $this->config; + } + /** + * Configuration for a container that is portable between hosts. + * + * @param ContainerConfig|null $config + * + * @return self + */ + public function setConfig(?ContainerConfig $config): self + { + $this->initialized['config'] = true; + $this->config = $config; + return $this; + } + /** + * NetworkSettings exposes the network settings in the API + * + * @return NetworkSettings|null + */ + public function getNetworkSettings(): ?NetworkSettings + { + return $this->networkSettings; + } + /** + * NetworkSettings exposes the network settings in the API + * + * @param NetworkSettings|null $networkSettings + * + * @return self + */ + public function setNetworkSettings(?NetworkSettings $networkSettings): self + { + $this->initialized['networkSettings'] = true; + $this->networkSettings = $networkSettings; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainersIdTopGetResponse200.php b/generated/Model/ContainersIdTopGetResponse200.php new file mode 100644 index 00000000..4aed5604 --- /dev/null +++ b/generated/Model/ContainersIdTopGetResponse200.php @@ -0,0 +1,77 @@ +initialized); + } + /** + * The ps column titles + * + * @var list|null + */ + protected $titles; + /** + * Each process running in the container, where each is process + is an array of values corresponding to the titles. + + * + * @var list>|null + */ + protected $processes; + /** + * The ps column titles + * + * @return list|null + */ + public function getTitles(): ?array + { + return $this->titles; + } + /** + * The ps column titles + * + * @param list|null $titles + * + * @return self + */ + public function setTitles(?array $titles): self + { + $this->initialized['titles'] = true; + $this->titles = $titles; + return $this; + } + /** + * Each process running in the container, where each is process + is an array of values corresponding to the titles. + + * + * @return list>|null + */ + public function getProcesses(): ?array + { + return $this->processes; + } + /** + * Each process running in the container, where each is process + is an array of values corresponding to the titles. + + * + * @param list>|null $processes + * + * @return self + */ + public function setProcesses(?array $processes): self + { + $this->initialized['processes'] = true; + $this->processes = $processes; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainersIdUpdatePostBody.php b/generated/Model/ContainersIdUpdatePostBody.php new file mode 100644 index 00000000..bfff8078 --- /dev/null +++ b/generated/Model/ContainersIdUpdatePostBody.php @@ -0,0 +1,1130 @@ +initialized); + } + /** + * An integer value representing this container's relative CPU weight + versus other containers. + + * + * @var int|null + */ + protected $cpuShares; + /** + * Memory limit in bytes. + * + * @var int|null + */ + protected $memory = 0; + /** + * Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + + * + * @var string|null + */ + protected $cgroupParent; + /** + * Block IO weight (relative weight). + * + * @var int|null + */ + protected $blkioWeight; + /** + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @var list|null + */ + protected $blkioWeightDevice; + /** + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var list|null + */ + protected $blkioDeviceReadBps; + /** + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var list|null + */ + protected $blkioDeviceWriteBps; + /** + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var list|null + */ + protected $blkioDeviceReadIOps; + /** + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var list|null + */ + protected $blkioDeviceWriteIOps; + /** + * The length of a CPU period in microseconds. + * + * @var int|null + */ + protected $cpuPeriod; + /** + * Microseconds of CPU time that the container can get in a CPU period. + * + * @var int|null + */ + protected $cpuQuota; + /** + * The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @var int|null + */ + protected $cpuRealtimePeriod; + /** + * The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @var int|null + */ + protected $cpuRealtimeRuntime; + /** + * CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * + * @var string|null + */ + protected $cpusetCpus; + /** + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + + * + * @var string|null + */ + protected $cpusetMems; + /** + * A list of devices to add to the container. + * + * @var list|null + */ + protected $devices; + /** + * a list of cgroup rules to apply to the container + * + * @var list|null + */ + protected $deviceCgroupRules; + /** + * A list of requests for devices to be sent to device drivers. + * + * @var list|null + */ + protected $deviceRequests; + /** + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + + * + * @var int|null + */ + protected $kernelMemoryTCP; + /** + * Memory soft limit in bytes. + * + * @var int|null + */ + protected $memoryReservation; + /** + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + + * + * @var int|null + */ + protected $memorySwap; + /** + * Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + + * + * @var int|null + */ + protected $memorySwappiness; + /** + * CPU quota in units of 10-9 CPUs. + * + * @var int|null + */ + protected $nanoCpus; + /** + * Disable OOM Killer for the container. + * + * @var bool|null + */ + protected $oomKillDisable; + /** + * Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + + * + * @var bool|null + */ + protected $init; + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + + * + * @var int|null + */ + protected $pidsLimit; + /** + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @var list|null + */ + protected $ulimits; + /** + * The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @var int|null + */ + protected $cpuCount; + /** + * The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @var int|null + */ + protected $cpuPercent; + /** + * Maximum IOps for the container system drive (Windows only) + * + * @var int|null + */ + protected $iOMaximumIOps; + /** + * Maximum IO in bytes per second for the container system drive + (Windows only). + + * + * @var int|null + */ + protected $iOMaximumBandwidth; + /** + * The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + + * + * @var RestartPolicy|null + */ + protected $restartPolicy; + /** + * An integer value representing this container's relative CPU weight + versus other containers. + + * + * @return int|null + */ + public function getCpuShares(): ?int + { + return $this->cpuShares; + } + /** + * An integer value representing this container's relative CPU weight + versus other containers. + + * + * @param int|null $cpuShares + * + * @return self + */ + public function setCpuShares(?int $cpuShares): self + { + $this->initialized['cpuShares'] = true; + $this->cpuShares = $cpuShares; + return $this; + } + /** + * Memory limit in bytes. + * + * @return int|null + */ + public function getMemory(): ?int + { + return $this->memory; + } + /** + * Memory limit in bytes. + * + * @param int|null $memory + * + * @return self + */ + public function setMemory(?int $memory): self + { + $this->initialized['memory'] = true; + $this->memory = $memory; + return $this; + } + /** + * Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + + * + * @return string|null + */ + public function getCgroupParent(): ?string + { + return $this->cgroupParent; + } + /** + * Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + + * + * @param string|null $cgroupParent + * + * @return self + */ + public function setCgroupParent(?string $cgroupParent): self + { + $this->initialized['cgroupParent'] = true; + $this->cgroupParent = $cgroupParent; + return $this; + } + /** + * Block IO weight (relative weight). + * + * @return int|null + */ + public function getBlkioWeight(): ?int + { + return $this->blkioWeight; + } + /** + * Block IO weight (relative weight). + * + * @param int|null $blkioWeight + * + * @return self + */ + public function setBlkioWeight(?int $blkioWeight): self + { + $this->initialized['blkioWeight'] = true; + $this->blkioWeight = $blkioWeight; + return $this; + } + /** + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @return list|null + */ + public function getBlkioWeightDevice(): ?array + { + return $this->blkioWeightDevice; + } + /** + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @param list|null $blkioWeightDevice + * + * @return self + */ + public function setBlkioWeightDevice(?array $blkioWeightDevice): self + { + $this->initialized['blkioWeightDevice'] = true; + $this->blkioWeightDevice = $blkioWeightDevice; + return $this; + } + /** + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return list|null + */ + public function getBlkioDeviceReadBps(): ?array + { + return $this->blkioDeviceReadBps; + } + /** + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param list|null $blkioDeviceReadBps + * + * @return self + */ + public function setBlkioDeviceReadBps(?array $blkioDeviceReadBps): self + { + $this->initialized['blkioDeviceReadBps'] = true; + $this->blkioDeviceReadBps = $blkioDeviceReadBps; + return $this; + } + /** + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return list|null + */ + public function getBlkioDeviceWriteBps(): ?array + { + return $this->blkioDeviceWriteBps; + } + /** + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param list|null $blkioDeviceWriteBps + * + * @return self + */ + public function setBlkioDeviceWriteBps(?array $blkioDeviceWriteBps): self + { + $this->initialized['blkioDeviceWriteBps'] = true; + $this->blkioDeviceWriteBps = $blkioDeviceWriteBps; + return $this; + } + /** + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return list|null + */ + public function getBlkioDeviceReadIOps(): ?array + { + return $this->blkioDeviceReadIOps; + } + /** + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param list|null $blkioDeviceReadIOps + * + * @return self + */ + public function setBlkioDeviceReadIOps(?array $blkioDeviceReadIOps): self + { + $this->initialized['blkioDeviceReadIOps'] = true; + $this->blkioDeviceReadIOps = $blkioDeviceReadIOps; + return $this; + } + /** + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return list|null + */ + public function getBlkioDeviceWriteIOps(): ?array + { + return $this->blkioDeviceWriteIOps; + } + /** + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param list|null $blkioDeviceWriteIOps + * + * @return self + */ + public function setBlkioDeviceWriteIOps(?array $blkioDeviceWriteIOps): self + { + $this->initialized['blkioDeviceWriteIOps'] = true; + $this->blkioDeviceWriteIOps = $blkioDeviceWriteIOps; + return $this; + } + /** + * The length of a CPU period in microseconds. + * + * @return int|null + */ + public function getCpuPeriod(): ?int + { + return $this->cpuPeriod; + } + /** + * The length of a CPU period in microseconds. + * + * @param int|null $cpuPeriod + * + * @return self + */ + public function setCpuPeriod(?int $cpuPeriod): self + { + $this->initialized['cpuPeriod'] = true; + $this->cpuPeriod = $cpuPeriod; + return $this; + } + /** + * Microseconds of CPU time that the container can get in a CPU period. + * + * @return int|null + */ + public function getCpuQuota(): ?int + { + return $this->cpuQuota; + } + /** + * Microseconds of CPU time that the container can get in a CPU period. + * + * @param int|null $cpuQuota + * + * @return self + */ + public function setCpuQuota(?int $cpuQuota): self + { + $this->initialized['cpuQuota'] = true; + $this->cpuQuota = $cpuQuota; + return $this; + } + /** + * The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @return int|null + */ + public function getCpuRealtimePeriod(): ?int + { + return $this->cpuRealtimePeriod; + } + /** + * The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @param int|null $cpuRealtimePeriod + * + * @return self + */ + public function setCpuRealtimePeriod(?int $cpuRealtimePeriod): self + { + $this->initialized['cpuRealtimePeriod'] = true; + $this->cpuRealtimePeriod = $cpuRealtimePeriod; + return $this; + } + /** + * The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @return int|null + */ + public function getCpuRealtimeRuntime(): ?int + { + return $this->cpuRealtimeRuntime; + } + /** + * The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @param int|null $cpuRealtimeRuntime + * + * @return self + */ + public function setCpuRealtimeRuntime(?int $cpuRealtimeRuntime): self + { + $this->initialized['cpuRealtimeRuntime'] = true; + $this->cpuRealtimeRuntime = $cpuRealtimeRuntime; + return $this; + } + /** + * CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * + * @return string|null + */ + public function getCpusetCpus(): ?string + { + return $this->cpusetCpus; + } + /** + * CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * + * @param string|null $cpusetCpus + * + * @return self + */ + public function setCpusetCpus(?string $cpusetCpus): self + { + $this->initialized['cpusetCpus'] = true; + $this->cpusetCpus = $cpusetCpus; + return $this; + } + /** + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + + * + * @return string|null + */ + public function getCpusetMems(): ?string + { + return $this->cpusetMems; + } + /** + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + + * + * @param string|null $cpusetMems + * + * @return self + */ + public function setCpusetMems(?string $cpusetMems): self + { + $this->initialized['cpusetMems'] = true; + $this->cpusetMems = $cpusetMems; + return $this; + } + /** + * A list of devices to add to the container. + * + * @return list|null + */ + public function getDevices(): ?array + { + return $this->devices; + } + /** + * A list of devices to add to the container. + * + * @param list|null $devices + * + * @return self + */ + public function setDevices(?array $devices): self + { + $this->initialized['devices'] = true; + $this->devices = $devices; + return $this; + } + /** + * a list of cgroup rules to apply to the container + * + * @return list|null + */ + public function getDeviceCgroupRules(): ?array + { + return $this->deviceCgroupRules; + } + /** + * a list of cgroup rules to apply to the container + * + * @param list|null $deviceCgroupRules + * + * @return self + */ + public function setDeviceCgroupRules(?array $deviceCgroupRules): self + { + $this->initialized['deviceCgroupRules'] = true; + $this->deviceCgroupRules = $deviceCgroupRules; + return $this; + } + /** + * A list of requests for devices to be sent to device drivers. + * + * @return list|null + */ + public function getDeviceRequests(): ?array + { + return $this->deviceRequests; + } + /** + * A list of requests for devices to be sent to device drivers. + * + * @param list|null $deviceRequests + * + * @return self + */ + public function setDeviceRequests(?array $deviceRequests): self + { + $this->initialized['deviceRequests'] = true; + $this->deviceRequests = $deviceRequests; + return $this; + } + /** + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + + * + * @return int|null + */ + public function getKernelMemoryTCP(): ?int + { + return $this->kernelMemoryTCP; + } + /** + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + + * + * @param int|null $kernelMemoryTCP + * + * @return self + */ + public function setKernelMemoryTCP(?int $kernelMemoryTCP): self + { + $this->initialized['kernelMemoryTCP'] = true; + $this->kernelMemoryTCP = $kernelMemoryTCP; + return $this; + } + /** + * Memory soft limit in bytes. + * + * @return int|null + */ + public function getMemoryReservation(): ?int + { + return $this->memoryReservation; + } + /** + * Memory soft limit in bytes. + * + * @param int|null $memoryReservation + * + * @return self + */ + public function setMemoryReservation(?int $memoryReservation): self + { + $this->initialized['memoryReservation'] = true; + $this->memoryReservation = $memoryReservation; + return $this; + } + /** + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + + * + * @return int|null + */ + public function getMemorySwap(): ?int + { + return $this->memorySwap; + } + /** + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + + * + * @param int|null $memorySwap + * + * @return self + */ + public function setMemorySwap(?int $memorySwap): self + { + $this->initialized['memorySwap'] = true; + $this->memorySwap = $memorySwap; + return $this; + } + /** + * Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + + * + * @return int|null + */ + public function getMemorySwappiness(): ?int + { + return $this->memorySwappiness; + } + /** + * Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + + * + * @param int|null $memorySwappiness + * + * @return self + */ + public function setMemorySwappiness(?int $memorySwappiness): self + { + $this->initialized['memorySwappiness'] = true; + $this->memorySwappiness = $memorySwappiness; + return $this; + } + /** + * CPU quota in units of 10-9 CPUs. + * + * @return int|null + */ + public function getNanoCpus(): ?int + { + return $this->nanoCpus; + } + /** + * CPU quota in units of 10-9 CPUs. + * + * @param int|null $nanoCpus + * + * @return self + */ + public function setNanoCpus(?int $nanoCpus): self + { + $this->initialized['nanoCpus'] = true; + $this->nanoCpus = $nanoCpus; + return $this; + } + /** + * Disable OOM Killer for the container. + * + * @return bool|null + */ + public function getOomKillDisable(): ?bool + { + return $this->oomKillDisable; + } + /** + * Disable OOM Killer for the container. + * + * @param bool|null $oomKillDisable + * + * @return self + */ + public function setOomKillDisable(?bool $oomKillDisable): self + { + $this->initialized['oomKillDisable'] = true; + $this->oomKillDisable = $oomKillDisable; + return $this; + } + /** + * Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + + * + * @return bool|null + */ + public function getInit(): ?bool + { + return $this->init; + } + /** + * Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + + * + * @param bool|null $init + * + * @return self + */ + public function setInit(?bool $init): self + { + $this->initialized['init'] = true; + $this->init = $init; + return $this; + } + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + + * + * @return int|null + */ + public function getPidsLimit(): ?int + { + return $this->pidsLimit; + } + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + + * + * @param int|null $pidsLimit + * + * @return self + */ + public function setPidsLimit(?int $pidsLimit): self + { + $this->initialized['pidsLimit'] = true; + $this->pidsLimit = $pidsLimit; + return $this; + } + /** + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @return list|null + */ + public function getUlimits(): ?array + { + return $this->ulimits; + } + /** + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @param list|null $ulimits + * + * @return self + */ + public function setUlimits(?array $ulimits): self + { + $this->initialized['ulimits'] = true; + $this->ulimits = $ulimits; + return $this; + } + /** + * The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @return int|null + */ + public function getCpuCount(): ?int + { + return $this->cpuCount; + } + /** + * The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @param int|null $cpuCount + * + * @return self + */ + public function setCpuCount(?int $cpuCount): self + { + $this->initialized['cpuCount'] = true; + $this->cpuCount = $cpuCount; + return $this; + } + /** + * The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @return int|null + */ + public function getCpuPercent(): ?int + { + return $this->cpuPercent; + } + /** + * The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @param int|null $cpuPercent + * + * @return self + */ + public function setCpuPercent(?int $cpuPercent): self + { + $this->initialized['cpuPercent'] = true; + $this->cpuPercent = $cpuPercent; + return $this; + } + /** + * Maximum IOps for the container system drive (Windows only) + * + * @return int|null + */ + public function getIOMaximumIOps(): ?int + { + return $this->iOMaximumIOps; + } + /** + * Maximum IOps for the container system drive (Windows only) + * + * @param int|null $iOMaximumIOps + * + * @return self + */ + public function setIOMaximumIOps(?int $iOMaximumIOps): self + { + $this->initialized['iOMaximumIOps'] = true; + $this->iOMaximumIOps = $iOMaximumIOps; + return $this; + } + /** + * Maximum IO in bytes per second for the container system drive + (Windows only). + + * + * @return int|null + */ + public function getIOMaximumBandwidth(): ?int + { + return $this->iOMaximumBandwidth; + } + /** + * Maximum IO in bytes per second for the container system drive + (Windows only). + + * + * @param int|null $iOMaximumBandwidth + * + * @return self + */ + public function setIOMaximumBandwidth(?int $iOMaximumBandwidth): self + { + $this->initialized['iOMaximumBandwidth'] = true; + $this->iOMaximumBandwidth = $iOMaximumBandwidth; + return $this; + } + /** + * The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + + * + * @return RestartPolicy|null + */ + public function getRestartPolicy(): ?RestartPolicy + { + return $this->restartPolicy; + } + /** + * The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + + * + * @param RestartPolicy|null $restartPolicy + * + * @return self + */ + public function setRestartPolicy(?RestartPolicy $restartPolicy): self + { + $this->initialized['restartPolicy'] = true; + $this->restartPolicy = $restartPolicy; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainersIdUpdatePostResponse200.php b/generated/Model/ContainersIdUpdatePostResponse200.php new file mode 100644 index 00000000..b5b64fa0 --- /dev/null +++ b/generated/Model/ContainersIdUpdatePostResponse200.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * + * + * @var list|null + */ + protected $warnings; + /** + * + * + * @return list|null + */ + public function getWarnings(): ?array + { + return $this->warnings; + } + /** + * + * + * @param list|null $warnings + * + * @return self + */ + public function setWarnings(?array $warnings): self + { + $this->initialized['warnings'] = true; + $this->warnings = $warnings; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ContainersPrunePostResponse200.php b/generated/Model/ContainersPrunePostResponse200.php new file mode 100644 index 00000000..9967836a --- /dev/null +++ b/generated/Model/ContainersPrunePostResponse200.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * Container IDs that were deleted + * + * @var list|null + */ + protected $containersDeleted; + /** + * Disk space reclaimed in bytes + * + * @var int|null + */ + protected $spaceReclaimed; + /** + * Container IDs that were deleted + * + * @return list|null + */ + public function getContainersDeleted(): ?array + { + return $this->containersDeleted; + } + /** + * Container IDs that were deleted + * + * @param list|null $containersDeleted + * + * @return self + */ + public function setContainersDeleted(?array $containersDeleted): self + { + $this->initialized['containersDeleted'] = true; + $this->containersDeleted = $containersDeleted; + return $this; + } + /** + * Disk space reclaimed in bytes + * + * @return int|null + */ + public function getSpaceReclaimed(): ?int + { + return $this->spaceReclaimed; + } + /** + * Disk space reclaimed in bytes + * + * @param int|null $spaceReclaimed + * + * @return self + */ + public function setSpaceReclaimed(?int $spaceReclaimed): self + { + $this->initialized['spaceReclaimed'] = true; + $this->spaceReclaimed = $spaceReclaimed; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/CreateImageInfo.php b/generated/Model/CreateImageInfo.php index 413e1468..428e8ad2 100644 --- a/generated/Model/CreateImageInfo.php +++ b/generated/Model/CreateImageInfo.php @@ -5,123 +5,179 @@ class CreateImageInfo { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var string|null */ protected $id; /** - * @var string + * + * + * @var string|null */ protected $error; /** - * @var string + * + * + * @var ErrorDetail|null + */ + protected $errorDetail; + /** + * + * + * @var string|null */ protected $status; /** - * @var string + * + * + * @var string|null */ protected $progress; /** - * @var ProgressDetail + * + * + * @var ProgressDetail|null */ protected $progressDetail; - /** - * @return string + * + * + * @return string|null */ - public function getId() + public function getId(): ?string { return $this->id; } - /** - * @param string $id + * + * + * @param string|null $id * * @return self */ - public function setId($id = null) + public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getError() + public function getError(): ?string { return $this->error; } - /** - * @param string $error + * + * + * @param string|null $error * * @return self */ - public function setError($error = null) + public function setError(?string $error): self { + $this->initialized['error'] = true; $this->error = $error; - return $this; } - /** - * @return string + * + * + * @return ErrorDetail|null + */ + public function getErrorDetail(): ?ErrorDetail + { + return $this->errorDetail; + } + /** + * + * + * @param ErrorDetail|null $errorDetail + * + * @return self */ - public function getStatus() + public function setErrorDetail(?ErrorDetail $errorDetail): self + { + $this->initialized['errorDetail'] = true; + $this->errorDetail = $errorDetail; + return $this; + } + /** + * + * + * @return string|null + */ + public function getStatus(): ?string { return $this->status; } - /** - * @param string $status + * + * + * @param string|null $status * * @return self */ - public function setStatus($status = null) + public function setStatus(?string $status): self { + $this->initialized['status'] = true; $this->status = $status; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getProgress() + public function getProgress(): ?string { return $this->progress; } - /** - * @param string $progress + * + * + * @param string|null $progress * * @return self */ - public function setProgress($progress = null) + public function setProgress(?string $progress): self { + $this->initialized['progress'] = true; $this->progress = $progress; - return $this; } - /** - * @return ProgressDetail + * + * + * @return ProgressDetail|null */ - public function getProgressDetail() + public function getProgressDetail(): ?ProgressDetail { return $this->progressDetail; } - /** - * @param ProgressDetail $progressDetail + * + * + * @param ProgressDetail|null $progressDetail * * @return self */ - public function setProgressDetail(?ProgressDetail $progressDetail = null) + public function setProgressDetail(?ProgressDetail $progressDetail): self { + $this->initialized['progressDetail'] = true; $this->progressDetail = $progressDetail; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/Device.php b/generated/Model/Device.php deleted file mode 100644 index db35ac42..00000000 --- a/generated/Model/Device.php +++ /dev/null @@ -1,79 +0,0 @@ -pathOnHost; - } - - /** - * @param string $pathOnHost - * - * @return self - */ - public function setPathOnHost($pathOnHost = null) - { - $this->pathOnHost = $pathOnHost; - - return $this; - } - - /** - * @return string - */ - public function getPathInContainer() - { - return $this->pathInContainer; - } - - /** - * @param string $pathInContainer - * - * @return self - */ - public function setPathInContainer($pathInContainer = null) - { - $this->pathInContainer = $pathInContainer; - - return $this; - } - - /** - * @return string - */ - public function getCgroupPermissions() - { - return $this->cgroupPermissions; - } - - /** - * @param string $cgroupPermissions - * - * @return self - */ - public function setCgroupPermissions($cgroupPermissions = null) - { - $this->cgroupPermissions = $cgroupPermissions; - - return $this; - } -} diff --git a/generated/Model/DeviceMapping.php b/generated/Model/DeviceMapping.php new file mode 100644 index 00000000..169986cf --- /dev/null +++ b/generated/Model/DeviceMapping.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $pathOnHost; + /** + * + * + * @var string|null + */ + protected $pathInContainer; + /** + * + * + * @var string|null + */ + protected $cgroupPermissions; + /** + * + * + * @return string|null + */ + public function getPathOnHost(): ?string + { + return $this->pathOnHost; + } + /** + * + * + * @param string|null $pathOnHost + * + * @return self + */ + public function setPathOnHost(?string $pathOnHost): self + { + $this->initialized['pathOnHost'] = true; + $this->pathOnHost = $pathOnHost; + return $this; + } + /** + * + * + * @return string|null + */ + public function getPathInContainer(): ?string + { + return $this->pathInContainer; + } + /** + * + * + * @param string|null $pathInContainer + * + * @return self + */ + public function setPathInContainer(?string $pathInContainer): self + { + $this->initialized['pathInContainer'] = true; + $this->pathInContainer = $pathInContainer; + return $this; + } + /** + * + * + * @return string|null + */ + public function getCgroupPermissions(): ?string + { + return $this->cgroupPermissions; + } + /** + * + * + * @param string|null $cgroupPermissions + * + * @return self + */ + public function setCgroupPermissions(?string $cgroupPermissions): self + { + $this->initialized['cgroupPermissions'] = true; + $this->cgroupPermissions = $cgroupPermissions; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/DeviceRate.php b/generated/Model/DeviceRate.php deleted file mode 100644 index 2c174e7b..00000000 --- a/generated/Model/DeviceRate.php +++ /dev/null @@ -1,55 +0,0 @@ -path; - } - - /** - * @param string $path - * - * @return self - */ - public function setPath($path = null) - { - $this->path = $path; - - return $this; - } - - /** - * @return int|string - */ - public function getRate() - { - return $this->rate; - } - - /** - * @param int|string $rate - * - * @return self - */ - public function setRate($rate = null) - { - $this->rate = $rate; - - return $this; - } -} diff --git a/generated/Model/DeviceRequest.php b/generated/Model/DeviceRequest.php new file mode 100644 index 00000000..4f53e5f7 --- /dev/null +++ b/generated/Model/DeviceRequest.php @@ -0,0 +1,161 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $driver; + /** + * + * + * @var int|null + */ + protected $count; + /** + * + * + * @var list|null + */ + protected $deviceIDs; + /** + * A list of capabilities; an OR list of AND lists of capabilities. + * + * @var list>|null + */ + protected $capabilities; + /** + * Driver-specific options, specified as a key/value pairs. These options + are passed directly to the driver. + + * + * @var array|null + */ + protected $options; + /** + * + * + * @return string|null + */ + public function getDriver(): ?string + { + return $this->driver; + } + /** + * + * + * @param string|null $driver + * + * @return self + */ + public function setDriver(?string $driver): self + { + $this->initialized['driver'] = true; + $this->driver = $driver; + return $this; + } + /** + * + * + * @return int|null + */ + public function getCount(): ?int + { + return $this->count; + } + /** + * + * + * @param int|null $count + * + * @return self + */ + public function setCount(?int $count): self + { + $this->initialized['count'] = true; + $this->count = $count; + return $this; + } + /** + * + * + * @return list|null + */ + public function getDeviceIDs(): ?array + { + return $this->deviceIDs; + } + /** + * + * + * @param list|null $deviceIDs + * + * @return self + */ + public function setDeviceIDs(?array $deviceIDs): self + { + $this->initialized['deviceIDs'] = true; + $this->deviceIDs = $deviceIDs; + return $this; + } + /** + * A list of capabilities; an OR list of AND lists of capabilities. + * + * @return list>|null + */ + public function getCapabilities(): ?array + { + return $this->capabilities; + } + /** + * A list of capabilities; an OR list of AND lists of capabilities. + * + * @param list>|null $capabilities + * + * @return self + */ + public function setCapabilities(?array $capabilities): self + { + $this->initialized['capabilities'] = true; + $this->capabilities = $capabilities; + return $this; + } + /** + * Driver-specific options, specified as a key/value pairs. These options + are passed directly to the driver. + + * + * @return array|null + */ + public function getOptions(): ?iterable + { + return $this->options; + } + /** + * Driver-specific options, specified as a key/value pairs. These options + are passed directly to the driver. + + * + * @param array|null $options + * + * @return self + */ + public function setOptions(?iterable $options): self + { + $this->initialized['options'] = true; + $this->options = $options; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/DeviceWeight.php b/generated/Model/DeviceWeight.php deleted file mode 100644 index a6d5c7d4..00000000 --- a/generated/Model/DeviceWeight.php +++ /dev/null @@ -1,55 +0,0 @@ -path; - } - - /** - * @param string $path - * - * @return self - */ - public function setPath($path = null) - { - $this->path = $path; - - return $this; - } - - /** - * @return int - */ - public function getWeight() - { - return $this->weight; - } - - /** - * @param int $weight - * - * @return self - */ - public function setWeight($weight = null) - { - $this->weight = $weight; - - return $this; - } -} diff --git a/generated/Model/DistributionInspect.php b/generated/Model/DistributionInspect.php new file mode 100644 index 00000000..f8512691 --- /dev/null +++ b/generated/Model/DistributionInspect.php @@ -0,0 +1,77 @@ +initialized); + } + /** + * A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + + * + * @var OCIDescriptor|null + */ + protected $descriptor; + /** + * An array containing all platforms supported by the image. + * + * @var list|null + */ + protected $platforms; + /** + * A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + + * + * @return OCIDescriptor|null + */ + public function getDescriptor(): ?OCIDescriptor + { + return $this->descriptor; + } + /** + * A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + + * + * @param OCIDescriptor|null $descriptor + * + * @return self + */ + public function setDescriptor(?OCIDescriptor $descriptor): self + { + $this->initialized['descriptor'] = true; + $this->descriptor = $descriptor; + return $this; + } + /** + * An array containing all platforms supported by the image. + * + * @return list|null + */ + public function getPlatforms(): ?array + { + return $this->platforms; + } + /** + * An array containing all platforms supported by the image. + * + * @param list|null $platforms + * + * @return self + */ + public function setPlatforms(?array $platforms): self + { + $this->initialized['platforms'] = true; + $this->platforms = $platforms; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Driver.php b/generated/Model/Driver.php index cba4ea5b..bb809346 100644 --- a/generated/Model/Driver.php +++ b/generated/Model/Driver.php @@ -5,51 +5,67 @@ class Driver { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * Name of the driver. + * + * @var string|null */ protected $name; /** - * @var string[]|null + * Key/value map of driver-specific options. + * + * @var array|null */ protected $options; - /** - * @return string + * Name of the driver. + * + * @return string|null */ - public function getName() + public function getName(): ?string { return $this->name; } - /** - * @param string $name + * Name of the driver. + * + * @param string|null $name * * @return self */ - public function setName($name = null) + public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string[]|null + * Key/value map of driver-specific options. + * + * @return array|null */ - public function getOptions() + public function getOptions(): ?iterable { return $this->options; } - /** - * @param string[]|null $options + * Key/value map of driver-specific options. + * + * @param array|null $options * * @return self */ - public function setOptions($options = null) + public function setOptions(?iterable $options): self { + $this->initialized['options'] = true; $this->options = $options; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/DriverData.php b/generated/Model/DriverData.php new file mode 100644 index 00000000..a8184ec2 --- /dev/null +++ b/generated/Model/DriverData.php @@ -0,0 +1,83 @@ +initialized); + } + /** + * Name of the storage driver. + * + * @var string|null + */ + protected $name; + /** + * Low-level storage metadata, provided as key/value pairs. + + This information is driver-specific, and depends on the storage-driver + in use, and should be used for informational purposes only. + + * + * @var array|null + */ + protected $data; + /** + * Name of the storage driver. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Name of the storage driver. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * Low-level storage metadata, provided as key/value pairs. + + This information is driver-specific, and depends on the storage-driver + in use, and should be used for informational purposes only. + + * + * @return array|null + */ + public function getData(): ?iterable + { + return $this->data; + } + /** + * Low-level storage metadata, provided as key/value pairs. + + This information is driver-specific, and depends on the storage-driver + in use, and should be used for informational purposes only. + + * + * @param array|null $data + * + * @return self + */ + public function setData(?iterable $data): self + { + $this->initialized['data'] = true; + $this->data = $data; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Endpoint.php b/generated/Model/Endpoint.php deleted file mode 100644 index 6e772a70..00000000 --- a/generated/Model/Endpoint.php +++ /dev/null @@ -1,79 +0,0 @@ -spec; - } - - /** - * @param EndpointSpec $spec - * - * @return self - */ - public function setSpec(?EndpointSpec $spec = null) - { - $this->spec = $spec; - - return $this; - } - - /** - * @return PortConfig[]|null - */ - public function getExposedPorts() - { - return $this->exposedPorts; - } - - /** - * @param PortConfig[]|null $exposedPorts - * - * @return self - */ - public function setExposedPorts($exposedPorts = null) - { - $this->exposedPorts = $exposedPorts; - - return $this; - } - - /** - * @return EndpointVirtualIP[]|null - */ - public function getVirtualIPs() - { - return $this->virtualIPs; - } - - /** - * @param EndpointVirtualIP[]|null $virtualIPs - * - * @return self - */ - public function setVirtualIPs($virtualIPs = null) - { - $this->virtualIPs = $virtualIPs; - - return $this; - } -} diff --git a/generated/Model/EndpointConfig.php b/generated/Model/EndpointConfig.php deleted file mode 100644 index 34b9f1f1..00000000 --- a/generated/Model/EndpointConfig.php +++ /dev/null @@ -1,55 +0,0 @@ -iPv4Address; - } - - /** - * @param string $iPv4Address - * - * @return self - */ - public function setIPv4Address($iPv4Address = null) - { - $this->iPv4Address = $iPv4Address; - - return $this; - } - - /** - * @return string - */ - public function getIPv6Address() - { - return $this->iPv6Address; - } - - /** - * @param string $iPv6Address - * - * @return self - */ - public function setIPv6Address($iPv6Address = null) - { - $this->iPv6Address = $iPv6Address; - - return $this; - } -} diff --git a/generated/Model/EndpointIPAMConfig.php b/generated/Model/EndpointIPAMConfig.php index 693a136e..e86adf83 100644 --- a/generated/Model/EndpointIPAMConfig.php +++ b/generated/Model/EndpointIPAMConfig.php @@ -5,75 +5,95 @@ class EndpointIPAMConfig { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var string|null */ protected $iPv4Address; /** - * @var string + * + * + * @var string|null */ protected $iPv6Address; /** - * @var string[] + * + * + * @var list|null */ protected $linkLocalIPs; - /** - * @return string + * + * + * @return string|null */ - public function getIPv4Address() + public function getIPv4Address(): ?string { return $this->iPv4Address; } - /** - * @param string $iPv4Address + * + * + * @param string|null $iPv4Address * * @return self */ - public function setIPv4Address($iPv4Address = null) + public function setIPv4Address(?string $iPv4Address): self { + $this->initialized['iPv4Address'] = true; $this->iPv4Address = $iPv4Address; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getIPv6Address() + public function getIPv6Address(): ?string { return $this->iPv6Address; } - /** - * @param string $iPv6Address + * + * + * @param string|null $iPv6Address * * @return self */ - public function setIPv6Address($iPv6Address = null) + public function setIPv6Address(?string $iPv6Address): self { + $this->initialized['iPv6Address'] = true; $this->iPv6Address = $iPv6Address; - return $this; } - /** - * @return string[] + * + * + * @return list|null */ - public function getLinkLocalIPs() + public function getLinkLocalIPs(): ?array { return $this->linkLocalIPs; } - /** - * @param string[] $linkLocalIPs + * + * + * @param list|null $linkLocalIPs * * @return self */ - public function setLinkLocalIPs(?array $linkLocalIPs = null) + public function setLinkLocalIPs(?array $linkLocalIPs): self { + $this->initialized['linkLocalIPs'] = true; $this->linkLocalIPs = $linkLocalIPs; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/EndpointPortConfig.php b/generated/Model/EndpointPortConfig.php new file mode 100644 index 00000000..69134e92 --- /dev/null +++ b/generated/Model/EndpointPortConfig.php @@ -0,0 +1,182 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $name; + /** + * + * + * @var string|null + */ + protected $protocol; + /** + * The port inside the container. + * + * @var int|null + */ + protected $targetPort; + /** + * The port on the swarm hosts. + * + * @var int|null + */ + protected $publishedPort; + /** + * The mode in which port is published. + +


+ + - "ingress" makes the target port accessible on every node, + regardless of whether there is a task for the service running on + that node or not. + - "host" bypasses the routing mesh and publish the port directly on + the swarm node where that service is running. + + * + * @var string|null + */ + protected $publishMode = 'ingress'; + /** + * + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * + * + * @return string|null + */ + public function getProtocol(): ?string + { + return $this->protocol; + } + /** + * + * + * @param string|null $protocol + * + * @return self + */ + public function setProtocol(?string $protocol): self + { + $this->initialized['protocol'] = true; + $this->protocol = $protocol; + return $this; + } + /** + * The port inside the container. + * + * @return int|null + */ + public function getTargetPort(): ?int + { + return $this->targetPort; + } + /** + * The port inside the container. + * + * @param int|null $targetPort + * + * @return self + */ + public function setTargetPort(?int $targetPort): self + { + $this->initialized['targetPort'] = true; + $this->targetPort = $targetPort; + return $this; + } + /** + * The port on the swarm hosts. + * + * @return int|null + */ + public function getPublishedPort(): ?int + { + return $this->publishedPort; + } + /** + * The port on the swarm hosts. + * + * @param int|null $publishedPort + * + * @return self + */ + public function setPublishedPort(?int $publishedPort): self + { + $this->initialized['publishedPort'] = true; + $this->publishedPort = $publishedPort; + return $this; + } + /** + * The mode in which port is published. + +


+ + - "ingress" makes the target port accessible on every node, + regardless of whether there is a task for the service running on + that node or not. + - "host" bypasses the routing mesh and publish the port directly on + the swarm node where that service is running. + + * + * @return string|null + */ + public function getPublishMode(): ?string + { + return $this->publishMode; + } + /** + * The mode in which port is published. + +


+ + - "ingress" makes the target port accessible on every node, + regardless of whether there is a task for the service running on + that node or not. + - "host" bypasses the routing mesh and publish the port directly on + the swarm node where that service is running. + + * + * @param string|null $publishMode + * + * @return self + */ + public function setPublishMode(?string $publishMode): self + { + $this->initialized['publishMode'] = true; + $this->publishMode = $publishMode; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/EndpointSettings.php b/generated/Model/EndpointSettings.php index 5add4494..97e83788 100644 --- a/generated/Model/EndpointSettings.php +++ b/generated/Model/EndpointSettings.php @@ -5,291 +5,436 @@ class EndpointSettings { /** - * @var EndpointIPAMConfig + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * EndpointIPAMConfig represents an endpoint's IPAM configuration. + * + * @var EndpointIPAMConfig|null */ protected $iPAMConfig; /** - * @var string[] + * + * + * @var list|null */ protected $links; /** - * @var string[] + * MAC address for the endpoint on this network. The network driver might ignore this parameter. + * + * @var string|null + */ + protected $macAddress; + /** + * + * + * @var list|null */ protected $aliases; /** - * @var string + * DriverOpts is a mapping of driver options and values. These options + are passed directly to the driver and are driver specific. + + * + * @var array|null + */ + protected $driverOpts; + /** + * Unique ID of the network. + * + * @var string|null */ protected $networkID; /** - * @var string + * Unique ID for the service endpoint in a Sandbox. + * + * @var string|null */ protected $endpointID; /** - * @var string + * Gateway address for this network. + * + * @var string|null */ protected $gateway; /** - * @var string + * IPv4 address. + * + * @var string|null */ protected $iPAddress; /** - * @var int + * Mask length of the IPv4 address. + * + * @var int|null */ protected $iPPrefixLen; /** - * @var string + * IPv6 gateway address. + * + * @var string|null */ protected $iPv6Gateway; /** - * @var string + * Global IPv6 address. + * + * @var string|null */ protected $globalIPv6Address; /** - * @var int + * Mask length of the global IPv6 address. + * + * @var int|null */ protected $globalIPv6PrefixLen; /** - * @var string - */ - protected $macAddress; - - /** - * @return EndpointIPAMConfig + * List of all DNS names an endpoint has on a specific network. This + list is based on the container name, network aliases, container short + ID, and hostname. + + These DNS names are non-fully qualified but can contain several dots. + You can get fully qualified DNS names by appending `.`. + For instance, if container name is `my.ctr` and the network is named + `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + `my.ctr.testnet`. + + * + * @var list|null + */ + protected $dNSNames; + /** + * EndpointIPAMConfig represents an endpoint's IPAM configuration. + * + * @return EndpointIPAMConfig|null */ - public function getIPAMConfig() + public function getIPAMConfig(): ?EndpointIPAMConfig { return $this->iPAMConfig; } - /** - * @param EndpointIPAMConfig $iPAMConfig + * EndpointIPAMConfig represents an endpoint's IPAM configuration. + * + * @param EndpointIPAMConfig|null $iPAMConfig * * @return self */ - public function setIPAMConfig(?EndpointIPAMConfig $iPAMConfig = null) + public function setIPAMConfig(?EndpointIPAMConfig $iPAMConfig): self { + $this->initialized['iPAMConfig'] = true; $this->iPAMConfig = $iPAMConfig; - return $this; } - /** - * @return string[] + * + * + * @return list|null */ - public function getLinks() + public function getLinks(): ?array { return $this->links; } - /** - * @param string[] $links + * + * + * @param list|null $links * * @return self */ - public function setLinks(?array $links = null) + public function setLinks(?array $links): self { + $this->initialized['links'] = true; $this->links = $links; - return $this; } - /** - * @return string[] + * MAC address for the endpoint on this network. The network driver might ignore this parameter. + * + * @return string|null */ - public function getAliases() + public function getMacAddress(): ?string + { + return $this->macAddress; + } + /** + * MAC address for the endpoint on this network. The network driver might ignore this parameter. + * + * @param string|null $macAddress + * + * @return self + */ + public function setMacAddress(?string $macAddress): self + { + $this->initialized['macAddress'] = true; + $this->macAddress = $macAddress; + return $this; + } + /** + * + * + * @return list|null + */ + public function getAliases(): ?array { return $this->aliases; } - /** - * @param string[] $aliases + * + * + * @param list|null $aliases * * @return self */ - public function setAliases(?array $aliases = null) + public function setAliases(?array $aliases): self { + $this->initialized['aliases'] = true; $this->aliases = $aliases; - return $this; } - /** - * @return string + * DriverOpts is a mapping of driver options and values. These options + are passed directly to the driver and are driver specific. + + * + * @return array|null + */ + public function getDriverOpts(): ?iterable + { + return $this->driverOpts; + } + /** + * DriverOpts is a mapping of driver options and values. These options + are passed directly to the driver and are driver specific. + + * + * @param array|null $driverOpts + * + * @return self + */ + public function setDriverOpts(?iterable $driverOpts): self + { + $this->initialized['driverOpts'] = true; + $this->driverOpts = $driverOpts; + return $this; + } + /** + * Unique ID of the network. + * + * @return string|null */ - public function getNetworkID() + public function getNetworkID(): ?string { return $this->networkID; } - /** - * @param string $networkID + * Unique ID of the network. + * + * @param string|null $networkID * * @return self */ - public function setNetworkID($networkID = null) + public function setNetworkID(?string $networkID): self { + $this->initialized['networkID'] = true; $this->networkID = $networkID; - return $this; } - /** - * @return string + * Unique ID for the service endpoint in a Sandbox. + * + * @return string|null */ - public function getEndpointID() + public function getEndpointID(): ?string { return $this->endpointID; } - /** - * @param string $endpointID + * Unique ID for the service endpoint in a Sandbox. + * + * @param string|null $endpointID * * @return self */ - public function setEndpointID($endpointID = null) + public function setEndpointID(?string $endpointID): self { + $this->initialized['endpointID'] = true; $this->endpointID = $endpointID; - return $this; } - /** - * @return string + * Gateway address for this network. + * + * @return string|null */ - public function getGateway() + public function getGateway(): ?string { return $this->gateway; } - /** - * @param string $gateway + * Gateway address for this network. + * + * @param string|null $gateway * * @return self */ - public function setGateway($gateway = null) + public function setGateway(?string $gateway): self { + $this->initialized['gateway'] = true; $this->gateway = $gateway; - return $this; } - /** - * @return string + * IPv4 address. + * + * @return string|null */ - public function getIPAddress() + public function getIPAddress(): ?string { return $this->iPAddress; } - /** - * @param string $iPAddress + * IPv4 address. + * + * @param string|null $iPAddress * * @return self */ - public function setIPAddress($iPAddress = null) + public function setIPAddress(?string $iPAddress): self { + $this->initialized['iPAddress'] = true; $this->iPAddress = $iPAddress; - return $this; } - /** - * @return int + * Mask length of the IPv4 address. + * + * @return int|null */ - public function getIPPrefixLen() + public function getIPPrefixLen(): ?int { return $this->iPPrefixLen; } - /** - * @param int $iPPrefixLen + * Mask length of the IPv4 address. + * + * @param int|null $iPPrefixLen * * @return self */ - public function setIPPrefixLen($iPPrefixLen = null) + public function setIPPrefixLen(?int $iPPrefixLen): self { + $this->initialized['iPPrefixLen'] = true; $this->iPPrefixLen = $iPPrefixLen; - return $this; } - /** - * @return string + * IPv6 gateway address. + * + * @return string|null */ - public function getIPv6Gateway() + public function getIPv6Gateway(): ?string { return $this->iPv6Gateway; } - /** - * @param string $iPv6Gateway + * IPv6 gateway address. + * + * @param string|null $iPv6Gateway * * @return self */ - public function setIPv6Gateway($iPv6Gateway = null) + public function setIPv6Gateway(?string $iPv6Gateway): self { + $this->initialized['iPv6Gateway'] = true; $this->iPv6Gateway = $iPv6Gateway; - return $this; } - /** - * @return string + * Global IPv6 address. + * + * @return string|null */ - public function getGlobalIPv6Address() + public function getGlobalIPv6Address(): ?string { return $this->globalIPv6Address; } - /** - * @param string $globalIPv6Address + * Global IPv6 address. + * + * @param string|null $globalIPv6Address * * @return self */ - public function setGlobalIPv6Address($globalIPv6Address = null) + public function setGlobalIPv6Address(?string $globalIPv6Address): self { + $this->initialized['globalIPv6Address'] = true; $this->globalIPv6Address = $globalIPv6Address; - return $this; } - /** - * @return int + * Mask length of the global IPv6 address. + * + * @return int|null */ - public function getGlobalIPv6PrefixLen() + public function getGlobalIPv6PrefixLen(): ?int { return $this->globalIPv6PrefixLen; } - /** - * @param int $globalIPv6PrefixLen + * Mask length of the global IPv6 address. + * + * @param int|null $globalIPv6PrefixLen * * @return self */ - public function setGlobalIPv6PrefixLen($globalIPv6PrefixLen = null) + public function setGlobalIPv6PrefixLen(?int $globalIPv6PrefixLen): self { + $this->initialized['globalIPv6PrefixLen'] = true; $this->globalIPv6PrefixLen = $globalIPv6PrefixLen; - return $this; } - /** - * @return string - */ - public function getMacAddress() + * List of all DNS names an endpoint has on a specific network. This + list is based on the container name, network aliases, container short + ID, and hostname. + + These DNS names are non-fully qualified but can contain several dots. + You can get fully qualified DNS names by appending `.`. + For instance, if container name is `my.ctr` and the network is named + `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + `my.ctr.testnet`. + + * + * @return list|null + */ + public function getDNSNames(): ?array { - return $this->macAddress; + return $this->dNSNames; } - /** - * @param string $macAddress - * - * @return self - */ - public function setMacAddress($macAddress = null) + * List of all DNS names an endpoint has on a specific network. This + list is based on the container name, network aliases, container short + ID, and hostname. + + These DNS names are non-fully qualified but can contain several dots. + You can get fully qualified DNS names by appending `.`. + For instance, if container name is `my.ctr` and the network is named + `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + `my.ctr.testnet`. + + * + * @param list|null $dNSNames + * + * @return self + */ + public function setDNSNames(?array $dNSNames): self { - $this->macAddress = $macAddress; - + $this->initialized['dNSNames'] = true; + $this->dNSNames = $dNSNames; return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/EndpointSpec.php b/generated/Model/EndpointSpec.php index 2f8b3f13..a9fd0062 100644 --- a/generated/Model/EndpointSpec.php +++ b/generated/Model/EndpointSpec.php @@ -5,51 +5,73 @@ class EndpointSpec { /** - * @var string + * @var array */ - protected $mode; + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } /** - * @var PortConfig[]|null + * The mode of resolution to use for internal load balancing between tasks. + * + * @var string|null */ + protected $mode = 'vip'; + /** + * List of exposed ports that this service is accessible on from the + outside. Ports can only be provided if `vip` resolution mode is used. + + * + * @var list|null + */ protected $ports; - /** - * @return string + * The mode of resolution to use for internal load balancing between tasks. + * + * @return string|null */ - public function getMode() + public function getMode(): ?string { return $this->mode; } - /** - * @param string $mode + * The mode of resolution to use for internal load balancing between tasks. + * + * @param string|null $mode * * @return self */ - public function setMode($mode = null) + public function setMode(?string $mode): self { + $this->initialized['mode'] = true; $this->mode = $mode; - return $this; } - /** - * @return PortConfig[]|null - */ - public function getPorts() + * List of exposed ports that this service is accessible on from the + outside. Ports can only be provided if `vip` resolution mode is used. + + * + * @return list|null + */ + public function getPorts(): ?array { return $this->ports; } - /** - * @param PortConfig[]|null $ports - * - * @return self - */ - public function setPorts($ports = null) + * List of exposed ports that this service is accessible on from the + outside. Ports can only be provided if `vip` resolution mode is used. + + * + * @param list|null $ports + * + * @return self + */ + public function setPorts(?array $ports): self { + $this->initialized['ports'] = true; $this->ports = $ports; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/EndpointVirtualIP.php b/generated/Model/EndpointVirtualIP.php deleted file mode 100644 index 7880d9da..00000000 --- a/generated/Model/EndpointVirtualIP.php +++ /dev/null @@ -1,55 +0,0 @@ -networkID; - } - - /** - * @param string $networkID - * - * @return self - */ - public function setNetworkID($networkID = null) - { - $this->networkID = $networkID; - - return $this; - } - - /** - * @return string - */ - public function getAddr() - { - return $this->addr; - } - - /** - * @param string $addr - * - * @return self - */ - public function setAddr($addr = null) - { - $this->addr = $addr; - - return $this; - } -} diff --git a/generated/Model/EngineDescription.php b/generated/Model/EngineDescription.php new file mode 100644 index 00000000..0655b754 --- /dev/null +++ b/generated/Model/EngineDescription.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $engineVersion; + /** + * + * + * @var array|null + */ + protected $labels; + /** + * + * + * @var list|null + */ + protected $plugins; + /** + * + * + * @return string|null + */ + public function getEngineVersion(): ?string + { + return $this->engineVersion; + } + /** + * + * + * @param string|null $engineVersion + * + * @return self + */ + public function setEngineVersion(?string $engineVersion): self + { + $this->initialized['engineVersion'] = true; + $this->engineVersion = $engineVersion; + return $this; + } + /** + * + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * + * + * @return list|null + */ + public function getPlugins(): ?array + { + return $this->plugins; + } + /** + * + * + * @param list|null $plugins + * + * @return self + */ + public function setPlugins(?array $plugins): self + { + $this->initialized['plugins'] = true; + $this->plugins = $plugins; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/EngineDescriptionPluginsItem.php b/generated/Model/EngineDescriptionPluginsItem.php new file mode 100644 index 00000000..d32380a2 --- /dev/null +++ b/generated/Model/EngineDescriptionPluginsItem.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $type; + /** + * + * + * @var string|null + */ + protected $name; + /** + * + * + * @return string|null + */ + public function getType(): ?string + { + return $this->type; + } + /** + * + * + * @param string|null $type + * + * @return self + */ + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + return $this; + } + /** + * + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ErrorDetail.php b/generated/Model/ErrorDetail.php index ca907989..0505364f 100644 --- a/generated/Model/ErrorDetail.php +++ b/generated/Model/ErrorDetail.php @@ -5,51 +5,67 @@ class ErrorDetail { /** - * @var int + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var int|null */ protected $code; /** - * @var string + * + * + * @var string|null */ protected $message; - /** - * @return int + * + * + * @return int|null */ - public function getCode() + public function getCode(): ?int { return $this->code; } - /** - * @param int $code + * + * + * @param int|null $code * * @return self */ - public function setCode($code = null) + public function setCode(?int $code): self { + $this->initialized['code'] = true; $this->code = $code; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getMessage() + public function getMessage(): ?string { return $this->message; } - /** - * @param string $message + * + * + * @param string|null $message * * @return self */ - public function setMessage($message = null) + public function setMessage(?string $message): self { + $this->initialized['message'] = true; $this->message = $message; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/ErrorResponse.php b/generated/Model/ErrorResponse.php new file mode 100644 index 00000000..409c2f1e --- /dev/null +++ b/generated/Model/ErrorResponse.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * The error message. + * + * @var string|null + */ + protected $message; + /** + * The error message. + * + * @return string|null + */ + public function getMessage(): ?string + { + return $this->message; + } + /** + * The error message. + * + * @param string|null $message + * + * @return self + */ + public function setMessage(?string $message): self + { + $this->initialized['message'] = true; + $this->message = $message; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Event.php b/generated/Model/Event.php deleted file mode 100644 index 19c246d0..00000000 --- a/generated/Model/Event.php +++ /dev/null @@ -1,127 +0,0 @@ -status; - } - - /** - * @param string $status - * - * @return self - */ - public function setStatus($status = null) - { - $this->status = $status; - - return $this; - } - - /** - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId($id = null) - { - $this->id = $id; - - return $this; - } - - /** - * @return string - */ - public function getFrom() - { - return $this->from; - } - - /** - * @param string $from - * - * @return self - */ - public function setFrom($from = null) - { - $this->from = $from; - - return $this; - } - - /** - * @return int - */ - public function getTime() - { - return $this->time; - } - - /** - * @param int $time - * - * @return self - */ - public function setTime($time = null) - { - $this->time = $time; - - return $this; - } - - /** - * @return int - */ - public function getTimeNano() - { - return $this->timeNano; - } - - /** - * @param int $timeNano - * - * @return self - */ - public function setTimeNano($timeNano = null) - { - $this->timeNano = $timeNano; - - return $this; - } -} diff --git a/generated/Model/EventActor.php b/generated/Model/EventActor.php new file mode 100644 index 00000000..10624703 --- /dev/null +++ b/generated/Model/EventActor.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * The ID of the object emitting the event + * + * @var string|null + */ + protected $iD; + /** + * Various key/value attributes of the object, depending on its type. + * + * @var array|null + */ + protected $attributes; + /** + * The ID of the object emitting the event + * + * @return string|null + */ + public function getID(): ?string + { + return $this->iD; + } + /** + * The ID of the object emitting the event + * + * @param string|null $iD + * + * @return self + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } + /** + * Various key/value attributes of the object, depending on its type. + * + * @return array|null + */ + public function getAttributes(): ?iterable + { + return $this->attributes; + } + /** + * Various key/value attributes of the object, depending on its type. + * + * @param array|null $attributes + * + * @return self + */ + public function setAttributes(?iterable $attributes): self + { + $this->initialized['attributes'] = true; + $this->attributes = $attributes; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/EventMessage.php b/generated/Model/EventMessage.php new file mode 100644 index 00000000..320cf866 --- /dev/null +++ b/generated/Model/EventMessage.php @@ -0,0 +1,195 @@ +initialized); + } + /** + * The type of object emitting the event + * + * @var string|null + */ + protected $type; + /** + * The type of event + * + * @var string|null + */ + protected $action; + /** + * Actor describes something that generates events, like a container, network, + or a volume. + + * + * @var EventActor|null + */ + protected $actor; + /** + * Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + + * + * @var string|null + */ + protected $scope; + /** + * Timestamp of event + * + * @var int|null + */ + protected $time; + /** + * Timestamp of event, with nanosecond accuracy + * + * @var int|null + */ + protected $timeNano; + /** + * The type of object emitting the event + * + * @return string|null + */ + public function getType(): ?string + { + return $this->type; + } + /** + * The type of object emitting the event + * + * @param string|null $type + * + * @return self + */ + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + return $this; + } + /** + * The type of event + * + * @return string|null + */ + public function getAction(): ?string + { + return $this->action; + } + /** + * The type of event + * + * @param string|null $action + * + * @return self + */ + public function setAction(?string $action): self + { + $this->initialized['action'] = true; + $this->action = $action; + return $this; + } + /** + * Actor describes something that generates events, like a container, network, + or a volume. + + * + * @return EventActor|null + */ + public function getActor(): ?EventActor + { + return $this->actor; + } + /** + * Actor describes something that generates events, like a container, network, + or a volume. + + * + * @param EventActor|null $actor + * + * @return self + */ + public function setActor(?EventActor $actor): self + { + $this->initialized['actor'] = true; + $this->actor = $actor; + return $this; + } + /** + * Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + + * + * @return string|null + */ + public function getScope(): ?string + { + return $this->scope; + } + /** + * Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + + * + * @param string|null $scope + * + * @return self + */ + public function setScope(?string $scope): self + { + $this->initialized['scope'] = true; + $this->scope = $scope; + return $this; + } + /** + * Timestamp of event + * + * @return int|null + */ + public function getTime(): ?int + { + return $this->time; + } + /** + * Timestamp of event + * + * @param int|null $time + * + * @return self + */ + public function setTime(?int $time): self + { + $this->initialized['time'] = true; + $this->time = $time; + return $this; + } + /** + * Timestamp of event, with nanosecond accuracy + * + * @return int|null + */ + public function getTimeNano(): ?int + { + return $this->timeNano; + } + /** + * Timestamp of event, with nanosecond accuracy + * + * @param int|null $timeNano + * + * @return self + */ + public function setTimeNano(?int $timeNano): self + { + $this->initialized['timeNano'] = true; + $this->timeNano = $timeNano; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ExecCommand.php b/generated/Model/ExecCommand.php deleted file mode 100644 index 8ec51546..00000000 --- a/generated/Model/ExecCommand.php +++ /dev/null @@ -1,223 +0,0 @@ -iD; - } - - /** - * @param string $iD - * - * @return self - */ - public function setID($iD = null) - { - $this->iD = $iD; - - return $this; - } - - /** - * @return bool - */ - public function getRunning() - { - return $this->running; - } - - /** - * @param bool $running - * - * @return self - */ - public function setRunning($running = null) - { - $this->running = $running; - - return $this; - } - - /** - * @return int - */ - public function getExitCode() - { - return $this->exitCode; - } - - /** - * @param int $exitCode - * - * @return self - */ - public function setExitCode($exitCode = null) - { - $this->exitCode = $exitCode; - - return $this; - } - - /** - * @return ProcessConfig - */ - public function getProcessConfig() - { - return $this->processConfig; - } - - /** - * @param ProcessConfig $processConfig - * - * @return self - */ - public function setProcessConfig(?ProcessConfig $processConfig = null) - { - $this->processConfig = $processConfig; - - return $this; - } - - /** - * @return bool - */ - public function getOpenStdin() - { - return $this->openStdin; - } - - /** - * @param bool $openStdin - * - * @return self - */ - public function setOpenStdin($openStdin = null) - { - $this->openStdin = $openStdin; - - return $this; - } - - /** - * @return bool - */ - public function getOpenStderr() - { - return $this->openStderr; - } - - /** - * @param bool $openStderr - * - * @return self - */ - public function setOpenStderr($openStderr = null) - { - $this->openStderr = $openStderr; - - return $this; - } - - /** - * @return bool - */ - public function getOpenStdout() - { - return $this->openStdout; - } - - /** - * @param bool $openStdout - * - * @return self - */ - public function setOpenStdout($openStdout = null) - { - $this->openStdout = $openStdout; - - return $this; - } - - /** - * @return Container - */ - public function getContainer() - { - return $this->container; - } - - /** - * @param Container $container - * - * @return self - */ - public function setContainer(?Container $container = null) - { - $this->container = $container; - - return $this; - } - - /** - * @return string - */ - public function getDetachKeys() - { - return $this->detachKeys; - } - - /** - * @param string $detachKeys - * - * @return self - */ - public function setDetachKeys($detachKeys = null) - { - $this->detachKeys = $detachKeys; - - return $this; - } -} diff --git a/generated/Model/ExecConfig.php b/generated/Model/ExecConfig.php deleted file mode 100644 index 828862cf..00000000 --- a/generated/Model/ExecConfig.php +++ /dev/null @@ -1,151 +0,0 @@ -attachStdin; - } - - /** - * @param bool $attachStdin - * - * @return self - */ - public function setAttachStdin($attachStdin = null) - { - $this->attachStdin = $attachStdin; - - return $this; - } - - /** - * @return bool - */ - public function getAttachStdout() - { - return $this->attachStdout; - } - - /** - * @param bool $attachStdout - * - * @return self - */ - public function setAttachStdout($attachStdout = null) - { - $this->attachStdout = $attachStdout; - - return $this; - } - - /** - * @return bool - */ - public function getAttachStderr() - { - return $this->attachStderr; - } - - /** - * @param bool $attachStderr - * - * @return self - */ - public function setAttachStderr($attachStderr = null) - { - $this->attachStderr = $attachStderr; - - return $this; - } - - /** - * @return bool - */ - public function getTty() - { - return $this->tty; - } - - /** - * @param bool $tty - * - * @return self - */ - public function setTty($tty = null) - { - $this->tty = $tty; - - return $this; - } - - /** - * @return string[]|null - */ - public function getCmd() - { - return $this->cmd; - } - - /** - * @param string[]|null $cmd - * - * @return self - */ - public function setCmd($cmd = null) - { - $this->cmd = $cmd; - - return $this; - } - - /** - * @return string - */ - public function getDetachKeys() - { - return $this->detachKeys; - } - - /** - * @param string $detachKeys - * - * @return self - */ - public function setDetachKeys($detachKeys = null) - { - $this->detachKeys = $detachKeys; - - return $this; - } -} diff --git a/generated/Model/ExecCreateResult.php b/generated/Model/ExecCreateResult.php deleted file mode 100644 index 52e798c0..00000000 --- a/generated/Model/ExecCreateResult.php +++ /dev/null @@ -1,55 +0,0 @@ -id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId($id = null) - { - $this->id = $id; - - return $this; - } - - /** - * @return string[]|null - */ - public function getWarnings() - { - return $this->warnings; - } - - /** - * @param string[]|null $warnings - * - * @return self - */ - public function setWarnings($warnings = null) - { - $this->warnings = $warnings; - - return $this; - } -} diff --git a/generated/Model/ExecIdJsonGetResponse200.php b/generated/Model/ExecIdJsonGetResponse200.php new file mode 100644 index 00000000..72f273e0 --- /dev/null +++ b/generated/Model/ExecIdJsonGetResponse200.php @@ -0,0 +1,323 @@ +initialized); + } + /** + * + * + * @var bool|null + */ + protected $canRemove; + /** + * + * + * @var string|null + */ + protected $detachKeys; + /** + * + * + * @var string|null + */ + protected $iD; + /** + * + * + * @var bool|null + */ + protected $running; + /** + * + * + * @var int|null + */ + protected $exitCode; + /** + * + * + * @var ProcessConfig|null + */ + protected $processConfig; + /** + * + * + * @var bool|null + */ + protected $openStdin; + /** + * + * + * @var bool|null + */ + protected $openStderr; + /** + * + * + * @var bool|null + */ + protected $openStdout; + /** + * + * + * @var string|null + */ + protected $containerID; + /** + * The system process ID for the exec process. + * + * @var int|null + */ + protected $pid; + /** + * + * + * @return bool|null + */ + public function getCanRemove(): ?bool + { + return $this->canRemove; + } + /** + * + * + * @param bool|null $canRemove + * + * @return self + */ + public function setCanRemove(?bool $canRemove): self + { + $this->initialized['canRemove'] = true; + $this->canRemove = $canRemove; + return $this; + } + /** + * + * + * @return string|null + */ + public function getDetachKeys(): ?string + { + return $this->detachKeys; + } + /** + * + * + * @param string|null $detachKeys + * + * @return self + */ + public function setDetachKeys(?string $detachKeys): self + { + $this->initialized['detachKeys'] = true; + $this->detachKeys = $detachKeys; + return $this; + } + /** + * + * + * @return string|null + */ + public function getID(): ?string + { + return $this->iD; + } + /** + * + * + * @param string|null $iD + * + * @return self + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } + /** + * + * + * @return bool|null + */ + public function getRunning(): ?bool + { + return $this->running; + } + /** + * + * + * @param bool|null $running + * + * @return self + */ + public function setRunning(?bool $running): self + { + $this->initialized['running'] = true; + $this->running = $running; + return $this; + } + /** + * + * + * @return int|null + */ + public function getExitCode(): ?int + { + return $this->exitCode; + } + /** + * + * + * @param int|null $exitCode + * + * @return self + */ + public function setExitCode(?int $exitCode): self + { + $this->initialized['exitCode'] = true; + $this->exitCode = $exitCode; + return $this; + } + /** + * + * + * @return ProcessConfig|null + */ + public function getProcessConfig(): ?ProcessConfig + { + return $this->processConfig; + } + /** + * + * + * @param ProcessConfig|null $processConfig + * + * @return self + */ + public function setProcessConfig(?ProcessConfig $processConfig): self + { + $this->initialized['processConfig'] = true; + $this->processConfig = $processConfig; + return $this; + } + /** + * + * + * @return bool|null + */ + public function getOpenStdin(): ?bool + { + return $this->openStdin; + } + /** + * + * + * @param bool|null $openStdin + * + * @return self + */ + public function setOpenStdin(?bool $openStdin): self + { + $this->initialized['openStdin'] = true; + $this->openStdin = $openStdin; + return $this; + } + /** + * + * + * @return bool|null + */ + public function getOpenStderr(): ?bool + { + return $this->openStderr; + } + /** + * + * + * @param bool|null $openStderr + * + * @return self + */ + public function setOpenStderr(?bool $openStderr): self + { + $this->initialized['openStderr'] = true; + $this->openStderr = $openStderr; + return $this; + } + /** + * + * + * @return bool|null + */ + public function getOpenStdout(): ?bool + { + return $this->openStdout; + } + /** + * + * + * @param bool|null $openStdout + * + * @return self + */ + public function setOpenStdout(?bool $openStdout): self + { + $this->initialized['openStdout'] = true; + $this->openStdout = $openStdout; + return $this; + } + /** + * + * + * @return string|null + */ + public function getContainerID(): ?string + { + return $this->containerID; + } + /** + * + * + * @param string|null $containerID + * + * @return self + */ + public function setContainerID(?string $containerID): self + { + $this->initialized['containerID'] = true; + $this->containerID = $containerID; + return $this; + } + /** + * The system process ID for the exec process. + * + * @return int|null + */ + public function getPid(): ?int + { + return $this->pid; + } + /** + * The system process ID for the exec process. + * + * @param int|null $pid + * + * @return self + */ + public function setPid(?int $pid): self + { + $this->initialized['pid'] = true; + $this->pid = $pid; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ExecIdStartPostBody.php b/generated/Model/ExecIdStartPostBody.php new file mode 100644 index 00000000..1253b660 --- /dev/null +++ b/generated/Model/ExecIdStartPostBody.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * Detach from the command. + * + * @var bool|null + */ + protected $detach; + /** + * Allocate a pseudo-TTY. + * + * @var bool|null + */ + protected $tty; + /** + * Initial console size, as an `[height, width]` array. + * + * @var list|null + */ + protected $consoleSize; + /** + * Detach from the command. + * + * @return bool|null + */ + public function getDetach(): ?bool + { + return $this->detach; + } + /** + * Detach from the command. + * + * @param bool|null $detach + * + * @return self + */ + public function setDetach(?bool $detach): self + { + $this->initialized['detach'] = true; + $this->detach = $detach; + return $this; + } + /** + * Allocate a pseudo-TTY. + * + * @return bool|null + */ + public function getTty(): ?bool + { + return $this->tty; + } + /** + * Allocate a pseudo-TTY. + * + * @param bool|null $tty + * + * @return self + */ + public function setTty(?bool $tty): self + { + $this->initialized['tty'] = true; + $this->tty = $tty; + return $this; + } + /** + * Initial console size, as an `[height, width]` array. + * + * @return list|null + */ + public function getConsoleSize(): ?array + { + return $this->consoleSize; + } + /** + * Initial console size, as an `[height, width]` array. + * + * @param list|null $consoleSize + * + * @return self + */ + public function setConsoleSize(?array $consoleSize): self + { + $this->initialized['consoleSize'] = true; + $this->consoleSize = $consoleSize; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ExecStartConfig.php b/generated/Model/ExecStartConfig.php deleted file mode 100644 index 2daf1fbc..00000000 --- a/generated/Model/ExecStartConfig.php +++ /dev/null @@ -1,55 +0,0 @@ -detach; - } - - /** - * @param bool $detach - * - * @return self - */ - public function setDetach($detach = null) - { - $this->detach = $detach; - - return $this; - } - - /** - * @return bool - */ - public function getTty() - { - return $this->tty; - } - - /** - * @param bool $tty - * - * @return self - */ - public function setTty($tty = null) - { - $this->tty = $tty; - - return $this; - } -} diff --git a/generated/Model/FilesystemChange.php b/generated/Model/FilesystemChange.php new file mode 100644 index 00000000..28ff6435 --- /dev/null +++ b/generated/Model/FilesystemChange.php @@ -0,0 +1,92 @@ +initialized); + } + /** + * Path to file or directory that has changed. + * + * @var string|null + */ + protected $path; + /** + * Kind of change + + Can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + + * + * @var int|null + */ + protected $kind; + /** + * Path to file or directory that has changed. + * + * @return string|null + */ + public function getPath(): ?string + { + return $this->path; + } + /** + * Path to file or directory that has changed. + * + * @param string|null $path + * + * @return self + */ + public function setPath(?string $path): self + { + $this->initialized['path'] = true; + $this->path = $path; + return $this; + } + /** + * Kind of change + + Can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + + * + * @return int|null + */ + public function getKind(): ?int + { + return $this->kind; + } + /** + * Kind of change + + Can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + + * + * @param int|null $kind + * + * @return self + */ + public function setKind(?int $kind): self + { + $this->initialized['kind'] = true; + $this->kind = $kind; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/GenericResourcesItem.php b/generated/Model/GenericResourcesItem.php new file mode 100644 index 00000000..3daf7a05 --- /dev/null +++ b/generated/Model/GenericResourcesItem.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var GenericResourcesItemNamedResourceSpec|null + */ + protected $namedResourceSpec; + /** + * + * + * @var GenericResourcesItemDiscreteResourceSpec|null + */ + protected $discreteResourceSpec; + /** + * + * + * @return GenericResourcesItemNamedResourceSpec|null + */ + public function getNamedResourceSpec(): ?GenericResourcesItemNamedResourceSpec + { + return $this->namedResourceSpec; + } + /** + * + * + * @param GenericResourcesItemNamedResourceSpec|null $namedResourceSpec + * + * @return self + */ + public function setNamedResourceSpec(?GenericResourcesItemNamedResourceSpec $namedResourceSpec): self + { + $this->initialized['namedResourceSpec'] = true; + $this->namedResourceSpec = $namedResourceSpec; + return $this; + } + /** + * + * + * @return GenericResourcesItemDiscreteResourceSpec|null + */ + public function getDiscreteResourceSpec(): ?GenericResourcesItemDiscreteResourceSpec + { + return $this->discreteResourceSpec; + } + /** + * + * + * @param GenericResourcesItemDiscreteResourceSpec|null $discreteResourceSpec + * + * @return self + */ + public function setDiscreteResourceSpec(?GenericResourcesItemDiscreteResourceSpec $discreteResourceSpec): self + { + $this->initialized['discreteResourceSpec'] = true; + $this->discreteResourceSpec = $discreteResourceSpec; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/GenericResourcesItemDiscreteResourceSpec.php b/generated/Model/GenericResourcesItemDiscreteResourceSpec.php new file mode 100644 index 00000000..c00d7dfc --- /dev/null +++ b/generated/Model/GenericResourcesItemDiscreteResourceSpec.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $kind; + /** + * + * + * @var int|null + */ + protected $value; + /** + * + * + * @return string|null + */ + public function getKind(): ?string + { + return $this->kind; + } + /** + * + * + * @param string|null $kind + * + * @return self + */ + public function setKind(?string $kind): self + { + $this->initialized['kind'] = true; + $this->kind = $kind; + return $this; + } + /** + * + * + * @return int|null + */ + public function getValue(): ?int + { + return $this->value; + } + /** + * + * + * @param int|null $value + * + * @return self + */ + public function setValue(?int $value): self + { + $this->initialized['value'] = true; + $this->value = $value; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/GenericResourcesItemNamedResourceSpec.php b/generated/Model/GenericResourcesItemNamedResourceSpec.php new file mode 100644 index 00000000..e7c13a40 --- /dev/null +++ b/generated/Model/GenericResourcesItemNamedResourceSpec.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $kind; + /** + * + * + * @var string|null + */ + protected $value; + /** + * + * + * @return string|null + */ + public function getKind(): ?string + { + return $this->kind; + } + /** + * + * + * @param string|null $kind + * + * @return self + */ + public function setKind(?string $kind): self + { + $this->initialized['kind'] = true; + $this->kind = $kind; + return $this; + } + /** + * + * + * @return string|null + */ + public function getValue(): ?string + { + return $this->value; + } + /** + * + * + * @param string|null $value + * + * @return self + */ + public function setValue(?string $value): self + { + $this->initialized['value'] = true; + $this->value = $value; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/GlobalService.php b/generated/Model/GlobalService.php deleted file mode 100644 index 118e5535..00000000 --- a/generated/Model/GlobalService.php +++ /dev/null @@ -1,7 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } - - /** - * @return mixed - */ - public function getData() - { - return $this->data; - } - - /** - * @param mixed $data - * - * @return self - */ - public function setData($data = null) - { - $this->data = $data; - - return $this; - } -} diff --git a/generated/Model/Health.php b/generated/Model/Health.php new file mode 100644 index 00000000..2bb1b5b3 --- /dev/null +++ b/generated/Model/Health.php @@ -0,0 +1,117 @@ +initialized); + } + /** + * Status is one of `none`, `starting`, `healthy` or `unhealthy` + + - "none" Indicates there is no healthcheck + - "starting" Starting indicates that the container is not yet ready + - "healthy" Healthy indicates that the container is running correctly + - "unhealthy" Unhealthy indicates that the container has a problem + + * + * @var string|null + */ + protected $status; + /** + * FailingStreak is the number of consecutive failures + * + * @var int|null + */ + protected $failingStreak; + /** + * Log contains the last few results (oldest first) + * + * @var list|null + */ + protected $log; + /** + * Status is one of `none`, `starting`, `healthy` or `unhealthy` + + - "none" Indicates there is no healthcheck + - "starting" Starting indicates that the container is not yet ready + - "healthy" Healthy indicates that the container is running correctly + - "unhealthy" Unhealthy indicates that the container has a problem + + * + * @return string|null + */ + public function getStatus(): ?string + { + return $this->status; + } + /** + * Status is one of `none`, `starting`, `healthy` or `unhealthy` + + - "none" Indicates there is no healthcheck + - "starting" Starting indicates that the container is not yet ready + - "healthy" Healthy indicates that the container is running correctly + - "unhealthy" Unhealthy indicates that the container has a problem + + * + * @param string|null $status + * + * @return self + */ + public function setStatus(?string $status): self + { + $this->initialized['status'] = true; + $this->status = $status; + return $this; + } + /** + * FailingStreak is the number of consecutive failures + * + * @return int|null + */ + public function getFailingStreak(): ?int + { + return $this->failingStreak; + } + /** + * FailingStreak is the number of consecutive failures + * + * @param int|null $failingStreak + * + * @return self + */ + public function setFailingStreak(?int $failingStreak): self + { + $this->initialized['failingStreak'] = true; + $this->failingStreak = $failingStreak; + return $this; + } + /** + * Log contains the last few results (oldest first) + * + * @return list|null + */ + public function getLog(): ?array + { + return $this->log; + } + /** + * Log contains the last few results (oldest first) + * + * @param list|null $log + * + * @return self + */ + public function setLog(?array $log): self + { + $this->initialized['log'] = true; + $this->log = $log; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/HealthConfig.php b/generated/Model/HealthConfig.php new file mode 100644 index 00000000..588bed23 --- /dev/null +++ b/generated/Model/HealthConfig.php @@ -0,0 +1,234 @@ +initialized); + } + /** + * The test to perform. Possible values are: + + - `[]` inherit healthcheck from image or parent image + - `["NONE"]` disable healthcheck + - `["CMD", args...]` exec arguments directly + - `["CMD-SHELL", command]` run command with system's default shell + + * + * @var list|null + */ + protected $test; + /** + * The time to wait between checks in nanoseconds. It should be 0 or at + least 1000000 (1 ms). 0 means inherit. + + * + * @var int|null + */ + protected $interval; + /** + * The time to wait before considering the check to have hung. It should + be 0 or at least 1000000 (1 ms). 0 means inherit. + + * + * @var int|null + */ + protected $timeout; + /** + * The number of consecutive failures needed to consider a container as + unhealthy. 0 means inherit. + + * + * @var int|null + */ + protected $retries; + /** + * Start period for the container to initialize before starting + health-retries countdown in nanoseconds. It should be 0 or at least + 1000000 (1 ms). 0 means inherit. + + * + * @var int|null + */ + protected $startPeriod; + /** + * The time to wait between checks in nanoseconds during the start period. + It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + * + * @var int|null + */ + protected $startInterval; + /** + * The test to perform. Possible values are: + + - `[]` inherit healthcheck from image or parent image + - `["NONE"]` disable healthcheck + - `["CMD", args...]` exec arguments directly + - `["CMD-SHELL", command]` run command with system's default shell + + * + * @return list|null + */ + public function getTest(): ?array + { + return $this->test; + } + /** + * The test to perform. Possible values are: + + - `[]` inherit healthcheck from image or parent image + - `["NONE"]` disable healthcheck + - `["CMD", args...]` exec arguments directly + - `["CMD-SHELL", command]` run command with system's default shell + + * + * @param list|null $test + * + * @return self + */ + public function setTest(?array $test): self + { + $this->initialized['test'] = true; + $this->test = $test; + return $this; + } + /** + * The time to wait between checks in nanoseconds. It should be 0 or at + least 1000000 (1 ms). 0 means inherit. + + * + * @return int|null + */ + public function getInterval(): ?int + { + return $this->interval; + } + /** + * The time to wait between checks in nanoseconds. It should be 0 or at + least 1000000 (1 ms). 0 means inherit. + + * + * @param int|null $interval + * + * @return self + */ + public function setInterval(?int $interval): self + { + $this->initialized['interval'] = true; + $this->interval = $interval; + return $this; + } + /** + * The time to wait before considering the check to have hung. It should + be 0 or at least 1000000 (1 ms). 0 means inherit. + + * + * @return int|null + */ + public function getTimeout(): ?int + { + return $this->timeout; + } + /** + * The time to wait before considering the check to have hung. It should + be 0 or at least 1000000 (1 ms). 0 means inherit. + + * + * @param int|null $timeout + * + * @return self + */ + public function setTimeout(?int $timeout): self + { + $this->initialized['timeout'] = true; + $this->timeout = $timeout; + return $this; + } + /** + * The number of consecutive failures needed to consider a container as + unhealthy. 0 means inherit. + + * + * @return int|null + */ + public function getRetries(): ?int + { + return $this->retries; + } + /** + * The number of consecutive failures needed to consider a container as + unhealthy. 0 means inherit. + + * + * @param int|null $retries + * + * @return self + */ + public function setRetries(?int $retries): self + { + $this->initialized['retries'] = true; + $this->retries = $retries; + return $this; + } + /** + * Start period for the container to initialize before starting + health-retries countdown in nanoseconds. It should be 0 or at least + 1000000 (1 ms). 0 means inherit. + + * + * @return int|null + */ + public function getStartPeriod(): ?int + { + return $this->startPeriod; + } + /** + * Start period for the container to initialize before starting + health-retries countdown in nanoseconds. It should be 0 or at least + 1000000 (1 ms). 0 means inherit. + + * + * @param int|null $startPeriod + * + * @return self + */ + public function setStartPeriod(?int $startPeriod): self + { + $this->initialized['startPeriod'] = true; + $this->startPeriod = $startPeriod; + return $this; + } + /** + * The time to wait between checks in nanoseconds during the start period. + It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + * + * @return int|null + */ + public function getStartInterval(): ?int + { + return $this->startInterval; + } + /** + * The time to wait between checks in nanoseconds during the start period. + It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + * + * @param int|null $startInterval + * + * @return self + */ + public function setStartInterval(?int $startInterval): self + { + $this->initialized['startInterval'] = true; + $this->startInterval = $startInterval; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/HealthcheckResult.php b/generated/Model/HealthcheckResult.php new file mode 100644 index 00000000..13bea4d4 --- /dev/null +++ b/generated/Model/HealthcheckResult.php @@ -0,0 +1,157 @@ +initialized); + } + /** + * Date and time at which this check started in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @var \DateTime|null + */ + protected $start; + /** + * Date and time at which this check ended in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @var string|null + */ + protected $end; + /** + * ExitCode meanings: + + - `0` healthy + - `1` unhealthy + - `2` reserved (considered unhealthy) + - other values: error running probe + + * + * @var int|null + */ + protected $exitCode; + /** + * Output from last check + * + * @var string|null + */ + protected $output; + /** + * Date and time at which this check started in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @return \DateTime|null + */ + public function getStart(): ?\DateTime + { + return $this->start; + } + /** + * Date and time at which this check started in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @param \DateTime|null $start + * + * @return self + */ + public function setStart(?\DateTime $start): self + { + $this->initialized['start'] = true; + $this->start = $start; + return $this; + } + /** + * Date and time at which this check ended in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @return string|null + */ + public function getEnd(): ?string + { + return $this->end; + } + /** + * Date and time at which this check ended in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @param string|null $end + * + * @return self + */ + public function setEnd(?string $end): self + { + $this->initialized['end'] = true; + $this->end = $end; + return $this; + } + /** + * ExitCode meanings: + + - `0` healthy + - `1` unhealthy + - `2` reserved (considered unhealthy) + - other values: error running probe + + * + * @return int|null + */ + public function getExitCode(): ?int + { + return $this->exitCode; + } + /** + * ExitCode meanings: + + - `0` healthy + - `1` unhealthy + - `2` reserved (considered unhealthy) + - other values: error running probe + + * + * @param int|null $exitCode + * + * @return self + */ + public function setExitCode(?int $exitCode): self + { + $this->initialized['exitCode'] = true; + $this->exitCode = $exitCode; + return $this; + } + /** + * Output from last check + * + * @return string|null + */ + public function getOutput(): ?string + { + return $this->output; + } + /** + * Output from last check + * + * @param string|null $output + * + * @return self + */ + public function setOutput(?string $output): self + { + $this->initialized['output'] = true; + $this->output = $output; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/HostConfig.php b/generated/Model/HostConfig.php index 34376e6b..f9513fa0 100644 --- a/generated/Model/HostConfig.php +++ b/generated/Model/HostConfig.php @@ -5,1179 +5,2532 @@ class HostConfig { /** - * @var string[]|null + * @var array */ - protected $binds; + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } /** - * @var string[]|null - */ - protected $tmpfs; + * An integer value representing this container's relative CPU weight + versus other containers. + + * + * @var int|null + */ + protected $cpuShares; /** - * @var string[]|null - */ - protected $links; + * Memory limit in bytes. + * + * @var int|null + */ + protected $memory = 0; + /** + * Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + + * + * @var string|null + */ + protected $cgroupParent; /** - * @var string[]|null + * Block IO weight (relative weight). + * + * @var int|null */ - protected $lxcConf; + protected $blkioWeight; /** - * @var int - */ - protected $memory; + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @var list|null + */ + protected $blkioWeightDevice; /** - * @var int - */ - protected $memorySwap; + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var list|null + */ + protected $blkioDeviceReadBps; /** - * @var int - */ - protected $memoryReservation; + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var list|null + */ + protected $blkioDeviceWriteBps; /** - * @var int - */ - protected $kernelMemory; + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var list|null + */ + protected $blkioDeviceReadIOps; /** - * @var int - */ - protected $cpuShares; + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var list|null + */ + protected $blkioDeviceWriteIOps; /** - * @var int + * The length of a CPU period in microseconds. + * + * @var int|null */ protected $cpuPeriod; /** - * @var int + * Microseconds of CPU time that the container can get in a CPU period. + * + * @var int|null */ protected $cpuQuota; /** - * @var string + * The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @var int|null + */ + protected $cpuRealtimePeriod; + /** + * The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @var int|null + */ + protected $cpuRealtimeRuntime; + /** + * CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * + * @var string|null */ protected $cpusetCpus; /** - * @var string - */ + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + + * + * @var string|null + */ protected $cpusetMems; /** - * @var int + * A list of devices to add to the container. + * + * @var list|null */ - protected $maximumIOps; + protected $devices; /** - * @var int + * a list of cgroup rules to apply to the container + * + * @var list|null */ - protected $maximumIOBps; + protected $deviceCgroupRules; /** - * @var int + * A list of requests for devices to be sent to device drivers. + * + * @var list|null + */ + protected $deviceRequests; + /** + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + + * + * @var int|null + */ + protected $kernelMemoryTCP; + /** + * Memory soft limit in bytes. + * + * @var int|null */ - protected $blkioWeight; + protected $memoryReservation; /** - * @var DeviceWeight[]|null - */ - protected $blkioWeightDevice; + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + + * + * @var int|null + */ + protected $memorySwap; /** - * @var DeviceRate[]|null - */ - protected $blkioDeviceReadBps; + * Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + + * + * @var int|null + */ + protected $memorySwappiness; /** - * @var DeviceRate[]|null + * CPU quota in units of 10-9 CPUs. + * + * @var int|null */ - protected $blkioDeviceReadIOps; + protected $nanoCpus; /** - * @var DeviceRate[]|null + * Disable OOM Killer for the container. + * + * @var bool|null */ - protected $blkioDeviceWriteBps; + protected $oomKillDisable; /** - * @var DeviceRate[]|null - */ - protected $blkioDeviceWriteIOps; + * Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + + * + * @var bool|null + */ + protected $init; + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + + * + * @var int|null + */ + protected $pidsLimit; /** - * @var int - */ - protected $memorySwappiness; + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @var list|null + */ + protected $ulimits; /** - * @var bool - */ - protected $oomKillDisable; + * The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @var int|null + */ + protected $cpuCount; + /** + * The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @var int|null + */ + protected $cpuPercent; + /** + * Maximum IOps for the container system drive (Windows only) + * + * @var int|null + */ + protected $iOMaximumIOps; + /** + * Maximum IO in bytes per second for the container system drive + (Windows only). + + * + * @var int|null + */ + protected $iOMaximumBandwidth; + /** + * A list of volume bindings for this container. Each volume binding + is a string in one of these forms: + + - `host-src:container-dest[:options]` to bind-mount a host path + into the container. Both `host-src`, and `container-dest` must + be an _absolute_ path. + - `volume-name:container-dest[:options]` to bind-mount a volume + managed by a volume driver into the container. `container-dest` + must be an _absolute_ path. + + `options` is an optional, comma-delimited list of: + + - `nocopy` disables automatic copying of data from the container + path to the volume. The `nocopy` flag only applies to named volumes. + - `[ro|rw]` mounts a volume read-only or read-write, respectively. + If omitted or set to `rw`, volumes are mounted read-write. + - `[z|Z]` applies SELinux labels to allow or deny multiple containers + to read and write to the same volume. + - `z`: a _shared_ content label is applied to the content. This + label indicates that multiple containers can share the volume + content, for both reading and writing. + - `Z`: a _private unshared_ label is applied to the content. + This label indicates that only the current container can use + a private volume. Labeling systems such as SELinux require + proper labels to be placed on volume content that is mounted + into a container. Without a label, the security system can + prevent a container's processes from using the content. By + default, the labels set by the host operating system are not + modified. + - `[[r]shared|[r]slave|[r]private]` specifies mount + [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + This only applies to bind-mounted volumes, not internal volumes + or named volumes. Mount propagation requires the source mount + point (the location where the source directory is mounted in the + host operating system) to have the correct propagation properties. + For shared volumes, the source mount point must be set to `shared`. + For slave volumes, the mount must be set to either `shared` or + `slave`. + + * + * @var list|null + */ + protected $binds; /** - * @var int + * Path to a file where the container ID is written + * + * @var string|null */ - protected $oomScoreAdj; + protected $containerIDFile; /** - * @var int + * The logging configuration for this container + * + * @var HostConfigLogConfig|null */ - protected $pidsLimit; + protected $logConfig; /** - * @var PortBinding[][]|null[]|null - */ + * Network mode to use for this container. Supported standard values + are: `bridge`, `host`, `none`, and `container:`. Any + other value is taken as a custom network's name to which this + container should connect to. + + * + * @var string|null + */ + protected $networkMode; + /** + * PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `/`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + + * + * @var array>|null + */ protected $portBindings; /** - * @var bool - */ - protected $publishAllPorts; + * The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + + * + * @var RestartPolicy|null + */ + protected $restartPolicy; /** - * @var bool - */ - protected $privileged; + * Automatically remove the container when the container's process + exits. This has no effect if `RestartPolicy` is set. + + * + * @var bool|null + */ + protected $autoRemove; /** - * @var bool + * Driver that this container uses to mount volumes. + * + * @var string|null */ - protected $readonlyRootfs; + protected $volumeDriver; /** - * @var string[]|null - */ - protected $sysctls; + * A list of volumes to inherit from another container, specified in + the form `[:]`. + + * + * @var list|null + */ + protected $volumesFrom; /** - * @var string[]|null + * Specification for mounts to be added to the container. + * + * @var list|null */ - protected $storageOpt; + protected $mounts; + /** + * Initial console size, as an `[height, width]` array. + * + * @var list|null + */ + protected $consoleSize; + /** + * Arbitrary non-identifying metadata attached to container and + provided to the runtime when the container is started. + + * + * @var array|null + */ + protected $annotations; + /** + * A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + + * + * @var list|null + */ + protected $capAdd; /** - * @var string[]|null + * A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + + * + * @var list|null + */ + protected $capDrop; + /** + * cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. + + * + * @var string|null + */ + protected $cgroupnsMode; + /** + * A list of DNS servers for the container to use. + * + * @var list|null */ protected $dns; /** - * @var string[]|null + * A list of DNS options. + * + * @var list|null */ protected $dnsOptions; /** - * @var string[]|null + * A list of DNS search domains. + * + * @var list|null */ protected $dnsSearch; /** - * @var string[]|null - */ + * A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + + * + * @var list|null + */ protected $extraHosts; /** - * @var string[]|null - */ - protected $volumesFrom; - /** - * @var string[]|null - */ - protected $capAdd; - /** - * @var string[]|null - */ - protected $capDrop; - /** - * @var string[]|null + * A list of additional groups that the container process will run as. + * + * @var list|null */ protected $groupAdd; /** - * @var RestartPolicy + * IPC sharing mode for the container. Possible values are: + + - `"none"`: own private IPC namespace, with /dev/shm not mounted + - `"private"`: own private IPC namespace + - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + - `"container:"`: join another (shareable) container's IPC namespace + - `"host"`: use the host system's IPC namespace + + If not specified, daemon default is used, which can either be `"private"` + or `"shareable"`, depending on daemon version and configuration. + + * + * @var string|null + */ + protected $ipcMode; + /** + * Cgroup to use for the container. + * + * @var string|null */ - protected $restartPolicy; + protected $cgroup; /** - * @var string + * A list of links for the container in the form `container_name:alias`. + * + * @var list|null */ - protected $usernsMode; + protected $links; /** - * @var string - */ - protected $networkMode; + * An integer value containing the score given to the container in + order to tune OOM killer preferences. + + * + * @var int|null + */ + protected $oomScoreAdj; /** - * @var Device[]|null + * Set the PID (Process) Namespace mode for the container. It can be + either: + + - `"container:"`: joins another container's PID namespace + - `"host"`: use the host's PID namespace inside the container + + * + * @var string|null + */ + protected $pidMode; + /** + * Gives the container full access to the host. + * + * @var bool|null */ - protected $devices; + protected $privileged; /** - * @var Ulimit[]|null - */ - protected $ulimits; + * Allocates an ephemeral host port for all of a container's + exposed ports. + + Ports are de-allocated when the container stops and allocated when + the container starts. The allocated port might be changed when + restarting the container. + + The port is selected from the ephemeral port range that depends on + the kernel. For example, on Linux the range is defined by + `/proc/sys/net/ipv4/ip_local_port_range`. + + * + * @var bool|null + */ + protected $publishAllPorts; /** - * @var string[]|null + * Mount the container's root filesystem as read only. + * + * @var bool|null */ + protected $readonlyRootfs; + /** + * A list of string values to customize labels for MLS systems, such + as SELinux. + + * + * @var list|null + */ protected $securityOpt; /** - * @var LogConfig + * Storage driver options for this container, in the form `{"size": "120G"}`. + * + * @var array|null */ - protected $logConfig; + protected $storageOpt; /** - * @var string - */ - protected $cgroupParent; + * A map of container directories which should be replaced by tmpfs + mounts, and their corresponding mount options. For example: + + ``` + { "/run": "rw,noexec,nosuid,size=65536k" } + ``` + + * + * @var array|null + */ + protected $tmpfs; /** - * @var string + * UTS namespace to use for the container. + * + * @var string|null */ - protected $volumeDriver; + protected $uTSMode; + /** + * Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + + * + * @var string|null + */ + protected $usernsMode; /** - * @var int + * Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. + * + * @var int|null */ protected $shmSize; - /** - * @return string[]|null + * A list of kernel parameters (sysctls) to set in the container. + For example: + + ``` + {"net.ipv4.ip_forward": "1"} + ``` + + * + * @var array|null + */ + protected $sysctls; + /** + * Runtime to use with this container. + * + * @var string|null */ - public function getBinds() + protected $runtime; + /** + * Isolation technology of the container. (Windows only) + * + * @var string|null + */ + protected $isolation; + /** + * The list of paths to be masked inside the container (this overrides + the default set of paths). + + * + * @var list|null + */ + protected $maskedPaths; + /** + * The list of paths to be set as read-only inside the container + (this overrides the default set of paths). + + * + * @var list|null + */ + protected $readonlyPaths; + /** + * An integer value representing this container's relative CPU weight + versus other containers. + + * + * @return int|null + */ + public function getCpuShares(): ?int { - return $this->binds; + return $this->cpuShares; } - /** - * @param string[]|null $binds - * - * @return self - */ - public function setBinds($binds = null) + * An integer value representing this container's relative CPU weight + versus other containers. + + * + * @param int|null $cpuShares + * + * @return self + */ + public function setCpuShares(?int $cpuShares): self { - $this->binds = $binds; - + $this->initialized['cpuShares'] = true; + $this->cpuShares = $cpuShares; return $this; } - /** - * @return string[]|null + * Memory limit in bytes. + * + * @return int|null */ - public function getTmpfs() + public function getMemory(): ?int { - return $this->tmpfs; + return $this->memory; } - /** - * @param string[]|null $tmpfs + * Memory limit in bytes. + * + * @param int|null $memory * * @return self */ - public function setTmpfs($tmpfs = null) + public function setMemory(?int $memory): self { - $this->tmpfs = $tmpfs; - + $this->initialized['memory'] = true; + $this->memory = $memory; return $this; } - /** - * @return string[]|null - */ - public function getLinks() + * Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + + * + * @return string|null + */ + public function getCgroupParent(): ?string { - return $this->links; + return $this->cgroupParent; } - /** - * @param string[]|null $links - * - * @return self - */ - public function setLinks($links = null) + * Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + + * + * @param string|null $cgroupParent + * + * @return self + */ + public function setCgroupParent(?string $cgroupParent): self { - $this->links = $links; - + $this->initialized['cgroupParent'] = true; + $this->cgroupParent = $cgroupParent; return $this; } - /** - * @return string[]|null + * Block IO weight (relative weight). + * + * @return int|null */ - public function getLxcConf() + public function getBlkioWeight(): ?int { - return $this->lxcConf; + return $this->blkioWeight; } - /** - * @param string[]|null $lxcConf + * Block IO weight (relative weight). + * + * @param int|null $blkioWeight * * @return self */ - public function setLxcConf($lxcConf = null) + public function setBlkioWeight(?int $blkioWeight): self { - $this->lxcConf = $lxcConf; - + $this->initialized['blkioWeight'] = true; + $this->blkioWeight = $blkioWeight; return $this; } - /** - * @return int - */ - public function getMemory() + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @return list|null + */ + public function getBlkioWeightDevice(): ?array { - return $this->memory; + return $this->blkioWeightDevice; } - /** - * @param int $memory - * - * @return self - */ - public function setMemory($memory = null) - { - $this->memory = $memory; - + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @param list|null $blkioWeightDevice + * + * @return self + */ + public function setBlkioWeightDevice(?array $blkioWeightDevice): self + { + $this->initialized['blkioWeightDevice'] = true; + $this->blkioWeightDevice = $blkioWeightDevice; return $this; } - /** - * @return int - */ - public function getMemorySwap() + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return list|null + */ + public function getBlkioDeviceReadBps(): ?array { - return $this->memorySwap; + return $this->blkioDeviceReadBps; } - /** - * @param int $memorySwap - * - * @return self - */ - public function setMemorySwap($memorySwap = null) - { - $this->memorySwap = $memorySwap; - + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param list|null $blkioDeviceReadBps + * + * @return self + */ + public function setBlkioDeviceReadBps(?array $blkioDeviceReadBps): self + { + $this->initialized['blkioDeviceReadBps'] = true; + $this->blkioDeviceReadBps = $blkioDeviceReadBps; return $this; } - /** - * @return int - */ - public function getMemoryReservation() + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return list|null + */ + public function getBlkioDeviceWriteBps(): ?array { - return $this->memoryReservation; + return $this->blkioDeviceWriteBps; } - /** - * @param int $memoryReservation - * - * @return self - */ - public function setMemoryReservation($memoryReservation = null) - { - $this->memoryReservation = $memoryReservation; - + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param list|null $blkioDeviceWriteBps + * + * @return self + */ + public function setBlkioDeviceWriteBps(?array $blkioDeviceWriteBps): self + { + $this->initialized['blkioDeviceWriteBps'] = true; + $this->blkioDeviceWriteBps = $blkioDeviceWriteBps; return $this; } - /** - * @return int - */ - public function getKernelMemory() + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return list|null + */ + public function getBlkioDeviceReadIOps(): ?array { - return $this->kernelMemory; + return $this->blkioDeviceReadIOps; } - /** - * @param int $kernelMemory - * - * @return self - */ - public function setKernelMemory($kernelMemory = null) - { - $this->kernelMemory = $kernelMemory; - + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param list|null $blkioDeviceReadIOps + * + * @return self + */ + public function setBlkioDeviceReadIOps(?array $blkioDeviceReadIOps): self + { + $this->initialized['blkioDeviceReadIOps'] = true; + $this->blkioDeviceReadIOps = $blkioDeviceReadIOps; return $this; } - /** - * @return int - */ - public function getCpuShares() + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return list|null + */ + public function getBlkioDeviceWriteIOps(): ?array { - return $this->cpuShares; + return $this->blkioDeviceWriteIOps; } - /** - * @param int $cpuShares - * - * @return self - */ - public function setCpuShares($cpuShares = null) - { - $this->cpuShares = $cpuShares; - + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param list|null $blkioDeviceWriteIOps + * + * @return self + */ + public function setBlkioDeviceWriteIOps(?array $blkioDeviceWriteIOps): self + { + $this->initialized['blkioDeviceWriteIOps'] = true; + $this->blkioDeviceWriteIOps = $blkioDeviceWriteIOps; return $this; } - /** - * @return int + * The length of a CPU period in microseconds. + * + * @return int|null */ - public function getCpuPeriod() + public function getCpuPeriod(): ?int { return $this->cpuPeriod; } - /** - * @param int $cpuPeriod + * The length of a CPU period in microseconds. + * + * @param int|null $cpuPeriod * * @return self */ - public function setCpuPeriod($cpuPeriod = null) + public function setCpuPeriod(?int $cpuPeriod): self { + $this->initialized['cpuPeriod'] = true; $this->cpuPeriod = $cpuPeriod; - return $this; } - /** - * @return int + * Microseconds of CPU time that the container can get in a CPU period. + * + * @return int|null */ - public function getCpuQuota() + public function getCpuQuota(): ?int { return $this->cpuQuota; } - /** - * @param int $cpuQuota + * Microseconds of CPU time that the container can get in a CPU period. + * + * @param int|null $cpuQuota * * @return self */ - public function setCpuQuota($cpuQuota = null) + public function setCpuQuota(?int $cpuQuota): self { + $this->initialized['cpuQuota'] = true; $this->cpuQuota = $cpuQuota; - return $this; } - /** - * @return string + * The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @return int|null + */ + public function getCpuRealtimePeriod(): ?int + { + return $this->cpuRealtimePeriod; + } + /** + * The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @param int|null $cpuRealtimePeriod + * + * @return self + */ + public function setCpuRealtimePeriod(?int $cpuRealtimePeriod): self + { + $this->initialized['cpuRealtimePeriod'] = true; + $this->cpuRealtimePeriod = $cpuRealtimePeriod; + return $this; + } + /** + * The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @return int|null + */ + public function getCpuRealtimeRuntime(): ?int + { + return $this->cpuRealtimeRuntime; + } + /** + * The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @param int|null $cpuRealtimeRuntime + * + * @return self + */ + public function setCpuRealtimeRuntime(?int $cpuRealtimeRuntime): self + { + $this->initialized['cpuRealtimeRuntime'] = true; + $this->cpuRealtimeRuntime = $cpuRealtimeRuntime; + return $this; + } + /** + * CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * + * @return string|null */ - public function getCpusetCpus() + public function getCpusetCpus(): ?string { return $this->cpusetCpus; } - /** - * @param string $cpusetCpus + * CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * + * @param string|null $cpusetCpus * * @return self */ - public function setCpusetCpus($cpusetCpus = null) + public function setCpusetCpus(?string $cpusetCpus): self { + $this->initialized['cpusetCpus'] = true; $this->cpusetCpus = $cpusetCpus; - return $this; } - /** - * @return string - */ - public function getCpusetMems() + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + + * + * @return string|null + */ + public function getCpusetMems(): ?string { return $this->cpusetMems; } - /** - * @param string $cpusetMems - * - * @return self - */ - public function setCpusetMems($cpusetMems = null) + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + + * + * @param string|null $cpusetMems + * + * @return self + */ + public function setCpusetMems(?string $cpusetMems): self { + $this->initialized['cpusetMems'] = true; $this->cpusetMems = $cpusetMems; - return $this; } - /** - * @return int + * A list of devices to add to the container. + * + * @return list|null */ - public function getMaximumIOps() + public function getDevices(): ?array { - return $this->maximumIOps; + return $this->devices; } - /** - * @param int $maximumIOps + * A list of devices to add to the container. + * + * @param list|null $devices * * @return self */ - public function setMaximumIOps($maximumIOps = null) + public function setDevices(?array $devices): self { - $this->maximumIOps = $maximumIOps; - + $this->initialized['devices'] = true; + $this->devices = $devices; return $this; } - /** - * @return int + * a list of cgroup rules to apply to the container + * + * @return list|null */ - public function getMaximumIOBps() + public function getDeviceCgroupRules(): ?array { - return $this->maximumIOBps; + return $this->deviceCgroupRules; } - /** - * @param int $maximumIOBps + * a list of cgroup rules to apply to the container + * + * @param list|null $deviceCgroupRules * * @return self */ - public function setMaximumIOBps($maximumIOBps = null) + public function setDeviceCgroupRules(?array $deviceCgroupRules): self { - $this->maximumIOBps = $maximumIOBps; - + $this->initialized['deviceCgroupRules'] = true; + $this->deviceCgroupRules = $deviceCgroupRules; return $this; } - /** - * @return int + * A list of requests for devices to be sent to device drivers. + * + * @return list|null */ - public function getBlkioWeight() + public function getDeviceRequests(): ?array { - return $this->blkioWeight; + return $this->deviceRequests; } - /** - * @param int $blkioWeight + * A list of requests for devices to be sent to device drivers. + * + * @param list|null $deviceRequests * * @return self */ - public function setBlkioWeight($blkioWeight = null) + public function setDeviceRequests(?array $deviceRequests): self { - $this->blkioWeight = $blkioWeight; - + $this->initialized['deviceRequests'] = true; + $this->deviceRequests = $deviceRequests; + return $this; + } + /** + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + + * + * @return int|null + */ + public function getKernelMemoryTCP(): ?int + { + return $this->kernelMemoryTCP; + } + /** + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + + * + * @param int|null $kernelMemoryTCP + * + * @return self + */ + public function setKernelMemoryTCP(?int $kernelMemoryTCP): self + { + $this->initialized['kernelMemoryTCP'] = true; + $this->kernelMemoryTCP = $kernelMemoryTCP; return $this; } - /** - * @return DeviceWeight[]|null + * Memory soft limit in bytes. + * + * @return int|null */ - public function getBlkioWeightDevice() + public function getMemoryReservation(): ?int { - return $this->blkioWeightDevice; + return $this->memoryReservation; } - /** - * @param DeviceWeight[]|null $blkioWeightDevice + * Memory soft limit in bytes. + * + * @param int|null $memoryReservation * * @return self */ - public function setBlkioWeightDevice($blkioWeightDevice = null) + public function setMemoryReservation(?int $memoryReservation): self { - $this->blkioWeightDevice = $blkioWeightDevice; - + $this->initialized['memoryReservation'] = true; + $this->memoryReservation = $memoryReservation; return $this; } - /** - * @return DeviceRate[]|null - */ - public function getBlkioDeviceReadBps() + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + + * + * @return int|null + */ + public function getMemorySwap(): ?int { - return $this->blkioDeviceReadBps; + return $this->memorySwap; } - /** - * @param DeviceRate[]|null $blkioDeviceReadBps - * - * @return self - */ - public function setBlkioDeviceReadBps($blkioDeviceReadBps = null) + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + + * + * @param int|null $memorySwap + * + * @return self + */ + public function setMemorySwap(?int $memorySwap): self { - $this->blkioDeviceReadBps = $blkioDeviceReadBps; - + $this->initialized['memorySwap'] = true; + $this->memorySwap = $memorySwap; + return $this; + } + /** + * Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + + * + * @return int|null + */ + public function getMemorySwappiness(): ?int + { + return $this->memorySwappiness; + } + /** + * Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + + * + * @param int|null $memorySwappiness + * + * @return self + */ + public function setMemorySwappiness(?int $memorySwappiness): self + { + $this->initialized['memorySwappiness'] = true; + $this->memorySwappiness = $memorySwappiness; return $this; } - /** - * @return DeviceRate[]|null + * CPU quota in units of 10-9 CPUs. + * + * @return int|null */ - public function getBlkioDeviceReadIOps() + public function getNanoCpus(): ?int { - return $this->blkioDeviceReadIOps; + return $this->nanoCpus; } - /** - * @param DeviceRate[]|null $blkioDeviceReadIOps + * CPU quota in units of 10-9 CPUs. + * + * @param int|null $nanoCpus * * @return self */ - public function setBlkioDeviceReadIOps($blkioDeviceReadIOps = null) + public function setNanoCpus(?int $nanoCpus): self { - $this->blkioDeviceReadIOps = $blkioDeviceReadIOps; - + $this->initialized['nanoCpus'] = true; + $this->nanoCpus = $nanoCpus; return $this; } - /** - * @return DeviceRate[]|null + * Disable OOM Killer for the container. + * + * @return bool|null */ - public function getBlkioDeviceWriteBps() + public function getOomKillDisable(): ?bool { - return $this->blkioDeviceWriteBps; + return $this->oomKillDisable; } - /** - * @param DeviceRate[]|null $blkioDeviceWriteBps + * Disable OOM Killer for the container. + * + * @param bool|null $oomKillDisable * * @return self */ - public function setBlkioDeviceWriteBps($blkioDeviceWriteBps = null) + public function setOomKillDisable(?bool $oomKillDisable): self { - $this->blkioDeviceWriteBps = $blkioDeviceWriteBps; - + $this->initialized['oomKillDisable'] = true; + $this->oomKillDisable = $oomKillDisable; return $this; } - /** - * @return DeviceRate[]|null + * Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + + * + * @return bool|null + */ + public function getInit(): ?bool + { + return $this->init; + } + /** + * Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + + * + * @param bool|null $init + * + * @return self + */ + public function setInit(?bool $init): self + { + $this->initialized['init'] = true; + $this->init = $init; + return $this; + } + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + + * + * @return int|null + */ + public function getPidsLimit(): ?int + { + return $this->pidsLimit; + } + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + + * + * @param int|null $pidsLimit + * + * @return self + */ + public function setPidsLimit(?int $pidsLimit): self + { + $this->initialized['pidsLimit'] = true; + $this->pidsLimit = $pidsLimit; + return $this; + } + /** + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @return list|null + */ + public function getUlimits(): ?array + { + return $this->ulimits; + } + /** + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @param list|null $ulimits + * + * @return self + */ + public function setUlimits(?array $ulimits): self + { + $this->initialized['ulimits'] = true; + $this->ulimits = $ulimits; + return $this; + } + /** + * The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @return int|null + */ + public function getCpuCount(): ?int + { + return $this->cpuCount; + } + /** + * The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @param int|null $cpuCount + * + * @return self + */ + public function setCpuCount(?int $cpuCount): self + { + $this->initialized['cpuCount'] = true; + $this->cpuCount = $cpuCount; + return $this; + } + /** + * The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @return int|null + */ + public function getCpuPercent(): ?int + { + return $this->cpuPercent; + } + /** + * The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @param int|null $cpuPercent + * + * @return self + */ + public function setCpuPercent(?int $cpuPercent): self + { + $this->initialized['cpuPercent'] = true; + $this->cpuPercent = $cpuPercent; + return $this; + } + /** + * Maximum IOps for the container system drive (Windows only) + * + * @return int|null */ - public function getBlkioDeviceWriteIOps() + public function getIOMaximumIOps(): ?int { - return $this->blkioDeviceWriteIOps; + return $this->iOMaximumIOps; } - /** - * @param DeviceRate[]|null $blkioDeviceWriteIOps + * Maximum IOps for the container system drive (Windows only) + * + * @param int|null $iOMaximumIOps * * @return self */ - public function setBlkioDeviceWriteIOps($blkioDeviceWriteIOps = null) + public function setIOMaximumIOps(?int $iOMaximumIOps): self { - $this->blkioDeviceWriteIOps = $blkioDeviceWriteIOps; - + $this->initialized['iOMaximumIOps'] = true; + $this->iOMaximumIOps = $iOMaximumIOps; + return $this; + } + /** + * Maximum IO in bytes per second for the container system drive + (Windows only). + + * + * @return int|null + */ + public function getIOMaximumBandwidth(): ?int + { + return $this->iOMaximumBandwidth; + } + /** + * Maximum IO in bytes per second for the container system drive + (Windows only). + + * + * @param int|null $iOMaximumBandwidth + * + * @return self + */ + public function setIOMaximumBandwidth(?int $iOMaximumBandwidth): self + { + $this->initialized['iOMaximumBandwidth'] = true; + $this->iOMaximumBandwidth = $iOMaximumBandwidth; + return $this; + } + /** + * A list of volume bindings for this container. Each volume binding + is a string in one of these forms: + + - `host-src:container-dest[:options]` to bind-mount a host path + into the container. Both `host-src`, and `container-dest` must + be an _absolute_ path. + - `volume-name:container-dest[:options]` to bind-mount a volume + managed by a volume driver into the container. `container-dest` + must be an _absolute_ path. + + `options` is an optional, comma-delimited list of: + + - `nocopy` disables automatic copying of data from the container + path to the volume. The `nocopy` flag only applies to named volumes. + - `[ro|rw]` mounts a volume read-only or read-write, respectively. + If omitted or set to `rw`, volumes are mounted read-write. + - `[z|Z]` applies SELinux labels to allow or deny multiple containers + to read and write to the same volume. + - `z`: a _shared_ content label is applied to the content. This + label indicates that multiple containers can share the volume + content, for both reading and writing. + - `Z`: a _private unshared_ label is applied to the content. + This label indicates that only the current container can use + a private volume. Labeling systems such as SELinux require + proper labels to be placed on volume content that is mounted + into a container. Without a label, the security system can + prevent a container's processes from using the content. By + default, the labels set by the host operating system are not + modified. + - `[[r]shared|[r]slave|[r]private]` specifies mount + [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + This only applies to bind-mounted volumes, not internal volumes + or named volumes. Mount propagation requires the source mount + point (the location where the source directory is mounted in the + host operating system) to have the correct propagation properties. + For shared volumes, the source mount point must be set to `shared`. + For slave volumes, the mount must be set to either `shared` or + `slave`. + + * + * @return list|null + */ + public function getBinds(): ?array + { + return $this->binds; + } + /** + * A list of volume bindings for this container. Each volume binding + is a string in one of these forms: + + - `host-src:container-dest[:options]` to bind-mount a host path + into the container. Both `host-src`, and `container-dest` must + be an _absolute_ path. + - `volume-name:container-dest[:options]` to bind-mount a volume + managed by a volume driver into the container. `container-dest` + must be an _absolute_ path. + + `options` is an optional, comma-delimited list of: + + - `nocopy` disables automatic copying of data from the container + path to the volume. The `nocopy` flag only applies to named volumes. + - `[ro|rw]` mounts a volume read-only or read-write, respectively. + If omitted or set to `rw`, volumes are mounted read-write. + - `[z|Z]` applies SELinux labels to allow or deny multiple containers + to read and write to the same volume. + - `z`: a _shared_ content label is applied to the content. This + label indicates that multiple containers can share the volume + content, for both reading and writing. + - `Z`: a _private unshared_ label is applied to the content. + This label indicates that only the current container can use + a private volume. Labeling systems such as SELinux require + proper labels to be placed on volume content that is mounted + into a container. Without a label, the security system can + prevent a container's processes from using the content. By + default, the labels set by the host operating system are not + modified. + - `[[r]shared|[r]slave|[r]private]` specifies mount + [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + This only applies to bind-mounted volumes, not internal volumes + or named volumes. Mount propagation requires the source mount + point (the location where the source directory is mounted in the + host operating system) to have the correct propagation properties. + For shared volumes, the source mount point must be set to `shared`. + For slave volumes, the mount must be set to either `shared` or + `slave`. + + * + * @param list|null $binds + * + * @return self + */ + public function setBinds(?array $binds): self + { + $this->initialized['binds'] = true; + $this->binds = $binds; return $this; } - /** - * @return int + * Path to a file where the container ID is written + * + * @return string|null */ - public function getMemorySwappiness() + public function getContainerIDFile(): ?string { - return $this->memorySwappiness; + return $this->containerIDFile; } - /** - * @param int $memorySwappiness + * Path to a file where the container ID is written + * + * @param string|null $containerIDFile * * @return self */ - public function setMemorySwappiness($memorySwappiness = null) + public function setContainerIDFile(?string $containerIDFile): self { - $this->memorySwappiness = $memorySwappiness; - + $this->initialized['containerIDFile'] = true; + $this->containerIDFile = $containerIDFile; return $this; } - /** - * @return bool + * The logging configuration for this container + * + * @return HostConfigLogConfig|null */ - public function getOomKillDisable() + public function getLogConfig(): ?HostConfigLogConfig { - return $this->oomKillDisable; + return $this->logConfig; } - /** - * @param bool $oomKillDisable + * The logging configuration for this container + * + * @param HostConfigLogConfig|null $logConfig * * @return self */ - public function setOomKillDisable($oomKillDisable = null) + public function setLogConfig(?HostConfigLogConfig $logConfig): self { - $this->oomKillDisable = $oomKillDisable; - + $this->initialized['logConfig'] = true; + $this->logConfig = $logConfig; return $this; } - /** - * @return int - */ - public function getOomScoreAdj() + * Network mode to use for this container. Supported standard values + are: `bridge`, `host`, `none`, and `container:`. Any + other value is taken as a custom network's name to which this + container should connect to. + + * + * @return string|null + */ + public function getNetworkMode(): ?string { - return $this->oomScoreAdj; + return $this->networkMode; + } + /** + * Network mode to use for this container. Supported standard values + are: `bridge`, `host`, `none`, and `container:`. Any + other value is taken as a custom network's name to which this + container should connect to. + + * + * @param string|null $networkMode + * + * @return self + */ + public function setNetworkMode(?string $networkMode): self + { + $this->initialized['networkMode'] = true; + $this->networkMode = $networkMode; + return $this; + } + /** + * PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `/`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + + * + * @return array>|null + */ + public function getPortBindings(): ?iterable + { + return $this->portBindings; + } + /** + * PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `/`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + + * + * @param array>|null $portBindings + * + * @return self + */ + public function setPortBindings(?iterable $portBindings): self + { + $this->initialized['portBindings'] = true; + $this->portBindings = $portBindings; + return $this; + } + /** + * The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + + * + * @return RestartPolicy|null + */ + public function getRestartPolicy(): ?RestartPolicy + { + return $this->restartPolicy; + } + /** + * The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + + * + * @param RestartPolicy|null $restartPolicy + * + * @return self + */ + public function setRestartPolicy(?RestartPolicy $restartPolicy): self + { + $this->initialized['restartPolicy'] = true; + $this->restartPolicy = $restartPolicy; + return $this; + } + /** + * Automatically remove the container when the container's process + exits. This has no effect if `RestartPolicy` is set. + + * + * @return bool|null + */ + public function getAutoRemove(): ?bool + { + return $this->autoRemove; } - /** - * @param int $oomScoreAdj - * - * @return self - */ - public function setOomScoreAdj($oomScoreAdj = null) + * Automatically remove the container when the container's process + exits. This has no effect if `RestartPolicy` is set. + + * + * @param bool|null $autoRemove + * + * @return self + */ + public function setAutoRemove(?bool $autoRemove): self { - $this->oomScoreAdj = $oomScoreAdj; - + $this->initialized['autoRemove'] = true; + $this->autoRemove = $autoRemove; return $this; } - /** - * @return int + * Driver that this container uses to mount volumes. + * + * @return string|null */ - public function getPidsLimit() + public function getVolumeDriver(): ?string { - return $this->pidsLimit; + return $this->volumeDriver; } - /** - * @param int $pidsLimit + * Driver that this container uses to mount volumes. + * + * @param string|null $volumeDriver * * @return self */ - public function setPidsLimit($pidsLimit = null) + public function setVolumeDriver(?string $volumeDriver): self { - $this->pidsLimit = $pidsLimit; - + $this->initialized['volumeDriver'] = true; + $this->volumeDriver = $volumeDriver; return $this; } - /** - * @return PortBinding[][]|null[]|null - */ - public function getPortBindings() + * A list of volumes to inherit from another container, specified in + the form `[:]`. + + * + * @return list|null + */ + public function getVolumesFrom(): ?array { - return $this->portBindings; + return $this->volumesFrom; } - /** - * @param PortBinding[][]|null[]|null $portBindings - * - * @return self - */ - public function setPortBindings($portBindings = null) + * A list of volumes to inherit from another container, specified in + the form `[:]`. + + * + * @param list|null $volumesFrom + * + * @return self + */ + public function setVolumesFrom(?array $volumesFrom): self { - $this->portBindings = $portBindings; - + $this->initialized['volumesFrom'] = true; + $this->volumesFrom = $volumesFrom; return $this; } - /** - * @return bool + * Specification for mounts to be added to the container. + * + * @return list|null */ - public function getPublishAllPorts() + public function getMounts(): ?array { - return $this->publishAllPorts; + return $this->mounts; } - /** - * @param bool $publishAllPorts + * Specification for mounts to be added to the container. + * + * @param list|null $mounts * * @return self */ - public function setPublishAllPorts($publishAllPorts = null) + public function setMounts(?array $mounts): self { - $this->publishAllPorts = $publishAllPorts; - + $this->initialized['mounts'] = true; + $this->mounts = $mounts; return $this; } - /** - * @return bool + * Initial console size, as an `[height, width]` array. + * + * @return list|null */ - public function getPrivileged() + public function getConsoleSize(): ?array { - return $this->privileged; + return $this->consoleSize; } - /** - * @param bool $privileged + * Initial console size, as an `[height, width]` array. + * + * @param list|null $consoleSize * * @return self */ - public function setPrivileged($privileged = null) + public function setConsoleSize(?array $consoleSize): self { - $this->privileged = $privileged; - + $this->initialized['consoleSize'] = true; + $this->consoleSize = $consoleSize; return $this; } - /** - * @return bool - */ - public function getReadonlyRootfs() + * Arbitrary non-identifying metadata attached to container and + provided to the runtime when the container is started. + + * + * @return array|null + */ + public function getAnnotations(): ?iterable { - return $this->readonlyRootfs; + return $this->annotations; } - /** - * @param bool $readonlyRootfs - * - * @return self - */ - public function setReadonlyRootfs($readonlyRootfs = null) + * Arbitrary non-identifying metadata attached to container and + provided to the runtime when the container is started. + + * + * @param array|null $annotations + * + * @return self + */ + public function setAnnotations(?iterable $annotations): self { - $this->readonlyRootfs = $readonlyRootfs; - + $this->initialized['annotations'] = true; + $this->annotations = $annotations; return $this; } - /** - * @return string[]|null - */ - public function getSysctls() + * A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + + * + * @return list|null + */ + public function getCapAdd(): ?array { - return $this->sysctls; + return $this->capAdd; } - /** - * @param string[]|null $sysctls - * - * @return self - */ - public function setSysctls($sysctls = null) + * A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + + * + * @param list|null $capAdd + * + * @return self + */ + public function setCapAdd(?array $capAdd): self { - $this->sysctls = $sysctls; - + $this->initialized['capAdd'] = true; + $this->capAdd = $capAdd; return $this; } - /** - * @return string[]|null - */ - public function getStorageOpt() + * A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + + * + * @return list|null + */ + public function getCapDrop(): ?array { - return $this->storageOpt; + return $this->capDrop; } - /** - * @param string[]|null $storageOpt - * - * @return self - */ - public function setStorageOpt($storageOpt = null) + * A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + + * + * @param list|null $capDrop + * + * @return self + */ + public function setCapDrop(?array $capDrop): self { - $this->storageOpt = $storageOpt; - + $this->initialized['capDrop'] = true; + $this->capDrop = $capDrop; + return $this; + } + /** + * cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. + + * + * @return string|null + */ + public function getCgroupnsMode(): ?string + { + return $this->cgroupnsMode; + } + /** + * cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. + + * + * @param string|null $cgroupnsMode + * + * @return self + */ + public function setCgroupnsMode(?string $cgroupnsMode): self + { + $this->initialized['cgroupnsMode'] = true; + $this->cgroupnsMode = $cgroupnsMode; return $this; } - /** - * @return string[]|null + * A list of DNS servers for the container to use. + * + * @return list|null */ - public function getDns() + public function getDns(): ?array { return $this->dns; } - /** - * @param string[]|null $dns + * A list of DNS servers for the container to use. + * + * @param list|null $dns * * @return self */ - public function setDns($dns = null) + public function setDns(?array $dns): self { + $this->initialized['dns'] = true; $this->dns = $dns; - return $this; } - /** - * @return string[]|null + * A list of DNS options. + * + * @return list|null */ - public function getDnsOptions() + public function getDnsOptions(): ?array { return $this->dnsOptions; } - /** - * @param string[]|null $dnsOptions + * A list of DNS options. + * + * @param list|null $dnsOptions * * @return self */ - public function setDnsOptions($dnsOptions = null) + public function setDnsOptions(?array $dnsOptions): self { + $this->initialized['dnsOptions'] = true; $this->dnsOptions = $dnsOptions; - return $this; } - /** - * @return string[]|null + * A list of DNS search domains. + * + * @return list|null */ - public function getDnsSearch() + public function getDnsSearch(): ?array { return $this->dnsSearch; } - /** - * @param string[]|null $dnsSearch + * A list of DNS search domains. + * + * @param list|null $dnsSearch * * @return self */ - public function setDnsSearch($dnsSearch = null) + public function setDnsSearch(?array $dnsSearch): self { + $this->initialized['dnsSearch'] = true; $this->dnsSearch = $dnsSearch; - return $this; } - /** - * @return string[]|null - */ - public function getExtraHosts() + * A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + + * + * @return list|null + */ + public function getExtraHosts(): ?array { return $this->extraHosts; } - /** - * @param string[]|null $extraHosts - * - * @return self - */ - public function setExtraHosts($extraHosts = null) + * A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + + * + * @param list|null $extraHosts + * + * @return self + */ + public function setExtraHosts(?array $extraHosts): self { + $this->initialized['extraHosts'] = true; $this->extraHosts = $extraHosts; - return $this; } - /** - * @return string[]|null + * A list of additional groups that the container process will run as. + * + * @return list|null */ - public function getVolumesFrom() + public function getGroupAdd(): ?array { - return $this->volumesFrom; + return $this->groupAdd; } - /** - * @param string[]|null $volumesFrom + * A list of additional groups that the container process will run as. + * + * @param list|null $groupAdd * * @return self */ - public function setVolumesFrom($volumesFrom = null) + public function setGroupAdd(?array $groupAdd): self { - $this->volumesFrom = $volumesFrom; - + $this->initialized['groupAdd'] = true; + $this->groupAdd = $groupAdd; + return $this; + } + /** + * IPC sharing mode for the container. Possible values are: + + - `"none"`: own private IPC namespace, with /dev/shm not mounted + - `"private"`: own private IPC namespace + - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + - `"container:"`: join another (shareable) container's IPC namespace + - `"host"`: use the host system's IPC namespace + + If not specified, daemon default is used, which can either be `"private"` + or `"shareable"`, depending on daemon version and configuration. + + * + * @return string|null + */ + public function getIpcMode(): ?string + { + return $this->ipcMode; + } + /** + * IPC sharing mode for the container. Possible values are: + + - `"none"`: own private IPC namespace, with /dev/shm not mounted + - `"private"`: own private IPC namespace + - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + - `"container:"`: join another (shareable) container's IPC namespace + - `"host"`: use the host system's IPC namespace + + If not specified, daemon default is used, which can either be `"private"` + or `"shareable"`, depending on daemon version and configuration. + + * + * @param string|null $ipcMode + * + * @return self + */ + public function setIpcMode(?string $ipcMode): self + { + $this->initialized['ipcMode'] = true; + $this->ipcMode = $ipcMode; return $this; } - /** - * @return string[]|null + * Cgroup to use for the container. + * + * @return string|null */ - public function getCapAdd() + public function getCgroup(): ?string { - return $this->capAdd; + return $this->cgroup; } - /** - * @param string[]|null $capAdd + * Cgroup to use for the container. + * + * @param string|null $cgroup * * @return self */ - public function setCapAdd($capAdd = null) + public function setCgroup(?string $cgroup): self { - $this->capAdd = $capAdd; - + $this->initialized['cgroup'] = true; + $this->cgroup = $cgroup; return $this; } - /** - * @return string[]|null + * A list of links for the container in the form `container_name:alias`. + * + * @return list|null */ - public function getCapDrop() + public function getLinks(): ?array { - return $this->capDrop; + return $this->links; } - /** - * @param string[]|null $capDrop + * A list of links for the container in the form `container_name:alias`. + * + * @param list|null $links * * @return self */ - public function setCapDrop($capDrop = null) + public function setLinks(?array $links): self { - $this->capDrop = $capDrop; - + $this->initialized['links'] = true; + $this->links = $links; return $this; } - /** - * @return string[]|null - */ - public function getGroupAdd() + * An integer value containing the score given to the container in + order to tune OOM killer preferences. + + * + * @return int|null + */ + public function getOomScoreAdj(): ?int { - return $this->groupAdd; + return $this->oomScoreAdj; } - /** - * @param string[]|null $groupAdd - * - * @return self - */ - public function setGroupAdd($groupAdd = null) + * An integer value containing the score given to the container in + order to tune OOM killer preferences. + + * + * @param int|null $oomScoreAdj + * + * @return self + */ + public function setOomScoreAdj(?int $oomScoreAdj): self { - $this->groupAdd = $groupAdd; - + $this->initialized['oomScoreAdj'] = true; + $this->oomScoreAdj = $oomScoreAdj; + return $this; + } + /** + * Set the PID (Process) Namespace mode for the container. It can be + either: + + - `"container:"`: joins another container's PID namespace + - `"host"`: use the host's PID namespace inside the container + + * + * @return string|null + */ + public function getPidMode(): ?string + { + return $this->pidMode; + } + /** + * Set the PID (Process) Namespace mode for the container. It can be + either: + + - `"container:"`: joins another container's PID namespace + - `"host"`: use the host's PID namespace inside the container + + * + * @param string|null $pidMode + * + * @return self + */ + public function setPidMode(?string $pidMode): self + { + $this->initialized['pidMode'] = true; + $this->pidMode = $pidMode; return $this; } - /** - * @return RestartPolicy + * Gives the container full access to the host. + * + * @return bool|null */ - public function getRestartPolicy() + public function getPrivileged(): ?bool { - return $this->restartPolicy; + return $this->privileged; } - /** - * @param RestartPolicy $restartPolicy + * Gives the container full access to the host. + * + * @param bool|null $privileged * * @return self */ - public function setRestartPolicy(?RestartPolicy $restartPolicy = null) + public function setPrivileged(?bool $privileged): self { - $this->restartPolicy = $restartPolicy; - + $this->initialized['privileged'] = true; + $this->privileged = $privileged; + return $this; + } + /** + * Allocates an ephemeral host port for all of a container's + exposed ports. + + Ports are de-allocated when the container stops and allocated when + the container starts. The allocated port might be changed when + restarting the container. + + The port is selected from the ephemeral port range that depends on + the kernel. For example, on Linux the range is defined by + `/proc/sys/net/ipv4/ip_local_port_range`. + + * + * @return bool|null + */ + public function getPublishAllPorts(): ?bool + { + return $this->publishAllPorts; + } + /** + * Allocates an ephemeral host port for all of a container's + exposed ports. + + Ports are de-allocated when the container stops and allocated when + the container starts. The allocated port might be changed when + restarting the container. + + The port is selected from the ephemeral port range that depends on + the kernel. For example, on Linux the range is defined by + `/proc/sys/net/ipv4/ip_local_port_range`. + + * + * @param bool|null $publishAllPorts + * + * @return self + */ + public function setPublishAllPorts(?bool $publishAllPorts): self + { + $this->initialized['publishAllPorts'] = true; + $this->publishAllPorts = $publishAllPorts; return $this; } - /** - * @return string + * Mount the container's root filesystem as read only. + * + * @return bool|null */ - public function getUsernsMode() + public function getReadonlyRootfs(): ?bool { - return $this->usernsMode; + return $this->readonlyRootfs; } - /** - * @param string $usernsMode + * Mount the container's root filesystem as read only. + * + * @param bool|null $readonlyRootfs * * @return self */ - public function setUsernsMode($usernsMode = null) + public function setReadonlyRootfs(?bool $readonlyRootfs): self { - $this->usernsMode = $usernsMode; - + $this->initialized['readonlyRootfs'] = true; + $this->readonlyRootfs = $readonlyRootfs; return $this; } - /** - * @return string - */ - public function getNetworkMode() + * A list of string values to customize labels for MLS systems, such + as SELinux. + + * + * @return list|null + */ + public function getSecurityOpt(): ?array { - return $this->networkMode; + return $this->securityOpt; } - /** - * @param string $networkMode - * - * @return self - */ - public function setNetworkMode($networkMode = null) + * A list of string values to customize labels for MLS systems, such + as SELinux. + + * + * @param list|null $securityOpt + * + * @return self + */ + public function setSecurityOpt(?array $securityOpt): self { - $this->networkMode = $networkMode; - + $this->initialized['securityOpt'] = true; + $this->securityOpt = $securityOpt; return $this; } - /** - * @return Device[]|null + * Storage driver options for this container, in the form `{"size": "120G"}`. + * + * @return array|null */ - public function getDevices() + public function getStorageOpt(): ?iterable { - return $this->devices; + return $this->storageOpt; } - /** - * @param Device[]|null $devices + * Storage driver options for this container, in the form `{"size": "120G"}`. + * + * @param array|null $storageOpt * * @return self */ - public function setDevices($devices = null) + public function setStorageOpt(?iterable $storageOpt): self { - $this->devices = $devices; - + $this->initialized['storageOpt'] = true; + $this->storageOpt = $storageOpt; + return $this; + } + /** + * A map of container directories which should be replaced by tmpfs + mounts, and their corresponding mount options. For example: + + ``` + { "/run": "rw,noexec,nosuid,size=65536k" } + ``` + + * + * @return array|null + */ + public function getTmpfs(): ?iterable + { + return $this->tmpfs; + } + /** + * A map of container directories which should be replaced by tmpfs + mounts, and their corresponding mount options. For example: + + ``` + { "/run": "rw,noexec,nosuid,size=65536k" } + ``` + + * + * @param array|null $tmpfs + * + * @return self + */ + public function setTmpfs(?iterable $tmpfs): self + { + $this->initialized['tmpfs'] = true; + $this->tmpfs = $tmpfs; return $this; } - /** - * @return Ulimit[]|null + * UTS namespace to use for the container. + * + * @return string|null */ - public function getUlimits() + public function getUTSMode(): ?string { - return $this->ulimits; + return $this->uTSMode; } - /** - * @param Ulimit[]|null $ulimits + * UTS namespace to use for the container. + * + * @param string|null $uTSMode * * @return self */ - public function setUlimits($ulimits = null) + public function setUTSMode(?string $uTSMode): self { - $this->ulimits = $ulimits; - + $this->initialized['uTSMode'] = true; + $this->uTSMode = $uTSMode; return $this; } - /** - * @return string[]|null - */ - public function getSecurityOpt() + * Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + + * + * @return string|null + */ + public function getUsernsMode(): ?string { - return $this->securityOpt; + return $this->usernsMode; } - /** - * @param string[]|null $securityOpt - * - * @return self - */ - public function setSecurityOpt($securityOpt = null) + * Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + + * + * @param string|null $usernsMode + * + * @return self + */ + public function setUsernsMode(?string $usernsMode): self { - $this->securityOpt = $securityOpt; - + $this->initialized['usernsMode'] = true; + $this->usernsMode = $usernsMode; return $this; } - /** - * @return LogConfig + * Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. + * + * @return int|null */ - public function getLogConfig() + public function getShmSize(): ?int { - return $this->logConfig; + return $this->shmSize; } - /** - * @param LogConfig $logConfig + * Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. + * + * @param int|null $shmSize * * @return self */ - public function setLogConfig(?LogConfig $logConfig = null) + public function setShmSize(?int $shmSize): self { - $this->logConfig = $logConfig; - + $this->initialized['shmSize'] = true; + $this->shmSize = $shmSize; + return $this; + } + /** + * A list of kernel parameters (sysctls) to set in the container. + For example: + + ``` + {"net.ipv4.ip_forward": "1"} + ``` + + * + * @return array|null + */ + public function getSysctls(): ?iterable + { + return $this->sysctls; + } + /** + * A list of kernel parameters (sysctls) to set in the container. + For example: + + ``` + {"net.ipv4.ip_forward": "1"} + ``` + + * + * @param array|null $sysctls + * + * @return self + */ + public function setSysctls(?iterable $sysctls): self + { + $this->initialized['sysctls'] = true; + $this->sysctls = $sysctls; return $this; } - /** - * @return string + * Runtime to use with this container. + * + * @return string|null */ - public function getCgroupParent() + public function getRuntime(): ?string { - return $this->cgroupParent; + return $this->runtime; } - /** - * @param string $cgroupParent + * Runtime to use with this container. + * + * @param string|null $runtime * * @return self */ - public function setCgroupParent($cgroupParent = null) + public function setRuntime(?string $runtime): self { - $this->cgroupParent = $cgroupParent; - + $this->initialized['runtime'] = true; + $this->runtime = $runtime; return $this; } - /** - * @return string + * Isolation technology of the container. (Windows only) + * + * @return string|null */ - public function getVolumeDriver() + public function getIsolation(): ?string { - return $this->volumeDriver; + return $this->isolation; } - /** - * @param string $volumeDriver + * Isolation technology of the container. (Windows only) + * + * @param string|null $isolation * * @return self */ - public function setVolumeDriver($volumeDriver = null) + public function setIsolation(?string $isolation): self { - $this->volumeDriver = $volumeDriver; - + $this->initialized['isolation'] = true; + $this->isolation = $isolation; return $this; } - /** - * @return int - */ - public function getShmSize() + * The list of paths to be masked inside the container (this overrides + the default set of paths). + + * + * @return list|null + */ + public function getMaskedPaths(): ?array { - return $this->shmSize; + return $this->maskedPaths; } - /** - * @param int $shmSize - * - * @return self - */ - public function setShmSize($shmSize = null) + * The list of paths to be masked inside the container (this overrides + the default set of paths). + + * + * @param list|null $maskedPaths + * + * @return self + */ + public function setMaskedPaths(?array $maskedPaths): self { - $this->shmSize = $shmSize; - + $this->initialized['maskedPaths'] = true; + $this->maskedPaths = $maskedPaths; + return $this; + } + /** + * The list of paths to be set as read-only inside the container + (this overrides the default set of paths). + + * + * @return list|null + */ + public function getReadonlyPaths(): ?array + { + return $this->readonlyPaths; + } + /** + * The list of paths to be set as read-only inside the container + (this overrides the default set of paths). + + * + * @param list|null $readonlyPaths + * + * @return self + */ + public function setReadonlyPaths(?array $readonlyPaths): self + { + $this->initialized['readonlyPaths'] = true; + $this->readonlyPaths = $readonlyPaths; return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/HostConfigLogConfig.php b/generated/Model/HostConfigLogConfig.php new file mode 100644 index 00000000..54aa2488 --- /dev/null +++ b/generated/Model/HostConfigLogConfig.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $type; + /** + * + * + * @var array|null + */ + protected $config; + /** + * + * + * @return string|null + */ + public function getType(): ?string + { + return $this->type; + } + /** + * + * + * @param string|null $type + * + * @return self + */ + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + return $this; + } + /** + * + * + * @return array|null + */ + public function getConfig(): ?iterable + { + return $this->config; + } + /** + * + * + * @param array|null $config + * + * @return self + */ + public function setConfig(?iterable $config): self + { + $this->initialized['config'] = true; + $this->config = $config; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/IPAM.php b/generated/Model/IPAM.php index c0a9750b..f1600b83 100644 --- a/generated/Model/IPAM.php +++ b/generated/Model/IPAM.php @@ -5,75 +5,110 @@ class IPAM { /** - * @var string + * @var array */ - protected $driver; + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } /** - * @var IPAMConfig[]|null + * Name of the IPAM driver to use. + * + * @var string|null */ + protected $driver = 'default'; + /** + * List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": , "IPRange": , "Gateway": , "AuxAddress": } + ``` + + * + * @var list|null + */ protected $config; /** - * @var string[]|null + * Driver-specific options, specified as a map. + * + * @var array|null */ protected $options; - /** - * @return string + * Name of the IPAM driver to use. + * + * @return string|null */ - public function getDriver() + public function getDriver(): ?string { return $this->driver; } - /** - * @param string $driver + * Name of the IPAM driver to use. + * + * @param string|null $driver * * @return self */ - public function setDriver($driver = null) + public function setDriver(?string $driver): self { + $this->initialized['driver'] = true; $this->driver = $driver; - return $this; } - /** - * @return IPAMConfig[]|null - */ - public function getConfig() + * List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": , "IPRange": , "Gateway": , "AuxAddress": } + ``` + + * + * @return list|null + */ + public function getConfig(): ?array { return $this->config; } - /** - * @param IPAMConfig[]|null $config - * - * @return self - */ - public function setConfig($config = null) + * List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": , "IPRange": , "Gateway": , "AuxAddress": } + ``` + + * + * @param list|null $config + * + * @return self + */ + public function setConfig(?array $config): self { + $this->initialized['config'] = true; $this->config = $config; - return $this; } - /** - * @return string[]|null + * Driver-specific options, specified as a map. + * + * @return array|null */ - public function getOptions() + public function getOptions(): ?iterable { return $this->options; } - /** - * @param string[]|null $options + * Driver-specific options, specified as a map. + * + * @param array|null $options * * @return self */ - public function setOptions($options = null) + public function setOptions(?iterable $options): self { + $this->initialized['options'] = true; $this->options = $options; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/IPAMConfig.php b/generated/Model/IPAMConfig.php index 83f95440..000473c1 100644 --- a/generated/Model/IPAMConfig.php +++ b/generated/Model/IPAMConfig.php @@ -5,75 +5,123 @@ class IPAMConfig { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var string|null */ protected $subnet; /** - * @var string + * + * + * @var string|null */ protected $iPRange; /** - * @var string + * + * + * @var string|null */ protected $gateway; - /** - * @return string + * + * + * @var array|null */ - public function getSubnet() + protected $auxiliaryAddresses; + /** + * + * + * @return string|null + */ + public function getSubnet(): ?string { return $this->subnet; } - /** - * @param string $subnet + * + * + * @param string|null $subnet * * @return self */ - public function setSubnet($subnet = null) + public function setSubnet(?string $subnet): self { + $this->initialized['subnet'] = true; $this->subnet = $subnet; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getIPRange() + public function getIPRange(): ?string { return $this->iPRange; } - /** - * @param string $iPRange + * + * + * @param string|null $iPRange * * @return self */ - public function setIPRange($iPRange = null) + public function setIPRange(?string $iPRange): self { + $this->initialized['iPRange'] = true; $this->iPRange = $iPRange; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getGateway() + public function getGateway(): ?string { return $this->gateway; } - /** - * @param string $gateway + * + * + * @param string|null $gateway * * @return self */ - public function setGateway($gateway = null) + public function setGateway(?string $gateway): self { + $this->initialized['gateway'] = true; $this->gateway = $gateway; - return $this; } -} + /** + * + * + * @return array|null + */ + public function getAuxiliaryAddresses(): ?iterable + { + return $this->auxiliaryAddresses; + } + /** + * + * + * @param array|null $auxiliaryAddresses + * + * @return self + */ + public function setAuxiliaryAddresses(?iterable $auxiliaryAddresses): self + { + $this->initialized['auxiliaryAddresses'] = true; + $this->auxiliaryAddresses = $auxiliaryAddresses; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/IdResponse.php b/generated/Model/IdResponse.php new file mode 100644 index 00000000..8f59e615 --- /dev/null +++ b/generated/Model/IdResponse.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * The id of the newly created object. + * + * @var string|null + */ + protected $id; + /** + * The id of the newly created object. + * + * @return string|null + */ + public function getId(): ?string + { + return $this->id; + } + /** + * The id of the newly created object. + * + * @param string|null $id + * + * @return self + */ + public function setId(?string $id): self + { + $this->initialized['id'] = true; + $this->id = $id; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Image.php b/generated/Model/Image.php deleted file mode 100644 index 96732916..00000000 --- a/generated/Model/Image.php +++ /dev/null @@ -1,391 +0,0 @@ -id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId($id = null) - { - $this->id = $id; - - return $this; - } - - /** - * @return string - */ - public function getContainer() - { - return $this->container; - } - - /** - * @param string $container - * - * @return self - */ - public function setContainer($container = null) - { - $this->container = $container; - - return $this; - } - - /** - * @return string - */ - public function getComment() - { - return $this->comment; - } - - /** - * @param string $comment - * - * @return self - */ - public function setComment($comment = null) - { - $this->comment = $comment; - - return $this; - } - - /** - * @return string - */ - public function getOs() - { - return $this->os; - } - - /** - * @param string $os - * - * @return self - */ - public function setOs($os = null) - { - $this->os = $os; - - return $this; - } - - /** - * @return string - */ - public function getArchitecture() - { - return $this->architecture; - } - - /** - * @param string $architecture - * - * @return self - */ - public function setArchitecture($architecture = null) - { - $this->architecture = $architecture; - - return $this; - } - - /** - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * @param string $parent - * - * @return self - */ - public function setParent($parent = null) - { - $this->parent = $parent; - - return $this; - } - - /** - * @return ContainerConfig - */ - public function getContainerConfig() - { - return $this->containerConfig; - } - - /** - * @param ContainerConfig $containerConfig - * - * @return self - */ - public function setContainerConfig(?ContainerConfig $containerConfig = null) - { - $this->containerConfig = $containerConfig; - - return $this; - } - - /** - * @return string - */ - public function getDockerVersion() - { - return $this->dockerVersion; - } - - /** - * @param string $dockerVersion - * - * @return self - */ - public function setDockerVersion($dockerVersion = null) - { - $this->dockerVersion = $dockerVersion; - - return $this; - } - - /** - * @return int - */ - public function getVirtualSize() - { - return $this->virtualSize; - } - - /** - * @param int $virtualSize - * - * @return self - */ - public function setVirtualSize($virtualSize = null) - { - $this->virtualSize = $virtualSize; - - return $this; - } - - /** - * @return int - */ - public function getSize() - { - return $this->size; - } - - /** - * @param int $size - * - * @return self - */ - public function setSize($size = null) - { - $this->size = $size; - - return $this; - } - - /** - * @return string - */ - public function getAuthor() - { - return $this->author; - } - - /** - * @param string $author - * - * @return self - */ - public function setAuthor($author = null) - { - $this->author = $author; - - return $this; - } - - /** - * @return string - */ - public function getCreated() - { - return $this->created; - } - - /** - * @param string $created - * - * @return self - */ - public function setCreated($created = null) - { - $this->created = $created; - - return $this; - } - - /** - * @return GraphDriver - */ - public function getGraphDriver() - { - return $this->graphDriver; - } - - /** - * @param GraphDriver $graphDriver - * - * @return self - */ - public function setGraphDriver(?GraphDriver $graphDriver = null) - { - $this->graphDriver = $graphDriver; - - return $this; - } - - /** - * @return string[]|null - */ - public function getRepoDigests() - { - return $this->repoDigests; - } - - /** - * @param string[]|null $repoDigests - * - * @return self - */ - public function setRepoDigests($repoDigests = null) - { - $this->repoDigests = $repoDigests; - - return $this; - } - - /** - * @return string[]|null - */ - public function getRepoTags() - { - return $this->repoTags; - } - - /** - * @param string[]|null $repoTags - * - * @return self - */ - public function setRepoTags($repoTags = null) - { - $this->repoTags = $repoTags; - - return $this; - } - - /** - * @return ContainerConfig - */ - public function getConfig() - { - return $this->config; - } - - /** - * @param ContainerConfig $config - * - * @return self - */ - public function setConfig(?ContainerConfig $config = null) - { - $this->config = $config; - - return $this; - } -} diff --git a/generated/Model/ImageConfig.php b/generated/Model/ImageConfig.php new file mode 100644 index 00000000..53a27502 --- /dev/null +++ b/generated/Model/ImageConfig.php @@ -0,0 +1,973 @@ +initialized); + } + /** + * The hostname to use for the container, as a valid RFC 1123 hostname. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always empty. It must not be used, and will be removed in API v1.48. + + * + * @var string|null + */ + protected $hostname; + /** + * The domain name to use for the container. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always empty. It must not be used, and will be removed in API v1.48. + + * + * @var string|null + */ + protected $domainname; + /** + * The user that commands are run as inside the container. + * + * @var string|null + */ + protected $user; + /** + * Whether to attach to `stdin`. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @var bool|null + */ + protected $attachStdin = false; + /** + * Whether to attach to `stdout`. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @var bool|null + */ + protected $attachStdout = false; + /** + * Whether to attach to `stderr`. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @var bool|null + */ + protected $attachStderr = false; + /** + * An object mapping ports to an empty object in the form: + + `{"/": {}}` + + * + * @var array|null + */ + protected $exposedPorts; + /** + * Attach standard streams to a TTY, including `stdin` if it is not closed. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @var bool|null + */ + protected $tty = false; + /** + * Open `stdin` + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @var bool|null + */ + protected $openStdin = false; + /** + * Close `stdin` after one attached client disconnects. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @var bool|null + */ + protected $stdinOnce = false; + /** + * A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + + * + * @var list|null + */ + protected $env; + /** + * Command to run specified as a string or an array of strings. + * + * @var list|null + */ + protected $cmd; + /** + * A test to perform to check that the container is healthy. + * + * @var HealthConfig|null + */ + protected $healthcheck; + /** + * Command is already escaped (Windows only) + * + * @var bool|null + */ + protected $argsEscaped = false; + /** + * The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always empty. It must not be used, and will be removed in API v1.48. + + * + * @var string|null + */ + protected $image = ''; + /** + * An object mapping mount point paths inside the container to empty + objects. + + * + * @var array|null + */ + protected $volumes; + /** + * The working directory for commands to run in. + * + * @var string|null + */ + protected $workingDir; + /** + * The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + + * + * @var list|null + */ + protected $entrypoint; + /** + * Disable networking for the container. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always omitted. It must not be used, and will be removed in API v1.48. + + * + * @var bool|null + */ + protected $networkDisabled = false; + /** + * MAC address of the container. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always omitted. It must not be used, and will be removed in API v1.48. + + * + * @var string|null + */ + protected $macAddress = ''; + /** + * `ONBUILD` metadata that were defined in the image's `Dockerfile`. + * + * @var list|null + */ + protected $onBuild; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * Signal to stop a container as a string or unsigned integer. + * + * @var string|null + */ + protected $stopSignal; + /** + * Timeout to stop a container in seconds. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always omitted. It must not be used, and will be removed in API v1.48. + + * + * @var int|null + */ + protected $stopTimeout = 10; + /** + * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + * + * @var list|null + */ + protected $shell; + /** + * The hostname to use for the container, as a valid RFC 1123 hostname. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always empty. It must not be used, and will be removed in API v1.48. + + * + * @return string|null + */ + public function getHostname(): ?string + { + return $this->hostname; + } + /** + * The hostname to use for the container, as a valid RFC 1123 hostname. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always empty. It must not be used, and will be removed in API v1.48. + + * + * @param string|null $hostname + * + * @return self + */ + public function setHostname(?string $hostname): self + { + $this->initialized['hostname'] = true; + $this->hostname = $hostname; + return $this; + } + /** + * The domain name to use for the container. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always empty. It must not be used, and will be removed in API v1.48. + + * + * @return string|null + */ + public function getDomainname(): ?string + { + return $this->domainname; + } + /** + * The domain name to use for the container. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always empty. It must not be used, and will be removed in API v1.48. + + * + * @param string|null $domainname + * + * @return self + */ + public function setDomainname(?string $domainname): self + { + $this->initialized['domainname'] = true; + $this->domainname = $domainname; + return $this; + } + /** + * The user that commands are run as inside the container. + * + * @return string|null + */ + public function getUser(): ?string + { + return $this->user; + } + /** + * The user that commands are run as inside the container. + * + * @param string|null $user + * + * @return self + */ + public function setUser(?string $user): self + { + $this->initialized['user'] = true; + $this->user = $user; + return $this; + } + /** + * Whether to attach to `stdin`. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @return bool|null + */ + public function getAttachStdin(): ?bool + { + return $this->attachStdin; + } + /** + * Whether to attach to `stdin`. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @param bool|null $attachStdin + * + * @return self + */ + public function setAttachStdin(?bool $attachStdin): self + { + $this->initialized['attachStdin'] = true; + $this->attachStdin = $attachStdin; + return $this; + } + /** + * Whether to attach to `stdout`. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @return bool|null + */ + public function getAttachStdout(): ?bool + { + return $this->attachStdout; + } + /** + * Whether to attach to `stdout`. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @param bool|null $attachStdout + * + * @return self + */ + public function setAttachStdout(?bool $attachStdout): self + { + $this->initialized['attachStdout'] = true; + $this->attachStdout = $attachStdout; + return $this; + } + /** + * Whether to attach to `stderr`. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @return bool|null + */ + public function getAttachStderr(): ?bool + { + return $this->attachStderr; + } + /** + * Whether to attach to `stderr`. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @param bool|null $attachStderr + * + * @return self + */ + public function setAttachStderr(?bool $attachStderr): self + { + $this->initialized['attachStderr'] = true; + $this->attachStderr = $attachStderr; + return $this; + } + /** + * An object mapping ports to an empty object in the form: + + `{"/": {}}` + + * + * @return array|null + */ + public function getExposedPorts(): ?iterable + { + return $this->exposedPorts; + } + /** + * An object mapping ports to an empty object in the form: + + `{"/": {}}` + + * + * @param array|null $exposedPorts + * + * @return self + */ + public function setExposedPorts(?iterable $exposedPorts): self + { + $this->initialized['exposedPorts'] = true; + $this->exposedPorts = $exposedPorts; + return $this; + } + /** + * Attach standard streams to a TTY, including `stdin` if it is not closed. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @return bool|null + */ + public function getTty(): ?bool + { + return $this->tty; + } + /** + * Attach standard streams to a TTY, including `stdin` if it is not closed. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @param bool|null $tty + * + * @return self + */ + public function setTty(?bool $tty): self + { + $this->initialized['tty'] = true; + $this->tty = $tty; + return $this; + } + /** + * Open `stdin` + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @return bool|null + */ + public function getOpenStdin(): ?bool + { + return $this->openStdin; + } + /** + * Open `stdin` + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @param bool|null $openStdin + * + * @return self + */ + public function setOpenStdin(?bool $openStdin): self + { + $this->initialized['openStdin'] = true; + $this->openStdin = $openStdin; + return $this; + } + /** + * Close `stdin` after one attached client disconnects. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @return bool|null + */ + public function getStdinOnce(): ?bool + { + return $this->stdinOnce; + } + /** + * Close `stdin` after one attached client disconnects. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + + * + * @param bool|null $stdinOnce + * + * @return self + */ + public function setStdinOnce(?bool $stdinOnce): self + { + $this->initialized['stdinOnce'] = true; + $this->stdinOnce = $stdinOnce; + return $this; + } + /** + * A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + + * + * @return list|null + */ + public function getEnv(): ?array + { + return $this->env; + } + /** + * A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + + * + * @param list|null $env + * + * @return self + */ + public function setEnv(?array $env): self + { + $this->initialized['env'] = true; + $this->env = $env; + return $this; + } + /** + * Command to run specified as a string or an array of strings. + * + * @return list|null + */ + public function getCmd(): ?array + { + return $this->cmd; + } + /** + * Command to run specified as a string or an array of strings. + * + * @param list|null $cmd + * + * @return self + */ + public function setCmd(?array $cmd): self + { + $this->initialized['cmd'] = true; + $this->cmd = $cmd; + return $this; + } + /** + * A test to perform to check that the container is healthy. + * + * @return HealthConfig|null + */ + public function getHealthcheck(): ?HealthConfig + { + return $this->healthcheck; + } + /** + * A test to perform to check that the container is healthy. + * + * @param HealthConfig|null $healthcheck + * + * @return self + */ + public function setHealthcheck(?HealthConfig $healthcheck): self + { + $this->initialized['healthcheck'] = true; + $this->healthcheck = $healthcheck; + return $this; + } + /** + * Command is already escaped (Windows only) + * + * @return bool|null + */ + public function getArgsEscaped(): ?bool + { + return $this->argsEscaped; + } + /** + * Command is already escaped (Windows only) + * + * @param bool|null $argsEscaped + * + * @return self + */ + public function setArgsEscaped(?bool $argsEscaped): self + { + $this->initialized['argsEscaped'] = true; + $this->argsEscaped = $argsEscaped; + return $this; + } + /** + * The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always empty. It must not be used, and will be removed in API v1.48. + + * + * @return string|null + */ + public function getImage(): ?string + { + return $this->image; + } + /** + * The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always empty. It must not be used, and will be removed in API v1.48. + + * + * @param string|null $image + * + * @return self + */ + public function setImage(?string $image): self + { + $this->initialized['image'] = true; + $this->image = $image; + return $this; + } + /** + * An object mapping mount point paths inside the container to empty + objects. + + * + * @return array|null + */ + public function getVolumes(): ?iterable + { + return $this->volumes; + } + /** + * An object mapping mount point paths inside the container to empty + objects. + + * + * @param array|null $volumes + * + * @return self + */ + public function setVolumes(?iterable $volumes): self + { + $this->initialized['volumes'] = true; + $this->volumes = $volumes; + return $this; + } + /** + * The working directory for commands to run in. + * + * @return string|null + */ + public function getWorkingDir(): ?string + { + return $this->workingDir; + } + /** + * The working directory for commands to run in. + * + * @param string|null $workingDir + * + * @return self + */ + public function setWorkingDir(?string $workingDir): self + { + $this->initialized['workingDir'] = true; + $this->workingDir = $workingDir; + return $this; + } + /** + * The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + + * + * @return list|null + */ + public function getEntrypoint(): ?array + { + return $this->entrypoint; + } + /** + * The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + + * + * @param list|null $entrypoint + * + * @return self + */ + public function setEntrypoint(?array $entrypoint): self + { + $this->initialized['entrypoint'] = true; + $this->entrypoint = $entrypoint; + return $this; + } + /** + * Disable networking for the container. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always omitted. It must not be used, and will be removed in API v1.48. + + * + * @return bool|null + */ + public function getNetworkDisabled(): ?bool + { + return $this->networkDisabled; + } + /** + * Disable networking for the container. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always omitted. It must not be used, and will be removed in API v1.48. + + * + * @param bool|null $networkDisabled + * + * @return self + */ + public function setNetworkDisabled(?bool $networkDisabled): self + { + $this->initialized['networkDisabled'] = true; + $this->networkDisabled = $networkDisabled; + return $this; + } + /** + * MAC address of the container. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always omitted. It must not be used, and will be removed in API v1.48. + + * + * @return string|null + */ + public function getMacAddress(): ?string + { + return $this->macAddress; + } + /** + * MAC address of the container. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always omitted. It must not be used, and will be removed in API v1.48. + + * + * @param string|null $macAddress + * + * @return self + */ + public function setMacAddress(?string $macAddress): self + { + $this->initialized['macAddress'] = true; + $this->macAddress = $macAddress; + return $this; + } + /** + * `ONBUILD` metadata that were defined in the image's `Dockerfile`. + * + * @return list|null + */ + public function getOnBuild(): ?array + { + return $this->onBuild; + } + /** + * `ONBUILD` metadata that were defined in the image's `Dockerfile`. + * + * @param list|null $onBuild + * + * @return self + */ + public function setOnBuild(?array $onBuild): self + { + $this->initialized['onBuild'] = true; + $this->onBuild = $onBuild; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * Signal to stop a container as a string or unsigned integer. + * + * @return string|null + */ + public function getStopSignal(): ?string + { + return $this->stopSignal; + } + /** + * Signal to stop a container as a string or unsigned integer. + * + * @param string|null $stopSignal + * + * @return self + */ + public function setStopSignal(?string $stopSignal): self + { + $this->initialized['stopSignal'] = true; + $this->stopSignal = $stopSignal; + return $this; + } + /** + * Timeout to stop a container in seconds. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always omitted. It must not be used, and will be removed in API v1.48. + + * + * @return int|null + */ + public function getStopTimeout(): ?int + { + return $this->stopTimeout; + } + /** + * Timeout to stop a container in seconds. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always omitted. It must not be used, and will be removed in API v1.48. + + * + * @param int|null $stopTimeout + * + * @return self + */ + public function setStopTimeout(?int $stopTimeout): self + { + $this->initialized['stopTimeout'] = true; + $this->stopTimeout = $stopTimeout; + return $this; + } + /** + * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + * + * @return list|null + */ + public function getShell(): ?array + { + return $this->shell; + } + /** + * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + * + * @param list|null $shell + * + * @return self + */ + public function setShell(?array $shell): self + { + $this->initialized['shell'] = true; + $this->shell = $shell; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImageDeleteResponseItem.php b/generated/Model/ImageDeleteResponseItem.php new file mode 100644 index 00000000..3799c3c7 --- /dev/null +++ b/generated/Model/ImageDeleteResponseItem.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * The image ID of an image that was untagged + * + * @var string|null + */ + protected $untagged; + /** + * The image ID of an image that was deleted + * + * @var string|null + */ + protected $deleted; + /** + * The image ID of an image that was untagged + * + * @return string|null + */ + public function getUntagged(): ?string + { + return $this->untagged; + } + /** + * The image ID of an image that was untagged + * + * @param string|null $untagged + * + * @return self + */ + public function setUntagged(?string $untagged): self + { + $this->initialized['untagged'] = true; + $this->untagged = $untagged; + return $this; + } + /** + * The image ID of an image that was deleted + * + * @return string|null + */ + public function getDeleted(): ?string + { + return $this->deleted; + } + /** + * The image ID of an image that was deleted + * + * @param string|null $deleted + * + * @return self + */ + public function setDeleted(?string $deleted): self + { + $this->initialized['deleted'] = true; + $this->deleted = $deleted; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImageHistoryItem.php b/generated/Model/ImageHistoryItem.php deleted file mode 100644 index 74660dca..00000000 --- a/generated/Model/ImageHistoryItem.php +++ /dev/null @@ -1,151 +0,0 @@ -id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId($id = null) - { - $this->id = $id; - - return $this; - } - - /** - * @return int - */ - public function getCreated() - { - return $this->created; - } - - /** - * @param int $created - * - * @return self - */ - public function setCreated($created = null) - { - $this->created = $created; - - return $this; - } - - /** - * @return string - */ - public function getCreatedBy() - { - return $this->createdBy; - } - - /** - * @param string $createdBy - * - * @return self - */ - public function setCreatedBy($createdBy = null) - { - $this->createdBy = $createdBy; - - return $this; - } - - /** - * @return string[]|null - */ - public function getTags() - { - return $this->tags; - } - - /** - * @param string[]|null $tags - * - * @return self - */ - public function setTags($tags = null) - { - $this->tags = $tags; - - return $this; - } - - /** - * @return int - */ - public function getSize() - { - return $this->size; - } - - /** - * @param int $size - * - * @return self - */ - public function setSize($size = null) - { - $this->size = $size; - - return $this; - } - - /** - * @return string - */ - public function getComment() - { - return $this->comment; - } - - /** - * @param string $comment - * - * @return self - */ - public function setComment($comment = null) - { - $this->comment = $comment; - - return $this; - } -} diff --git a/generated/Model/ImageID.php b/generated/Model/ImageID.php new file mode 100644 index 00000000..d78d4ca6 --- /dev/null +++ b/generated/Model/ImageID.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $iD; + /** + * + * + * @return string|null + */ + public function getID(): ?string + { + return $this->iD; + } + /** + * + * + * @param string|null $iD + * + * @return self + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImageInspect.php b/generated/Model/ImageInspect.php new file mode 100644 index 00000000..ffedff58 --- /dev/null +++ b/generated/Model/ImageInspect.php @@ -0,0 +1,660 @@ +initialized); + } + /** + * ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + + * + * @var string|null + */ + protected $id; + /** + * List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + + * + * @var list|null + */ + protected $repoTags; + /** + * List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + + * + * @var list|null + */ + protected $repoDigests; + /** + * ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + + * + * @var string|null + */ + protected $parent; + /** + * Optional message that was set when committing or importing the image. + * + * @var string|null + */ + protected $comment; + /** + * Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if present in the image, + and omitted otherwise. + + * + * @var string|null + */ + protected $created; + /** + * The version of Docker that was used to build the image. + + Depending on how the image was created, this field may be empty. + + * + * @var string|null + */ + protected $dockerVersion; + /** + * Name of the author that was specified when committing the image, or as + specified through MAINTAINER (deprecated) in the Dockerfile. + + * + * @var string|null + */ + protected $author; + /** + * Configuration of the image. These fields are used as defaults + when starting a container from the image. + + * + * @var ImageConfig|null + */ + protected $config; + /** + * Hardware CPU architecture that the image runs on. + * + * @var string|null + */ + protected $architecture; + /** + * CPU architecture variant (presently ARM-only). + * + * @var string|null + */ + protected $variant; + /** + * Operating System the image is built to run on. + * + * @var string|null + */ + protected $os; + /** + * Operating System version the image is built to run on (especially + for Windows). + + * + * @var string|null + */ + protected $osVersion; + /** + * Total size of the image including all layers it is composed of. + * + * @var int|null + */ + protected $size; + /** + * Total size of the image including all layers it is composed of. + + Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + + * + * @var int|null + */ + protected $virtualSize; + /** + * Information about the storage driver used to store the container's and + image's filesystem. + + * + * @var DriverData|null + */ + protected $graphDriver; + /** + * Information about the image's RootFS, including the layer IDs. + * + * @var ImageInspectRootFS|null + */ + protected $rootFS; + /** + * Additional metadata of the image in the local cache. This information + is local to the daemon, and not part of the image itself. + + * + * @var ImageInspectMetadata|null + */ + protected $metadata; + /** + * ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + + * + * @return string|null + */ + public function getId(): ?string + { + return $this->id; + } + /** + * ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + + * + * @param string|null $id + * + * @return self + */ + public function setId(?string $id): self + { + $this->initialized['id'] = true; + $this->id = $id; + return $this; + } + /** + * List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + + * + * @return list|null + */ + public function getRepoTags(): ?array + { + return $this->repoTags; + } + /** + * List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + + * + * @param list|null $repoTags + * + * @return self + */ + public function setRepoTags(?array $repoTags): self + { + $this->initialized['repoTags'] = true; + $this->repoTags = $repoTags; + return $this; + } + /** + * List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + + * + * @return list|null + */ + public function getRepoDigests(): ?array + { + return $this->repoDigests; + } + /** + * List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + + * + * @param list|null $repoDigests + * + * @return self + */ + public function setRepoDigests(?array $repoDigests): self + { + $this->initialized['repoDigests'] = true; + $this->repoDigests = $repoDigests; + return $this; + } + /** + * ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + + * + * @return string|null + */ + public function getParent(): ?string + { + return $this->parent; + } + /** + * ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + + * + * @param string|null $parent + * + * @return self + */ + public function setParent(?string $parent): self + { + $this->initialized['parent'] = true; + $this->parent = $parent; + return $this; + } + /** + * Optional message that was set when committing or importing the image. + * + * @return string|null + */ + public function getComment(): ?string + { + return $this->comment; + } + /** + * Optional message that was set when committing or importing the image. + * + * @param string|null $comment + * + * @return self + */ + public function setComment(?string $comment): self + { + $this->initialized['comment'] = true; + $this->comment = $comment; + return $this; + } + /** + * Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if present in the image, + and omitted otherwise. + + * + * @return string|null + */ + public function getCreated(): ?string + { + return $this->created; + } + /** + * Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if present in the image, + and omitted otherwise. + + * + * @param string|null $created + * + * @return self + */ + public function setCreated(?string $created): self + { + $this->initialized['created'] = true; + $this->created = $created; + return $this; + } + /** + * The version of Docker that was used to build the image. + + Depending on how the image was created, this field may be empty. + + * + * @return string|null + */ + public function getDockerVersion(): ?string + { + return $this->dockerVersion; + } + /** + * The version of Docker that was used to build the image. + + Depending on how the image was created, this field may be empty. + + * + * @param string|null $dockerVersion + * + * @return self + */ + public function setDockerVersion(?string $dockerVersion): self + { + $this->initialized['dockerVersion'] = true; + $this->dockerVersion = $dockerVersion; + return $this; + } + /** + * Name of the author that was specified when committing the image, or as + specified through MAINTAINER (deprecated) in the Dockerfile. + + * + * @return string|null + */ + public function getAuthor(): ?string + { + return $this->author; + } + /** + * Name of the author that was specified when committing the image, or as + specified through MAINTAINER (deprecated) in the Dockerfile. + + * + * @param string|null $author + * + * @return self + */ + public function setAuthor(?string $author): self + { + $this->initialized['author'] = true; + $this->author = $author; + return $this; + } + /** + * Configuration of the image. These fields are used as defaults + when starting a container from the image. + + * + * @return ImageConfig|null + */ + public function getConfig(): ?ImageConfig + { + return $this->config; + } + /** + * Configuration of the image. These fields are used as defaults + when starting a container from the image. + + * + * @param ImageConfig|null $config + * + * @return self + */ + public function setConfig(?ImageConfig $config): self + { + $this->initialized['config'] = true; + $this->config = $config; + return $this; + } + /** + * Hardware CPU architecture that the image runs on. + * + * @return string|null + */ + public function getArchitecture(): ?string + { + return $this->architecture; + } + /** + * Hardware CPU architecture that the image runs on. + * + * @param string|null $architecture + * + * @return self + */ + public function setArchitecture(?string $architecture): self + { + $this->initialized['architecture'] = true; + $this->architecture = $architecture; + return $this; + } + /** + * CPU architecture variant (presently ARM-only). + * + * @return string|null + */ + public function getVariant(): ?string + { + return $this->variant; + } + /** + * CPU architecture variant (presently ARM-only). + * + * @param string|null $variant + * + * @return self + */ + public function setVariant(?string $variant): self + { + $this->initialized['variant'] = true; + $this->variant = $variant; + return $this; + } + /** + * Operating System the image is built to run on. + * + * @return string|null + */ + public function getOs(): ?string + { + return $this->os; + } + /** + * Operating System the image is built to run on. + * + * @param string|null $os + * + * @return self + */ + public function setOs(?string $os): self + { + $this->initialized['os'] = true; + $this->os = $os; + return $this; + } + /** + * Operating System version the image is built to run on (especially + for Windows). + + * + * @return string|null + */ + public function getOsVersion(): ?string + { + return $this->osVersion; + } + /** + * Operating System version the image is built to run on (especially + for Windows). + + * + * @param string|null $osVersion + * + * @return self + */ + public function setOsVersion(?string $osVersion): self + { + $this->initialized['osVersion'] = true; + $this->osVersion = $osVersion; + return $this; + } + /** + * Total size of the image including all layers it is composed of. + * + * @return int|null + */ + public function getSize(): ?int + { + return $this->size; + } + /** + * Total size of the image including all layers it is composed of. + * + * @param int|null $size + * + * @return self + */ + public function setSize(?int $size): self + { + $this->initialized['size'] = true; + $this->size = $size; + return $this; + } + /** + * Total size of the image including all layers it is composed of. + + Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + + * + * @return int|null + */ + public function getVirtualSize(): ?int + { + return $this->virtualSize; + } + /** + * Total size of the image including all layers it is composed of. + + Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + + * + * @param int|null $virtualSize + * + * @return self + */ + public function setVirtualSize(?int $virtualSize): self + { + $this->initialized['virtualSize'] = true; + $this->virtualSize = $virtualSize; + return $this; + } + /** + * Information about the storage driver used to store the container's and + image's filesystem. + + * + * @return DriverData|null + */ + public function getGraphDriver(): ?DriverData + { + return $this->graphDriver; + } + /** + * Information about the storage driver used to store the container's and + image's filesystem. + + * + * @param DriverData|null $graphDriver + * + * @return self + */ + public function setGraphDriver(?DriverData $graphDriver): self + { + $this->initialized['graphDriver'] = true; + $this->graphDriver = $graphDriver; + return $this; + } + /** + * Information about the image's RootFS, including the layer IDs. + * + * @return ImageInspectRootFS|null + */ + public function getRootFS(): ?ImageInspectRootFS + { + return $this->rootFS; + } + /** + * Information about the image's RootFS, including the layer IDs. + * + * @param ImageInspectRootFS|null $rootFS + * + * @return self + */ + public function setRootFS(?ImageInspectRootFS $rootFS): self + { + $this->initialized['rootFS'] = true; + $this->rootFS = $rootFS; + return $this; + } + /** + * Additional metadata of the image in the local cache. This information + is local to the daemon, and not part of the image itself. + + * + * @return ImageInspectMetadata|null + */ + public function getMetadata(): ?ImageInspectMetadata + { + return $this->metadata; + } + /** + * Additional metadata of the image in the local cache. This information + is local to the daemon, and not part of the image itself. + + * + * @param ImageInspectMetadata|null $metadata + * + * @return self + */ + public function setMetadata(?ImageInspectMetadata $metadata): self + { + $this->initialized['metadata'] = true; + $this->metadata = $metadata; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImageInspectMetadata.php b/generated/Model/ImageInspectMetadata.php new file mode 100644 index 00000000..c8e8d796 --- /dev/null +++ b/generated/Model/ImageInspectMetadata.php @@ -0,0 +1,58 @@ +initialized); + } + /** + * Date and time at which the image was last tagged in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if the image was tagged locally, + and omitted otherwise. + + * + * @var string|null + */ + protected $lastTagTime; + /** + * Date and time at which the image was last tagged in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if the image was tagged locally, + and omitted otherwise. + + * + * @return string|null + */ + public function getLastTagTime(): ?string + { + return $this->lastTagTime; + } + /** + * Date and time at which the image was last tagged in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if the image was tagged locally, + and omitted otherwise. + + * + * @param string|null $lastTagTime + * + * @return self + */ + public function setLastTagTime(?string $lastTagTime): self + { + $this->initialized['lastTagTime'] = true; + $this->lastTagTime = $lastTagTime; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImageInspectRootFS.php b/generated/Model/ImageInspectRootFS.php new file mode 100644 index 00000000..b2088b54 --- /dev/null +++ b/generated/Model/ImageInspectRootFS.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $type; + /** + * + * + * @var list|null + */ + protected $layers; + /** + * + * + * @return string|null + */ + public function getType(): ?string + { + return $this->type; + } + /** + * + * + * @param string|null $type + * + * @return self + */ + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + return $this; + } + /** + * + * + * @return list|null + */ + public function getLayers(): ?array + { + return $this->layers; + } + /** + * + * + * @param list|null $layers + * + * @return self + */ + public function setLayers(?array $layers): self + { + $this->initialized['layers'] = true; + $this->layers = $layers; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImageItem.php b/generated/Model/ImageItem.php deleted file mode 100644 index 09569bfe..00000000 --- a/generated/Model/ImageItem.php +++ /dev/null @@ -1,199 +0,0 @@ -repoTags; - } - - /** - * @param string[]|null $repoTags - * - * @return self - */ - public function setRepoTags($repoTags = null) - { - $this->repoTags = $repoTags; - - return $this; - } - - /** - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId($id = null) - { - $this->id = $id; - - return $this; - } - - /** - * @return string - */ - public function getParentId() - { - return $this->parentId; - } - - /** - * @param string $parentId - * - * @return self - */ - public function setParentId($parentId = null) - { - $this->parentId = $parentId; - - return $this; - } - - /** - * @return int - */ - public function getCreated() - { - return $this->created; - } - - /** - * @param int $created - * - * @return self - */ - public function setCreated($created = null) - { - $this->created = $created; - - return $this; - } - - /** - * @return int - */ - public function getSize() - { - return $this->size; - } - - /** - * @param int $size - * - * @return self - */ - public function setSize($size = null) - { - $this->size = $size; - - return $this; - } - - /** - * @return int - */ - public function getVirtualSize() - { - return $this->virtualSize; - } - - /** - * @param int $virtualSize - * - * @return self - */ - public function setVirtualSize($virtualSize = null) - { - $this->virtualSize = $virtualSize; - - return $this; - } - - /** - * @return string[]|null - */ - public function getLabels() - { - return $this->labels; - } - - /** - * @param string[]|null $labels - * - * @return self - */ - public function setLabels($labels = null) - { - $this->labels = $labels; - - return $this; - } - - /** - * @return string[]|null - */ - public function getRepoDigests() - { - return $this->repoDigests; - } - - /** - * @param string[]|null $repoDigests - * - * @return self - */ - public function setRepoDigests($repoDigests = null) - { - $this->repoDigests = $repoDigests; - - return $this; - } -} diff --git a/generated/Model/ImageManifestSummary.php b/generated/Model/ImageManifestSummary.php new file mode 100644 index 00000000..65720ae5 --- /dev/null +++ b/generated/Model/ImageManifestSummary.php @@ -0,0 +1,253 @@ +initialized); + } + /** + * ID is the content-addressable ID of an image and is the same as the + digest of the image manifest. + + * + * @var string|null + */ + protected $iD; + /** + * A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + + * + * @var OCIDescriptor|null + */ + protected $descriptor; + /** + * Indicates whether all the child content (image config, layers) is fully available locally. + * + * @var bool|null + */ + protected $available; + /** + * + * + * @var ImageManifestSummarySize|null + */ + protected $size; + /** + * The kind of the manifest. + + kind | description + -------------|----------------------------------------------------------- + image | Image manifest that can be used to start a container. + attestation | Attestation manifest produced by the Buildkit builder for a specific image manifest. + + * + * @var string|null + */ + protected $kind; + /** + * The image data for the image manifest. + This field is only populated when Kind is "image". + + * + * @var ImageManifestSummaryImageData|null + */ + protected $imageData; + /** + * The image data for the attestation manifest. + This field is only populated when Kind is "attestation". + + * + * @var ImageManifestSummaryAttestationData|null + */ + protected $attestationData; + /** + * ID is the content-addressable ID of an image and is the same as the + digest of the image manifest. + + * + * @return string|null + */ + public function getID(): ?string + { + return $this->iD; + } + /** + * ID is the content-addressable ID of an image and is the same as the + digest of the image manifest. + + * + * @param string|null $iD + * + * @return self + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } + /** + * A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + + * + * @return OCIDescriptor|null + */ + public function getDescriptor(): ?OCIDescriptor + { + return $this->descriptor; + } + /** + * A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + + * + * @param OCIDescriptor|null $descriptor + * + * @return self + */ + public function setDescriptor(?OCIDescriptor $descriptor): self + { + $this->initialized['descriptor'] = true; + $this->descriptor = $descriptor; + return $this; + } + /** + * Indicates whether all the child content (image config, layers) is fully available locally. + * + * @return bool|null + */ + public function getAvailable(): ?bool + { + return $this->available; + } + /** + * Indicates whether all the child content (image config, layers) is fully available locally. + * + * @param bool|null $available + * + * @return self + */ + public function setAvailable(?bool $available): self + { + $this->initialized['available'] = true; + $this->available = $available; + return $this; + } + /** + * + * + * @return ImageManifestSummarySize|null + */ + public function getSize(): ?ImageManifestSummarySize + { + return $this->size; + } + /** + * + * + * @param ImageManifestSummarySize|null $size + * + * @return self + */ + public function setSize(?ImageManifestSummarySize $size): self + { + $this->initialized['size'] = true; + $this->size = $size; + return $this; + } + /** + * The kind of the manifest. + + kind | description + -------------|----------------------------------------------------------- + image | Image manifest that can be used to start a container. + attestation | Attestation manifest produced by the Buildkit builder for a specific image manifest. + + * + * @return string|null + */ + public function getKind(): ?string + { + return $this->kind; + } + /** + * The kind of the manifest. + + kind | description + -------------|----------------------------------------------------------- + image | Image manifest that can be used to start a container. + attestation | Attestation manifest produced by the Buildkit builder for a specific image manifest. + + * + * @param string|null $kind + * + * @return self + */ + public function setKind(?string $kind): self + { + $this->initialized['kind'] = true; + $this->kind = $kind; + return $this; + } + /** + * The image data for the image manifest. + This field is only populated when Kind is "image". + + * + * @return ImageManifestSummaryImageData|null + */ + public function getImageData(): ?ImageManifestSummaryImageData + { + return $this->imageData; + } + /** + * The image data for the image manifest. + This field is only populated when Kind is "image". + + * + * @param ImageManifestSummaryImageData|null $imageData + * + * @return self + */ + public function setImageData(?ImageManifestSummaryImageData $imageData): self + { + $this->initialized['imageData'] = true; + $this->imageData = $imageData; + return $this; + } + /** + * The image data for the attestation manifest. + This field is only populated when Kind is "attestation". + + * + * @return ImageManifestSummaryAttestationData|null + */ + public function getAttestationData(): ?ImageManifestSummaryAttestationData + { + return $this->attestationData; + } + /** + * The image data for the attestation manifest. + This field is only populated when Kind is "attestation". + + * + * @param ImageManifestSummaryAttestationData|null $attestationData + * + * @return self + */ + public function setAttestationData(?ImageManifestSummaryAttestationData $attestationData): self + { + $this->initialized['attestationData'] = true; + $this->attestationData = $attestationData; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImageManifestSummaryAttestationData.php b/generated/Model/ImageManifestSummaryAttestationData.php new file mode 100644 index 00000000..e6386380 --- /dev/null +++ b/generated/Model/ImageManifestSummaryAttestationData.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * The digest of the image manifest that this attestation is for. + * + * @var string|null + */ + protected $for; + /** + * The digest of the image manifest that this attestation is for. + * + * @return string|null + */ + public function getFor(): ?string + { + return $this->for; + } + /** + * The digest of the image manifest that this attestation is for. + * + * @param string|null $for + * + * @return self + */ + public function setFor(?string $for): self + { + $this->initialized['for'] = true; + $this->for = $for; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImageManifestSummaryImageData.php b/generated/Model/ImageManifestSummaryImageData.php new file mode 100644 index 00000000..5c29ff0b --- /dev/null +++ b/generated/Model/ImageManifestSummaryImageData.php @@ -0,0 +1,105 @@ +initialized); + } + /** + * Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + + * + * @var OCIPlatform|null + */ + protected $platform; + /** + * The IDs of the containers that are using this image. + * + * @var list|null + */ + protected $containers; + /** + * + * + * @var ImageManifestSummaryImageDataSize|null + */ + protected $size; + /** + * Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + + * + * @return OCIPlatform|null + */ + public function getPlatform(): ?OCIPlatform + { + return $this->platform; + } + /** + * Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + + * + * @param OCIPlatform|null $platform + * + * @return self + */ + public function setPlatform(?OCIPlatform $platform): self + { + $this->initialized['platform'] = true; + $this->platform = $platform; + return $this; + } + /** + * The IDs of the containers that are using this image. + * + * @return list|null + */ + public function getContainers(): ?array + { + return $this->containers; + } + /** + * The IDs of the containers that are using this image. + * + * @param list|null $containers + * + * @return self + */ + public function setContainers(?array $containers): self + { + $this->initialized['containers'] = true; + $this->containers = $containers; + return $this; + } + /** + * + * + * @return ImageManifestSummaryImageDataSize|null + */ + public function getSize(): ?ImageManifestSummaryImageDataSize + { + return $this->size; + } + /** + * + * + * @param ImageManifestSummaryImageDataSize|null $size + * + * @return self + */ + public function setSize(?ImageManifestSummaryImageDataSize $size): self + { + $this->initialized['size'] = true; + $this->size = $size; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImageManifestSummaryImageDataSize.php b/generated/Model/ImageManifestSummaryImageDataSize.php new file mode 100644 index 00000000..14ce09ee --- /dev/null +++ b/generated/Model/ImageManifestSummaryImageDataSize.php @@ -0,0 +1,64 @@ +initialized); + } + /** + * Unpacked is the size (in bytes) of the locally unpacked + (uncompressed) image content that's directly usable by the containers + running this image. + It's independent of the distributable content - e.g. + the image might still have an unpacked data that's still used by + some container even when the distributable/compressed content is + already gone. + + * + * @var int|null + */ + protected $unpacked; + /** + * Unpacked is the size (in bytes) of the locally unpacked + (uncompressed) image content that's directly usable by the containers + running this image. + It's independent of the distributable content - e.g. + the image might still have an unpacked data that's still used by + some container even when the distributable/compressed content is + already gone. + + * + * @return int|null + */ + public function getUnpacked(): ?int + { + return $this->unpacked; + } + /** + * Unpacked is the size (in bytes) of the locally unpacked + (uncompressed) image content that's directly usable by the containers + running this image. + It's independent of the distributable content - e.g. + the image might still have an unpacked data that's still used by + some container even when the distributable/compressed content is + already gone. + + * + * @param int|null $unpacked + * + * @return self + */ + public function setUnpacked(?int $unpacked): self + { + $this->initialized['unpacked'] = true; + $this->unpacked = $unpacked; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImageManifestSummarySize.php b/generated/Model/ImageManifestSummarySize.php new file mode 100644 index 00000000..91d65489 --- /dev/null +++ b/generated/Model/ImageManifestSummarySize.php @@ -0,0 +1,107 @@ +initialized); + } + /** + * Total is the total size (in bytes) of all the locally present + data (both distributable and non-distributable) that's related to + this manifest and its children. + This equal to the sum of [Content] size AND all the sizes in the + [Size] struct present in the Kind-specific data struct. + For example, for an image kind (Kind == "image") + this would include the size of the image content and unpacked + image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). + + * + * @var int|null + */ + protected $total; + /** + * Content is the size (in bytes) of all the locally present + content in the content store (e.g. image config, layers) + referenced by this manifest and its children. + This only includes blobs in the content store. + + * + * @var int|null + */ + protected $content; + /** + * Total is the total size (in bytes) of all the locally present + data (both distributable and non-distributable) that's related to + this manifest and its children. + This equal to the sum of [Content] size AND all the sizes in the + [Size] struct present in the Kind-specific data struct. + For example, for an image kind (Kind == "image") + this would include the size of the image content and unpacked + image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). + + * + * @return int|null + */ + public function getTotal(): ?int + { + return $this->total; + } + /** + * Total is the total size (in bytes) of all the locally present + data (both distributable and non-distributable) that's related to + this manifest and its children. + This equal to the sum of [Content] size AND all the sizes in the + [Size] struct present in the Kind-specific data struct. + For example, for an image kind (Kind == "image") + this would include the size of the image content and unpacked + image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). + + * + * @param int|null $total + * + * @return self + */ + public function setTotal(?int $total): self + { + $this->initialized['total'] = true; + $this->total = $total; + return $this; + } + /** + * Content is the size (in bytes) of all the locally present + content in the content store (e.g. image config, layers) + referenced by this manifest and its children. + This only includes blobs in the content store. + + * + * @return int|null + */ + public function getContent(): ?int + { + return $this->content; + } + /** + * Content is the size (in bytes) of all the locally present + content in the content store (e.g. image config, layers) + referenced by this manifest and its children. + This only includes blobs in the content store. + + * + * @param int|null $content + * + * @return self + */ + public function setContent(?int $content): self + { + $this->initialized['content'] = true; + $this->content = $content; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImageSearchResult.php b/generated/Model/ImageSearchResult.php deleted file mode 100644 index 9643d0b2..00000000 --- a/generated/Model/ImageSearchResult.php +++ /dev/null @@ -1,127 +0,0 @@ -description; - } - - /** - * @param string $description - * - * @return self - */ - public function setDescription($description = null) - { - $this->description = $description; - - return $this; - } - - /** - * @return bool - */ - public function getIsOfficial() - { - return $this->isOfficial; - } - - /** - * @param bool $isOfficial - * - * @return self - */ - public function setIsOfficial($isOfficial = null) - { - $this->isOfficial = $isOfficial; - - return $this; - } - - /** - * @return bool - */ - public function getIsAutomated() - { - return $this->isAutomated; - } - - /** - * @param bool $isAutomated - * - * @return self - */ - public function setIsAutomated($isAutomated = null) - { - $this->isAutomated = $isAutomated; - - return $this; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } - - /** - * @return int - */ - public function getStarCount() - { - return $this->starCount; - } - - /** - * @param int $starCount - * - * @return self - */ - public function setStarCount($starCount = null) - { - $this->starCount = $starCount; - - return $this; - } -} diff --git a/generated/Model/ImageSummary.php b/generated/Model/ImageSummary.php new file mode 100644 index 00000000..f67e5001 --- /dev/null +++ b/generated/Model/ImageSummary.php @@ -0,0 +1,461 @@ +initialized); + } + /** + * ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + + * + * @var string|null + */ + protected $id; + /** + * ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + + * + * @var string|null + */ + protected $parentId; + /** + * List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + + * + * @var list|null + */ + protected $repoTags; + /** + * List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + + * + * @var list|null + */ + protected $repoDigests; + /** + * Date and time at which the image was created as a Unix timestamp + (number of seconds since EPOCH). + + * + * @var int|null + */ + protected $created; + /** + * Total size of the image including all layers it is composed of. + * + * @var int|null + */ + protected $size; + /** + * Total size of image layers that are shared between this image and other + images. + + This size is not calculated by default. `-1` indicates that the value + has not been set / calculated. + + * + * @var int|null + */ + protected $sharedSize; + /** + * Total size of the image including all layers it is composed of. + + Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + * + * @var int|null + */ + protected $virtualSize; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * Number of containers using this image. Includes both stopped and running + containers. + + This size is not calculated by default, and depends on which API endpoint + is used. `-1` indicates that the value has not been set / calculated. + + * + * @var int|null + */ + protected $containers; + /** + * Manifests is a list of manifests available in this image. + It provides a more detailed view of the platform-specific image manifests + or other image-attached data like build attestations. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + + * + * @var list|null + */ + protected $manifests; + /** + * ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + + * + * @return string|null + */ + public function getId(): ?string + { + return $this->id; + } + /** + * ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + + * + * @param string|null $id + * + * @return self + */ + public function setId(?string $id): self + { + $this->initialized['id'] = true; + $this->id = $id; + return $this; + } + /** + * ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + + * + * @return string|null + */ + public function getParentId(): ?string + { + return $this->parentId; + } + /** + * ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + + * + * @param string|null $parentId + * + * @return self + */ + public function setParentId(?string $parentId): self + { + $this->initialized['parentId'] = true; + $this->parentId = $parentId; + return $this; + } + /** + * List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + + * + * @return list|null + */ + public function getRepoTags(): ?array + { + return $this->repoTags; + } + /** + * List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + + * + * @param list|null $repoTags + * + * @return self + */ + public function setRepoTags(?array $repoTags): self + { + $this->initialized['repoTags'] = true; + $this->repoTags = $repoTags; + return $this; + } + /** + * List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + + * + * @return list|null + */ + public function getRepoDigests(): ?array + { + return $this->repoDigests; + } + /** + * List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + + * + * @param list|null $repoDigests + * + * @return self + */ + public function setRepoDigests(?array $repoDigests): self + { + $this->initialized['repoDigests'] = true; + $this->repoDigests = $repoDigests; + return $this; + } + /** + * Date and time at which the image was created as a Unix timestamp + (number of seconds since EPOCH). + + * + * @return int|null + */ + public function getCreated(): ?int + { + return $this->created; + } + /** + * Date and time at which the image was created as a Unix timestamp + (number of seconds since EPOCH). + + * + * @param int|null $created + * + * @return self + */ + public function setCreated(?int $created): self + { + $this->initialized['created'] = true; + $this->created = $created; + return $this; + } + /** + * Total size of the image including all layers it is composed of. + * + * @return int|null + */ + public function getSize(): ?int + { + return $this->size; + } + /** + * Total size of the image including all layers it is composed of. + * + * @param int|null $size + * + * @return self + */ + public function setSize(?int $size): self + { + $this->initialized['size'] = true; + $this->size = $size; + return $this; + } + /** + * Total size of image layers that are shared between this image and other + images. + + This size is not calculated by default. `-1` indicates that the value + has not been set / calculated. + + * + * @return int|null + */ + public function getSharedSize(): ?int + { + return $this->sharedSize; + } + /** + * Total size of image layers that are shared between this image and other + images. + + This size is not calculated by default. `-1` indicates that the value + has not been set / calculated. + + * + * @param int|null $sharedSize + * + * @return self + */ + public function setSharedSize(?int $sharedSize): self + { + $this->initialized['sharedSize'] = true; + $this->sharedSize = $sharedSize; + return $this; + } + /** + * Total size of the image including all layers it is composed of. + + Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + * + * @return int|null + */ + public function getVirtualSize(): ?int + { + return $this->virtualSize; + } + /** + * Total size of the image including all layers it is composed of. + + Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + * + * @param int|null $virtualSize + * + * @return self + */ + public function setVirtualSize(?int $virtualSize): self + { + $this->initialized['virtualSize'] = true; + $this->virtualSize = $virtualSize; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * Number of containers using this image. Includes both stopped and running + containers. + + This size is not calculated by default, and depends on which API endpoint + is used. `-1` indicates that the value has not been set / calculated. + + * + * @return int|null + */ + public function getContainers(): ?int + { + return $this->containers; + } + /** + * Number of containers using this image. Includes both stopped and running + containers. + + This size is not calculated by default, and depends on which API endpoint + is used. `-1` indicates that the value has not been set / calculated. + + * + * @param int|null $containers + * + * @return self + */ + public function setContainers(?int $containers): self + { + $this->initialized['containers'] = true; + $this->containers = $containers; + return $this; + } + /** + * Manifests is a list of manifests available in this image. + It provides a more detailed view of the platform-specific image manifests + or other image-attached data like build attestations. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + + * + * @return list|null + */ + public function getManifests(): ?array + { + return $this->manifests; + } + /** + * Manifests is a list of manifests available in this image. + It provides a more detailed view of the platform-specific image manifests + or other image-attached data like build attestations. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + + * + * @param list|null $manifests + * + * @return self + */ + public function setManifests(?array $manifests): self + { + $this->initialized['manifests'] = true; + $this->manifests = $manifests; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImagesNameHistoryGetResponse200Item.php b/generated/Model/ImagesNameHistoryGetResponse200Item.php new file mode 100644 index 00000000..d4d444ca --- /dev/null +++ b/generated/Model/ImagesNameHistoryGetResponse200Item.php @@ -0,0 +1,183 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $id; + /** + * + * + * @var int|null + */ + protected $created; + /** + * + * + * @var string|null + */ + protected $createdBy; + /** + * + * + * @var list|null + */ + protected $tags; + /** + * + * + * @var int|null + */ + protected $size; + /** + * + * + * @var string|null + */ + protected $comment; + /** + * + * + * @return string|null + */ + public function getId(): ?string + { + return $this->id; + } + /** + * + * + * @param string|null $id + * + * @return self + */ + public function setId(?string $id): self + { + $this->initialized['id'] = true; + $this->id = $id; + return $this; + } + /** + * + * + * @return int|null + */ + public function getCreated(): ?int + { + return $this->created; + } + /** + * + * + * @param int|null $created + * + * @return self + */ + public function setCreated(?int $created): self + { + $this->initialized['created'] = true; + $this->created = $created; + return $this; + } + /** + * + * + * @return string|null + */ + public function getCreatedBy(): ?string + { + return $this->createdBy; + } + /** + * + * + * @param string|null $createdBy + * + * @return self + */ + public function setCreatedBy(?string $createdBy): self + { + $this->initialized['createdBy'] = true; + $this->createdBy = $createdBy; + return $this; + } + /** + * + * + * @return list|null + */ + public function getTags(): ?array + { + return $this->tags; + } + /** + * + * + * @param list|null $tags + * + * @return self + */ + public function setTags(?array $tags): self + { + $this->initialized['tags'] = true; + $this->tags = $tags; + return $this; + } + /** + * + * + * @return int|null + */ + public function getSize(): ?int + { + return $this->size; + } + /** + * + * + * @param int|null $size + * + * @return self + */ + public function setSize(?int $size): self + { + $this->initialized['size'] = true; + $this->size = $size; + return $this; + } + /** + * + * + * @return string|null + */ + public function getComment(): ?string + { + return $this->comment; + } + /** + * + * + * @param string|null $comment + * + * @return self + */ + public function setComment(?string $comment): self + { + $this->initialized['comment'] = true; + $this->comment = $comment; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImagesPrunePostResponse200.php b/generated/Model/ImagesPrunePostResponse200.php new file mode 100644 index 00000000..e990cd83 --- /dev/null +++ b/generated/Model/ImagesPrunePostResponse200.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * Images that were deleted + * + * @var list|null + */ + protected $imagesDeleted; + /** + * Disk space reclaimed in bytes + * + * @var int|null + */ + protected $spaceReclaimed; + /** + * Images that were deleted + * + * @return list|null + */ + public function getImagesDeleted(): ?array + { + return $this->imagesDeleted; + } + /** + * Images that were deleted + * + * @param list|null $imagesDeleted + * + * @return self + */ + public function setImagesDeleted(?array $imagesDeleted): self + { + $this->initialized['imagesDeleted'] = true; + $this->imagesDeleted = $imagesDeleted; + return $this; + } + /** + * Disk space reclaimed in bytes + * + * @return int|null + */ + public function getSpaceReclaimed(): ?int + { + return $this->spaceReclaimed; + } + /** + * Disk space reclaimed in bytes + * + * @param int|null $spaceReclaimed + * + * @return self + */ + public function setSpaceReclaimed(?int $spaceReclaimed): self + { + $this->initialized['spaceReclaimed'] = true; + $this->spaceReclaimed = $spaceReclaimed; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ImagesSearchGetResponse200Item.php b/generated/Model/ImagesSearchGetResponse200Item.php new file mode 100644 index 00000000..ea23779c --- /dev/null +++ b/generated/Model/ImagesSearchGetResponse200Item.php @@ -0,0 +1,170 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $description; + /** + * + * + * @var bool|null + */ + protected $isOfficial; + /** + * Whether this repository has automated builds enabled. + +


+ + > **Deprecated**: This field is deprecated and will always be "false". + + * + * @var bool|null + */ + protected $isAutomated; + /** + * + * + * @var string|null + */ + protected $name; + /** + * + * + * @var int|null + */ + protected $starCount; + /** + * + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + /** + * + * + * @param string|null $description + * + * @return self + */ + public function setDescription(?string $description): self + { + $this->initialized['description'] = true; + $this->description = $description; + return $this; + } + /** + * + * + * @return bool|null + */ + public function getIsOfficial(): ?bool + { + return $this->isOfficial; + } + /** + * + * + * @param bool|null $isOfficial + * + * @return self + */ + public function setIsOfficial(?bool $isOfficial): self + { + $this->initialized['isOfficial'] = true; + $this->isOfficial = $isOfficial; + return $this; + } + /** + * Whether this repository has automated builds enabled. + +


+ + > **Deprecated**: This field is deprecated and will always be "false". + + * + * @return bool|null + */ + public function getIsAutomated(): ?bool + { + return $this->isAutomated; + } + /** + * Whether this repository has automated builds enabled. + +


+ + > **Deprecated**: This field is deprecated and will always be "false". + + * + * @param bool|null $isAutomated + * + * @return self + */ + public function setIsAutomated(?bool $isAutomated): self + { + $this->initialized['isAutomated'] = true; + $this->isAutomated = $isAutomated; + return $this; + } + /** + * + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * + * + * @return int|null + */ + public function getStarCount(): ?int + { + return $this->starCount; + } + /** + * + * + * @param int|null $starCount + * + * @return self + */ + public function setStarCount(?int $starCount): self + { + $this->initialized['starCount'] = true; + $this->starCount = $starCount; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/IndexInfo.php b/generated/Model/IndexInfo.php new file mode 100644 index 00000000..7962f47f --- /dev/null +++ b/generated/Model/IndexInfo.php @@ -0,0 +1,163 @@ +initialized); + } + /** + * Name of the registry, such as "docker.io". + * + * @var string|null + */ + protected $name; + /** + * List of mirrors, expressed as URIs. + * + * @var list|null + */ + protected $mirrors; + /** + * Indicates if the registry is part of the list of insecure + registries. + + If `false`, the registry is insecure. Insecure registries accept + un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + unknown CAs) communication. + + > **Warning**: Insecure registries can be useful when running a local + > registry. However, because its use creates security vulnerabilities + > it should ONLY be enabled for testing purposes. For increased + > security, users should add their CA to their system's list of + > trusted CAs instead of enabling this option. + + * + * @var bool|null + */ + protected $secure; + /** + * Indicates whether this is an official registry (i.e., Docker Hub / docker.io) + * + * @var bool|null + */ + protected $official; + /** + * Name of the registry, such as "docker.io". + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Name of the registry, such as "docker.io". + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * List of mirrors, expressed as URIs. + * + * @return list|null + */ + public function getMirrors(): ?array + { + return $this->mirrors; + } + /** + * List of mirrors, expressed as URIs. + * + * @param list|null $mirrors + * + * @return self + */ + public function setMirrors(?array $mirrors): self + { + $this->initialized['mirrors'] = true; + $this->mirrors = $mirrors; + return $this; + } + /** + * Indicates if the registry is part of the list of insecure + registries. + + If `false`, the registry is insecure. Insecure registries accept + un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + unknown CAs) communication. + + > **Warning**: Insecure registries can be useful when running a local + > registry. However, because its use creates security vulnerabilities + > it should ONLY be enabled for testing purposes. For increased + > security, users should add their CA to their system's list of + > trusted CAs instead of enabling this option. + + * + * @return bool|null + */ + public function getSecure(): ?bool + { + return $this->secure; + } + /** + * Indicates if the registry is part of the list of insecure + registries. + + If `false`, the registry is insecure. Insecure registries accept + un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + unknown CAs) communication. + + > **Warning**: Insecure registries can be useful when running a local + > registry. However, because its use creates security vulnerabilities + > it should ONLY be enabled for testing purposes. For increased + > security, users should add their CA to their system's list of + > trusted CAs instead of enabling this option. + + * + * @param bool|null $secure + * + * @return self + */ + public function setSecure(?bool $secure): self + { + $this->initialized['secure'] = true; + $this->secure = $secure; + return $this; + } + /** + * Indicates whether this is an official registry (i.e., Docker Hub / docker.io) + * + * @return bool|null + */ + public function getOfficial(): ?bool + { + return $this->official; + } + /** + * Indicates whether this is an official registry (i.e., Docker Hub / docker.io) + * + * @param bool|null $official + * + * @return self + */ + public function setOfficial(?bool $official): self + { + $this->initialized['official'] = true; + $this->official = $official; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/JoinTokens.php b/generated/Model/JoinTokens.php new file mode 100644 index 00000000..ea97d5c0 --- /dev/null +++ b/generated/Model/JoinTokens.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * The token workers can use to join the swarm. + * + * @var string|null + */ + protected $worker; + /** + * The token managers can use to join the swarm. + * + * @var string|null + */ + protected $manager; + /** + * The token workers can use to join the swarm. + * + * @return string|null + */ + public function getWorker(): ?string + { + return $this->worker; + } + /** + * The token workers can use to join the swarm. + * + * @param string|null $worker + * + * @return self + */ + public function setWorker(?string $worker): self + { + $this->initialized['worker'] = true; + $this->worker = $worker; + return $this; + } + /** + * The token managers can use to join the swarm. + * + * @return string|null + */ + public function getManager(): ?string + { + return $this->manager; + } + /** + * The token managers can use to join the swarm. + * + * @param string|null $manager + * + * @return self + */ + public function setManager(?string $manager): self + { + $this->initialized['manager'] = true; + $this->manager = $manager; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Limit.php b/generated/Model/Limit.php new file mode 100644 index 00000000..420b4772 --- /dev/null +++ b/generated/Model/Limit.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * + * + * @var int|null + */ + protected $nanoCPUs; + /** + * + * + * @var int|null + */ + protected $memoryBytes; + /** + * Limits the maximum number of PIDs in the container. Set `0` for unlimited. + * + * @var int|null + */ + protected $pids = 0; + /** + * + * + * @return int|null + */ + public function getNanoCPUs(): ?int + { + return $this->nanoCPUs; + } + /** + * + * + * @param int|null $nanoCPUs + * + * @return self + */ + public function setNanoCPUs(?int $nanoCPUs): self + { + $this->initialized['nanoCPUs'] = true; + $this->nanoCPUs = $nanoCPUs; + return $this; + } + /** + * + * + * @return int|null + */ + public function getMemoryBytes(): ?int + { + return $this->memoryBytes; + } + /** + * + * + * @param int|null $memoryBytes + * + * @return self + */ + public function setMemoryBytes(?int $memoryBytes): self + { + $this->initialized['memoryBytes'] = true; + $this->memoryBytes = $memoryBytes; + return $this; + } + /** + * Limits the maximum number of PIDs in the container. Set `0` for unlimited. + * + * @return int|null + */ + public function getPids(): ?int + { + return $this->pids; + } + /** + * Limits the maximum number of PIDs in the container. Set `0` for unlimited. + * + * @param int|null $pids + * + * @return self + */ + public function setPids(?int $pids): self + { + $this->initialized['pids'] = true; + $this->pids = $pids; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/LogConfig.php b/generated/Model/LogConfig.php deleted file mode 100644 index 2b061be6..00000000 --- a/generated/Model/LogConfig.php +++ /dev/null @@ -1,55 +0,0 @@ -type; - } - - /** - * @param string $type - * - * @return self - */ - public function setType($type = null) - { - $this->type = $type; - - return $this; - } - - /** - * @return string[]|null - */ - public function getConfig() - { - return $this->config; - } - - /** - * @param string[]|null $config - * - * @return self - */ - public function setConfig($config = null) - { - $this->config = $config; - - return $this; - } -} diff --git a/generated/Model/ManagerStatus.php b/generated/Model/ManagerStatus.php new file mode 100644 index 00000000..421f54fe --- /dev/null +++ b/generated/Model/ManagerStatus.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * + * + * @var bool|null + */ + protected $leader = false; + /** + * Reachability represents the reachability of a node. + * + * @var string|null + */ + protected $reachability; + /** + * The IP address and port at which the manager is reachable. + * + * @var string|null + */ + protected $addr; + /** + * + * + * @return bool|null + */ + public function getLeader(): ?bool + { + return $this->leader; + } + /** + * + * + * @param bool|null $leader + * + * @return self + */ + public function setLeader(?bool $leader): self + { + $this->initialized['leader'] = true; + $this->leader = $leader; + return $this; + } + /** + * Reachability represents the reachability of a node. + * + * @return string|null + */ + public function getReachability(): ?string + { + return $this->reachability; + } + /** + * Reachability represents the reachability of a node. + * + * @param string|null $reachability + * + * @return self + */ + public function setReachability(?string $reachability): self + { + $this->initialized['reachability'] = true; + $this->reachability = $reachability; + return $this; + } + /** + * The IP address and port at which the manager is reachable. + * + * @return string|null + */ + public function getAddr(): ?string + { + return $this->addr; + } + /** + * The IP address and port at which the manager is reachable. + * + * @param string|null $addr + * + * @return self + */ + public function setAddr(?string $addr): self + { + $this->initialized['addr'] = true; + $this->addr = $addr; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Mount.php b/generated/Model/Mount.php index d0eef297..f285d0a6 100644 --- a/generated/Model/Mount.php +++ b/generated/Model/Mount.php @@ -5,171 +5,256 @@ class Mount { /** - * @var string + * @var array */ - protected $name; + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } /** - * @var string + * Container path. + * + * @var string|null + */ + protected $target; + /** + * Mount source (e.g. a volume name, a host path). + * + * @var string|null */ protected $source; /** - * @var string + * The mount type. Available types: + + - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. + - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `cluster` a Swarm cluster volume + + * + * @var string|null + */ + protected $type; + /** + * Whether the mount should be read-only. + * + * @var bool|null */ - protected $destination; + protected $readOnly; /** - * @var string + * The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`. + * + * @var string|null */ - protected $driver; + protected $consistency; /** - * @var string + * Optional configuration for the `bind` type. + * + * @var MountBindOptions|null */ - protected $mode; + protected $bindOptions; /** - * @var bool + * Optional configuration for the `volume` type. + * + * @var MountVolumeOptions|null */ - protected $rW; + protected $volumeOptions; /** - * @var string + * Optional configuration for the `tmpfs` type. + * + * @var MountTmpfsOptions|null */ - protected $propagation; - + protected $tmpfsOptions; /** - * @return string + * Container path. + * + * @return string|null */ - public function getName() + public function getTarget(): ?string { - return $this->name; + return $this->target; } - /** - * @param string $name + * Container path. + * + * @param string|null $target * * @return self */ - public function setName($name = null) + public function setTarget(?string $target): self { - $this->name = $name; - + $this->initialized['target'] = true; + $this->target = $target; return $this; } - /** - * @return string + * Mount source (e.g. a volume name, a host path). + * + * @return string|null */ - public function getSource() + public function getSource(): ?string { return $this->source; } - /** - * @param string $source + * Mount source (e.g. a volume name, a host path). + * + * @param string|null $source * * @return self */ - public function setSource($source = null) + public function setSource(?string $source): self { + $this->initialized['source'] = true; $this->source = $source; - return $this; } - /** - * @return string + * The mount type. Available types: + + - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. + - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `cluster` a Swarm cluster volume + + * + * @return string|null + */ + public function getType(): ?string + { + return $this->type; + } + /** + * The mount type. Available types: + + - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. + - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `cluster` a Swarm cluster volume + + * + * @param string|null $type + * + * @return self + */ + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + return $this; + } + /** + * Whether the mount should be read-only. + * + * @return bool|null */ - public function getDestination() + public function getReadOnly(): ?bool { - return $this->destination; + return $this->readOnly; } - /** - * @param string $destination + * Whether the mount should be read-only. + * + * @param bool|null $readOnly * * @return self */ - public function setDestination($destination = null) + public function setReadOnly(?bool $readOnly): self { - $this->destination = $destination; - + $this->initialized['readOnly'] = true; + $this->readOnly = $readOnly; return $this; } - /** - * @return string + * The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`. + * + * @return string|null */ - public function getDriver() + public function getConsistency(): ?string { - return $this->driver; + return $this->consistency; } - /** - * @param string $driver + * The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`. + * + * @param string|null $consistency * * @return self */ - public function setDriver($driver = null) + public function setConsistency(?string $consistency): self { - $this->driver = $driver; - + $this->initialized['consistency'] = true; + $this->consistency = $consistency; return $this; } - /** - * @return string + * Optional configuration for the `bind` type. + * + * @return MountBindOptions|null */ - public function getMode() + public function getBindOptions(): ?MountBindOptions { - return $this->mode; + return $this->bindOptions; } - /** - * @param string $mode + * Optional configuration for the `bind` type. + * + * @param MountBindOptions|null $bindOptions * * @return self */ - public function setMode($mode = null) + public function setBindOptions(?MountBindOptions $bindOptions): self { - $this->mode = $mode; - + $this->initialized['bindOptions'] = true; + $this->bindOptions = $bindOptions; return $this; } - /** - * @return bool + * Optional configuration for the `volume` type. + * + * @return MountVolumeOptions|null */ - public function getRW() + public function getVolumeOptions(): ?MountVolumeOptions { - return $this->rW; + return $this->volumeOptions; } - /** - * @param bool $rW + * Optional configuration for the `volume` type. + * + * @param MountVolumeOptions|null $volumeOptions * * @return self */ - public function setRW($rW = null) + public function setVolumeOptions(?MountVolumeOptions $volumeOptions): self { - $this->rW = $rW; - + $this->initialized['volumeOptions'] = true; + $this->volumeOptions = $volumeOptions; return $this; } - /** - * @return string + * Optional configuration for the `tmpfs` type. + * + * @return MountTmpfsOptions|null */ - public function getPropagation() + public function getTmpfsOptions(): ?MountTmpfsOptions { - return $this->propagation; + return $this->tmpfsOptions; } - /** - * @param string $propagation + * Optional configuration for the `tmpfs` type. + * + * @param MountTmpfsOptions|null $tmpfsOptions * * @return self */ - public function setPropagation($propagation = null) + public function setTmpfsOptions(?MountTmpfsOptions $tmpfsOptions): self { - $this->propagation = $propagation; - + $this->initialized['tmpfsOptions'] = true; + $this->tmpfsOptions = $tmpfsOptions; return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/MountBindOptions.php b/generated/Model/MountBindOptions.php new file mode 100644 index 00000000..487cc8df --- /dev/null +++ b/generated/Model/MountBindOptions.php @@ -0,0 +1,173 @@ +initialized); + } + /** + * A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`. + * + * @var string|null + */ + protected $propagation; + /** + * Disable recursive bind mount. + * + * @var bool|null + */ + protected $nonRecursive = false; + /** + * Create mount point on host if missing + * + * @var bool|null + */ + protected $createMountpoint = false; + /** + * Make the mount non-recursively read-only, but still leave the mount recursive + (unless NonRecursive is set to `true` in conjunction). + + Added in v1.44, before that version all read-only mounts were + non-recursive by default. To match the previous behaviour this + will default to `true` for clients on versions prior to v1.44. + + * + * @var bool|null + */ + protected $readOnlyNonRecursive = false; + /** + * Raise an error if the mount cannot be made recursively read-only. + * + * @var bool|null + */ + protected $readOnlyForceRecursive = false; + /** + * A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`. + * + * @return string|null + */ + public function getPropagation(): ?string + { + return $this->propagation; + } + /** + * A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`. + * + * @param string|null $propagation + * + * @return self + */ + public function setPropagation(?string $propagation): self + { + $this->initialized['propagation'] = true; + $this->propagation = $propagation; + return $this; + } + /** + * Disable recursive bind mount. + * + * @return bool|null + */ + public function getNonRecursive(): ?bool + { + return $this->nonRecursive; + } + /** + * Disable recursive bind mount. + * + * @param bool|null $nonRecursive + * + * @return self + */ + public function setNonRecursive(?bool $nonRecursive): self + { + $this->initialized['nonRecursive'] = true; + $this->nonRecursive = $nonRecursive; + return $this; + } + /** + * Create mount point on host if missing + * + * @return bool|null + */ + public function getCreateMountpoint(): ?bool + { + return $this->createMountpoint; + } + /** + * Create mount point on host if missing + * + * @param bool|null $createMountpoint + * + * @return self + */ + public function setCreateMountpoint(?bool $createMountpoint): self + { + $this->initialized['createMountpoint'] = true; + $this->createMountpoint = $createMountpoint; + return $this; + } + /** + * Make the mount non-recursively read-only, but still leave the mount recursive + (unless NonRecursive is set to `true` in conjunction). + + Added in v1.44, before that version all read-only mounts were + non-recursive by default. To match the previous behaviour this + will default to `true` for clients on versions prior to v1.44. + + * + * @return bool|null + */ + public function getReadOnlyNonRecursive(): ?bool + { + return $this->readOnlyNonRecursive; + } + /** + * Make the mount non-recursively read-only, but still leave the mount recursive + (unless NonRecursive is set to `true` in conjunction). + + Added in v1.44, before that version all read-only mounts were + non-recursive by default. To match the previous behaviour this + will default to `true` for clients on versions prior to v1.44. + + * + * @param bool|null $readOnlyNonRecursive + * + * @return self + */ + public function setReadOnlyNonRecursive(?bool $readOnlyNonRecursive): self + { + $this->initialized['readOnlyNonRecursive'] = true; + $this->readOnlyNonRecursive = $readOnlyNonRecursive; + return $this; + } + /** + * Raise an error if the mount cannot be made recursively read-only. + * + * @return bool|null + */ + public function getReadOnlyForceRecursive(): ?bool + { + return $this->readOnlyForceRecursive; + } + /** + * Raise an error if the mount cannot be made recursively read-only. + * + * @param bool|null $readOnlyForceRecursive + * + * @return self + */ + public function setReadOnlyForceRecursive(?bool $readOnlyForceRecursive): self + { + $this->initialized['readOnlyForceRecursive'] = true; + $this->readOnlyForceRecursive = $readOnlyForceRecursive; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/MountPoint.php b/generated/Model/MountPoint.php new file mode 100644 index 00000000..086b7f53 --- /dev/null +++ b/generated/Model/MountPoint.php @@ -0,0 +1,311 @@ +initialized); + } + /** + * The mount type: + + - `bind` a mount of a file or directory from the host into the container. + - `volume` a docker volume with the given `Name`. + - `tmpfs` a `tmpfs`. + - `npipe` a named pipe from the host into the container. + - `cluster` a Swarm cluster volume + + * + * @var string|null + */ + protected $type; + /** + * Name is the name reference to the underlying data defined by `Source` + e.g., the volume name. + + * + * @var string|null + */ + protected $name; + /** + * Source location of the mount. + + For volumes, this contains the storage location of the volume (within + `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + the source (host) part of the bind-mount. For `tmpfs` mount points, this + field is empty. + + * + * @var string|null + */ + protected $source; + /** + * Destination is the path relative to the container root (`/`) where + the `Source` is mounted inside the container. + + * + * @var string|null + */ + protected $destination; + /** + * Driver is the volume driver used to create the volume (if it is a volume). + * + * @var string|null + */ + protected $driver; + /** + * Mode is a comma separated list of options supplied by the user when + creating the bind/volume mount. + + The default is platform-specific (`"z"` on Linux, empty on Windows). + + * + * @var string|null + */ + protected $mode; + /** + * Whether the mount is mounted writable (read-write). + * + * @var bool|null + */ + protected $rW; + /** + * Propagation describes how mounts are propagated from the host into the + mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + for details. This field is not used on Windows. + + * + * @var string|null + */ + protected $propagation; + /** + * The mount type: + + - `bind` a mount of a file or directory from the host into the container. + - `volume` a docker volume with the given `Name`. + - `tmpfs` a `tmpfs`. + - `npipe` a named pipe from the host into the container. + - `cluster` a Swarm cluster volume + + * + * @return string|null + */ + public function getType(): ?string + { + return $this->type; + } + /** + * The mount type: + + - `bind` a mount of a file or directory from the host into the container. + - `volume` a docker volume with the given `Name`. + - `tmpfs` a `tmpfs`. + - `npipe` a named pipe from the host into the container. + - `cluster` a Swarm cluster volume + + * + * @param string|null $type + * + * @return self + */ + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + return $this; + } + /** + * Name is the name reference to the underlying data defined by `Source` + e.g., the volume name. + + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Name is the name reference to the underlying data defined by `Source` + e.g., the volume name. + + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * Source location of the mount. + + For volumes, this contains the storage location of the volume (within + `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + the source (host) part of the bind-mount. For `tmpfs` mount points, this + field is empty. + + * + * @return string|null + */ + public function getSource(): ?string + { + return $this->source; + } + /** + * Source location of the mount. + + For volumes, this contains the storage location of the volume (within + `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + the source (host) part of the bind-mount. For `tmpfs` mount points, this + field is empty. + + * + * @param string|null $source + * + * @return self + */ + public function setSource(?string $source): self + { + $this->initialized['source'] = true; + $this->source = $source; + return $this; + } + /** + * Destination is the path relative to the container root (`/`) where + the `Source` is mounted inside the container. + + * + * @return string|null + */ + public function getDestination(): ?string + { + return $this->destination; + } + /** + * Destination is the path relative to the container root (`/`) where + the `Source` is mounted inside the container. + + * + * @param string|null $destination + * + * @return self + */ + public function setDestination(?string $destination): self + { + $this->initialized['destination'] = true; + $this->destination = $destination; + return $this; + } + /** + * Driver is the volume driver used to create the volume (if it is a volume). + * + * @return string|null + */ + public function getDriver(): ?string + { + return $this->driver; + } + /** + * Driver is the volume driver used to create the volume (if it is a volume). + * + * @param string|null $driver + * + * @return self + */ + public function setDriver(?string $driver): self + { + $this->initialized['driver'] = true; + $this->driver = $driver; + return $this; + } + /** + * Mode is a comma separated list of options supplied by the user when + creating the bind/volume mount. + + The default is platform-specific (`"z"` on Linux, empty on Windows). + + * + * @return string|null + */ + public function getMode(): ?string + { + return $this->mode; + } + /** + * Mode is a comma separated list of options supplied by the user when + creating the bind/volume mount. + + The default is platform-specific (`"z"` on Linux, empty on Windows). + + * + * @param string|null $mode + * + * @return self + */ + public function setMode(?string $mode): self + { + $this->initialized['mode'] = true; + $this->mode = $mode; + return $this; + } + /** + * Whether the mount is mounted writable (read-write). + * + * @return bool|null + */ + public function getRW(): ?bool + { + return $this->rW; + } + /** + * Whether the mount is mounted writable (read-write). + * + * @param bool|null $rW + * + * @return self + */ + public function setRW(?bool $rW): self + { + $this->initialized['rW'] = true; + $this->rW = $rW; + return $this; + } + /** + * Propagation describes how mounts are propagated from the host into the + mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + for details. This field is not used on Windows. + + * + * @return string|null + */ + public function getPropagation(): ?string + { + return $this->propagation; + } + /** + * Propagation describes how mounts are propagated from the host into the + mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + for details. This field is not used on Windows. + + * + * @param string|null $propagation + * + * @return self + */ + public function setPropagation(?string $propagation): self + { + $this->initialized['propagation'] = true; + $this->propagation = $propagation; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/MountTmpfsOptions.php b/generated/Model/MountTmpfsOptions.php new file mode 100644 index 00000000..4e0b1ce9 --- /dev/null +++ b/generated/Model/MountTmpfsOptions.php @@ -0,0 +1,111 @@ +initialized); + } + /** + * The size for the tmpfs mount in bytes. + * + * @var int|null + */ + protected $sizeBytes; + /** + * The permission mode for the tmpfs mount in an integer. + * + * @var int|null + */ + protected $mode; + /** + * The options to be passed to the tmpfs mount. An array of arrays. + Flag options should be provided as 1-length arrays. Other types + should be provided as as 2-length arrays, where the first item is + the key and the second the value. + + * + * @var list>|null + */ + protected $options; + /** + * The size for the tmpfs mount in bytes. + * + * @return int|null + */ + public function getSizeBytes(): ?int + { + return $this->sizeBytes; + } + /** + * The size for the tmpfs mount in bytes. + * + * @param int|null $sizeBytes + * + * @return self + */ + public function setSizeBytes(?int $sizeBytes): self + { + $this->initialized['sizeBytes'] = true; + $this->sizeBytes = $sizeBytes; + return $this; + } + /** + * The permission mode for the tmpfs mount in an integer. + * + * @return int|null + */ + public function getMode(): ?int + { + return $this->mode; + } + /** + * The permission mode for the tmpfs mount in an integer. + * + * @param int|null $mode + * + * @return self + */ + public function setMode(?int $mode): self + { + $this->initialized['mode'] = true; + $this->mode = $mode; + return $this; + } + /** + * The options to be passed to the tmpfs mount. An array of arrays. + Flag options should be provided as 1-length arrays. Other types + should be provided as as 2-length arrays, where the first item is + the key and the second the value. + + * + * @return list>|null + */ + public function getOptions(): ?array + { + return $this->options; + } + /** + * The options to be passed to the tmpfs mount. An array of arrays. + Flag options should be provided as 1-length arrays. Other types + should be provided as as 2-length arrays, where the first item is + the key and the second the value. + + * + * @param list>|null $options + * + * @return self + */ + public function setOptions(?array $options): self + { + $this->initialized['options'] = true; + $this->options = $options; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/MountVolumeOptions.php b/generated/Model/MountVolumeOptions.php new file mode 100644 index 00000000..b7903369 --- /dev/null +++ b/generated/Model/MountVolumeOptions.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * Populate volume with data from the target. + * + * @var bool|null + */ + protected $noCopy = false; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * Map of driver specific options + * + * @var MountVolumeOptionsDriverConfig|null + */ + protected $driverConfig; + /** + * Source path inside the volume. Must be relative without any back traversals. + * + * @var string|null + */ + protected $subpath; + /** + * Populate volume with data from the target. + * + * @return bool|null + */ + public function getNoCopy(): ?bool + { + return $this->noCopy; + } + /** + * Populate volume with data from the target. + * + * @param bool|null $noCopy + * + * @return self + */ + public function setNoCopy(?bool $noCopy): self + { + $this->initialized['noCopy'] = true; + $this->noCopy = $noCopy; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * Map of driver specific options + * + * @return MountVolumeOptionsDriverConfig|null + */ + public function getDriverConfig(): ?MountVolumeOptionsDriverConfig + { + return $this->driverConfig; + } + /** + * Map of driver specific options + * + * @param MountVolumeOptionsDriverConfig|null $driverConfig + * + * @return self + */ + public function setDriverConfig(?MountVolumeOptionsDriverConfig $driverConfig): self + { + $this->initialized['driverConfig'] = true; + $this->driverConfig = $driverConfig; + return $this; + } + /** + * Source path inside the volume. Must be relative without any back traversals. + * + * @return string|null + */ + public function getSubpath(): ?string + { + return $this->subpath; + } + /** + * Source path inside the volume. Must be relative without any back traversals. + * + * @param string|null $subpath + * + * @return self + */ + public function setSubpath(?string $subpath): self + { + $this->initialized['subpath'] = true; + $this->subpath = $subpath; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/MountVolumeOptionsDriverConfig.php b/generated/Model/MountVolumeOptionsDriverConfig.php new file mode 100644 index 00000000..f7bfeb74 --- /dev/null +++ b/generated/Model/MountVolumeOptionsDriverConfig.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * Name of the driver to use to create the volume. + * + * @var string|null + */ + protected $name; + /** + * key/value map of driver specific options. + * + * @var array|null + */ + protected $options; + /** + * Name of the driver to use to create the volume. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Name of the driver to use to create the volume. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * key/value map of driver specific options. + * + * @return array|null + */ + public function getOptions(): ?iterable + { + return $this->options; + } + /** + * key/value map of driver specific options. + * + * @param array|null $options + * + * @return self + */ + public function setOptions(?iterable $options): self + { + $this->initialized['options'] = true; + $this->options = $options; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Network.php b/generated/Model/Network.php index ec7e0360..ddbd7fca 100644 --- a/generated/Model/Network.php +++ b/generated/Model/Network.php @@ -5,243 +5,541 @@ class Network { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * Name of the network. + * + * @var string|null */ protected $name; /** - * @var string + * ID that uniquely identifies a network on a single machine. + * + * @var string|null */ protected $id; /** - * @var string - */ + * Date and time at which the network was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @var string|null + */ + protected $created; + /** + * The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level) + + * + * @var string|null + */ protected $scope; /** - * @var string - */ + * The name of the driver used to create the network (e.g. `bridge`, + `overlay`). + + * + * @var string|null + */ protected $driver; /** - * @var bool + * Whether the network was created with IPv4 enabled. + * + * @var bool|null + */ + protected $enableIPv4; + /** + * Whether the network was created with IPv6 enabled. + * + * @var bool|null */ protected $enableIPv6; /** - * @var IPAM + * + * + * @var IPAM|null */ protected $iPAM; /** - * @var bool + * Whether the network is created to only allow internal networking + connectivity. + + * + * @var bool|null + */ + protected $internal = false; + /** + * Whether a global / swarm scope network is manually attachable by regular + containers from workers in swarm mode. + + * + * @var bool|null + */ + protected $attachable = false; + /** + * Whether the network is providing the routing-mesh for the swarm cluster. + * + * @var bool|null */ - protected $internal; + protected $ingress = false; /** - * @var NetworkContainer[]|null + * The config-only network source to provide the configuration for + this network. + + * + * @var ConfigReference|null + */ + protected $configFrom; + /** + * Whether the network is a config-only network. Config-only networks are + placeholder networks for network configurations to be used by other + networks. Config-only networks cannot be used directly to run containers + or services. + + * + * @var bool|null + */ + protected $configOnly = false; + /** + * Contains endpoints attached to the network. + * + * @var array|null */ protected $containers; /** - * @var string[] + * Network-specific options uses when creating the network. + * + * @var array|null */ protected $options; /** - * @var string[]|null + * User-defined key/value metadata. + * + * @var array|null */ protected $labels; - /** - * @return string + * List of peer nodes for an overlay network. This field is only present + for overlay networks, and omitted for other network types. + + * + * @var list|null + */ + protected $peers; + /** + * Name of the network. + * + * @return string|null */ - public function getName() + public function getName(): ?string { return $this->name; } - /** - * @param string $name + * Name of the network. + * + * @param string|null $name * * @return self */ - public function setName($name = null) + public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string + * ID that uniquely identifies a network on a single machine. + * + * @return string|null */ - public function getId() + public function getId(): ?string { return $this->id; } - /** - * @param string $id + * ID that uniquely identifies a network on a single machine. + * + * @param string|null $id * * @return self */ - public function setId($id = null) + public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; - return $this; } - /** - * @return string - */ - public function getScope() + * Date and time at which the network was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @return string|null + */ + public function getCreated(): ?string + { + return $this->created; + } + /** + * Date and time at which the network was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @param string|null $created + * + * @return self + */ + public function setCreated(?string $created): self + { + $this->initialized['created'] = true; + $this->created = $created; + return $this; + } + /** + * The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level) + + * + * @return string|null + */ + public function getScope(): ?string { return $this->scope; } - /** - * @param string $scope - * - * @return self - */ - public function setScope($scope = null) + * The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level) + + * + * @param string|null $scope + * + * @return self + */ + public function setScope(?string $scope): self { + $this->initialized['scope'] = true; $this->scope = $scope; - return $this; } - /** - * @return string - */ - public function getDriver() + * The name of the driver used to create the network (e.g. `bridge`, + `overlay`). + + * + * @return string|null + */ + public function getDriver(): ?string { return $this->driver; } - /** - * @param string $driver + * The name of the driver used to create the network (e.g. `bridge`, + `overlay`). + + * + * @param string|null $driver + * + * @return self + */ + public function setDriver(?string $driver): self + { + $this->initialized['driver'] = true; + $this->driver = $driver; + return $this; + } + /** + * Whether the network was created with IPv4 enabled. + * + * @return bool|null + */ + public function getEnableIPv4(): ?bool + { + return $this->enableIPv4; + } + /** + * Whether the network was created with IPv4 enabled. + * + * @param bool|null $enableIPv4 * * @return self */ - public function setDriver($driver = null) + public function setEnableIPv4(?bool $enableIPv4): self { - $this->driver = $driver; - + $this->initialized['enableIPv4'] = true; + $this->enableIPv4 = $enableIPv4; return $this; } - /** - * @return bool + * Whether the network was created with IPv6 enabled. + * + * @return bool|null */ - public function getEnableIPv6() + public function getEnableIPv6(): ?bool { return $this->enableIPv6; } - /** - * @param bool $enableIPv6 + * Whether the network was created with IPv6 enabled. + * + * @param bool|null $enableIPv6 * * @return self */ - public function setEnableIPv6($enableIPv6 = null) + public function setEnableIPv6(?bool $enableIPv6): self { + $this->initialized['enableIPv6'] = true; $this->enableIPv6 = $enableIPv6; - return $this; } - /** - * @return IPAM + * + * + * @return IPAM|null */ - public function getIPAM() + public function getIPAM(): ?IPAM { return $this->iPAM; } - /** - * @param IPAM $iPAM + * + * + * @param IPAM|null $iPAM * * @return self */ - public function setIPAM(?IPAM $iPAM = null) + public function setIPAM(?IPAM $iPAM): self { + $this->initialized['iPAM'] = true; $this->iPAM = $iPAM; - return $this; } - /** - * @return bool - */ - public function getInternal() + * Whether the network is created to only allow internal networking + connectivity. + + * + * @return bool|null + */ + public function getInternal(): ?bool { return $this->internal; } - /** - * @param bool $internal + * Whether the network is created to only allow internal networking + connectivity. + + * + * @param bool|null $internal + * + * @return self + */ + public function setInternal(?bool $internal): self + { + $this->initialized['internal'] = true; + $this->internal = $internal; + return $this; + } + /** + * Whether a global / swarm scope network is manually attachable by regular + containers from workers in swarm mode. + + * + * @return bool|null + */ + public function getAttachable(): ?bool + { + return $this->attachable; + } + /** + * Whether a global / swarm scope network is manually attachable by regular + containers from workers in swarm mode. + + * + * @param bool|null $attachable + * + * @return self + */ + public function setAttachable(?bool $attachable): self + { + $this->initialized['attachable'] = true; + $this->attachable = $attachable; + return $this; + } + /** + * Whether the network is providing the routing-mesh for the swarm cluster. + * + * @return bool|null + */ + public function getIngress(): ?bool + { + return $this->ingress; + } + /** + * Whether the network is providing the routing-mesh for the swarm cluster. + * + * @param bool|null $ingress * * @return self */ - public function setInternal($internal = null) + public function setIngress(?bool $ingress): self { - $this->internal = $internal; - + $this->initialized['ingress'] = true; + $this->ingress = $ingress; + return $this; + } + /** + * The config-only network source to provide the configuration for + this network. + + * + * @return ConfigReference|null + */ + public function getConfigFrom(): ?ConfigReference + { + return $this->configFrom; + } + /** + * The config-only network source to provide the configuration for + this network. + + * + * @param ConfigReference|null $configFrom + * + * @return self + */ + public function setConfigFrom(?ConfigReference $configFrom): self + { + $this->initialized['configFrom'] = true; + $this->configFrom = $configFrom; return $this; } - /** - * @return NetworkContainer[]|null + * Whether the network is a config-only network. Config-only networks are + placeholder networks for network configurations to be used by other + networks. Config-only networks cannot be used directly to run containers + or services. + + * + * @return bool|null + */ + public function getConfigOnly(): ?bool + { + return $this->configOnly; + } + /** + * Whether the network is a config-only network. Config-only networks are + placeholder networks for network configurations to be used by other + networks. Config-only networks cannot be used directly to run containers + or services. + + * + * @param bool|null $configOnly + * + * @return self + */ + public function setConfigOnly(?bool $configOnly): self + { + $this->initialized['configOnly'] = true; + $this->configOnly = $configOnly; + return $this; + } + /** + * Contains endpoints attached to the network. + * + * @return array|null */ - public function getContainers() + public function getContainers(): ?iterable { return $this->containers; } - /** - * @param NetworkContainer[]|null $containers + * Contains endpoints attached to the network. + * + * @param array|null $containers * * @return self */ - public function setContainers($containers = null) + public function setContainers(?iterable $containers): self { + $this->initialized['containers'] = true; $this->containers = $containers; - return $this; } - /** - * @return string[] + * Network-specific options uses when creating the network. + * + * @return array|null */ - public function getOptions() + public function getOptions(): ?iterable { return $this->options; } - /** - * @param string[] $options + * Network-specific options uses when creating the network. + * + * @param array|null $options * * @return self */ - public function setOptions(?\ArrayObject $options = null) + public function setOptions(?iterable $options): self { + $this->initialized['options'] = true; $this->options = $options; - return $this; } - /** - * @return string[]|null + * User-defined key/value metadata. + * + * @return array|null */ - public function getLabels() + public function getLabels(): ?iterable { return $this->labels; } - /** - * @param string[]|null $labels + * User-defined key/value metadata. + * + * @param array|null $labels * * @return self */ - public function setLabels($labels = null) + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; - return $this; } -} + /** + * List of peer nodes for an overlay network. This field is only present + for overlay networks, and omitted for other network types. + + * + * @return list|null + */ + public function getPeers(): ?array + { + return $this->peers; + } + /** + * List of peer nodes for an overlay network. This field is only present + for overlay networks, and omitted for other network types. + + * + * @param list|null $peers + * + * @return self + */ + public function setPeers(?array $peers): self + { + $this->initialized['peers'] = true; + $this->peers = $peers; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/NetworkAttachment.php b/generated/Model/NetworkAttachment.php deleted file mode 100644 index e70ccc16..00000000 --- a/generated/Model/NetworkAttachment.php +++ /dev/null @@ -1,55 +0,0 @@ -network; - } - - /** - * @param SwarmNetwork $network - * - * @return self - */ - public function setNetwork(?SwarmNetwork $network = null) - { - $this->network = $network; - - return $this; - } - - /** - * @return string[]|null - */ - public function getAddresses() - { - return $this->addresses; - } - - /** - * @param string[]|null $addresses - * - * @return self - */ - public function setAddresses($addresses = null) - { - $this->addresses = $addresses; - - return $this; - } -} diff --git a/generated/Model/NetworkAttachmentConfig.php b/generated/Model/NetworkAttachmentConfig.php index e0eef625..2114e31a 100644 --- a/generated/Model/NetworkAttachmentConfig.php +++ b/generated/Model/NetworkAttachmentConfig.php @@ -5,51 +5,95 @@ class NetworkAttachmentConfig { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * The target network for attachment. Must be a network name or ID. + * + * @var string|null */ protected $target; /** - * @var string[]|null + * Discoverable alternate names for the service on this network. + * + * @var list|null */ protected $aliases; - /** - * @return string + * Driver attachment options for the network target. + * + * @var array|null + */ + protected $driverOpts; + /** + * The target network for attachment. Must be a network name or ID. + * + * @return string|null */ - public function getTarget() + public function getTarget(): ?string { return $this->target; } - /** - * @param string $target + * The target network for attachment. Must be a network name or ID. + * + * @param string|null $target * * @return self */ - public function setTarget($target = null) + public function setTarget(?string $target): self { + $this->initialized['target'] = true; $this->target = $target; - return $this; } - /** - * @return string[]|null + * Discoverable alternate names for the service on this network. + * + * @return list|null */ - public function getAliases() + public function getAliases(): ?array { return $this->aliases; } - /** - * @param string[]|null $aliases + * Discoverable alternate names for the service on this network. + * + * @param list|null $aliases * * @return self */ - public function setAliases($aliases = null) + public function setAliases(?array $aliases): self { + $this->initialized['aliases'] = true; $this->aliases = $aliases; - return $this; } -} + /** + * Driver attachment options for the network target. + * + * @return array|null + */ + public function getDriverOpts(): ?iterable + { + return $this->driverOpts; + } + /** + * Driver attachment options for the network target. + * + * @param array|null $driverOpts + * + * @return self + */ + public function setDriverOpts(?iterable $driverOpts): self + { + $this->initialized['driverOpts'] = true; + $this->driverOpts = $driverOpts; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/NetworkConfig.php b/generated/Model/NetworkConfig.php deleted file mode 100644 index 61e0f1b2..00000000 --- a/generated/Model/NetworkConfig.php +++ /dev/null @@ -1,199 +0,0 @@ -bridge; - } - - /** - * @param string $bridge - * - * @return self - */ - public function setBridge($bridge = null) - { - $this->bridge = $bridge; - - return $this; - } - - /** - * @return string - */ - public function getGateway() - { - return $this->gateway; - } - - /** - * @param string $gateway - * - * @return self - */ - public function setGateway($gateway = null) - { - $this->gateway = $gateway; - - return $this; - } - - /** - * @return string - */ - public function getIPAddress() - { - return $this->iPAddress; - } - - /** - * @param string $iPAddress - * - * @return self - */ - public function setIPAddress($iPAddress = null) - { - $this->iPAddress = $iPAddress; - - return $this; - } - - /** - * @return int - */ - public function getIPPrefixLen() - { - return $this->iPPrefixLen; - } - - /** - * @param int $iPPrefixLen - * - * @return self - */ - public function setIPPrefixLen($iPPrefixLen = null) - { - $this->iPPrefixLen = $iPPrefixLen; - - return $this; - } - - /** - * @return string - */ - public function getMacAddress() - { - return $this->macAddress; - } - - /** - * @param string $macAddress - * - * @return self - */ - public function setMacAddress($macAddress = null) - { - $this->macAddress = $macAddress; - - return $this; - } - - /** - * @return string - */ - public function getPortMapping() - { - return $this->portMapping; - } - - /** - * @param string $portMapping - * - * @return self - */ - public function setPortMapping($portMapping = null) - { - $this->portMapping = $portMapping; - - return $this; - } - - /** - * @return ContainerNetwork[] - */ - public function getNetworks() - { - return $this->networks; - } - - /** - * @param ContainerNetwork[] $networks - * - * @return self - */ - public function setNetworks(?\ArrayObject $networks = null) - { - $this->networks = $networks; - - return $this; - } - - /** - * @return PortBinding[][]|null[]|null - */ - public function getPorts() - { - return $this->ports; - } - - /** - * @param PortBinding[][]|null[]|null $ports - * - * @return self - */ - public function setPorts($ports = null) - { - $this->ports = $ports; - - return $this; - } -} diff --git a/generated/Model/NetworkContainer.php b/generated/Model/NetworkContainer.php index 40d276a4..5ef28fb1 100644 --- a/generated/Model/NetworkContainer.php +++ b/generated/Model/NetworkContainer.php @@ -5,123 +5,151 @@ class NetworkContainer { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var string|null */ protected $name; /** - * @var string + * + * + * @var string|null */ protected $endpointID; /** - * @var string + * + * + * @var string|null */ protected $macAddress; /** - * @var string + * + * + * @var string|null */ protected $iPv4Address; /** - * @var string + * + * + * @var string|null */ protected $iPv6Address; - /** - * @return string + * + * + * @return string|null */ - public function getName() + public function getName(): ?string { return $this->name; } - /** - * @param string $name + * + * + * @param string|null $name * * @return self */ - public function setName($name = null) + public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getEndpointID() + public function getEndpointID(): ?string { return $this->endpointID; } - /** - * @param string $endpointID + * + * + * @param string|null $endpointID * * @return self */ - public function setEndpointID($endpointID = null) + public function setEndpointID(?string $endpointID): self { + $this->initialized['endpointID'] = true; $this->endpointID = $endpointID; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getMacAddress() + public function getMacAddress(): ?string { return $this->macAddress; } - /** - * @param string $macAddress + * + * + * @param string|null $macAddress * * @return self */ - public function setMacAddress($macAddress = null) + public function setMacAddress(?string $macAddress): self { + $this->initialized['macAddress'] = true; $this->macAddress = $macAddress; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getIPv4Address() + public function getIPv4Address(): ?string { return $this->iPv4Address; } - /** - * @param string $iPv4Address + * + * + * @param string|null $iPv4Address * * @return self */ - public function setIPv4Address($iPv4Address = null) + public function setIPv4Address(?string $iPv4Address): self { + $this->initialized['iPv4Address'] = true; $this->iPv4Address = $iPv4Address; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getIPv6Address() + public function getIPv6Address(): ?string { return $this->iPv6Address; } - /** - * @param string $iPv6Address + * + * + * @param string|null $iPv6Address * * @return self */ - public function setIPv6Address($iPv6Address = null) + public function setIPv6Address(?string $iPv6Address): self { + $this->initialized['iPv6Address'] = true; $this->iPv6Address = $iPv6Address; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/NetworkCreateConfig.php b/generated/Model/NetworkCreateConfig.php deleted file mode 100644 index 11e39c65..00000000 --- a/generated/Model/NetworkCreateConfig.php +++ /dev/null @@ -1,199 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } - - /** - * @return bool - */ - public function getCheckDuplicate() - { - return $this->checkDuplicate; - } - - /** - * @param bool $checkDuplicate - * - * @return self - */ - public function setCheckDuplicate($checkDuplicate = null) - { - $this->checkDuplicate = $checkDuplicate; - - return $this; - } - - /** - * @return string - */ - public function getDriver() - { - return $this->driver; - } - - /** - * @param string $driver - * - * @return self - */ - public function setDriver($driver = null) - { - $this->driver = $driver; - - return $this; - } - - /** - * @return bool - */ - public function getEnableIPv6() - { - return $this->enableIPv6; - } - - /** - * @param bool $enableIPv6 - * - * @return self - */ - public function setEnableIPv6($enableIPv6 = null) - { - $this->enableIPv6 = $enableIPv6; - - return $this; - } - - /** - * @return IPAM - */ - public function getIPAM() - { - return $this->iPAM; - } - - /** - * @param IPAM $iPAM - * - * @return self - */ - public function setIPAM(?IPAM $iPAM = null) - { - $this->iPAM = $iPAM; - - return $this; - } - - /** - * @return bool - */ - public function getInternal() - { - return $this->internal; - } - - /** - * @param bool $internal - * - * @return self - */ - public function setInternal($internal = null) - { - $this->internal = $internal; - - return $this; - } - - /** - * @return string[] - */ - public function getOptions() - { - return $this->options; - } - - /** - * @param string[] $options - * - * @return self - */ - public function setOptions(?\ArrayObject $options = null) - { - $this->options = $options; - - return $this; - } - - /** - * @return string[]|null - */ - public function getLabels() - { - return $this->labels; - } - - /** - * @param string[]|null $labels - * - * @return self - */ - public function setLabels($labels = null) - { - $this->labels = $labels; - - return $this; - } -} diff --git a/generated/Model/NetworkCreateResponse.php b/generated/Model/NetworkCreateResponse.php new file mode 100644 index 00000000..97671413 --- /dev/null +++ b/generated/Model/NetworkCreateResponse.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * The ID of the created network. + * + * @var string|null + */ + protected $id; + /** + * Warnings encountered when creating the container + * + * @var string|null + */ + protected $warning; + /** + * The ID of the created network. + * + * @return string|null + */ + public function getId(): ?string + { + return $this->id; + } + /** + * The ID of the created network. + * + * @param string|null $id + * + * @return self + */ + public function setId(?string $id): self + { + $this->initialized['id'] = true; + $this->id = $id; + return $this; + } + /** + * Warnings encountered when creating the container + * + * @return string|null + */ + public function getWarning(): ?string + { + return $this->warning; + } + /** + * Warnings encountered when creating the container + * + * @param string|null $warning + * + * @return self + */ + public function setWarning(?string $warning): self + { + $this->initialized['warning'] = true; + $this->warning = $warning; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/NetworkCreateResult.php b/generated/Model/NetworkCreateResult.php deleted file mode 100644 index 1255580c..00000000 --- a/generated/Model/NetworkCreateResult.php +++ /dev/null @@ -1,55 +0,0 @@ -id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId($id = null) - { - $this->id = $id; - - return $this; - } - - /** - * @return string - */ - public function getWarning() - { - return $this->warning; - } - - /** - * @param string $warning - * - * @return self - */ - public function setWarning($warning = null) - { - $this->warning = $warning; - - return $this; - } -} diff --git a/generated/Model/NetworkSettings.php b/generated/Model/NetworkSettings.php new file mode 100644 index 00000000..0423b45e --- /dev/null +++ b/generated/Model/NetworkSettings.php @@ -0,0 +1,780 @@ +initialized); + } + /** + * Name of the default bridge interface when dockerd's --bridge flag is set. + * + * @var string|null + */ + protected $bridge; + /** + * SandboxID uniquely represents a container's network stack. + * + * @var string|null + */ + protected $sandboxID; + /** + * Indicates if hairpin NAT should be enabled on the virtual interface. + + Deprecated: This field is never set and will be removed in a future release. + + * + * @var bool|null + */ + protected $hairpinMode; + /** + * IPv6 unicast address using the link-local prefix. + + Deprecated: This field is never set and will be removed in a future release. + + * + * @var string|null + */ + protected $linkLocalIPv6Address; + /** + * Prefix length of the IPv6 unicast address. + + Deprecated: This field is never set and will be removed in a future release. + + * + * @var int|null + */ + protected $linkLocalIPv6PrefixLen; + /** + * PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `/`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + + * + * @var array>|null + */ + protected $ports; + /** + * SandboxKey is the full path of the netns handle + * + * @var string|null + */ + protected $sandboxKey; + /** + * Deprecated: This field is never set and will be removed in a future release. + * + * @var list
|null + */ + protected $secondaryIPAddresses; + /** + * Deprecated: This field is never set and will be removed in a future release. + * + * @var list
|null + */ + protected $secondaryIPv6Addresses; + /** + * EndpointID uniquely represents a service endpoint in a Sandbox. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @var string|null + */ + protected $endpointID; + /** + * Gateway address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @var string|null + */ + protected $gateway; + /** + * Global IPv6 address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @var string|null + */ + protected $globalIPv6Address; + /** + * Mask length of the global IPv6 address. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @var int|null + */ + protected $globalIPv6PrefixLen; + /** + * IPv4 address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @var string|null + */ + protected $iPAddress; + /** + * Mask length of the IPv4 address. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @var int|null + */ + protected $iPPrefixLen; + /** + * IPv6 gateway address for this network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @var string|null + */ + protected $iPv6Gateway; + /** + * MAC address for the container on the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @var string|null + */ + protected $macAddress; + /** + * Information about all networks that the container is connected to. + * + * @var array|null + */ + protected $networks; + /** + * Name of the default bridge interface when dockerd's --bridge flag is set. + * + * @return string|null + */ + public function getBridge(): ?string + { + return $this->bridge; + } + /** + * Name of the default bridge interface when dockerd's --bridge flag is set. + * + * @param string|null $bridge + * + * @return self + */ + public function setBridge(?string $bridge): self + { + $this->initialized['bridge'] = true; + $this->bridge = $bridge; + return $this; + } + /** + * SandboxID uniquely represents a container's network stack. + * + * @return string|null + */ + public function getSandboxID(): ?string + { + return $this->sandboxID; + } + /** + * SandboxID uniquely represents a container's network stack. + * + * @param string|null $sandboxID + * + * @return self + */ + public function setSandboxID(?string $sandboxID): self + { + $this->initialized['sandboxID'] = true; + $this->sandboxID = $sandboxID; + return $this; + } + /** + * Indicates if hairpin NAT should be enabled on the virtual interface. + + Deprecated: This field is never set and will be removed in a future release. + + * + * @return bool|null + */ + public function getHairpinMode(): ?bool + { + return $this->hairpinMode; + } + /** + * Indicates if hairpin NAT should be enabled on the virtual interface. + + Deprecated: This field is never set and will be removed in a future release. + + * + * @param bool|null $hairpinMode + * + * @return self + */ + public function setHairpinMode(?bool $hairpinMode): self + { + $this->initialized['hairpinMode'] = true; + $this->hairpinMode = $hairpinMode; + return $this; + } + /** + * IPv6 unicast address using the link-local prefix. + + Deprecated: This field is never set and will be removed in a future release. + + * + * @return string|null + */ + public function getLinkLocalIPv6Address(): ?string + { + return $this->linkLocalIPv6Address; + } + /** + * IPv6 unicast address using the link-local prefix. + + Deprecated: This field is never set and will be removed in a future release. + + * + * @param string|null $linkLocalIPv6Address + * + * @return self + */ + public function setLinkLocalIPv6Address(?string $linkLocalIPv6Address): self + { + $this->initialized['linkLocalIPv6Address'] = true; + $this->linkLocalIPv6Address = $linkLocalIPv6Address; + return $this; + } + /** + * Prefix length of the IPv6 unicast address. + + Deprecated: This field is never set and will be removed in a future release. + + * + * @return int|null + */ + public function getLinkLocalIPv6PrefixLen(): ?int + { + return $this->linkLocalIPv6PrefixLen; + } + /** + * Prefix length of the IPv6 unicast address. + + Deprecated: This field is never set and will be removed in a future release. + + * + * @param int|null $linkLocalIPv6PrefixLen + * + * @return self + */ + public function setLinkLocalIPv6PrefixLen(?int $linkLocalIPv6PrefixLen): self + { + $this->initialized['linkLocalIPv6PrefixLen'] = true; + $this->linkLocalIPv6PrefixLen = $linkLocalIPv6PrefixLen; + return $this; + } + /** + * PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `/`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + + * + * @return array>|null + */ + public function getPorts(): ?iterable + { + return $this->ports; + } + /** + * PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `/`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + + * + * @param array>|null $ports + * + * @return self + */ + public function setPorts(?iterable $ports): self + { + $this->initialized['ports'] = true; + $this->ports = $ports; + return $this; + } + /** + * SandboxKey is the full path of the netns handle + * + * @return string|null + */ + public function getSandboxKey(): ?string + { + return $this->sandboxKey; + } + /** + * SandboxKey is the full path of the netns handle + * + * @param string|null $sandboxKey + * + * @return self + */ + public function setSandboxKey(?string $sandboxKey): self + { + $this->initialized['sandboxKey'] = true; + $this->sandboxKey = $sandboxKey; + return $this; + } + /** + * Deprecated: This field is never set and will be removed in a future release. + * + * @return list
|null + */ + public function getSecondaryIPAddresses(): ?array + { + return $this->secondaryIPAddresses; + } + /** + * Deprecated: This field is never set and will be removed in a future release. + * + * @param list
|null $secondaryIPAddresses + * + * @return self + */ + public function setSecondaryIPAddresses(?array $secondaryIPAddresses): self + { + $this->initialized['secondaryIPAddresses'] = true; + $this->secondaryIPAddresses = $secondaryIPAddresses; + return $this; + } + /** + * Deprecated: This field is never set and will be removed in a future release. + * + * @return list
|null + */ + public function getSecondaryIPv6Addresses(): ?array + { + return $this->secondaryIPv6Addresses; + } + /** + * Deprecated: This field is never set and will be removed in a future release. + * + * @param list
|null $secondaryIPv6Addresses + * + * @return self + */ + public function setSecondaryIPv6Addresses(?array $secondaryIPv6Addresses): self + { + $this->initialized['secondaryIPv6Addresses'] = true; + $this->secondaryIPv6Addresses = $secondaryIPv6Addresses; + return $this; + } + /** + * EndpointID uniquely represents a service endpoint in a Sandbox. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @return string|null + */ + public function getEndpointID(): ?string + { + return $this->endpointID; + } + /** + * EndpointID uniquely represents a service endpoint in a Sandbox. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @param string|null $endpointID + * + * @return self + */ + public function setEndpointID(?string $endpointID): self + { + $this->initialized['endpointID'] = true; + $this->endpointID = $endpointID; + return $this; + } + /** + * Gateway address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @return string|null + */ + public function getGateway(): ?string + { + return $this->gateway; + } + /** + * Gateway address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @param string|null $gateway + * + * @return self + */ + public function setGateway(?string $gateway): self + { + $this->initialized['gateway'] = true; + $this->gateway = $gateway; + return $this; + } + /** + * Global IPv6 address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @return string|null + */ + public function getGlobalIPv6Address(): ?string + { + return $this->globalIPv6Address; + } + /** + * Global IPv6 address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @param string|null $globalIPv6Address + * + * @return self + */ + public function setGlobalIPv6Address(?string $globalIPv6Address): self + { + $this->initialized['globalIPv6Address'] = true; + $this->globalIPv6Address = $globalIPv6Address; + return $this; + } + /** + * Mask length of the global IPv6 address. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @return int|null + */ + public function getGlobalIPv6PrefixLen(): ?int + { + return $this->globalIPv6PrefixLen; + } + /** + * Mask length of the global IPv6 address. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @param int|null $globalIPv6PrefixLen + * + * @return self + */ + public function setGlobalIPv6PrefixLen(?int $globalIPv6PrefixLen): self + { + $this->initialized['globalIPv6PrefixLen'] = true; + $this->globalIPv6PrefixLen = $globalIPv6PrefixLen; + return $this; + } + /** + * IPv4 address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @return string|null + */ + public function getIPAddress(): ?string + { + return $this->iPAddress; + } + /** + * IPv4 address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @param string|null $iPAddress + * + * @return self + */ + public function setIPAddress(?string $iPAddress): self + { + $this->initialized['iPAddress'] = true; + $this->iPAddress = $iPAddress; + return $this; + } + /** + * Mask length of the IPv4 address. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @return int|null + */ + public function getIPPrefixLen(): ?int + { + return $this->iPPrefixLen; + } + /** + * Mask length of the IPv4 address. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @param int|null $iPPrefixLen + * + * @return self + */ + public function setIPPrefixLen(?int $iPPrefixLen): self + { + $this->initialized['iPPrefixLen'] = true; + $this->iPPrefixLen = $iPPrefixLen; + return $this; + } + /** + * IPv6 gateway address for this network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @return string|null + */ + public function getIPv6Gateway(): ?string + { + return $this->iPv6Gateway; + } + /** + * IPv6 gateway address for this network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @param string|null $iPv6Gateway + * + * @return self + */ + public function setIPv6Gateway(?string $iPv6Gateway): self + { + $this->initialized['iPv6Gateway'] = true; + $this->iPv6Gateway = $iPv6Gateway; + return $this; + } + /** + * MAC address for the container on the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @return string|null + */ + public function getMacAddress(): ?string + { + return $this->macAddress; + } + /** + * MAC address for the container on the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + + * + * @param string|null $macAddress + * + * @return self + */ + public function setMacAddress(?string $macAddress): self + { + $this->initialized['macAddress'] = true; + $this->macAddress = $macAddress; + return $this; + } + /** + * Information about all networks that the container is connected to. + * + * @return array|null + */ + public function getNetworks(): ?iterable + { + return $this->networks; + } + /** + * Information about all networks that the container is connected to. + * + * @param array|null $networks + * + * @return self + */ + public function setNetworks(?iterable $networks): self + { + $this->initialized['networks'] = true; + $this->networks = $networks; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/NetworkingConfig.php b/generated/Model/NetworkingConfig.php index 9b95c58f..dca49118 100644 --- a/generated/Model/NetworkingConfig.php +++ b/generated/Model/NetworkingConfig.php @@ -5,27 +5,48 @@ class NetworkingConfig { /** - * @var EndpointSettings[] + * @var array */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * A mapping of network name to endpoint configuration for that network. + The endpoint configuration can be left empty to connect to that + network with no particular endpoint configuration. + + * + * @var array|null + */ protected $endpointsConfig; - /** - * @return EndpointSettings[] - */ - public function getEndpointsConfig() + * A mapping of network name to endpoint configuration for that network. + The endpoint configuration can be left empty to connect to that + network with no particular endpoint configuration. + + * + * @return array|null + */ + public function getEndpointsConfig(): ?iterable { return $this->endpointsConfig; } - /** - * @param EndpointSettings[] $endpointsConfig - * - * @return self - */ - public function setEndpointsConfig(?\ArrayObject $endpointsConfig = null) + * A mapping of network name to endpoint configuration for that network. + The endpoint configuration can be left empty to connect to that + network with no particular endpoint configuration. + + * + * @param array|null $endpointsConfig + * + * @return self + */ + public function setEndpointsConfig(?iterable $endpointsConfig): self { + $this->initialized['endpointsConfig'] = true; $this->endpointsConfig = $endpointsConfig; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/NetworksCreatePostBody.php b/generated/Model/NetworksCreatePostBody.php new file mode 100644 index 00000000..c93a3346 --- /dev/null +++ b/generated/Model/NetworksCreatePostBody.php @@ -0,0 +1,421 @@ +initialized); + } + /** + * The network's name. + * + * @var string|null + */ + protected $name; + /** + * Name of the network driver plugin to use. + * + * @var string|null + */ + protected $driver = 'bridge'; + /** + * The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level). + + * + * @var string|null + */ + protected $scope; + /** + * Restrict external access to the network. + * + * @var bool|null + */ + protected $internal; + /** + * Globally scoped network is manually attachable by regular + containers from workers in swarm mode. + + * + * @var bool|null + */ + protected $attachable; + /** + * Ingress network is the network which provides the routing-mesh + in swarm mode. + + * + * @var bool|null + */ + protected $ingress; + /** + * Creates a config-only network. Config-only networks are placeholder + networks for network configurations to be used by other networks. + Config-only networks cannot be used directly to run containers + or services. + + * + * @var bool|null + */ + protected $configOnly = false; + /** + * The config-only network source to provide the configuration for + this network. + + * + * @var ConfigReference|null + */ + protected $configFrom; + /** + * + * + * @var IPAM|null + */ + protected $iPAM; + /** + * Enable IPv4 on the network. + To disable IPv4, the daemon must be started with experimental features enabled. + + * + * @var bool|null + */ + protected $enableIPv4; + /** + * Enable IPv6 on the network. + * + * @var bool|null + */ + protected $enableIPv6; + /** + * Network specific options to be used by the drivers. + * + * @var array|null + */ + protected $options; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * The network's name. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * The network's name. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * Name of the network driver plugin to use. + * + * @return string|null + */ + public function getDriver(): ?string + { + return $this->driver; + } + /** + * Name of the network driver plugin to use. + * + * @param string|null $driver + * + * @return self + */ + public function setDriver(?string $driver): self + { + $this->initialized['driver'] = true; + $this->driver = $driver; + return $this; + } + /** + * The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level). + + * + * @return string|null + */ + public function getScope(): ?string + { + return $this->scope; + } + /** + * The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level). + + * + * @param string|null $scope + * + * @return self + */ + public function setScope(?string $scope): self + { + $this->initialized['scope'] = true; + $this->scope = $scope; + return $this; + } + /** + * Restrict external access to the network. + * + * @return bool|null + */ + public function getInternal(): ?bool + { + return $this->internal; + } + /** + * Restrict external access to the network. + * + * @param bool|null $internal + * + * @return self + */ + public function setInternal(?bool $internal): self + { + $this->initialized['internal'] = true; + $this->internal = $internal; + return $this; + } + /** + * Globally scoped network is manually attachable by regular + containers from workers in swarm mode. + + * + * @return bool|null + */ + public function getAttachable(): ?bool + { + return $this->attachable; + } + /** + * Globally scoped network is manually attachable by regular + containers from workers in swarm mode. + + * + * @param bool|null $attachable + * + * @return self + */ + public function setAttachable(?bool $attachable): self + { + $this->initialized['attachable'] = true; + $this->attachable = $attachable; + return $this; + } + /** + * Ingress network is the network which provides the routing-mesh + in swarm mode. + + * + * @return bool|null + */ + public function getIngress(): ?bool + { + return $this->ingress; + } + /** + * Ingress network is the network which provides the routing-mesh + in swarm mode. + + * + * @param bool|null $ingress + * + * @return self + */ + public function setIngress(?bool $ingress): self + { + $this->initialized['ingress'] = true; + $this->ingress = $ingress; + return $this; + } + /** + * Creates a config-only network. Config-only networks are placeholder + networks for network configurations to be used by other networks. + Config-only networks cannot be used directly to run containers + or services. + + * + * @return bool|null + */ + public function getConfigOnly(): ?bool + { + return $this->configOnly; + } + /** + * Creates a config-only network. Config-only networks are placeholder + networks for network configurations to be used by other networks. + Config-only networks cannot be used directly to run containers + or services. + + * + * @param bool|null $configOnly + * + * @return self + */ + public function setConfigOnly(?bool $configOnly): self + { + $this->initialized['configOnly'] = true; + $this->configOnly = $configOnly; + return $this; + } + /** + * The config-only network source to provide the configuration for + this network. + + * + * @return ConfigReference|null + */ + public function getConfigFrom(): ?ConfigReference + { + return $this->configFrom; + } + /** + * The config-only network source to provide the configuration for + this network. + + * + * @param ConfigReference|null $configFrom + * + * @return self + */ + public function setConfigFrom(?ConfigReference $configFrom): self + { + $this->initialized['configFrom'] = true; + $this->configFrom = $configFrom; + return $this; + } + /** + * + * + * @return IPAM|null + */ + public function getIPAM(): ?IPAM + { + return $this->iPAM; + } + /** + * + * + * @param IPAM|null $iPAM + * + * @return self + */ + public function setIPAM(?IPAM $iPAM): self + { + $this->initialized['iPAM'] = true; + $this->iPAM = $iPAM; + return $this; + } + /** + * Enable IPv4 on the network. + To disable IPv4, the daemon must be started with experimental features enabled. + + * + * @return bool|null + */ + public function getEnableIPv4(): ?bool + { + return $this->enableIPv4; + } + /** + * Enable IPv4 on the network. + To disable IPv4, the daemon must be started with experimental features enabled. + + * + * @param bool|null $enableIPv4 + * + * @return self + */ + public function setEnableIPv4(?bool $enableIPv4): self + { + $this->initialized['enableIPv4'] = true; + $this->enableIPv4 = $enableIPv4; + return $this; + } + /** + * Enable IPv6 on the network. + * + * @return bool|null + */ + public function getEnableIPv6(): ?bool + { + return $this->enableIPv6; + } + /** + * Enable IPv6 on the network. + * + * @param bool|null $enableIPv6 + * + * @return self + */ + public function setEnableIPv6(?bool $enableIPv6): self + { + $this->initialized['enableIPv6'] = true; + $this->enableIPv6 = $enableIPv6; + return $this; + } + /** + * Network specific options to be used by the drivers. + * + * @return array|null + */ + public function getOptions(): ?iterable + { + return $this->options; + } + /** + * Network specific options to be used by the drivers. + * + * @param array|null $options + * + * @return self + */ + public function setOptions(?iterable $options): self + { + $this->initialized['options'] = true; + $this->options = $options; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/NetworksIdConnectPostBody.php b/generated/Model/NetworksIdConnectPostBody.php new file mode 100644 index 00000000..e23af78b --- /dev/null +++ b/generated/Model/NetworksIdConnectPostBody.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * The ID or name of the container to connect to the network. + * + * @var string|null + */ + protected $container; + /** + * Configuration for a network endpoint. + * + * @var EndpointSettings|null + */ + protected $endpointConfig; + /** + * The ID or name of the container to connect to the network. + * + * @return string|null + */ + public function getContainer(): ?string + { + return $this->container; + } + /** + * The ID or name of the container to connect to the network. + * + * @param string|null $container + * + * @return self + */ + public function setContainer(?string $container): self + { + $this->initialized['container'] = true; + $this->container = $container; + return $this; + } + /** + * Configuration for a network endpoint. + * + * @return EndpointSettings|null + */ + public function getEndpointConfig(): ?EndpointSettings + { + return $this->endpointConfig; + } + /** + * Configuration for a network endpoint. + * + * @param EndpointSettings|null $endpointConfig + * + * @return self + */ + public function setEndpointConfig(?EndpointSettings $endpointConfig): self + { + $this->initialized['endpointConfig'] = true; + $this->endpointConfig = $endpointConfig; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/NetworksIdDisconnectPostBody.php b/generated/Model/NetworksIdDisconnectPostBody.php new file mode 100644 index 00000000..2631d21f --- /dev/null +++ b/generated/Model/NetworksIdDisconnectPostBody.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * The ID or name of the container to disconnect from the network. + * + * @var string|null + */ + protected $container; + /** + * Force the container to disconnect from the network. + * + * @var bool|null + */ + protected $force; + /** + * The ID or name of the container to disconnect from the network. + * + * @return string|null + */ + public function getContainer(): ?string + { + return $this->container; + } + /** + * The ID or name of the container to disconnect from the network. + * + * @param string|null $container + * + * @return self + */ + public function setContainer(?string $container): self + { + $this->initialized['container'] = true; + $this->container = $container; + return $this; + } + /** + * Force the container to disconnect from the network. + * + * @return bool|null + */ + public function getForce(): ?bool + { + return $this->force; + } + /** + * Force the container to disconnect from the network. + * + * @param bool|null $force + * + * @return self + */ + public function setForce(?bool $force): self + { + $this->initialized['force'] = true; + $this->force = $force; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/NetworksPrunePostResponse200.php b/generated/Model/NetworksPrunePostResponse200.php new file mode 100644 index 00000000..53433241 --- /dev/null +++ b/generated/Model/NetworksPrunePostResponse200.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * Networks that were deleted + * + * @var list|null + */ + protected $networksDeleted; + /** + * Networks that were deleted + * + * @return list|null + */ + public function getNetworksDeleted(): ?array + { + return $this->networksDeleted; + } + /** + * Networks that were deleted + * + * @param list|null $networksDeleted + * + * @return self + */ + public function setNetworksDeleted(?array $networksDeleted): self + { + $this->initialized['networksDeleted'] = true; + $this->networksDeleted = $networksDeleted; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Node.php b/generated/Model/Node.php index ae0f5f89..26eaff79 100644 --- a/generated/Model/Node.php +++ b/generated/Model/Node.php @@ -5,195 +5,304 @@ class Node { /** - * @var string + * @var array */ - protected $iD; + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } /** - * @var NodeVersion + * + * + * @var string|null */ + protected $iD; + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @var ObjectVersion|null + */ protected $version; /** - * @var \DateTime - */ + * Date and time at which the node was added to the swarm in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @var string|null + */ protected $createdAt; /** - * @var \DateTime - */ + * Date and time at which the node was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @var string|null + */ protected $updatedAt; /** - * @var NodeSpec + * + * + * @var NodeSpec|null */ protected $spec; /** - * @var NodeDescription - */ + * NodeDescription encapsulates the properties of the Node as reported by the + agent. + + * + * @var NodeDescription|null + */ protected $description; /** - * @var NodeStatus - */ + * NodeStatus represents the status of a node. + + It provides the current status of the node, as seen by the manager. + + * + * @var NodeStatus|null + */ protected $status; /** - * @var NodeManagerStatus - */ + * ManagerStatus represents the status of a manager. + + It provides the current status of a node's manager component, if the node + is a manager. + + * + * @var ManagerStatus|null + */ protected $managerStatus; - /** - * @return string + * + * + * @return string|null */ - public function getID() + public function getID(): ?string { return $this->iD; } - /** - * @param string $iD + * + * + * @param string|null $iD * * @return self */ - public function setID($iD = null) + public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; - return $this; } - /** - * @return NodeVersion - */ - public function getVersion() + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @return ObjectVersion|null + */ + public function getVersion(): ?ObjectVersion { return $this->version; } - /** - * @param NodeVersion $version - * - * @return self - */ - public function setVersion(?NodeVersion $version = null) + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @param ObjectVersion|null $version + * + * @return self + */ + public function setVersion(?ObjectVersion $version): self { + $this->initialized['version'] = true; $this->version = $version; - return $this; } - /** - * @return \DateTime - */ - public function getCreatedAt() + * Date and time at which the node was added to the swarm in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @return string|null + */ + public function getCreatedAt(): ?string { return $this->createdAt; } - /** - * @param \DateTime $createdAt - * - * @return self - */ - public function setCreatedAt(?\DateTime $createdAt = null) + * Date and time at which the node was added to the swarm in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @param string|null $createdAt + * + * @return self + */ + public function setCreatedAt(?string $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; - return $this; } - /** - * @return \DateTime - */ - public function getUpdatedAt() + * Date and time at which the node was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @return string|null + */ + public function getUpdatedAt(): ?string { return $this->updatedAt; } - /** - * @param \DateTime $updatedAt - * - * @return self - */ - public function setUpdatedAt(?\DateTime $updatedAt = null) + * Date and time at which the node was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @param string|null $updatedAt + * + * @return self + */ + public function setUpdatedAt(?string $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; - return $this; } - /** - * @return NodeSpec + * + * + * @return NodeSpec|null */ - public function getSpec() + public function getSpec(): ?NodeSpec { return $this->spec; } - /** - * @param NodeSpec $spec + * + * + * @param NodeSpec|null $spec * * @return self */ - public function setSpec(?NodeSpec $spec = null) + public function setSpec(?NodeSpec $spec): self { + $this->initialized['spec'] = true; $this->spec = $spec; - return $this; } - /** - * @return NodeDescription - */ - public function getDescription() + * NodeDescription encapsulates the properties of the Node as reported by the + agent. + + * + * @return NodeDescription|null + */ + public function getDescription(): ?NodeDescription { return $this->description; } - /** - * @param NodeDescription $description - * - * @return self - */ - public function setDescription(?NodeDescription $description = null) + * NodeDescription encapsulates the properties of the Node as reported by the + agent. + + * + * @param NodeDescription|null $description + * + * @return self + */ + public function setDescription(?NodeDescription $description): self { + $this->initialized['description'] = true; $this->description = $description; - return $this; } - /** - * @return NodeStatus - */ - public function getStatus() + * NodeStatus represents the status of a node. + + It provides the current status of the node, as seen by the manager. + + * + * @return NodeStatus|null + */ + public function getStatus(): ?NodeStatus { return $this->status; } - /** - * @param NodeStatus $status - * - * @return self - */ - public function setStatus(?NodeStatus $status = null) + * NodeStatus represents the status of a node. + + It provides the current status of the node, as seen by the manager. + + * + * @param NodeStatus|null $status + * + * @return self + */ + public function setStatus(?NodeStatus $status): self { + $this->initialized['status'] = true; $this->status = $status; - return $this; } - /** - * @return NodeManagerStatus - */ - public function getManagerStatus() + * ManagerStatus represents the status of a manager. + + It provides the current status of a node's manager component, if the node + is a manager. + + * + * @return ManagerStatus|null + */ + public function getManagerStatus(): ?ManagerStatus { return $this->managerStatus; } - /** - * @param NodeManagerStatus $managerStatus - * - * @return self - */ - public function setManagerStatus(?NodeManagerStatus $managerStatus = null) + * ManagerStatus represents the status of a manager. + + It provides the current status of a node's manager component, if the node + is a manager. + + * + * @param ManagerStatus|null $managerStatus + * + * @return self + */ + public function setManagerStatus(?ManagerStatus $managerStatus): self { + $this->initialized['managerStatus'] = true; $this->managerStatus = $managerStatus; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/NodeDescription.php b/generated/Model/NodeDescription.php index b80872c4..65a0c241 100644 --- a/generated/Model/NodeDescription.php +++ b/generated/Model/NodeDescription.php @@ -5,99 +5,163 @@ class NodeDescription { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var string|null */ protected $hostname; /** - * @var NodePlatform + * Platform represents the platform (Arch/OS). + * + * @var Platform|null */ protected $platform; /** - * @var NodeResources - */ + * An object describing the resources which can be advertised by a node and + requested by a task. + + * + * @var ResourceObject|null + */ protected $resources; /** - * @var NodeEngine + * EngineDescription provides information about an engine. + * + * @var EngineDescription|null */ protected $engine; - /** - * @return string + * Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + + * + * @var TLSInfo|null + */ + protected $tLSInfo; + /** + * + * + * @return string|null */ - public function getHostname() + public function getHostname(): ?string { return $this->hostname; } - /** - * @param string $hostname + * + * + * @param string|null $hostname * * @return self */ - public function setHostname($hostname = null) + public function setHostname(?string $hostname): self { + $this->initialized['hostname'] = true; $this->hostname = $hostname; - return $this; } - /** - * @return NodePlatform + * Platform represents the platform (Arch/OS). + * + * @return Platform|null */ - public function getPlatform() + public function getPlatform(): ?Platform { return $this->platform; } - /** - * @param NodePlatform $platform + * Platform represents the platform (Arch/OS). + * + * @param Platform|null $platform * * @return self */ - public function setPlatform(?NodePlatform $platform = null) + public function setPlatform(?Platform $platform): self { + $this->initialized['platform'] = true; $this->platform = $platform; - return $this; } - /** - * @return NodeResources - */ - public function getResources() + * An object describing the resources which can be advertised by a node and + requested by a task. + + * + * @return ResourceObject|null + */ + public function getResources(): ?ResourceObject { return $this->resources; } - /** - * @param NodeResources $resources - * - * @return self - */ - public function setResources(?NodeResources $resources = null) + * An object describing the resources which can be advertised by a node and + requested by a task. + + * + * @param ResourceObject|null $resources + * + * @return self + */ + public function setResources(?ResourceObject $resources): self { + $this->initialized['resources'] = true; $this->resources = $resources; - return $this; } - /** - * @return NodeEngine + * EngineDescription provides information about an engine. + * + * @return EngineDescription|null */ - public function getEngine() + public function getEngine(): ?EngineDescription { return $this->engine; } - /** - * @param NodeEngine $engine + * EngineDescription provides information about an engine. + * + * @param EngineDescription|null $engine * * @return self */ - public function setEngine(?NodeEngine $engine = null) + public function setEngine(?EngineDescription $engine): self { + $this->initialized['engine'] = true; $this->engine = $engine; - return $this; } -} + /** + * Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + + * + * @return TLSInfo|null + */ + public function getTLSInfo(): ?TLSInfo + { + return $this->tLSInfo; + } + /** + * Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + + * + * @param TLSInfo|null $tLSInfo + * + * @return self + */ + public function setTLSInfo(?TLSInfo $tLSInfo): self + { + $this->initialized['tLSInfo'] = true; + $this->tLSInfo = $tLSInfo; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/NodeEngine.php b/generated/Model/NodeEngine.php deleted file mode 100644 index 434dcf78..00000000 --- a/generated/Model/NodeEngine.php +++ /dev/null @@ -1,79 +0,0 @@ -engineVersion; - } - - /** - * @param bool $engineVersion - * - * @return self - */ - public function setEngineVersion($engineVersion = null) - { - $this->engineVersion = $engineVersion; - - return $this; - } - - /** - * @return string[]|null - */ - public function getLabels() - { - return $this->labels; - } - - /** - * @param string[]|null $labels - * - * @return self - */ - public function setLabels($labels = null) - { - $this->labels = $labels; - - return $this; - } - - /** - * @return NodePlugin[] - */ - public function getPlugins() - { - return $this->plugins; - } - - /** - * @param NodePlugin[] $plugins - * - * @return self - */ - public function setPlugins(?array $plugins = null) - { - $this->plugins = $plugins; - - return $this; - } -} diff --git a/generated/Model/NodeManagerStatus.php b/generated/Model/NodeManagerStatus.php deleted file mode 100644 index 4f7b1ede..00000000 --- a/generated/Model/NodeManagerStatus.php +++ /dev/null @@ -1,79 +0,0 @@ -leader; - } - - /** - * @param bool $leader - * - * @return self - */ - public function setLeader($leader = null) - { - $this->leader = $leader; - - return $this; - } - - /** - * @return string - */ - public function getReachability() - { - return $this->reachability; - } - - /** - * @param string $reachability - * - * @return self - */ - public function setReachability($reachability = null) - { - $this->reachability = $reachability; - - return $this; - } - - /** - * @return string - */ - public function getAddr() - { - return $this->addr; - } - - /** - * @param string $addr - * - * @return self - */ - public function setAddr($addr = null) - { - $this->addr = $addr; - - return $this; - } -} diff --git a/generated/Model/NodePlatform.php b/generated/Model/NodePlatform.php deleted file mode 100644 index e13b51a4..00000000 --- a/generated/Model/NodePlatform.php +++ /dev/null @@ -1,55 +0,0 @@ -architecture; - } - - /** - * @param string $architecture - * - * @return self - */ - public function setArchitecture($architecture = null) - { - $this->architecture = $architecture; - - return $this; - } - - /** - * @return string - */ - public function getOS() - { - return $this->oS; - } - - /** - * @param string $oS - * - * @return self - */ - public function setOS($oS = null) - { - $this->oS = $oS; - - return $this; - } -} diff --git a/generated/Model/NodePlugin.php b/generated/Model/NodePlugin.php deleted file mode 100644 index 639960fe..00000000 --- a/generated/Model/NodePlugin.php +++ /dev/null @@ -1,55 +0,0 @@ -type; - } - - /** - * @param string $type - * - * @return self - */ - public function setType($type = null) - { - $this->type = $type; - - return $this; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } -} diff --git a/generated/Model/NodeResources.php b/generated/Model/NodeResources.php deleted file mode 100644 index 6f1b7d0b..00000000 --- a/generated/Model/NodeResources.php +++ /dev/null @@ -1,55 +0,0 @@ -nanoCPUs; - } - - /** - * @param int $nanoCPUs - * - * @return self - */ - public function setNanoCPUs($nanoCPUs = null) - { - $this->nanoCPUs = $nanoCPUs; - - return $this; - } - - /** - * @return int - */ - public function getMemoryBytes() - { - return $this->memoryBytes; - } - - /** - * @param int $memoryBytes - * - * @return self - */ - public function setMemoryBytes($memoryBytes = null) - { - $this->memoryBytes = $memoryBytes; - - return $this; - } -} diff --git a/generated/Model/NodeSpec.php b/generated/Model/NodeSpec.php index 24287195..557ef8fd 100644 --- a/generated/Model/NodeSpec.php +++ b/generated/Model/NodeSpec.php @@ -5,99 +5,123 @@ class NodeSpec { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * Name for the node. + * + * @var string|null */ protected $name; /** - * @var string + * User-defined key/value metadata. + * + * @var array|null */ - protected $role; + protected $labels; /** - * @var string + * Role of the node. + * + * @var string|null */ - protected $availability; + protected $role; /** - * @var string[]|null + * Availability of the node. + * + * @var string|null */ - protected $labels; - + protected $availability; /** - * @return string + * Name for the node. + * + * @return string|null */ - public function getName() + public function getName(): ?string { return $this->name; } - /** - * @param string $name + * Name for the node. + * + * @param string|null $name * * @return self */ - public function setName($name = null) + public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string + * User-defined key/value metadata. + * + * @return array|null */ - public function getRole() + public function getLabels(): ?iterable { - return $this->role; + return $this->labels; } - /** - * @param string $role + * User-defined key/value metadata. + * + * @param array|null $labels * * @return self */ - public function setRole($role = null) + public function setLabels(?iterable $labels): self { - $this->role = $role; - + $this->initialized['labels'] = true; + $this->labels = $labels; return $this; } - /** - * @return string + * Role of the node. + * + * @return string|null */ - public function getAvailability() + public function getRole(): ?string { - return $this->availability; + return $this->role; } - /** - * @param string $availability + * Role of the node. + * + * @param string|null $role * * @return self */ - public function setAvailability($availability = null) + public function setRole(?string $role): self { - $this->availability = $availability; - + $this->initialized['role'] = true; + $this->role = $role; return $this; } - /** - * @return string[]|null + * Availability of the node. + * + * @return string|null */ - public function getLabels() + public function getAvailability(): ?string { - return $this->labels; + return $this->availability; } - /** - * @param string[]|null $labels + * Availability of the node. + * + * @param string|null $availability * * @return self */ - public function setLabels($labels = null) + public function setAvailability(?string $availability): self { - $this->labels = $labels; - + $this->initialized['availability'] = true; + $this->availability = $availability; return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/NodeStatus.php b/generated/Model/NodeStatus.php index f3ace0f1..7de30580 100644 --- a/generated/Model/NodeStatus.php +++ b/generated/Model/NodeStatus.php @@ -5,27 +5,95 @@ class NodeStatus { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * NodeState represents the state of a node. + * + * @var string|null */ protected $state; - /** - * @return string + * + * + * @var string|null */ - public function getState() + protected $message; + /** + * IP address of the node. + * + * @var string|null + */ + protected $addr; + /** + * NodeState represents the state of a node. + * + * @return string|null + */ + public function getState(): ?string { return $this->state; } - /** - * @param string $state + * NodeState represents the state of a node. + * + * @param string|null $state * * @return self */ - public function setState($state = null) + public function setState(?string $state): self { + $this->initialized['state'] = true; $this->state = $state; - return $this; } -} + /** + * + * + * @return string|null + */ + public function getMessage(): ?string + { + return $this->message; + } + /** + * + * + * @param string|null $message + * + * @return self + */ + public function setMessage(?string $message): self + { + $this->initialized['message'] = true; + $this->message = $message; + return $this; + } + /** + * IP address of the node. + * + * @return string|null + */ + public function getAddr(): ?string + { + return $this->addr; + } + /** + * IP address of the node. + * + * @param string|null $addr + * + * @return self + */ + public function setAddr(?string $addr): self + { + $this->initialized['addr'] = true; + $this->addr = $addr; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/NodeVersion.php b/generated/Model/NodeVersion.php deleted file mode 100644 index a80ff88a..00000000 --- a/generated/Model/NodeVersion.php +++ /dev/null @@ -1,31 +0,0 @@ -index; - } - - /** - * @param string $index - * - * @return self - */ - public function setIndex($index = null) - { - $this->index = $index; - - return $this; - } -} diff --git a/generated/Model/OCIDescriptor.php b/generated/Model/OCIDescriptor.php new file mode 100644 index 00000000..c60481c8 --- /dev/null +++ b/generated/Model/OCIDescriptor.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * The media type of the object this schema refers to. + * + * @var string|null + */ + protected $mediaType; + /** + * The digest of the targeted content. + * + * @var string|null + */ + protected $digest; + /** + * The size in bytes of the blob. + * + * @var int|null + */ + protected $size; + /** + * The media type of the object this schema refers to. + * + * @return string|null + */ + public function getMediaType(): ?string + { + return $this->mediaType; + } + /** + * The media type of the object this schema refers to. + * + * @param string|null $mediaType + * + * @return self + */ + public function setMediaType(?string $mediaType): self + { + $this->initialized['mediaType'] = true; + $this->mediaType = $mediaType; + return $this; + } + /** + * The digest of the targeted content. + * + * @return string|null + */ + public function getDigest(): ?string + { + return $this->digest; + } + /** + * The digest of the targeted content. + * + * @param string|null $digest + * + * @return self + */ + public function setDigest(?string $digest): self + { + $this->initialized['digest'] = true; + $this->digest = $digest; + return $this; + } + /** + * The size in bytes of the blob. + * + * @return int|null + */ + public function getSize(): ?int + { + return $this->size; + } + /** + * The size in bytes of the blob. + * + * @param int|null $size + * + * @return self + */ + public function setSize(?int $size): self + { + $this->initialized['size'] = true; + $this->size = $size; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/OCIPlatform.php b/generated/Model/OCIPlatform.php new file mode 100644 index 00000000..72074586 --- /dev/null +++ b/generated/Model/OCIPlatform.php @@ -0,0 +1,173 @@ +initialized); + } + /** + * The CPU architecture, for example `amd64` or `ppc64`. + * + * @var string|null + */ + protected $architecture; + /** + * The operating system, for example `linux` or `windows`. + * + * @var string|null + */ + protected $os; + /** + * Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + + * + * @var string|null + */ + protected $osVersion; + /** + * Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + + * + * @var list|null + */ + protected $osFeatures; + /** + * Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + + * + * @var string|null + */ + protected $variant; + /** + * The CPU architecture, for example `amd64` or `ppc64`. + * + * @return string|null + */ + public function getArchitecture(): ?string + { + return $this->architecture; + } + /** + * The CPU architecture, for example `amd64` or `ppc64`. + * + * @param string|null $architecture + * + * @return self + */ + public function setArchitecture(?string $architecture): self + { + $this->initialized['architecture'] = true; + $this->architecture = $architecture; + return $this; + } + /** + * The operating system, for example `linux` or `windows`. + * + * @return string|null + */ + public function getOs(): ?string + { + return $this->os; + } + /** + * The operating system, for example `linux` or `windows`. + * + * @param string|null $os + * + * @return self + */ + public function setOs(?string $os): self + { + $this->initialized['os'] = true; + $this->os = $os; + return $this; + } + /** + * Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + + * + * @return string|null + */ + public function getOsVersion(): ?string + { + return $this->osVersion; + } + /** + * Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + + * + * @param string|null $osVersion + * + * @return self + */ + public function setOsVersion(?string $osVersion): self + { + $this->initialized['osVersion'] = true; + $this->osVersion = $osVersion; + return $this; + } + /** + * Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + + * + * @return list|null + */ + public function getOsFeatures(): ?array + { + return $this->osFeatures; + } + /** + * Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + + * + * @param list|null $osFeatures + * + * @return self + */ + public function setOsFeatures(?array $osFeatures): self + { + $this->initialized['osFeatures'] = true; + $this->osFeatures = $osFeatures; + return $this; + } + /** + * Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + + * + * @return string|null + */ + public function getVariant(): ?string + { + return $this->variant; + } + /** + * Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + + * + * @param string|null $variant + * + * @return self + */ + public function setVariant(?string $variant): self + { + $this->initialized['variant'] = true; + $this->variant = $variant; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ObjectVersion.php b/generated/Model/ObjectVersion.php new file mode 100644 index 00000000..f03a8407 --- /dev/null +++ b/generated/Model/ObjectVersion.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * + * + * @var int|null + */ + protected $index; + /** + * + * + * @return int|null + */ + public function getIndex(): ?int + { + return $this->index; + } + /** + * + * + * @param int|null $index + * + * @return self + */ + public function setIndex(?int $index): self + { + $this->initialized['index'] = true; + $this->index = $index; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PeerInfo.php b/generated/Model/PeerInfo.php new file mode 100644 index 00000000..ab3419a4 --- /dev/null +++ b/generated/Model/PeerInfo.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * ID of the peer-node in the Swarm cluster. + * + * @var string|null + */ + protected $name; + /** + * IP-address of the peer-node in the Swarm cluster. + * + * @var string|null + */ + protected $iP; + /** + * ID of the peer-node in the Swarm cluster. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * ID of the peer-node in the Swarm cluster. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * IP-address of the peer-node in the Swarm cluster. + * + * @return string|null + */ + public function getIP(): ?string + { + return $this->iP; + } + /** + * IP-address of the peer-node in the Swarm cluster. + * + * @param string|null $iP + * + * @return self + */ + public function setIP(?string $iP): self + { + $this->initialized['iP'] = true; + $this->iP = $iP; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PeerNode.php b/generated/Model/PeerNode.php new file mode 100644 index 00000000..2cce643c --- /dev/null +++ b/generated/Model/PeerNode.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * Unique identifier of for this node in the swarm. + * + * @var string|null + */ + protected $nodeID; + /** + * IP address and ports at which this node can be reached. + * + * @var string|null + */ + protected $addr; + /** + * Unique identifier of for this node in the swarm. + * + * @return string|null + */ + public function getNodeID(): ?string + { + return $this->nodeID; + } + /** + * Unique identifier of for this node in the swarm. + * + * @param string|null $nodeID + * + * @return self + */ + public function setNodeID(?string $nodeID): self + { + $this->initialized['nodeID'] = true; + $this->nodeID = $nodeID; + return $this; + } + /** + * IP address and ports at which this node can be reached. + * + * @return string|null + */ + public function getAddr(): ?string + { + return $this->addr; + } + /** + * IP address and ports at which this node can be reached. + * + * @param string|null $addr + * + * @return self + */ + public function setAddr(?string $addr): self + { + $this->initialized['addr'] = true; + $this->addr = $addr; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Platform.php b/generated/Model/Platform.php new file mode 100644 index 00000000..e8c77e29 --- /dev/null +++ b/generated/Model/Platform.php @@ -0,0 +1,77 @@ +initialized); + } + /** + * Architecture represents the hardware architecture (for example, + `x86_64`). + + * + * @var string|null + */ + protected $architecture; + /** + * OS represents the Operating System (for example, `linux` or `windows`). + * + * @var string|null + */ + protected $oS; + /** + * Architecture represents the hardware architecture (for example, + `x86_64`). + + * + * @return string|null + */ + public function getArchitecture(): ?string + { + return $this->architecture; + } + /** + * Architecture represents the hardware architecture (for example, + `x86_64`). + + * + * @param string|null $architecture + * + * @return self + */ + public function setArchitecture(?string $architecture): self + { + $this->initialized['architecture'] = true; + $this->architecture = $architecture; + return $this; + } + /** + * OS represents the Operating System (for example, `linux` or `windows`). + * + * @return string|null + */ + public function getOS(): ?string + { + return $this->oS; + } + /** + * OS represents the Operating System (for example, `linux` or `windows`). + * + * @param string|null $oS + * + * @return self + */ + public function setOS(?string $oS): self + { + $this->initialized['oS'] = true; + $this->oS = $oS; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Plugin.php b/generated/Model/Plugin.php new file mode 100644 index 00000000..df9f4fff --- /dev/null +++ b/generated/Model/Plugin.php @@ -0,0 +1,183 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $id; + /** + * + * + * @var string|null + */ + protected $name; + /** + * True if the plugin is running. False if the plugin is not running, only installed. + * + * @var bool|null + */ + protected $enabled; + /** + * Settings that can be modified by users. + * + * @var PluginSettings|null + */ + protected $settings; + /** + * plugin remote reference used to push/pull the plugin + * + * @var string|null + */ + protected $pluginReference; + /** + * The config of a plugin. + * + * @var PluginConfig|null + */ + protected $config; + /** + * + * + * @return string|null + */ + public function getId(): ?string + { + return $this->id; + } + /** + * + * + * @param string|null $id + * + * @return self + */ + public function setId(?string $id): self + { + $this->initialized['id'] = true; + $this->id = $id; + return $this; + } + /** + * + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * True if the plugin is running. False if the plugin is not running, only installed. + * + * @return bool|null + */ + public function getEnabled(): ?bool + { + return $this->enabled; + } + /** + * True if the plugin is running. False if the plugin is not running, only installed. + * + * @param bool|null $enabled + * + * @return self + */ + public function setEnabled(?bool $enabled): self + { + $this->initialized['enabled'] = true; + $this->enabled = $enabled; + return $this; + } + /** + * Settings that can be modified by users. + * + * @return PluginSettings|null + */ + public function getSettings(): ?PluginSettings + { + return $this->settings; + } + /** + * Settings that can be modified by users. + * + * @param PluginSettings|null $settings + * + * @return self + */ + public function setSettings(?PluginSettings $settings): self + { + $this->initialized['settings'] = true; + $this->settings = $settings; + return $this; + } + /** + * plugin remote reference used to push/pull the plugin + * + * @return string|null + */ + public function getPluginReference(): ?string + { + return $this->pluginReference; + } + /** + * plugin remote reference used to push/pull the plugin + * + * @param string|null $pluginReference + * + * @return self + */ + public function setPluginReference(?string $pluginReference): self + { + $this->initialized['pluginReference'] = true; + $this->pluginReference = $pluginReference; + return $this; + } + /** + * The config of a plugin. + * + * @return PluginConfig|null + */ + public function getConfig(): ?PluginConfig + { + return $this->config; + } + /** + * The config of a plugin. + * + * @param PluginConfig|null $config + * + * @return self + */ + public function setConfig(?PluginConfig $config): self + { + $this->initialized['config'] = true; + $this->config = $config; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginConfig.php b/generated/Model/PluginConfig.php new file mode 100644 index 00000000..01ebe10f --- /dev/null +++ b/generated/Model/PluginConfig.php @@ -0,0 +1,463 @@ +initialized); + } + /** + * Docker Version used to create the plugin + * + * @var string|null + */ + protected $dockerVersion; + /** + * + * + * @var string|null + */ + protected $description; + /** + * + * + * @var string|null + */ + protected $documentation; + /** + * The interface between Docker and the plugin + * + * @var PluginConfigInterface|null + */ + protected $interface; + /** + * + * + * @var list|null + */ + protected $entrypoint; + /** + * + * + * @var string|null + */ + protected $workDir; + /** + * + * + * @var PluginConfigUser|null + */ + protected $user; + /** + * + * + * @var PluginConfigNetwork|null + */ + protected $network; + /** + * + * + * @var PluginConfigLinux|null + */ + protected $linux; + /** + * + * + * @var string|null + */ + protected $propagatedMount; + /** + * + * + * @var bool|null + */ + protected $ipcHost; + /** + * + * + * @var bool|null + */ + protected $pidHost; + /** + * + * + * @var list|null + */ + protected $mounts; + /** + * + * + * @var list|null + */ + protected $env; + /** + * + * + * @var PluginConfigArgs|null + */ + protected $args; + /** + * + * + * @var PluginConfigRootfs|null + */ + protected $rootfs; + /** + * Docker Version used to create the plugin + * + * @return string|null + */ + public function getDockerVersion(): ?string + { + return $this->dockerVersion; + } + /** + * Docker Version used to create the plugin + * + * @param string|null $dockerVersion + * + * @return self + */ + public function setDockerVersion(?string $dockerVersion): self + { + $this->initialized['dockerVersion'] = true; + $this->dockerVersion = $dockerVersion; + return $this; + } + /** + * + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + /** + * + * + * @param string|null $description + * + * @return self + */ + public function setDescription(?string $description): self + { + $this->initialized['description'] = true; + $this->description = $description; + return $this; + } + /** + * + * + * @return string|null + */ + public function getDocumentation(): ?string + { + return $this->documentation; + } + /** + * + * + * @param string|null $documentation + * + * @return self + */ + public function setDocumentation(?string $documentation): self + { + $this->initialized['documentation'] = true; + $this->documentation = $documentation; + return $this; + } + /** + * The interface between Docker and the plugin + * + * @return PluginConfigInterface|null + */ + public function getInterface(): ?PluginConfigInterface + { + return $this->interface; + } + /** + * The interface between Docker and the plugin + * + * @param PluginConfigInterface|null $interface + * + * @return self + */ + public function setInterface(?PluginConfigInterface $interface): self + { + $this->initialized['interface'] = true; + $this->interface = $interface; + return $this; + } + /** + * + * + * @return list|null + */ + public function getEntrypoint(): ?array + { + return $this->entrypoint; + } + /** + * + * + * @param list|null $entrypoint + * + * @return self + */ + public function setEntrypoint(?array $entrypoint): self + { + $this->initialized['entrypoint'] = true; + $this->entrypoint = $entrypoint; + return $this; + } + /** + * + * + * @return string|null + */ + public function getWorkDir(): ?string + { + return $this->workDir; + } + /** + * + * + * @param string|null $workDir + * + * @return self + */ + public function setWorkDir(?string $workDir): self + { + $this->initialized['workDir'] = true; + $this->workDir = $workDir; + return $this; + } + /** + * + * + * @return PluginConfigUser|null + */ + public function getUser(): ?PluginConfigUser + { + return $this->user; + } + /** + * + * + * @param PluginConfigUser|null $user + * + * @return self + */ + public function setUser(?PluginConfigUser $user): self + { + $this->initialized['user'] = true; + $this->user = $user; + return $this; + } + /** + * + * + * @return PluginConfigNetwork|null + */ + public function getNetwork(): ?PluginConfigNetwork + { + return $this->network; + } + /** + * + * + * @param PluginConfigNetwork|null $network + * + * @return self + */ + public function setNetwork(?PluginConfigNetwork $network): self + { + $this->initialized['network'] = true; + $this->network = $network; + return $this; + } + /** + * + * + * @return PluginConfigLinux|null + */ + public function getLinux(): ?PluginConfigLinux + { + return $this->linux; + } + /** + * + * + * @param PluginConfigLinux|null $linux + * + * @return self + */ + public function setLinux(?PluginConfigLinux $linux): self + { + $this->initialized['linux'] = true; + $this->linux = $linux; + return $this; + } + /** + * + * + * @return string|null + */ + public function getPropagatedMount(): ?string + { + return $this->propagatedMount; + } + /** + * + * + * @param string|null $propagatedMount + * + * @return self + */ + public function setPropagatedMount(?string $propagatedMount): self + { + $this->initialized['propagatedMount'] = true; + $this->propagatedMount = $propagatedMount; + return $this; + } + /** + * + * + * @return bool|null + */ + public function getIpcHost(): ?bool + { + return $this->ipcHost; + } + /** + * + * + * @param bool|null $ipcHost + * + * @return self + */ + public function setIpcHost(?bool $ipcHost): self + { + $this->initialized['ipcHost'] = true; + $this->ipcHost = $ipcHost; + return $this; + } + /** + * + * + * @return bool|null + */ + public function getPidHost(): ?bool + { + return $this->pidHost; + } + /** + * + * + * @param bool|null $pidHost + * + * @return self + */ + public function setPidHost(?bool $pidHost): self + { + $this->initialized['pidHost'] = true; + $this->pidHost = $pidHost; + return $this; + } + /** + * + * + * @return list|null + */ + public function getMounts(): ?array + { + return $this->mounts; + } + /** + * + * + * @param list|null $mounts + * + * @return self + */ + public function setMounts(?array $mounts): self + { + $this->initialized['mounts'] = true; + $this->mounts = $mounts; + return $this; + } + /** + * + * + * @return list|null + */ + public function getEnv(): ?array + { + return $this->env; + } + /** + * + * + * @param list|null $env + * + * @return self + */ + public function setEnv(?array $env): self + { + $this->initialized['env'] = true; + $this->env = $env; + return $this; + } + /** + * + * + * @return PluginConfigArgs|null + */ + public function getArgs(): ?PluginConfigArgs + { + return $this->args; + } + /** + * + * + * @param PluginConfigArgs|null $args + * + * @return self + */ + public function setArgs(?PluginConfigArgs $args): self + { + $this->initialized['args'] = true; + $this->args = $args; + return $this; + } + /** + * + * + * @return PluginConfigRootfs|null + */ + public function getRootfs(): ?PluginConfigRootfs + { + return $this->rootfs; + } + /** + * + * + * @param PluginConfigRootfs|null $rootfs + * + * @return self + */ + public function setRootfs(?PluginConfigRootfs $rootfs): self + { + $this->initialized['rootfs'] = true; + $this->rootfs = $rootfs; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginConfigArgs.php b/generated/Model/PluginConfigArgs.php new file mode 100644 index 00000000..93d5fb8b --- /dev/null +++ b/generated/Model/PluginConfigArgs.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $name; + /** + * + * + * @var string|null + */ + protected $description; + /** + * + * + * @var list|null + */ + protected $settable; + /** + * + * + * @var list|null + */ + protected $value; + /** + * + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + /** + * + * + * @param string|null $description + * + * @return self + */ + public function setDescription(?string $description): self + { + $this->initialized['description'] = true; + $this->description = $description; + return $this; + } + /** + * + * + * @return list|null + */ + public function getSettable(): ?array + { + return $this->settable; + } + /** + * + * + * @param list|null $settable + * + * @return self + */ + public function setSettable(?array $settable): self + { + $this->initialized['settable'] = true; + $this->settable = $settable; + return $this; + } + /** + * + * + * @return list|null + */ + public function getValue(): ?array + { + return $this->value; + } + /** + * + * + * @param list|null $value + * + * @return self + */ + public function setValue(?array $value): self + { + $this->initialized['value'] = true; + $this->value = $value; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginConfigInterface.php b/generated/Model/PluginConfigInterface.php new file mode 100644 index 00000000..aa1f4243 --- /dev/null +++ b/generated/Model/PluginConfigInterface.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * + * + * @var list|null + */ + protected $types; + /** + * + * + * @var string|null + */ + protected $socket; + /** + * Protocol to use for clients connecting to the plugin. + * + * @var string|null + */ + protected $protocolScheme; + /** + * + * + * @return list|null + */ + public function getTypes(): ?array + { + return $this->types; + } + /** + * + * + * @param list|null $types + * + * @return self + */ + public function setTypes(?array $types): self + { + $this->initialized['types'] = true; + $this->types = $types; + return $this; + } + /** + * + * + * @return string|null + */ + public function getSocket(): ?string + { + return $this->socket; + } + /** + * + * + * @param string|null $socket + * + * @return self + */ + public function setSocket(?string $socket): self + { + $this->initialized['socket'] = true; + $this->socket = $socket; + return $this; + } + /** + * Protocol to use for clients connecting to the plugin. + * + * @return string|null + */ + public function getProtocolScheme(): ?string + { + return $this->protocolScheme; + } + /** + * Protocol to use for clients connecting to the plugin. + * + * @param string|null $protocolScheme + * + * @return self + */ + public function setProtocolScheme(?string $protocolScheme): self + { + $this->initialized['protocolScheme'] = true; + $this->protocolScheme = $protocolScheme; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginConfigLinux.php b/generated/Model/PluginConfigLinux.php new file mode 100644 index 00000000..8589fcd5 --- /dev/null +++ b/generated/Model/PluginConfigLinux.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * + * + * @var list|null + */ + protected $capabilities; + /** + * + * + * @var bool|null + */ + protected $allowAllDevices; + /** + * + * + * @var list|null + */ + protected $devices; + /** + * + * + * @return list|null + */ + public function getCapabilities(): ?array + { + return $this->capabilities; + } + /** + * + * + * @param list|null $capabilities + * + * @return self + */ + public function setCapabilities(?array $capabilities): self + { + $this->initialized['capabilities'] = true; + $this->capabilities = $capabilities; + return $this; + } + /** + * + * + * @return bool|null + */ + public function getAllowAllDevices(): ?bool + { + return $this->allowAllDevices; + } + /** + * + * + * @param bool|null $allowAllDevices + * + * @return self + */ + public function setAllowAllDevices(?bool $allowAllDevices): self + { + $this->initialized['allowAllDevices'] = true; + $this->allowAllDevices = $allowAllDevices; + return $this; + } + /** + * + * + * @return list|null + */ + public function getDevices(): ?array + { + return $this->devices; + } + /** + * + * + * @param list|null $devices + * + * @return self + */ + public function setDevices(?array $devices): self + { + $this->initialized['devices'] = true; + $this->devices = $devices; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginConfigNetwork.php b/generated/Model/PluginConfigNetwork.php new file mode 100644 index 00000000..2680d067 --- /dev/null +++ b/generated/Model/PluginConfigNetwork.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $type; + /** + * + * + * @return string|null + */ + public function getType(): ?string + { + return $this->type; + } + /** + * + * + * @param string|null $type + * + * @return self + */ + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginConfigRootfs.php b/generated/Model/PluginConfigRootfs.php new file mode 100644 index 00000000..013938b5 --- /dev/null +++ b/generated/Model/PluginConfigRootfs.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $type; + /** + * + * + * @var list|null + */ + protected $diffIds; + /** + * + * + * @return string|null + */ + public function getType(): ?string + { + return $this->type; + } + /** + * + * + * @param string|null $type + * + * @return self + */ + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + return $this; + } + /** + * + * + * @return list|null + */ + public function getDiffIds(): ?array + { + return $this->diffIds; + } + /** + * + * + * @param list|null $diffIds + * + * @return self + */ + public function setDiffIds(?array $diffIds): self + { + $this->initialized['diffIds'] = true; + $this->diffIds = $diffIds; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginConfigUser.php b/generated/Model/PluginConfigUser.php new file mode 100644 index 00000000..e7a626f6 --- /dev/null +++ b/generated/Model/PluginConfigUser.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var int|null + */ + protected $uID; + /** + * + * + * @var int|null + */ + protected $gID; + /** + * + * + * @return int|null + */ + public function getUID(): ?int + { + return $this->uID; + } + /** + * + * + * @param int|null $uID + * + * @return self + */ + public function setUID(?int $uID): self + { + $this->initialized['uID'] = true; + $this->uID = $uID; + return $this; + } + /** + * + * + * @return int|null + */ + public function getGID(): ?int + { + return $this->gID; + } + /** + * + * + * @param int|null $gID + * + * @return self + */ + public function setGID(?int $gID): self + { + $this->initialized['gID'] = true; + $this->gID = $gID; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginDevice.php b/generated/Model/PluginDevice.php new file mode 100644 index 00000000..8e2d4ea7 --- /dev/null +++ b/generated/Model/PluginDevice.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $name; + /** + * + * + * @var string|null + */ + protected $description; + /** + * + * + * @var list|null + */ + protected $settable; + /** + * + * + * @var string|null + */ + protected $path; + /** + * + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + /** + * + * + * @param string|null $description + * + * @return self + */ + public function setDescription(?string $description): self + { + $this->initialized['description'] = true; + $this->description = $description; + return $this; + } + /** + * + * + * @return list|null + */ + public function getSettable(): ?array + { + return $this->settable; + } + /** + * + * + * @param list|null $settable + * + * @return self + */ + public function setSettable(?array $settable): self + { + $this->initialized['settable'] = true; + $this->settable = $settable; + return $this; + } + /** + * + * + * @return string|null + */ + public function getPath(): ?string + { + return $this->path; + } + /** + * + * + * @param string|null $path + * + * @return self + */ + public function setPath(?string $path): self + { + $this->initialized['path'] = true; + $this->path = $path; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginEnv.php b/generated/Model/PluginEnv.php new file mode 100644 index 00000000..4561c24c --- /dev/null +++ b/generated/Model/PluginEnv.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $name; + /** + * + * + * @var string|null + */ + protected $description; + /** + * + * + * @var list|null + */ + protected $settable; + /** + * + * + * @var string|null + */ + protected $value; + /** + * + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + /** + * + * + * @param string|null $description + * + * @return self + */ + public function setDescription(?string $description): self + { + $this->initialized['description'] = true; + $this->description = $description; + return $this; + } + /** + * + * + * @return list|null + */ + public function getSettable(): ?array + { + return $this->settable; + } + /** + * + * + * @param list|null $settable + * + * @return self + */ + public function setSettable(?array $settable): self + { + $this->initialized['settable'] = true; + $this->settable = $settable; + return $this; + } + /** + * + * + * @return string|null + */ + public function getValue(): ?string + { + return $this->value; + } + /** + * + * + * @param string|null $value + * + * @return self + */ + public function setValue(?string $value): self + { + $this->initialized['value'] = true; + $this->value = $value; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginInterfaceType.php b/generated/Model/PluginInterfaceType.php new file mode 100644 index 00000000..50b83a3f --- /dev/null +++ b/generated/Model/PluginInterfaceType.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $prefix; + /** + * + * + * @var string|null + */ + protected $capability; + /** + * + * + * @var string|null + */ + protected $version; + /** + * + * + * @return string|null + */ + public function getPrefix(): ?string + { + return $this->prefix; + } + /** + * + * + * @param string|null $prefix + * + * @return self + */ + public function setPrefix(?string $prefix): self + { + $this->initialized['prefix'] = true; + $this->prefix = $prefix; + return $this; + } + /** + * + * + * @return string|null + */ + public function getCapability(): ?string + { + return $this->capability; + } + /** + * + * + * @param string|null $capability + * + * @return self + */ + public function setCapability(?string $capability): self + { + $this->initialized['capability'] = true; + $this->capability = $capability; + return $this; + } + /** + * + * + * @return string|null + */ + public function getVersion(): ?string + { + return $this->version; + } + /** + * + * + * @param string|null $version + * + * @return self + */ + public function setVersion(?string $version): self + { + $this->initialized['version'] = true; + $this->version = $version; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginMount.php b/generated/Model/PluginMount.php new file mode 100644 index 00000000..78ca56cc --- /dev/null +++ b/generated/Model/PluginMount.php @@ -0,0 +1,211 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $name; + /** + * + * + * @var string|null + */ + protected $description; + /** + * + * + * @var list|null + */ + protected $settable; + /** + * + * + * @var string|null + */ + protected $source; + /** + * + * + * @var string|null + */ + protected $destination; + /** + * + * + * @var string|null + */ + protected $type; + /** + * + * + * @var list|null + */ + protected $options; + /** + * + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + /** + * + * + * @param string|null $description + * + * @return self + */ + public function setDescription(?string $description): self + { + $this->initialized['description'] = true; + $this->description = $description; + return $this; + } + /** + * + * + * @return list|null + */ + public function getSettable(): ?array + { + return $this->settable; + } + /** + * + * + * @param list|null $settable + * + * @return self + */ + public function setSettable(?array $settable): self + { + $this->initialized['settable'] = true; + $this->settable = $settable; + return $this; + } + /** + * + * + * @return string|null + */ + public function getSource(): ?string + { + return $this->source; + } + /** + * + * + * @param string|null $source + * + * @return self + */ + public function setSource(?string $source): self + { + $this->initialized['source'] = true; + $this->source = $source; + return $this; + } + /** + * + * + * @return string|null + */ + public function getDestination(): ?string + { + return $this->destination; + } + /** + * + * + * @param string|null $destination + * + * @return self + */ + public function setDestination(?string $destination): self + { + $this->initialized['destination'] = true; + $this->destination = $destination; + return $this; + } + /** + * + * + * @return string|null + */ + public function getType(): ?string + { + return $this->type; + } + /** + * + * + * @param string|null $type + * + * @return self + */ + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + return $this; + } + /** + * + * + * @return list|null + */ + public function getOptions(): ?array + { + return $this->options; + } + /** + * + * + * @param list|null $options + * + * @return self + */ + public function setOptions(?array $options): self + { + $this->initialized['options'] = true; + $this->options = $options; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginPrivilege.php b/generated/Model/PluginPrivilege.php new file mode 100644 index 00000000..5256dc87 --- /dev/null +++ b/generated/Model/PluginPrivilege.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $name; + /** + * + * + * @var string|null + */ + protected $description; + /** + * + * + * @var list|null + */ + protected $value; + /** + * + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + /** + * + * + * @param string|null $description + * + * @return self + */ + public function setDescription(?string $description): self + { + $this->initialized['description'] = true; + $this->description = $description; + return $this; + } + /** + * + * + * @return list|null + */ + public function getValue(): ?array + { + return $this->value; + } + /** + * + * + * @param list|null $value + * + * @return self + */ + public function setValue(?array $value): self + { + $this->initialized['value'] = true; + $this->value = $value; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginSettings.php b/generated/Model/PluginSettings.php new file mode 100644 index 00000000..f79bf0b7 --- /dev/null +++ b/generated/Model/PluginSettings.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * + * + * @var list|null + */ + protected $mounts; + /** + * + * + * @var list|null + */ + protected $env; + /** + * + * + * @var list|null + */ + protected $args; + /** + * + * + * @var list|null + */ + protected $devices; + /** + * + * + * @return list|null + */ + public function getMounts(): ?array + { + return $this->mounts; + } + /** + * + * + * @param list|null $mounts + * + * @return self + */ + public function setMounts(?array $mounts): self + { + $this->initialized['mounts'] = true; + $this->mounts = $mounts; + return $this; + } + /** + * + * + * @return list|null + */ + public function getEnv(): ?array + { + return $this->env; + } + /** + * + * + * @param list|null $env + * + * @return self + */ + public function setEnv(?array $env): self + { + $this->initialized['env'] = true; + $this->env = $env; + return $this; + } + /** + * + * + * @return list|null + */ + public function getArgs(): ?array + { + return $this->args; + } + /** + * + * + * @param list|null $args + * + * @return self + */ + public function setArgs(?array $args): self + { + $this->initialized['args'] = true; + $this->args = $args; + return $this; + } + /** + * + * + * @return list|null + */ + public function getDevices(): ?array + { + return $this->devices; + } + /** + * + * + * @param list|null $devices + * + * @return self + */ + public function setDevices(?array $devices): self + { + $this->initialized['devices'] = true; + $this->devices = $devices; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/PluginsInfo.php b/generated/Model/PluginsInfo.php new file mode 100644 index 00000000..8732c314 --- /dev/null +++ b/generated/Model/PluginsInfo.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * Names of available volume-drivers, and network-driver plugins. + * + * @var list|null + */ + protected $volume; + /** + * Names of available network-drivers, and network-driver plugins. + * + * @var list|null + */ + protected $network; + /** + * Names of available authorization plugins. + * + * @var list|null + */ + protected $authorization; + /** + * Names of available logging-drivers, and logging-driver plugins. + * + * @var list|null + */ + protected $log; + /** + * Names of available volume-drivers, and network-driver plugins. + * + * @return list|null + */ + public function getVolume(): ?array + { + return $this->volume; + } + /** + * Names of available volume-drivers, and network-driver plugins. + * + * @param list|null $volume + * + * @return self + */ + public function setVolume(?array $volume): self + { + $this->initialized['volume'] = true; + $this->volume = $volume; + return $this; + } + /** + * Names of available network-drivers, and network-driver plugins. + * + * @return list|null + */ + public function getNetwork(): ?array + { + return $this->network; + } + /** + * Names of available network-drivers, and network-driver plugins. + * + * @param list|null $network + * + * @return self + */ + public function setNetwork(?array $network): self + { + $this->initialized['network'] = true; + $this->network = $network; + return $this; + } + /** + * Names of available authorization plugins. + * + * @return list|null + */ + public function getAuthorization(): ?array + { + return $this->authorization; + } + /** + * Names of available authorization plugins. + * + * @param list|null $authorization + * + * @return self + */ + public function setAuthorization(?array $authorization): self + { + $this->initialized['authorization'] = true; + $this->authorization = $authorization; + return $this; + } + /** + * Names of available logging-drivers, and logging-driver plugins. + * + * @return list|null + */ + public function getLog(): ?array + { + return $this->log; + } + /** + * Names of available logging-drivers, and logging-driver plugins. + * + * @param list|null $log + * + * @return self + */ + public function setLog(?array $log): self + { + $this->initialized['log'] = true; + $this->log = $log; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Port.php b/generated/Model/Port.php index f94c49af..8f2df6c6 100644 --- a/generated/Model/Port.php +++ b/generated/Model/Port.php @@ -5,75 +5,123 @@ class Port { /** - * @var int + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * Host IP address that the container's port is mapped to + * + * @var string|null + */ + protected $iP; + /** + * Port on the container + * + * @var int|null */ protected $privatePort; /** - * @var int + * Port exposed on the host + * + * @var int|null */ protected $publicPort; /** - * @var string + * + * + * @var string|null */ protected $type; - /** - * @return int + * Host IP address that the container's port is mapped to + * + * @return string|null + */ + public function getIP(): ?string + { + return $this->iP; + } + /** + * Host IP address that the container's port is mapped to + * + * @param string|null $iP + * + * @return self + */ + public function setIP(?string $iP): self + { + $this->initialized['iP'] = true; + $this->iP = $iP; + return $this; + } + /** + * Port on the container + * + * @return int|null */ - public function getPrivatePort() + public function getPrivatePort(): ?int { return $this->privatePort; } - /** - * @param int $privatePort + * Port on the container + * + * @param int|null $privatePort * * @return self */ - public function setPrivatePort($privatePort = null) + public function setPrivatePort(?int $privatePort): self { + $this->initialized['privatePort'] = true; $this->privatePort = $privatePort; - return $this; } - /** - * @return int + * Port exposed on the host + * + * @return int|null */ - public function getPublicPort() + public function getPublicPort(): ?int { return $this->publicPort; } - /** - * @param int $publicPort + * Port exposed on the host + * + * @param int|null $publicPort * * @return self */ - public function setPublicPort($publicPort = null) + public function setPublicPort(?int $publicPort): self { + $this->initialized['publicPort'] = true; $this->publicPort = $publicPort; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getType() + public function getType(): ?string { return $this->type; } - /** - * @param string $type + * + * + * @param string|null $type * * @return self */ - public function setType($type = null) + public function setType(?string $type): self { + $this->initialized['type'] = true; $this->type = $type; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/PortBinding.php b/generated/Model/PortBinding.php index 2f478f4f..d5ce1ef2 100644 --- a/generated/Model/PortBinding.php +++ b/generated/Model/PortBinding.php @@ -5,51 +5,67 @@ class PortBinding { /** - * @var string + * @var array */ - protected $hostPort; + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } /** - * @var string + * Host IP address that the container's port is mapped to. + * + * @var string|null */ protected $hostIp; - /** - * @return string + * Host port number that the container's port is mapped to. + * + * @var string|null */ - public function getHostPort() + protected $hostPort; + /** + * Host IP address that the container's port is mapped to. + * + * @return string|null + */ + public function getHostIp(): ?string { - return $this->hostPort; + return $this->hostIp; } - /** - * @param string $hostPort + * Host IP address that the container's port is mapped to. + * + * @param string|null $hostIp * * @return self */ - public function setHostPort($hostPort = null) + public function setHostIp(?string $hostIp): self { - $this->hostPort = $hostPort; - + $this->initialized['hostIp'] = true; + $this->hostIp = $hostIp; return $this; } - /** - * @return string + * Host port number that the container's port is mapped to. + * + * @return string|null */ - public function getHostIp() + public function getHostPort(): ?string { - return $this->hostIp; + return $this->hostPort; } - /** - * @param string $hostIp + * Host port number that the container's port is mapped to. + * + * @param string|null $hostPort * * @return self */ - public function setHostIp($hostIp = null) + public function setHostPort(?string $hostPort): self { - $this->hostIp = $hostIp; - + $this->initialized['hostPort'] = true; + $this->hostPort = $hostPort; return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/PortConfig.php b/generated/Model/PortConfig.php deleted file mode 100644 index bfe27b2f..00000000 --- a/generated/Model/PortConfig.php +++ /dev/null @@ -1,103 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getProtocol() - { - return $this->protocol; - } - - /** - * @param string $protocol - * - * @return self - */ - public function setProtocol($protocol = null) - { - $this->protocol = $protocol; - - return $this; - } - - /** - * @return int - */ - public function getTargetPort() - { - return $this->targetPort; - } - - /** - * @param int $targetPort - * - * @return self - */ - public function setTargetPort($targetPort = null) - { - $this->targetPort = $targetPort; - - return $this; - } - - /** - * @return int - */ - public function getPublishedPort() - { - return $this->publishedPort; - } - - /** - * @param int $publishedPort - * - * @return self - */ - public function setPublishedPort($publishedPort = null) - { - $this->publishedPort = $publishedPort; - - return $this; - } -} diff --git a/generated/Model/PortStatus.php b/generated/Model/PortStatus.php new file mode 100644 index 00000000..17c5a725 --- /dev/null +++ b/generated/Model/PortStatus.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * + * + * @var list|null + */ + protected $ports; + /** + * + * + * @return list|null + */ + public function getPorts(): ?array + { + return $this->ports; + } + /** + * + * + * @param list|null $ports + * + * @return self + */ + public function setPorts(?array $ports): self + { + $this->initialized['ports'] = true; + $this->ports = $ports; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ProcessConfig.php b/generated/Model/ProcessConfig.php index 9599d8b9..b80c21f7 100644 --- a/generated/Model/ProcessConfig.php +++ b/generated/Model/ProcessConfig.php @@ -5,123 +5,151 @@ class ProcessConfig { /** - * @var bool + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var bool|null */ protected $privileged; /** - * @var string + * + * + * @var string|null */ protected $user; /** - * @var bool + * + * + * @var bool|null */ protected $tty; /** - * @var string + * + * + * @var string|null */ protected $entrypoint; /** - * @var string[]|null + * + * + * @var list|null */ protected $arguments; - /** - * @return bool + * + * + * @return bool|null */ - public function getPrivileged() + public function getPrivileged(): ?bool { return $this->privileged; } - /** - * @param bool $privileged + * + * + * @param bool|null $privileged * * @return self */ - public function setPrivileged($privileged = null) + public function setPrivileged(?bool $privileged): self { + $this->initialized['privileged'] = true; $this->privileged = $privileged; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getUser() + public function getUser(): ?string { return $this->user; } - /** - * @param string $user + * + * + * @param string|null $user * * @return self */ - public function setUser($user = null) + public function setUser(?string $user): self { + $this->initialized['user'] = true; $this->user = $user; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getTty() + public function getTty(): ?bool { return $this->tty; } - /** - * @param bool $tty + * + * + * @param bool|null $tty * * @return self */ - public function setTty($tty = null) + public function setTty(?bool $tty): self { + $this->initialized['tty'] = true; $this->tty = $tty; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getEntrypoint() + public function getEntrypoint(): ?string { return $this->entrypoint; } - /** - * @param string $entrypoint + * + * + * @param string|null $entrypoint * * @return self */ - public function setEntrypoint($entrypoint = null) + public function setEntrypoint(?string $entrypoint): self { + $this->initialized['entrypoint'] = true; $this->entrypoint = $entrypoint; - return $this; } - /** - * @return string[]|null + * + * + * @return list|null */ - public function getArguments() + public function getArguments(): ?array { return $this->arguments; } - /** - * @param string[]|null $arguments + * + * + * @param list|null $arguments * * @return self */ - public function setArguments($arguments = null) + public function setArguments(?array $arguments): self { + $this->initialized['arguments'] = true; $this->arguments = $arguments; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/ProgressDetail.php b/generated/Model/ProgressDetail.php index 91ad6caa..416a169d 100644 --- a/generated/Model/ProgressDetail.php +++ b/generated/Model/ProgressDetail.php @@ -5,99 +5,67 @@ class ProgressDetail { /** - * @var int + * @var array */ - protected $code; - /** - * @var int - */ - protected $message; - /** - * @var int - */ - protected $current; - /** - * @var int - */ - protected $total; - - /** - * @return int - */ - public function getCode() + protected $initialized = []; + public function isInitialized($property): bool { - return $this->code; + return array_key_exists($property, $this->initialized); } - /** - * @param int $code + * * - * @return self - */ - public function setCode($code = null) - { - $this->code = $code; - - return $this; - } - - /** - * @return int + * @var int|null */ - public function getMessage() - { - return $this->message; - } - + protected $current; /** - * @param int $message + * * - * @return self + * @var int|null */ - public function setMessage($message = null) - { - $this->message = $message; - - return $this; - } - + protected $total; /** - * @return int + * + * + * @return int|null */ - public function getCurrent() + public function getCurrent(): ?int { return $this->current; } - /** - * @param int $current + * + * + * @param int|null $current * * @return self */ - public function setCurrent($current = null) + public function setCurrent(?int $current): self { + $this->initialized['current'] = true; $this->current = $current; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getTotal() + public function getTotal(): ?int { return $this->total; } - /** - * @param int $total + * + * + * @param int|null $total * * @return self */ - public function setTotal($total = null) + public function setTotal(?int $total): self { + $this->initialized['total'] = true; $this->total = $total; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/PushImageInfo.php b/generated/Model/PushImageInfo.php index 79d58b46..5b42d31d 100644 --- a/generated/Model/PushImageInfo.php +++ b/generated/Model/PushImageInfo.php @@ -5,99 +5,123 @@ class PushImageInfo { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var string|null */ protected $error; /** - * @var string + * + * + * @var string|null */ protected $status; /** - * @var string + * + * + * @var string|null */ protected $progress; /** - * @var ProgressDetail + * + * + * @var ProgressDetail|null */ protected $progressDetail; - /** - * @return string + * + * + * @return string|null */ - public function getError() + public function getError(): ?string { return $this->error; } - /** - * @param string $error + * + * + * @param string|null $error * * @return self */ - public function setError($error = null) + public function setError(?string $error): self { + $this->initialized['error'] = true; $this->error = $error; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getStatus() + public function getStatus(): ?string { return $this->status; } - /** - * @param string $status + * + * + * @param string|null $status * * @return self */ - public function setStatus($status = null) + public function setStatus(?string $status): self { + $this->initialized['status'] = true; $this->status = $status; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getProgress() + public function getProgress(): ?string { return $this->progress; } - /** - * @param string $progress + * + * + * @param string|null $progress * * @return self */ - public function setProgress($progress = null) + public function setProgress(?string $progress): self { + $this->initialized['progress'] = true; $this->progress = $progress; - return $this; } - /** - * @return ProgressDetail + * + * + * @return ProgressDetail|null */ - public function getProgressDetail() + public function getProgressDetail(): ?ProgressDetail { return $this->progressDetail; } - /** - * @param ProgressDetail $progressDetail + * + * + * @param ProgressDetail|null $progressDetail * * @return self */ - public function setProgressDetail(?ProgressDetail $progressDetail = null) + public function setProgressDetail(?ProgressDetail $progressDetail): self { + $this->initialized['progressDetail'] = true; $this->progressDetail = $progressDetail; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/Registry.php b/generated/Model/Registry.php deleted file mode 100644 index de557948..00000000 --- a/generated/Model/Registry.php +++ /dev/null @@ -1,103 +0,0 @@ -mirrors; - } - - /** - * @param string[]|null $mirrors - * - * @return self - */ - public function setMirrors($mirrors = null) - { - $this->mirrors = $mirrors; - - return $this; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } - - /** - * @return bool - */ - public function getOfficial() - { - return $this->official; - } - - /** - * @param bool $official - * - * @return self - */ - public function setOfficial($official = null) - { - $this->official = $official; - - return $this; - } - - /** - * @return bool - */ - public function getSecure() - { - return $this->secure; - } - - /** - * @param bool $secure - * - * @return self - */ - public function setSecure($secure = null) - { - $this->secure = $secure; - - return $this; - } -} diff --git a/generated/Model/RegistryConfig.php b/generated/Model/RegistryConfig.php deleted file mode 100644 index 40641123..00000000 --- a/generated/Model/RegistryConfig.php +++ /dev/null @@ -1,55 +0,0 @@ -indexConfigs; - } - - /** - * @param Registry[] $indexConfigs - * - * @return self - */ - public function setIndexConfigs(?\ArrayObject $indexConfigs = null) - { - $this->indexConfigs = $indexConfigs; - - return $this; - } - - /** - * @return string[]|null - */ - public function getInsecureRegistryCIDRs() - { - return $this->insecureRegistryCIDRs; - } - - /** - * @param string[]|null $insecureRegistryCIDRs - * - * @return self - */ - public function setInsecureRegistryCIDRs($insecureRegistryCIDRs = null) - { - $this->insecureRegistryCIDRs = $insecureRegistryCIDRs; - - return $this; - } -} diff --git a/generated/Model/RegistryServiceConfig.php b/generated/Model/RegistryServiceConfig.php new file mode 100644 index 00000000..d95150c4 --- /dev/null +++ b/generated/Model/RegistryServiceConfig.php @@ -0,0 +1,353 @@ +initialized); + } + /** + * List of IP ranges to which nondistributable artifacts can be pushed, + using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). + + Some images (for example, Windows base images) contain artifacts + whose distribution is restricted by license. When these images are + pushed to a registry, restricted artifacts are not included. + + This configuration override this behavior, and enables the daemon to + push nondistributable artifacts to all registries whose resolved IP + address is within the subnet described by the CIDR syntax. + + This option is useful when pushing images containing + nondistributable artifacts to a registry on an air-gapped network so + hosts on that network can pull the images without connecting to + another server. + + > **Warning**: Nondistributable artifacts typically have restrictions + > on how and where they can be distributed and shared. Only use this + > feature to push artifacts to private registries and ensure that you + > are in compliance with any terms that cover redistributing + > nondistributable artifacts. + + * + * @var list|null + */ + protected $allowNondistributableArtifactsCIDRs; + /** + * List of registry hostnames to which nondistributable artifacts can be + pushed, using the format `[:]` or `[:]`. + + Some images (for example, Windows base images) contain artifacts + whose distribution is restricted by license. When these images are + pushed to a registry, restricted artifacts are not included. + + This configuration override this behavior for the specified + registries. + + This option is useful when pushing images containing + nondistributable artifacts to a registry on an air-gapped network so + hosts on that network can pull the images without connecting to + another server. + + > **Warning**: Nondistributable artifacts typically have restrictions + > on how and where they can be distributed and shared. Only use this + > feature to push artifacts to private registries and ensure that you + > are in compliance with any terms that cover redistributing + > nondistributable artifacts. + + * + * @var list|null + */ + protected $allowNondistributableArtifactsHostnames; + /** + * List of IP ranges of insecure registries, using the CIDR syntax + ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + from unknown CAs) communication. + + By default, local registries (`127.0.0.0/8`) are configured as + insecure. All other registries are secure. Communicating with an + insecure registry is not possible if the daemon assumes that registry + is secure. + + This configuration override this behavior, insecure communication with + registries whose resolved IP address is within the subnet described by + the CIDR syntax. + + Registries can also be marked insecure by hostname. Those registries + are listed under `IndexConfigs` and have their `Secure` field set to + `false`. + + > **Warning**: Using this option can be useful when running a local + > registry, but introduces security vulnerabilities. This option + > should therefore ONLY be used for testing purposes. For increased + > security, users should add their CA to their system's list of trusted + > CAs instead of enabling this option. + + * + * @var list|null + */ + protected $insecureRegistryCIDRs; + /** + * + * + * @var array|null + */ + protected $indexConfigs; + /** + * List of registry URLs that act as a mirror for the official + (`docker.io`) registry. + + * + * @var list|null + */ + protected $mirrors; + /** + * List of IP ranges to which nondistributable artifacts can be pushed, + using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). + + Some images (for example, Windows base images) contain artifacts + whose distribution is restricted by license. When these images are + pushed to a registry, restricted artifacts are not included. + + This configuration override this behavior, and enables the daemon to + push nondistributable artifacts to all registries whose resolved IP + address is within the subnet described by the CIDR syntax. + + This option is useful when pushing images containing + nondistributable artifacts to a registry on an air-gapped network so + hosts on that network can pull the images without connecting to + another server. + + > **Warning**: Nondistributable artifacts typically have restrictions + > on how and where they can be distributed and shared. Only use this + > feature to push artifacts to private registries and ensure that you + > are in compliance with any terms that cover redistributing + > nondistributable artifacts. + + * + * @return list|null + */ + public function getAllowNondistributableArtifactsCIDRs(): ?array + { + return $this->allowNondistributableArtifactsCIDRs; + } + /** + * List of IP ranges to which nondistributable artifacts can be pushed, + using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). + + Some images (for example, Windows base images) contain artifacts + whose distribution is restricted by license. When these images are + pushed to a registry, restricted artifacts are not included. + + This configuration override this behavior, and enables the daemon to + push nondistributable artifacts to all registries whose resolved IP + address is within the subnet described by the CIDR syntax. + + This option is useful when pushing images containing + nondistributable artifacts to a registry on an air-gapped network so + hosts on that network can pull the images without connecting to + another server. + + > **Warning**: Nondistributable artifacts typically have restrictions + > on how and where they can be distributed and shared. Only use this + > feature to push artifacts to private registries and ensure that you + > are in compliance with any terms that cover redistributing + > nondistributable artifacts. + + * + * @param list|null $allowNondistributableArtifactsCIDRs + * + * @return self + */ + public function setAllowNondistributableArtifactsCIDRs(?array $allowNondistributableArtifactsCIDRs): self + { + $this->initialized['allowNondistributableArtifactsCIDRs'] = true; + $this->allowNondistributableArtifactsCIDRs = $allowNondistributableArtifactsCIDRs; + return $this; + } + /** + * List of registry hostnames to which nondistributable artifacts can be + pushed, using the format `[:]` or `[:]`. + + Some images (for example, Windows base images) contain artifacts + whose distribution is restricted by license. When these images are + pushed to a registry, restricted artifacts are not included. + + This configuration override this behavior for the specified + registries. + + This option is useful when pushing images containing + nondistributable artifacts to a registry on an air-gapped network so + hosts on that network can pull the images without connecting to + another server. + + > **Warning**: Nondistributable artifacts typically have restrictions + > on how and where they can be distributed and shared. Only use this + > feature to push artifacts to private registries and ensure that you + > are in compliance with any terms that cover redistributing + > nondistributable artifacts. + + * + * @return list|null + */ + public function getAllowNondistributableArtifactsHostnames(): ?array + { + return $this->allowNondistributableArtifactsHostnames; + } + /** + * List of registry hostnames to which nondistributable artifacts can be + pushed, using the format `[:]` or `[:]`. + + Some images (for example, Windows base images) contain artifacts + whose distribution is restricted by license. When these images are + pushed to a registry, restricted artifacts are not included. + + This configuration override this behavior for the specified + registries. + + This option is useful when pushing images containing + nondistributable artifacts to a registry on an air-gapped network so + hosts on that network can pull the images without connecting to + another server. + + > **Warning**: Nondistributable artifacts typically have restrictions + > on how and where they can be distributed and shared. Only use this + > feature to push artifacts to private registries and ensure that you + > are in compliance with any terms that cover redistributing + > nondistributable artifacts. + + * + * @param list|null $allowNondistributableArtifactsHostnames + * + * @return self + */ + public function setAllowNondistributableArtifactsHostnames(?array $allowNondistributableArtifactsHostnames): self + { + $this->initialized['allowNondistributableArtifactsHostnames'] = true; + $this->allowNondistributableArtifactsHostnames = $allowNondistributableArtifactsHostnames; + return $this; + } + /** + * List of IP ranges of insecure registries, using the CIDR syntax + ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + from unknown CAs) communication. + + By default, local registries (`127.0.0.0/8`) are configured as + insecure. All other registries are secure. Communicating with an + insecure registry is not possible if the daemon assumes that registry + is secure. + + This configuration override this behavior, insecure communication with + registries whose resolved IP address is within the subnet described by + the CIDR syntax. + + Registries can also be marked insecure by hostname. Those registries + are listed under `IndexConfigs` and have their `Secure` field set to + `false`. + + > **Warning**: Using this option can be useful when running a local + > registry, but introduces security vulnerabilities. This option + > should therefore ONLY be used for testing purposes. For increased + > security, users should add their CA to their system's list of trusted + > CAs instead of enabling this option. + + * + * @return list|null + */ + public function getInsecureRegistryCIDRs(): ?array + { + return $this->insecureRegistryCIDRs; + } + /** + * List of IP ranges of insecure registries, using the CIDR syntax + ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + from unknown CAs) communication. + + By default, local registries (`127.0.0.0/8`) are configured as + insecure. All other registries are secure. Communicating with an + insecure registry is not possible if the daemon assumes that registry + is secure. + + This configuration override this behavior, insecure communication with + registries whose resolved IP address is within the subnet described by + the CIDR syntax. + + Registries can also be marked insecure by hostname. Those registries + are listed under `IndexConfigs` and have their `Secure` field set to + `false`. + + > **Warning**: Using this option can be useful when running a local + > registry, but introduces security vulnerabilities. This option + > should therefore ONLY be used for testing purposes. For increased + > security, users should add their CA to their system's list of trusted + > CAs instead of enabling this option. + + * + * @param list|null $insecureRegistryCIDRs + * + * @return self + */ + public function setInsecureRegistryCIDRs(?array $insecureRegistryCIDRs): self + { + $this->initialized['insecureRegistryCIDRs'] = true; + $this->insecureRegistryCIDRs = $insecureRegistryCIDRs; + return $this; + } + /** + * + * + * @return array|null + */ + public function getIndexConfigs(): ?iterable + { + return $this->indexConfigs; + } + /** + * + * + * @param array|null $indexConfigs + * + * @return self + */ + public function setIndexConfigs(?iterable $indexConfigs): self + { + $this->initialized['indexConfigs'] = true; + $this->indexConfigs = $indexConfigs; + return $this; + } + /** + * List of registry URLs that act as a mirror for the official + (`docker.io`) registry. + + * + * @return list|null + */ + public function getMirrors(): ?array + { + return $this->mirrors; + } + /** + * List of registry URLs that act as a mirror for the official + (`docker.io`) registry. + + * + * @param list|null $mirrors + * + * @return self + */ + public function setMirrors(?array $mirrors): self + { + $this->initialized['mirrors'] = true; + $this->mirrors = $mirrors; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ReplicatedService.php b/generated/Model/ReplicatedService.php deleted file mode 100644 index ece65d0f..00000000 --- a/generated/Model/ReplicatedService.php +++ /dev/null @@ -1,31 +0,0 @@ -replicas; - } - - /** - * @param int $replicas - * - * @return self - */ - public function setReplicas($replicas = null) - { - $this->replicas = $replicas; - - return $this; - } -} diff --git a/generated/Model/ResourceObject.php b/generated/Model/ResourceObject.php new file mode 100644 index 00000000..2af2622a --- /dev/null +++ b/generated/Model/ResourceObject.php @@ -0,0 +1,105 @@ +initialized); + } + /** + * + * + * @var int|null + */ + protected $nanoCPUs; + /** + * + * + * @var int|null + */ + protected $memoryBytes; + /** + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @var list|null + */ + protected $genericResources; + /** + * + * + * @return int|null + */ + public function getNanoCPUs(): ?int + { + return $this->nanoCPUs; + } + /** + * + * + * @param int|null $nanoCPUs + * + * @return self + */ + public function setNanoCPUs(?int $nanoCPUs): self + { + $this->initialized['nanoCPUs'] = true; + $this->nanoCPUs = $nanoCPUs; + return $this; + } + /** + * + * + * @return int|null + */ + public function getMemoryBytes(): ?int + { + return $this->memoryBytes; + } + /** + * + * + * @param int|null $memoryBytes + * + * @return self + */ + public function setMemoryBytes(?int $memoryBytes): self + { + $this->initialized['memoryBytes'] = true; + $this->memoryBytes = $memoryBytes; + return $this; + } + /** + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @return list|null + */ + public function getGenericResources(): ?array + { + return $this->genericResources; + } + /** + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @param list|null $genericResources + * + * @return self + */ + public function setGenericResources(?array $genericResources): self + { + $this->initialized['genericResources'] = true; + $this->genericResources = $genericResources; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ResourceUpdate.php b/generated/Model/ResourceUpdate.php deleted file mode 100644 index b5feacc1..00000000 --- a/generated/Model/ResourceUpdate.php +++ /dev/null @@ -1,271 +0,0 @@ -blkioWeight; - } - - /** - * @param int $blkioWeight - * - * @return self - */ - public function setBlkioWeight($blkioWeight = null) - { - $this->blkioWeight = $blkioWeight; - - return $this; - } - - /** - * @return int - */ - public function getCpuShares() - { - return $this->cpuShares; - } - - /** - * @param int $cpuShares - * - * @return self - */ - public function setCpuShares($cpuShares = null) - { - $this->cpuShares = $cpuShares; - - return $this; - } - - /** - * @return int - */ - public function getCpuPeriod() - { - return $this->cpuPeriod; - } - - /** - * @param int $cpuPeriod - * - * @return self - */ - public function setCpuPeriod($cpuPeriod = null) - { - $this->cpuPeriod = $cpuPeriod; - - return $this; - } - - /** - * @return int - */ - public function getCpuQuota() - { - return $this->cpuQuota; - } - - /** - * @param int $cpuQuota - * - * @return self - */ - public function setCpuQuota($cpuQuota = null) - { - $this->cpuQuota = $cpuQuota; - - return $this; - } - - /** - * @return string - */ - public function getCpusetCpus() - { - return $this->cpusetCpus; - } - - /** - * @param string $cpusetCpus - * - * @return self - */ - public function setCpusetCpus($cpusetCpus = null) - { - $this->cpusetCpus = $cpusetCpus; - - return $this; - } - - /** - * @return string - */ - public function getCpusetMems() - { - return $this->cpusetMems; - } - - /** - * @param string $cpusetMems - * - * @return self - */ - public function setCpusetMems($cpusetMems = null) - { - $this->cpusetMems = $cpusetMems; - - return $this; - } - - /** - * @return int - */ - public function getMemory() - { - return $this->memory; - } - - /** - * @param int $memory - * - * @return self - */ - public function setMemory($memory = null) - { - $this->memory = $memory; - - return $this; - } - - /** - * @return int - */ - public function getMemorySwap() - { - return $this->memorySwap; - } - - /** - * @param int $memorySwap - * - * @return self - */ - public function setMemorySwap($memorySwap = null) - { - $this->memorySwap = $memorySwap; - - return $this; - } - - /** - * @return int - */ - public function getMemoryReservation() - { - return $this->memoryReservation; - } - - /** - * @param int $memoryReservation - * - * @return self - */ - public function setMemoryReservation($memoryReservation = null) - { - $this->memoryReservation = $memoryReservation; - - return $this; - } - - /** - * @return int - */ - public function getKernelMemory() - { - return $this->kernelMemory; - } - - /** - * @param int $kernelMemory - * - * @return self - */ - public function setKernelMemory($kernelMemory = null) - { - $this->kernelMemory = $kernelMemory; - - return $this; - } - - /** - * @return RestartPolicy - */ - public function getRestartPolicy() - { - return $this->restartPolicy; - } - - /** - * @param RestartPolicy $restartPolicy - * - * @return self - */ - public function setRestartPolicy(?RestartPolicy $restartPolicy = null) - { - $this->restartPolicy = $restartPolicy; - - return $this; - } -} diff --git a/generated/Model/Resources.php b/generated/Model/Resources.php new file mode 100644 index 00000000..9ee9e887 --- /dev/null +++ b/generated/Model/Resources.php @@ -0,0 +1,1087 @@ +initialized); + } + /** + * An integer value representing this container's relative CPU weight + versus other containers. + + * + * @var int|null + */ + protected $cpuShares; + /** + * Memory limit in bytes. + * + * @var int|null + */ + protected $memory = 0; + /** + * Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + + * + * @var string|null + */ + protected $cgroupParent; + /** + * Block IO weight (relative weight). + * + * @var int|null + */ + protected $blkioWeight; + /** + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @var list|null + */ + protected $blkioWeightDevice; + /** + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var list|null + */ + protected $blkioDeviceReadBps; + /** + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var list|null + */ + protected $blkioDeviceWriteBps; + /** + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var list|null + */ + protected $blkioDeviceReadIOps; + /** + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var list|null + */ + protected $blkioDeviceWriteIOps; + /** + * The length of a CPU period in microseconds. + * + * @var int|null + */ + protected $cpuPeriod; + /** + * Microseconds of CPU time that the container can get in a CPU period. + * + * @var int|null + */ + protected $cpuQuota; + /** + * The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @var int|null + */ + protected $cpuRealtimePeriod; + /** + * The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @var int|null + */ + protected $cpuRealtimeRuntime; + /** + * CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * + * @var string|null + */ + protected $cpusetCpus; + /** + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + + * + * @var string|null + */ + protected $cpusetMems; + /** + * A list of devices to add to the container. + * + * @var list|null + */ + protected $devices; + /** + * a list of cgroup rules to apply to the container + * + * @var list|null + */ + protected $deviceCgroupRules; + /** + * A list of requests for devices to be sent to device drivers. + * + * @var list|null + */ + protected $deviceRequests; + /** + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + + * + * @var int|null + */ + protected $kernelMemoryTCP; + /** + * Memory soft limit in bytes. + * + * @var int|null + */ + protected $memoryReservation; + /** + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + + * + * @var int|null + */ + protected $memorySwap; + /** + * Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + + * + * @var int|null + */ + protected $memorySwappiness; + /** + * CPU quota in units of 10-9 CPUs. + * + * @var int|null + */ + protected $nanoCpus; + /** + * Disable OOM Killer for the container. + * + * @var bool|null + */ + protected $oomKillDisable; + /** + * Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + + * + * @var bool|null + */ + protected $init; + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + + * + * @var int|null + */ + protected $pidsLimit; + /** + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @var list|null + */ + protected $ulimits; + /** + * The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @var int|null + */ + protected $cpuCount; + /** + * The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @var int|null + */ + protected $cpuPercent; + /** + * Maximum IOps for the container system drive (Windows only) + * + * @var int|null + */ + protected $iOMaximumIOps; + /** + * Maximum IO in bytes per second for the container system drive + (Windows only). + + * + * @var int|null + */ + protected $iOMaximumBandwidth; + /** + * An integer value representing this container's relative CPU weight + versus other containers. + + * + * @return int|null + */ + public function getCpuShares(): ?int + { + return $this->cpuShares; + } + /** + * An integer value representing this container's relative CPU weight + versus other containers. + + * + * @param int|null $cpuShares + * + * @return self + */ + public function setCpuShares(?int $cpuShares): self + { + $this->initialized['cpuShares'] = true; + $this->cpuShares = $cpuShares; + return $this; + } + /** + * Memory limit in bytes. + * + * @return int|null + */ + public function getMemory(): ?int + { + return $this->memory; + } + /** + * Memory limit in bytes. + * + * @param int|null $memory + * + * @return self + */ + public function setMemory(?int $memory): self + { + $this->initialized['memory'] = true; + $this->memory = $memory; + return $this; + } + /** + * Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + + * + * @return string|null + */ + public function getCgroupParent(): ?string + { + return $this->cgroupParent; + } + /** + * Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + + * + * @param string|null $cgroupParent + * + * @return self + */ + public function setCgroupParent(?string $cgroupParent): self + { + $this->initialized['cgroupParent'] = true; + $this->cgroupParent = $cgroupParent; + return $this; + } + /** + * Block IO weight (relative weight). + * + * @return int|null + */ + public function getBlkioWeight(): ?int + { + return $this->blkioWeight; + } + /** + * Block IO weight (relative weight). + * + * @param int|null $blkioWeight + * + * @return self + */ + public function setBlkioWeight(?int $blkioWeight): self + { + $this->initialized['blkioWeight'] = true; + $this->blkioWeight = $blkioWeight; + return $this; + } + /** + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @return list|null + */ + public function getBlkioWeightDevice(): ?array + { + return $this->blkioWeightDevice; + } + /** + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @param list|null $blkioWeightDevice + * + * @return self + */ + public function setBlkioWeightDevice(?array $blkioWeightDevice): self + { + $this->initialized['blkioWeightDevice'] = true; + $this->blkioWeightDevice = $blkioWeightDevice; + return $this; + } + /** + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return list|null + */ + public function getBlkioDeviceReadBps(): ?array + { + return $this->blkioDeviceReadBps; + } + /** + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param list|null $blkioDeviceReadBps + * + * @return self + */ + public function setBlkioDeviceReadBps(?array $blkioDeviceReadBps): self + { + $this->initialized['blkioDeviceReadBps'] = true; + $this->blkioDeviceReadBps = $blkioDeviceReadBps; + return $this; + } + /** + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return list|null + */ + public function getBlkioDeviceWriteBps(): ?array + { + return $this->blkioDeviceWriteBps; + } + /** + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param list|null $blkioDeviceWriteBps + * + * @return self + */ + public function setBlkioDeviceWriteBps(?array $blkioDeviceWriteBps): self + { + $this->initialized['blkioDeviceWriteBps'] = true; + $this->blkioDeviceWriteBps = $blkioDeviceWriteBps; + return $this; + } + /** + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return list|null + */ + public function getBlkioDeviceReadIOps(): ?array + { + return $this->blkioDeviceReadIOps; + } + /** + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param list|null $blkioDeviceReadIOps + * + * @return self + */ + public function setBlkioDeviceReadIOps(?array $blkioDeviceReadIOps): self + { + $this->initialized['blkioDeviceReadIOps'] = true; + $this->blkioDeviceReadIOps = $blkioDeviceReadIOps; + return $this; + } + /** + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return list|null + */ + public function getBlkioDeviceWriteIOps(): ?array + { + return $this->blkioDeviceWriteIOps; + } + /** + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param list|null $blkioDeviceWriteIOps + * + * @return self + */ + public function setBlkioDeviceWriteIOps(?array $blkioDeviceWriteIOps): self + { + $this->initialized['blkioDeviceWriteIOps'] = true; + $this->blkioDeviceWriteIOps = $blkioDeviceWriteIOps; + return $this; + } + /** + * The length of a CPU period in microseconds. + * + * @return int|null + */ + public function getCpuPeriod(): ?int + { + return $this->cpuPeriod; + } + /** + * The length of a CPU period in microseconds. + * + * @param int|null $cpuPeriod + * + * @return self + */ + public function setCpuPeriod(?int $cpuPeriod): self + { + $this->initialized['cpuPeriod'] = true; + $this->cpuPeriod = $cpuPeriod; + return $this; + } + /** + * Microseconds of CPU time that the container can get in a CPU period. + * + * @return int|null + */ + public function getCpuQuota(): ?int + { + return $this->cpuQuota; + } + /** + * Microseconds of CPU time that the container can get in a CPU period. + * + * @param int|null $cpuQuota + * + * @return self + */ + public function setCpuQuota(?int $cpuQuota): self + { + $this->initialized['cpuQuota'] = true; + $this->cpuQuota = $cpuQuota; + return $this; + } + /** + * The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @return int|null + */ + public function getCpuRealtimePeriod(): ?int + { + return $this->cpuRealtimePeriod; + } + /** + * The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @param int|null $cpuRealtimePeriod + * + * @return self + */ + public function setCpuRealtimePeriod(?int $cpuRealtimePeriod): self + { + $this->initialized['cpuRealtimePeriod'] = true; + $this->cpuRealtimePeriod = $cpuRealtimePeriod; + return $this; + } + /** + * The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @return int|null + */ + public function getCpuRealtimeRuntime(): ?int + { + return $this->cpuRealtimeRuntime; + } + /** + * The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + + * + * @param int|null $cpuRealtimeRuntime + * + * @return self + */ + public function setCpuRealtimeRuntime(?int $cpuRealtimeRuntime): self + { + $this->initialized['cpuRealtimeRuntime'] = true; + $this->cpuRealtimeRuntime = $cpuRealtimeRuntime; + return $this; + } + /** + * CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * + * @return string|null + */ + public function getCpusetCpus(): ?string + { + return $this->cpusetCpus; + } + /** + * CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * + * @param string|null $cpusetCpus + * + * @return self + */ + public function setCpusetCpus(?string $cpusetCpus): self + { + $this->initialized['cpusetCpus'] = true; + $this->cpusetCpus = $cpusetCpus; + return $this; + } + /** + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + + * + * @return string|null + */ + public function getCpusetMems(): ?string + { + return $this->cpusetMems; + } + /** + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + + * + * @param string|null $cpusetMems + * + * @return self + */ + public function setCpusetMems(?string $cpusetMems): self + { + $this->initialized['cpusetMems'] = true; + $this->cpusetMems = $cpusetMems; + return $this; + } + /** + * A list of devices to add to the container. + * + * @return list|null + */ + public function getDevices(): ?array + { + return $this->devices; + } + /** + * A list of devices to add to the container. + * + * @param list|null $devices + * + * @return self + */ + public function setDevices(?array $devices): self + { + $this->initialized['devices'] = true; + $this->devices = $devices; + return $this; + } + /** + * a list of cgroup rules to apply to the container + * + * @return list|null + */ + public function getDeviceCgroupRules(): ?array + { + return $this->deviceCgroupRules; + } + /** + * a list of cgroup rules to apply to the container + * + * @param list|null $deviceCgroupRules + * + * @return self + */ + public function setDeviceCgroupRules(?array $deviceCgroupRules): self + { + $this->initialized['deviceCgroupRules'] = true; + $this->deviceCgroupRules = $deviceCgroupRules; + return $this; + } + /** + * A list of requests for devices to be sent to device drivers. + * + * @return list|null + */ + public function getDeviceRequests(): ?array + { + return $this->deviceRequests; + } + /** + * A list of requests for devices to be sent to device drivers. + * + * @param list|null $deviceRequests + * + * @return self + */ + public function setDeviceRequests(?array $deviceRequests): self + { + $this->initialized['deviceRequests'] = true; + $this->deviceRequests = $deviceRequests; + return $this; + } + /** + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + + * + * @return int|null + */ + public function getKernelMemoryTCP(): ?int + { + return $this->kernelMemoryTCP; + } + /** + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + + * + * @param int|null $kernelMemoryTCP + * + * @return self + */ + public function setKernelMemoryTCP(?int $kernelMemoryTCP): self + { + $this->initialized['kernelMemoryTCP'] = true; + $this->kernelMemoryTCP = $kernelMemoryTCP; + return $this; + } + /** + * Memory soft limit in bytes. + * + * @return int|null + */ + public function getMemoryReservation(): ?int + { + return $this->memoryReservation; + } + /** + * Memory soft limit in bytes. + * + * @param int|null $memoryReservation + * + * @return self + */ + public function setMemoryReservation(?int $memoryReservation): self + { + $this->initialized['memoryReservation'] = true; + $this->memoryReservation = $memoryReservation; + return $this; + } + /** + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + + * + * @return int|null + */ + public function getMemorySwap(): ?int + { + return $this->memorySwap; + } + /** + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + + * + * @param int|null $memorySwap + * + * @return self + */ + public function setMemorySwap(?int $memorySwap): self + { + $this->initialized['memorySwap'] = true; + $this->memorySwap = $memorySwap; + return $this; + } + /** + * Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + + * + * @return int|null + */ + public function getMemorySwappiness(): ?int + { + return $this->memorySwappiness; + } + /** + * Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + + * + * @param int|null $memorySwappiness + * + * @return self + */ + public function setMemorySwappiness(?int $memorySwappiness): self + { + $this->initialized['memorySwappiness'] = true; + $this->memorySwappiness = $memorySwappiness; + return $this; + } + /** + * CPU quota in units of 10-9 CPUs. + * + * @return int|null + */ + public function getNanoCpus(): ?int + { + return $this->nanoCpus; + } + /** + * CPU quota in units of 10-9 CPUs. + * + * @param int|null $nanoCpus + * + * @return self + */ + public function setNanoCpus(?int $nanoCpus): self + { + $this->initialized['nanoCpus'] = true; + $this->nanoCpus = $nanoCpus; + return $this; + } + /** + * Disable OOM Killer for the container. + * + * @return bool|null + */ + public function getOomKillDisable(): ?bool + { + return $this->oomKillDisable; + } + /** + * Disable OOM Killer for the container. + * + * @param bool|null $oomKillDisable + * + * @return self + */ + public function setOomKillDisable(?bool $oomKillDisable): self + { + $this->initialized['oomKillDisable'] = true; + $this->oomKillDisable = $oomKillDisable; + return $this; + } + /** + * Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + + * + * @return bool|null + */ + public function getInit(): ?bool + { + return $this->init; + } + /** + * Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + + * + * @param bool|null $init + * + * @return self + */ + public function setInit(?bool $init): self + { + $this->initialized['init'] = true; + $this->init = $init; + return $this; + } + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + + * + * @return int|null + */ + public function getPidsLimit(): ?int + { + return $this->pidsLimit; + } + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + + * + * @param int|null $pidsLimit + * + * @return self + */ + public function setPidsLimit(?int $pidsLimit): self + { + $this->initialized['pidsLimit'] = true; + $this->pidsLimit = $pidsLimit; + return $this; + } + /** + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @return list|null + */ + public function getUlimits(): ?array + { + return $this->ulimits; + } + /** + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @param list|null $ulimits + * + * @return self + */ + public function setUlimits(?array $ulimits): self + { + $this->initialized['ulimits'] = true; + $this->ulimits = $ulimits; + return $this; + } + /** + * The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @return int|null + */ + public function getCpuCount(): ?int + { + return $this->cpuCount; + } + /** + * The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @param int|null $cpuCount + * + * @return self + */ + public function setCpuCount(?int $cpuCount): self + { + $this->initialized['cpuCount'] = true; + $this->cpuCount = $cpuCount; + return $this; + } + /** + * The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @return int|null + */ + public function getCpuPercent(): ?int + { + return $this->cpuPercent; + } + /** + * The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + + * + * @param int|null $cpuPercent + * + * @return self + */ + public function setCpuPercent(?int $cpuPercent): self + { + $this->initialized['cpuPercent'] = true; + $this->cpuPercent = $cpuPercent; + return $this; + } + /** + * Maximum IOps for the container system drive (Windows only) + * + * @return int|null + */ + public function getIOMaximumIOps(): ?int + { + return $this->iOMaximumIOps; + } + /** + * Maximum IOps for the container system drive (Windows only) + * + * @param int|null $iOMaximumIOps + * + * @return self + */ + public function setIOMaximumIOps(?int $iOMaximumIOps): self + { + $this->initialized['iOMaximumIOps'] = true; + $this->iOMaximumIOps = $iOMaximumIOps; + return $this; + } + /** + * Maximum IO in bytes per second for the container system drive + (Windows only). + + * + * @return int|null + */ + public function getIOMaximumBandwidth(): ?int + { + return $this->iOMaximumBandwidth; + } + /** + * Maximum IO in bytes per second for the container system drive + (Windows only). + + * + * @param int|null $iOMaximumBandwidth + * + * @return self + */ + public function setIOMaximumBandwidth(?int $iOMaximumBandwidth): self + { + $this->initialized['iOMaximumBandwidth'] = true; + $this->iOMaximumBandwidth = $iOMaximumBandwidth; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ResourcesBlkioWeightDeviceItem.php b/generated/Model/ResourcesBlkioWeightDeviceItem.php new file mode 100644 index 00000000..1947dbbb --- /dev/null +++ b/generated/Model/ResourcesBlkioWeightDeviceItem.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $path; + /** + * + * + * @var int|null + */ + protected $weight; + /** + * + * + * @return string|null + */ + public function getPath(): ?string + { + return $this->path; + } + /** + * + * + * @param string|null $path + * + * @return self + */ + public function setPath(?string $path): self + { + $this->initialized['path'] = true; + $this->path = $path; + return $this; + } + /** + * + * + * @return int|null + */ + public function getWeight(): ?int + { + return $this->weight; + } + /** + * + * + * @param int|null $weight + * + * @return self + */ + public function setWeight(?int $weight): self + { + $this->initialized['weight'] = true; + $this->weight = $weight; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ResourcesUlimitsItem.php b/generated/Model/ResourcesUlimitsItem.php new file mode 100644 index 00000000..d74e0128 --- /dev/null +++ b/generated/Model/ResourcesUlimitsItem.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * Name of ulimit + * + * @var string|null + */ + protected $name; + /** + * Soft limit + * + * @var int|null + */ + protected $soft; + /** + * Hard limit + * + * @var int|null + */ + protected $hard; + /** + * Name of ulimit + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Name of ulimit + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * Soft limit + * + * @return int|null + */ + public function getSoft(): ?int + { + return $this->soft; + } + /** + * Soft limit + * + * @param int|null $soft + * + * @return self + */ + public function setSoft(?int $soft): self + { + $this->initialized['soft'] = true; + $this->soft = $soft; + return $this; + } + /** + * Hard limit + * + * @return int|null + */ + public function getHard(): ?int + { + return $this->hard; + } + /** + * Hard limit + * + * @param int|null $hard + * + * @return self + */ + public function setHard(?int $hard): self + { + $this->initialized['hard'] = true; + $this->hard = $hard; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/RestartPolicy.php b/generated/Model/RestartPolicy.php index 34a64ee7..0588717c 100644 --- a/generated/Model/RestartPolicy.php +++ b/generated/Model/RestartPolicy.php @@ -5,51 +5,82 @@ class RestartPolicy { /** - * @var string + * @var array */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * - Empty string means not to restart + - `no` Do not automatically restart + - `always` Always restart + - `unless-stopped` Restart always except when the user has manually stopped the container + - `on-failure` Restart only when the container exit code is non-zero + + * + * @var string|null + */ protected $name; /** - * @var int + * If `on-failure` is used, the number of times to retry before giving up. + * + * @var int|null */ protected $maximumRetryCount; - /** - * @return string - */ - public function getName() + * - Empty string means not to restart + - `no` Do not automatically restart + - `always` Always restart + - `unless-stopped` Restart always except when the user has manually stopped the container + - `on-failure` Restart only when the container exit code is non-zero + + * + * @return string|null + */ + public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) + * - Empty string means not to restart + - `no` Do not automatically restart + - `always` Always restart + - `unless-stopped` Restart always except when the user has manually stopped the container + - `on-failure` Restart only when the container exit code is non-zero + + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return int + * If `on-failure` is used, the number of times to retry before giving up. + * + * @return int|null */ - public function getMaximumRetryCount() + public function getMaximumRetryCount(): ?int { return $this->maximumRetryCount; } - /** - * @param int $maximumRetryCount + * If `on-failure` is used, the number of times to retry before giving up. + * + * @param int|null $maximumRetryCount * * @return self */ - public function setMaximumRetryCount($maximumRetryCount = null) + public function setMaximumRetryCount(?int $maximumRetryCount): self { + $this->initialized['maximumRetryCount'] = true; $this->maximumRetryCount = $maximumRetryCount; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/Runtime.php b/generated/Model/Runtime.php new file mode 100644 index 00000000..ac2d66b8 --- /dev/null +++ b/generated/Model/Runtime.php @@ -0,0 +1,153 @@ +initialized); + } + /** + * Name and, optional, path, of the OCI executable binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + + * + * @var string|null + */ + protected $path; + /** + * List of command-line arguments to pass to the runtime when invoked. + * + * @var list|null + */ + protected $runtimeArgs; + /** + * Information specific to the runtime. + + While this API specification does not define data provided by runtimes, + the following well-known properties may be provided by runtimes: + + `org.opencontainers.runtime-spec.features`: features structure as defined + in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + in a JSON string representation. + +


+ + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + + * + * @var array|null + */ + protected $status; + /** + * Name and, optional, path, of the OCI executable binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + + * + * @return string|null + */ + public function getPath(): ?string + { + return $this->path; + } + /** + * Name and, optional, path, of the OCI executable binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + + * + * @param string|null $path + * + * @return self + */ + public function setPath(?string $path): self + { + $this->initialized['path'] = true; + $this->path = $path; + return $this; + } + /** + * List of command-line arguments to pass to the runtime when invoked. + * + * @return list|null + */ + public function getRuntimeArgs(): ?array + { + return $this->runtimeArgs; + } + /** + * List of command-line arguments to pass to the runtime when invoked. + * + * @param list|null $runtimeArgs + * + * @return self + */ + public function setRuntimeArgs(?array $runtimeArgs): self + { + $this->initialized['runtimeArgs'] = true; + $this->runtimeArgs = $runtimeArgs; + return $this; + } + /** + * Information specific to the runtime. + + While this API specification does not define data provided by runtimes, + the following well-known properties may be provided by runtimes: + + `org.opencontainers.runtime-spec.features`: features structure as defined + in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + in a JSON string representation. + +


+ + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + + * + * @return array|null + */ + public function getStatus(): ?iterable + { + return $this->status; + } + /** + * Information specific to the runtime. + + While this API specification does not define data provided by runtimes, + the following well-known properties may be provided by runtimes: + + `org.opencontainers.runtime-spec.features`: features structure as defined + in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + in a JSON string representation. + +


+ + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + + * + * @param array|null $status + * + * @return self + */ + public function setStatus(?iterable $status): self + { + $this->initialized['status'] = true; + $this->status = $status; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Secret.php b/generated/Model/Secret.php new file mode 100644 index 00000000..1d1775f3 --- /dev/null +++ b/generated/Model/Secret.php @@ -0,0 +1,185 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $iD; + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @var ObjectVersion|null + */ + protected $version; + /** + * + * + * @var string|null + */ + protected $createdAt; + /** + * + * + * @var string|null + */ + protected $updatedAt; + /** + * + * + * @var SecretSpec|null + */ + protected $spec; + /** + * + * + * @return string|null + */ + public function getID(): ?string + { + return $this->iD; + } + /** + * + * + * @param string|null $iD + * + * @return self + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @return ObjectVersion|null + */ + public function getVersion(): ?ObjectVersion + { + return $this->version; + } + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @param ObjectVersion|null $version + * + * @return self + */ + public function setVersion(?ObjectVersion $version): self + { + $this->initialized['version'] = true; + $this->version = $version; + return $this; + } + /** + * + * + * @return string|null + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + /** + * + * + * @param string|null $createdAt + * + * @return self + */ + public function setCreatedAt(?string $createdAt): self + { + $this->initialized['createdAt'] = true; + $this->createdAt = $createdAt; + return $this; + } + /** + * + * + * @return string|null + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + /** + * + * + * @param string|null $updatedAt + * + * @return self + */ + public function setUpdatedAt(?string $updatedAt): self + { + $this->initialized['updatedAt'] = true; + $this->updatedAt = $updatedAt; + return $this; + } + /** + * + * + * @return SecretSpec|null + */ + public function getSpec(): ?SecretSpec + { + return $this->spec; + } + /** + * + * + * @param SecretSpec|null $spec + * + * @return self + */ + public function setSpec(?SecretSpec $spec): self + { + $this->initialized['spec'] = true; + $this->spec = $spec; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SecretSpec.php b/generated/Model/SecretSpec.php new file mode 100644 index 00000000..46475768 --- /dev/null +++ b/generated/Model/SecretSpec.php @@ -0,0 +1,170 @@ +initialized); + } + /** + * User-defined name of the secret. + * + * @var string|null + */ + protected $name; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + data to store as secret. + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + + * + * @var string|null + */ + protected $data; + /** + * Driver represents a driver (network, logging, secrets). + * + * @var Driver|null + */ + protected $driver; + /** + * Driver represents a driver (network, logging, secrets). + * + * @var Driver|null + */ + protected $templating; + /** + * User-defined name of the secret. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * User-defined name of the secret. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + data to store as secret. + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + + * + * @return string|null + */ + public function getData(): ?string + { + return $this->data; + } + /** + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + data to store as secret. + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + + * + * @param string|null $data + * + * @return self + */ + public function setData(?string $data): self + { + $this->initialized['data'] = true; + $this->data = $data; + return $this; + } + /** + * Driver represents a driver (network, logging, secrets). + * + * @return Driver|null + */ + public function getDriver(): ?Driver + { + return $this->driver; + } + /** + * Driver represents a driver (network, logging, secrets). + * + * @param Driver|null $driver + * + * @return self + */ + public function setDriver(?Driver $driver): self + { + $this->initialized['driver'] = true; + $this->driver = $driver; + return $this; + } + /** + * Driver represents a driver (network, logging, secrets). + * + * @return Driver|null + */ + public function getTemplating(): ?Driver + { + return $this->templating; + } + /** + * Driver represents a driver (network, logging, secrets). + * + * @param Driver|null $templating + * + * @return self + */ + public function setTemplating(?Driver $templating): self + { + $this->initialized['templating'] = true; + $this->templating = $templating; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SecretsCreatePostBody.php b/generated/Model/SecretsCreatePostBody.php new file mode 100644 index 00000000..03b302bb --- /dev/null +++ b/generated/Model/SecretsCreatePostBody.php @@ -0,0 +1,170 @@ +initialized); + } + /** + * User-defined name of the secret. + * + * @var string|null + */ + protected $name; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + data to store as secret. + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + + * + * @var string|null + */ + protected $data; + /** + * Driver represents a driver (network, logging, secrets). + * + * @var Driver|null + */ + protected $driver; + /** + * Driver represents a driver (network, logging, secrets). + * + * @var Driver|null + */ + protected $templating; + /** + * User-defined name of the secret. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * User-defined name of the secret. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + data to store as secret. + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + + * + * @return string|null + */ + public function getData(): ?string + { + return $this->data; + } + /** + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + data to store as secret. + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + + * + * @param string|null $data + * + * @return self + */ + public function setData(?string $data): self + { + $this->initialized['data'] = true; + $this->data = $data; + return $this; + } + /** + * Driver represents a driver (network, logging, secrets). + * + * @return Driver|null + */ + public function getDriver(): ?Driver + { + return $this->driver; + } + /** + * Driver represents a driver (network, logging, secrets). + * + * @param Driver|null $driver + * + * @return self + */ + public function setDriver(?Driver $driver): self + { + $this->initialized['driver'] = true; + $this->driver = $driver; + return $this; + } + /** + * Driver represents a driver (network, logging, secrets). + * + * @return Driver|null + */ + public function getTemplating(): ?Driver + { + return $this->templating; + } + /** + * Driver represents a driver (network, logging, secrets). + * + * @param Driver|null $templating + * + * @return self + */ + public function setTemplating(?Driver $templating): self + { + $this->initialized['templating'] = true; + $this->templating = $templating; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Service.php b/generated/Model/Service.php index 36816a12..a90ca9e1 100644 --- a/generated/Model/Service.php +++ b/generated/Model/Service.php @@ -5,171 +5,311 @@ class Service { /** - * @var string + * @var array */ - protected $iD; + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } /** - * @var NodeVersion + * + * + * @var string|null */ + protected $iD; + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @var ObjectVersion|null + */ protected $version; /** - * @var \DateTime + * + * + * @var string|null */ protected $createdAt; /** - * @var \DateTime + * + * + * @var string|null */ protected $updatedAt; /** - * @var ServiceSpec + * User modifiable configuration for a service. + * + * @var ServiceSpec|null */ protected $spec; /** - * @var Endpoint + * + * + * @var ServiceEndpoint|null */ protected $endpoint; /** - * @var UpdateStatus + * The status of a service update. + * + * @var ServiceUpdateStatus|null */ protected $updateStatus; - /** - * @return string + * The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + + * + * @var ServiceServiceStatus|null + */ + protected $serviceStatus; + /** + * The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + + * + * @var ServiceJobStatus|null + */ + protected $jobStatus; + /** + * + * + * @return string|null */ - public function getID() + public function getID(): ?string { return $this->iD; } - /** - * @param string $iD + * + * + * @param string|null $iD * * @return self */ - public function setID($iD = null) + public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; - return $this; } - /** - * @return NodeVersion - */ - public function getVersion() + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @return ObjectVersion|null + */ + public function getVersion(): ?ObjectVersion { return $this->version; } - /** - * @param NodeVersion $version - * - * @return self - */ - public function setVersion(?NodeVersion $version = null) + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @param ObjectVersion|null $version + * + * @return self + */ + public function setVersion(?ObjectVersion $version): self { + $this->initialized['version'] = true; $this->version = $version; - return $this; } - /** - * @return \DateTime + * + * + * @return string|null */ - public function getCreatedAt() + public function getCreatedAt(): ?string { return $this->createdAt; } - /** - * @param \DateTime $createdAt + * + * + * @param string|null $createdAt * * @return self */ - public function setCreatedAt(?\DateTime $createdAt = null) + public function setCreatedAt(?string $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; - return $this; } - /** - * @return \DateTime + * + * + * @return string|null */ - public function getUpdatedAt() + public function getUpdatedAt(): ?string { return $this->updatedAt; } - /** - * @param \DateTime $updatedAt + * + * + * @param string|null $updatedAt * * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt = null) + public function setUpdatedAt(?string $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; - return $this; } - /** - * @return ServiceSpec + * User modifiable configuration for a service. + * + * @return ServiceSpec|null */ - public function getSpec() + public function getSpec(): ?ServiceSpec { return $this->spec; } - /** - * @param ServiceSpec $spec + * User modifiable configuration for a service. + * + * @param ServiceSpec|null $spec * * @return self */ - public function setSpec(?ServiceSpec $spec = null) + public function setSpec(?ServiceSpec $spec): self { + $this->initialized['spec'] = true; $this->spec = $spec; - return $this; } - /** - * @return Endpoint + * + * + * @return ServiceEndpoint|null */ - public function getEndpoint() + public function getEndpoint(): ?ServiceEndpoint { return $this->endpoint; } - /** - * @param Endpoint $endpoint + * + * + * @param ServiceEndpoint|null $endpoint * * @return self */ - public function setEndpoint(?Endpoint $endpoint = null) + public function setEndpoint(?ServiceEndpoint $endpoint): self { + $this->initialized['endpoint'] = true; $this->endpoint = $endpoint; - return $this; } - /** - * @return UpdateStatus + * The status of a service update. + * + * @return ServiceUpdateStatus|null */ - public function getUpdateStatus() + public function getUpdateStatus(): ?ServiceUpdateStatus { return $this->updateStatus; } - /** - * @param UpdateStatus $updateStatus + * The status of a service update. + * + * @param ServiceUpdateStatus|null $updateStatus * * @return self */ - public function setUpdateStatus(?UpdateStatus $updateStatus = null) + public function setUpdateStatus(?ServiceUpdateStatus $updateStatus): self { + $this->initialized['updateStatus'] = true; $this->updateStatus = $updateStatus; - return $this; } -} + /** + * The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + + * + * @return ServiceServiceStatus|null + */ + public function getServiceStatus(): ?ServiceServiceStatus + { + return $this->serviceStatus; + } + /** + * The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + + * + * @param ServiceServiceStatus|null $serviceStatus + * + * @return self + */ + public function setServiceStatus(?ServiceServiceStatus $serviceStatus): self + { + $this->initialized['serviceStatus'] = true; + $this->serviceStatus = $serviceStatus; + return $this; + } + /** + * The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + + * + * @return ServiceJobStatus|null + */ + public function getJobStatus(): ?ServiceJobStatus + { + return $this->jobStatus; + } + /** + * The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + + * + * @param ServiceJobStatus|null $jobStatus + * + * @return self + */ + public function setJobStatus(?ServiceJobStatus $jobStatus): self + { + $this->initialized['jobStatus'] = true; + $this->jobStatus = $jobStatus; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServiceCreateResponse.php b/generated/Model/ServiceCreateResponse.php index 22111404..4446b9fc 100644 --- a/generated/Model/ServiceCreateResponse.php +++ b/generated/Model/ServiceCreateResponse.php @@ -5,27 +5,76 @@ class ServiceCreateResponse { /** - * @var string + * @var array */ - protected $id; - + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } /** - * @return string + * The ID of the created service. + * + * @var string|null */ - public function getId() + protected $iD; + /** + * Optional warning message. + + FIXME(thaJeztah): this should have "omitempty" in the generated type. + + * + * @var list|null + */ + protected $warnings; + /** + * The ID of the created service. + * + * @return string|null + */ + public function getID(): ?string { - return $this->id; + return $this->iD; } - /** - * @param string $id + * The ID of the created service. + * + * @param string|null $iD * * @return self */ - public function setId($id = null) + public function setID(?string $iD): self { - $this->id = $id; - + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } + /** + * Optional warning message. + + FIXME(thaJeztah): this should have "omitempty" in the generated type. + + * + * @return list|null + */ + public function getWarnings(): ?array + { + return $this->warnings; + } + /** + * Optional warning message. + + FIXME(thaJeztah): this should have "omitempty" in the generated type. + + * + * @param list|null $warnings + * + * @return self + */ + public function setWarnings(?array $warnings): self + { + $this->initialized['warnings'] = true; + $this->warnings = $warnings; return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/ServiceEndpoint.php b/generated/Model/ServiceEndpoint.php new file mode 100644 index 00000000..b49891ba --- /dev/null +++ b/generated/Model/ServiceEndpoint.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * Properties that can be configured to access and load balance a service. + * + * @var EndpointSpec|null + */ + protected $spec; + /** + * + * + * @var list|null + */ + protected $ports; + /** + * + * + * @var list|null + */ + protected $virtualIPs; + /** + * Properties that can be configured to access and load balance a service. + * + * @return EndpointSpec|null + */ + public function getSpec(): ?EndpointSpec + { + return $this->spec; + } + /** + * Properties that can be configured to access and load balance a service. + * + * @param EndpointSpec|null $spec + * + * @return self + */ + public function setSpec(?EndpointSpec $spec): self + { + $this->initialized['spec'] = true; + $this->spec = $spec; + return $this; + } + /** + * + * + * @return list|null + */ + public function getPorts(): ?array + { + return $this->ports; + } + /** + * + * + * @param list|null $ports + * + * @return self + */ + public function setPorts(?array $ports): self + { + $this->initialized['ports'] = true; + $this->ports = $ports; + return $this; + } + /** + * + * + * @return list|null + */ + public function getVirtualIPs(): ?array + { + return $this->virtualIPs; + } + /** + * + * + * @param list|null $virtualIPs + * + * @return self + */ + public function setVirtualIPs(?array $virtualIPs): self + { + $this->initialized['virtualIPs'] = true; + $this->virtualIPs = $virtualIPs; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServiceEndpointVirtualIPsItem.php b/generated/Model/ServiceEndpointVirtualIPsItem.php new file mode 100644 index 00000000..36699b2a --- /dev/null +++ b/generated/Model/ServiceEndpointVirtualIPsItem.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $networkID; + /** + * + * + * @var string|null + */ + protected $addr; + /** + * + * + * @return string|null + */ + public function getNetworkID(): ?string + { + return $this->networkID; + } + /** + * + * + * @param string|null $networkID + * + * @return self + */ + public function setNetworkID(?string $networkID): self + { + $this->initialized['networkID'] = true; + $this->networkID = $networkID; + return $this; + } + /** + * + * + * @return string|null + */ + public function getAddr(): ?string + { + return $this->addr; + } + /** + * + * + * @param string|null $addr + * + * @return self + */ + public function setAddr(?string $addr): self + { + $this->initialized['addr'] = true; + $this->addr = $addr; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServiceJobStatus.php b/generated/Model/ServiceJobStatus.php new file mode 100644 index 00000000..b55c8c15 --- /dev/null +++ b/generated/Model/ServiceJobStatus.php @@ -0,0 +1,107 @@ +initialized); + } + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @var ObjectVersion|null + */ + protected $jobIteration; + /** + * The last time, as observed by the server, that this job was + started. + + * + * @var string|null + */ + protected $lastExecution; + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @return ObjectVersion|null + */ + public function getJobIteration(): ?ObjectVersion + { + return $this->jobIteration; + } + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @param ObjectVersion|null $jobIteration + * + * @return self + */ + public function setJobIteration(?ObjectVersion $jobIteration): self + { + $this->initialized['jobIteration'] = true; + $this->jobIteration = $jobIteration; + return $this; + } + /** + * The last time, as observed by the server, that this job was + started. + + * + * @return string|null + */ + public function getLastExecution(): ?string + { + return $this->lastExecution; + } + /** + * The last time, as observed by the server, that this job was + started. + + * + * @param string|null $lastExecution + * + * @return self + */ + public function setLastExecution(?string $lastExecution): self + { + $this->initialized['lastExecution'] = true; + $this->lastExecution = $lastExecution; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServiceServiceStatus.php b/generated/Model/ServiceServiceStatus.php new file mode 100644 index 00000000..a664fbcc --- /dev/null +++ b/generated/Model/ServiceServiceStatus.php @@ -0,0 +1,126 @@ +initialized); + } + /** + * The number of tasks for the service currently in the Running state. + * + * @var int|null + */ + protected $runningTasks; + /** + * The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + + * + * @var int|null + */ + protected $desiredTasks; + /** + * The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + + * + * @var int|null + */ + protected $completedTasks; + /** + * The number of tasks for the service currently in the Running state. + * + * @return int|null + */ + public function getRunningTasks(): ?int + { + return $this->runningTasks; + } + /** + * The number of tasks for the service currently in the Running state. + * + * @param int|null $runningTasks + * + * @return self + */ + public function setRunningTasks(?int $runningTasks): self + { + $this->initialized['runningTasks'] = true; + $this->runningTasks = $runningTasks; + return $this; + } + /** + * The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + + * + * @return int|null + */ + public function getDesiredTasks(): ?int + { + return $this->desiredTasks; + } + /** + * The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + + * + * @param int|null $desiredTasks + * + * @return self + */ + public function setDesiredTasks(?int $desiredTasks): self + { + $this->initialized['desiredTasks'] = true; + $this->desiredTasks = $desiredTasks; + return $this; + } + /** + * The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + + * + * @return int|null + */ + public function getCompletedTasks(): ?int + { + return $this->completedTasks; + } + /** + * The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + + * + * @param int|null $completedTasks + * + * @return self + */ + public function setCompletedTasks(?int $completedTasks): self + { + $this->initialized['completedTasks'] = true; + $this->completedTasks = $completedTasks; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServiceSpec.php b/generated/Model/ServiceSpec.php index 23ad2748..e56dd3cf 100644 --- a/generated/Model/ServiceSpec.php +++ b/generated/Model/ServiceSpec.php @@ -5,171 +5,244 @@ class ServiceSpec { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * Name of the service. + * + * @var string|null */ protected $name; /** - * @var string[]|null + * User-defined key/value metadata. + * + * @var array|null */ protected $labels; /** - * @var TaskSpec + * User modifiable task configuration. + * + * @var TaskSpec|null */ protected $taskTemplate; /** - * @var ServiceSpecMode + * Scheduling mode for the service. + * + * @var ServiceSpecMode|null */ protected $mode; /** - * @var UpdateConfig + * Specification for the update strategy of the service. + * + * @var ServiceSpecUpdateConfig|null */ protected $updateConfig; /** - * @var NetworkAttachmentConfig[]|null + * Specification for the rollback strategy of the service. + * + * @var ServiceSpecRollbackConfig|null */ + protected $rollbackConfig; + /** + * Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + + * + * @var list|null + */ protected $networks; /** - * @var string + * Properties that can be configured to access and load balance a service. + * + * @var EndpointSpec|null */ protected $endpointSpec; - /** - * @return string + * Name of the service. + * + * @return string|null */ - public function getName() + public function getName(): ?string { return $this->name; } - /** - * @param string $name + * Name of the service. + * + * @param string|null $name * * @return self */ - public function setName($name = null) + public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string[]|null + * User-defined key/value metadata. + * + * @return array|null */ - public function getLabels() + public function getLabels(): ?iterable { return $this->labels; } - /** - * @param string[]|null $labels + * User-defined key/value metadata. + * + * @param array|null $labels * * @return self */ - public function setLabels($labels = null) + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; - return $this; } - /** - * @return TaskSpec + * User modifiable task configuration. + * + * @return TaskSpec|null */ - public function getTaskTemplate() + public function getTaskTemplate(): ?TaskSpec { return $this->taskTemplate; } - /** - * @param TaskSpec $taskTemplate + * User modifiable task configuration. + * + * @param TaskSpec|null $taskTemplate * * @return self */ - public function setTaskTemplate(?TaskSpec $taskTemplate = null) + public function setTaskTemplate(?TaskSpec $taskTemplate): self { + $this->initialized['taskTemplate'] = true; $this->taskTemplate = $taskTemplate; - return $this; } - /** - * @return ServiceSpecMode + * Scheduling mode for the service. + * + * @return ServiceSpecMode|null */ - public function getMode() + public function getMode(): ?ServiceSpecMode { return $this->mode; } - /** - * @param ServiceSpecMode $mode + * Scheduling mode for the service. + * + * @param ServiceSpecMode|null $mode * * @return self */ - public function setMode(?ServiceSpecMode $mode = null) + public function setMode(?ServiceSpecMode $mode): self { + $this->initialized['mode'] = true; $this->mode = $mode; - return $this; } - /** - * @return UpdateConfig + * Specification for the update strategy of the service. + * + * @return ServiceSpecUpdateConfig|null */ - public function getUpdateConfig() + public function getUpdateConfig(): ?ServiceSpecUpdateConfig { return $this->updateConfig; } - /** - * @param UpdateConfig $updateConfig + * Specification for the update strategy of the service. + * + * @param ServiceSpecUpdateConfig|null $updateConfig * * @return self */ - public function setUpdateConfig(?UpdateConfig $updateConfig = null) + public function setUpdateConfig(?ServiceSpecUpdateConfig $updateConfig): self { + $this->initialized['updateConfig'] = true; $this->updateConfig = $updateConfig; - return $this; } - /** - * @return NetworkAttachmentConfig[]|null + * Specification for the rollback strategy of the service. + * + * @return ServiceSpecRollbackConfig|null */ - public function getNetworks() + public function getRollbackConfig(): ?ServiceSpecRollbackConfig { - return $this->networks; + return $this->rollbackConfig; } - /** - * @param NetworkAttachmentConfig[]|null $networks + * Specification for the rollback strategy of the service. + * + * @param ServiceSpecRollbackConfig|null $rollbackConfig * * @return self */ - public function setNetworks($networks = null) + public function setRollbackConfig(?ServiceSpecRollbackConfig $rollbackConfig): self { + $this->initialized['rollbackConfig'] = true; + $this->rollbackConfig = $rollbackConfig; + return $this; + } + /** + * Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + + * + * @return list|null + */ + public function getNetworks(): ?array + { + return $this->networks; + } + /** + * Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + + * + * @param list|null $networks + * + * @return self + */ + public function setNetworks(?array $networks): self + { + $this->initialized['networks'] = true; $this->networks = $networks; - return $this; } - /** - * @return string + * Properties that can be configured to access and load balance a service. + * + * @return EndpointSpec|null */ - public function getEndpointSpec() + public function getEndpointSpec(): ?EndpointSpec { return $this->endpointSpec; } - /** - * @param string $endpointSpec + * Properties that can be configured to access and load balance a service. + * + * @param EndpointSpec|null $endpointSpec * * @return self */ - public function setEndpointSpec($endpointSpec = null) + public function setEndpointSpec(?EndpointSpec $endpointSpec): self { + $this->initialized['endpointSpec'] = true; $this->endpointSpec = $endpointSpec; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/ServiceSpecMode.php b/generated/Model/ServiceSpecMode.php index 6ed9b53f..d7ad7f09 100644 --- a/generated/Model/ServiceSpecMode.php +++ b/generated/Model/ServiceSpecMode.php @@ -5,51 +5,135 @@ class ServiceSpecMode { /** - * @var ReplicatedService + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var ServiceSpecModeReplicated|null */ protected $replicated; /** - * @var GlobalService + * + * + * @var mixed|null */ protected $global; - /** - * @return ReplicatedService + * The mode used for services with a finite number of tasks that run + to a completed state. + + * + * @var ServiceSpecModeReplicatedJob|null + */ + protected $replicatedJob; + /** + * The mode used for services which run a task to the completed state + on each valid node. + + * + * @var mixed|null + */ + protected $globalJob; + /** + * + * + * @return ServiceSpecModeReplicated|null */ - public function getReplicated() + public function getReplicated(): ?ServiceSpecModeReplicated { return $this->replicated; } - /** - * @param ReplicatedService $replicated + * + * + * @param ServiceSpecModeReplicated|null $replicated * * @return self */ - public function setReplicated(?ReplicatedService $replicated = null) + public function setReplicated(?ServiceSpecModeReplicated $replicated): self { + $this->initialized['replicated'] = true; $this->replicated = $replicated; - return $this; } - /** - * @return GlobalService + * + * + * @return mixed */ public function getGlobal() { return $this->global; } - /** - * @param GlobalService $global + * + * + * @param mixed $global * * @return self */ - public function setGlobal(?GlobalService $global = null) + public function setGlobal($global): self { + $this->initialized['global'] = true; $this->global = $global; - return $this; } -} + /** + * The mode used for services with a finite number of tasks that run + to a completed state. + + * + * @return ServiceSpecModeReplicatedJob|null + */ + public function getReplicatedJob(): ?ServiceSpecModeReplicatedJob + { + return $this->replicatedJob; + } + /** + * The mode used for services with a finite number of tasks that run + to a completed state. + + * + * @param ServiceSpecModeReplicatedJob|null $replicatedJob + * + * @return self + */ + public function setReplicatedJob(?ServiceSpecModeReplicatedJob $replicatedJob): self + { + $this->initialized['replicatedJob'] = true; + $this->replicatedJob = $replicatedJob; + return $this; + } + /** + * The mode used for services which run a task to the completed state + on each valid node. + + * + * @return mixed + */ + public function getGlobalJob() + { + return $this->globalJob; + } + /** + * The mode used for services which run a task to the completed state + on each valid node. + + * + * @param mixed $globalJob + * + * @return self + */ + public function setGlobalJob($globalJob): self + { + $this->initialized['globalJob'] = true; + $this->globalJob = $globalJob; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServiceSpecModeReplicated.php b/generated/Model/ServiceSpecModeReplicated.php new file mode 100644 index 00000000..5751ef5b --- /dev/null +++ b/generated/Model/ServiceSpecModeReplicated.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * + * + * @var int|null + */ + protected $replicas; + /** + * + * + * @return int|null + */ + public function getReplicas(): ?int + { + return $this->replicas; + } + /** + * + * + * @param int|null $replicas + * + * @return self + */ + public function setReplicas(?int $replicas): self + { + $this->initialized['replicas'] = true; + $this->replicas = $replicas; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServiceSpecModeReplicatedJob.php b/generated/Model/ServiceSpecModeReplicatedJob.php new file mode 100644 index 00000000..06fd7d8d --- /dev/null +++ b/generated/Model/ServiceSpecModeReplicatedJob.php @@ -0,0 +1,77 @@ +initialized); + } + /** + * The maximum number of replicas to run simultaneously. + * + * @var int|null + */ + protected $maxConcurrent = 1; + /** + * The total number of replicas desired to reach the Completed + state. If unset, will default to the value of `MaxConcurrent` + + * + * @var int|null + */ + protected $totalCompletions; + /** + * The maximum number of replicas to run simultaneously. + * + * @return int|null + */ + public function getMaxConcurrent(): ?int + { + return $this->maxConcurrent; + } + /** + * The maximum number of replicas to run simultaneously. + * + * @param int|null $maxConcurrent + * + * @return self + */ + public function setMaxConcurrent(?int $maxConcurrent): self + { + $this->initialized['maxConcurrent'] = true; + $this->maxConcurrent = $maxConcurrent; + return $this; + } + /** + * The total number of replicas desired to reach the Completed + state. If unset, will default to the value of `MaxConcurrent` + + * + * @return int|null + */ + public function getTotalCompletions(): ?int + { + return $this->totalCompletions; + } + /** + * The total number of replicas desired to reach the Completed + state. If unset, will default to the value of `MaxConcurrent` + + * + * @param int|null $totalCompletions + * + * @return self + */ + public function setTotalCompletions(?int $totalCompletions): self + { + $this->initialized['totalCompletions'] = true; + $this->totalCompletions = $totalCompletions; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServiceSpecRollbackConfig.php b/generated/Model/ServiceSpecRollbackConfig.php new file mode 100644 index 00000000..006f9b98 --- /dev/null +++ b/generated/Model/ServiceSpecRollbackConfig.php @@ -0,0 +1,219 @@ +initialized); + } + /** + * Maximum number of tasks to be rolled back in one iteration (0 means + unlimited parallelism). + + * + * @var int|null + */ + protected $parallelism; + /** + * Amount of time between rollback iterations, in nanoseconds. + * + * @var int|null + */ + protected $delay; + /** + * Action to take if an rolled back task fails to run, or stops + running during the rollback. + + * + * @var string|null + */ + protected $failureAction; + /** + * Amount of time to monitor each rolled back task for failures, in + nanoseconds. + + * + * @var int|null + */ + protected $monitor; + /** + * The fraction of tasks that may fail during a rollback before the + failure action is invoked, specified as a floating point number + between 0 and 1. + + * + * @var float|null + */ + protected $maxFailureRatio = 0; + /** + * The order of operations when rolling back a task. Either the old + task is shut down before the new task is started, or the new task + is started before the old task is shut down. + + * + * @var string|null + */ + protected $order; + /** + * Maximum number of tasks to be rolled back in one iteration (0 means + unlimited parallelism). + + * + * @return int|null + */ + public function getParallelism(): ?int + { + return $this->parallelism; + } + /** + * Maximum number of tasks to be rolled back in one iteration (0 means + unlimited parallelism). + + * + * @param int|null $parallelism + * + * @return self + */ + public function setParallelism(?int $parallelism): self + { + $this->initialized['parallelism'] = true; + $this->parallelism = $parallelism; + return $this; + } + /** + * Amount of time between rollback iterations, in nanoseconds. + * + * @return int|null + */ + public function getDelay(): ?int + { + return $this->delay; + } + /** + * Amount of time between rollback iterations, in nanoseconds. + * + * @param int|null $delay + * + * @return self + */ + public function setDelay(?int $delay): self + { + $this->initialized['delay'] = true; + $this->delay = $delay; + return $this; + } + /** + * Action to take if an rolled back task fails to run, or stops + running during the rollback. + + * + * @return string|null + */ + public function getFailureAction(): ?string + { + return $this->failureAction; + } + /** + * Action to take if an rolled back task fails to run, or stops + running during the rollback. + + * + * @param string|null $failureAction + * + * @return self + */ + public function setFailureAction(?string $failureAction): self + { + $this->initialized['failureAction'] = true; + $this->failureAction = $failureAction; + return $this; + } + /** + * Amount of time to monitor each rolled back task for failures, in + nanoseconds. + + * + * @return int|null + */ + public function getMonitor(): ?int + { + return $this->monitor; + } + /** + * Amount of time to monitor each rolled back task for failures, in + nanoseconds. + + * + * @param int|null $monitor + * + * @return self + */ + public function setMonitor(?int $monitor): self + { + $this->initialized['monitor'] = true; + $this->monitor = $monitor; + return $this; + } + /** + * The fraction of tasks that may fail during a rollback before the + failure action is invoked, specified as a floating point number + between 0 and 1. + + * + * @return float|null + */ + public function getMaxFailureRatio(): ?float + { + return $this->maxFailureRatio; + } + /** + * The fraction of tasks that may fail during a rollback before the + failure action is invoked, specified as a floating point number + between 0 and 1. + + * + * @param float|null $maxFailureRatio + * + * @return self + */ + public function setMaxFailureRatio(?float $maxFailureRatio): self + { + $this->initialized['maxFailureRatio'] = true; + $this->maxFailureRatio = $maxFailureRatio; + return $this; + } + /** + * The order of operations when rolling back a task. Either the old + task is shut down before the new task is started, or the new task + is started before the old task is shut down. + + * + * @return string|null + */ + public function getOrder(): ?string + { + return $this->order; + } + /** + * The order of operations when rolling back a task. Either the old + task is shut down before the new task is started, or the new task + is started before the old task is shut down. + + * + * @param string|null $order + * + * @return self + */ + public function setOrder(?string $order): self + { + $this->initialized['order'] = true; + $this->order = $order; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServiceSpecUpdateConfig.php b/generated/Model/ServiceSpecUpdateConfig.php new file mode 100644 index 00000000..69ca0c1f --- /dev/null +++ b/generated/Model/ServiceSpecUpdateConfig.php @@ -0,0 +1,219 @@ +initialized); + } + /** + * Maximum number of tasks to be updated in one iteration (0 means + unlimited parallelism). + + * + * @var int|null + */ + protected $parallelism; + /** + * Amount of time between updates, in nanoseconds. + * + * @var int|null + */ + protected $delay; + /** + * Action to take if an updated task fails to run, or stops running + during the update. + + * + * @var string|null + */ + protected $failureAction; + /** + * Amount of time to monitor each updated task for failures, in + nanoseconds. + + * + * @var int|null + */ + protected $monitor; + /** + * The fraction of tasks that may fail during an update before the + failure action is invoked, specified as a floating point number + between 0 and 1. + + * + * @var float|null + */ + protected $maxFailureRatio = 0; + /** + * The order of operations when rolling out an updated task. Either + the old task is shut down before the new task is started, or the + new task is started before the old task is shut down. + + * + * @var string|null + */ + protected $order; + /** + * Maximum number of tasks to be updated in one iteration (0 means + unlimited parallelism). + + * + * @return int|null + */ + public function getParallelism(): ?int + { + return $this->parallelism; + } + /** + * Maximum number of tasks to be updated in one iteration (0 means + unlimited parallelism). + + * + * @param int|null $parallelism + * + * @return self + */ + public function setParallelism(?int $parallelism): self + { + $this->initialized['parallelism'] = true; + $this->parallelism = $parallelism; + return $this; + } + /** + * Amount of time between updates, in nanoseconds. + * + * @return int|null + */ + public function getDelay(): ?int + { + return $this->delay; + } + /** + * Amount of time between updates, in nanoseconds. + * + * @param int|null $delay + * + * @return self + */ + public function setDelay(?int $delay): self + { + $this->initialized['delay'] = true; + $this->delay = $delay; + return $this; + } + /** + * Action to take if an updated task fails to run, or stops running + during the update. + + * + * @return string|null + */ + public function getFailureAction(): ?string + { + return $this->failureAction; + } + /** + * Action to take if an updated task fails to run, or stops running + during the update. + + * + * @param string|null $failureAction + * + * @return self + */ + public function setFailureAction(?string $failureAction): self + { + $this->initialized['failureAction'] = true; + $this->failureAction = $failureAction; + return $this; + } + /** + * Amount of time to monitor each updated task for failures, in + nanoseconds. + + * + * @return int|null + */ + public function getMonitor(): ?int + { + return $this->monitor; + } + /** + * Amount of time to monitor each updated task for failures, in + nanoseconds. + + * + * @param int|null $monitor + * + * @return self + */ + public function setMonitor(?int $monitor): self + { + $this->initialized['monitor'] = true; + $this->monitor = $monitor; + return $this; + } + /** + * The fraction of tasks that may fail during an update before the + failure action is invoked, specified as a floating point number + between 0 and 1. + + * + * @return float|null + */ + public function getMaxFailureRatio(): ?float + { + return $this->maxFailureRatio; + } + /** + * The fraction of tasks that may fail during an update before the + failure action is invoked, specified as a floating point number + between 0 and 1. + + * + * @param float|null $maxFailureRatio + * + * @return self + */ + public function setMaxFailureRatio(?float $maxFailureRatio): self + { + $this->initialized['maxFailureRatio'] = true; + $this->maxFailureRatio = $maxFailureRatio; + return $this; + } + /** + * The order of operations when rolling out an updated task. Either + the old task is shut down before the new task is started, or the + new task is started before the old task is shut down. + + * + * @return string|null + */ + public function getOrder(): ?string + { + return $this->order; + } + /** + * The order of operations when rolling out an updated task. Either + the old task is shut down before the new task is started, or the + new task is started before the old task is shut down. + + * + * @param string|null $order + * + * @return self + */ + public function setOrder(?string $order): self + { + $this->initialized['order'] = true; + $this->order = $order; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServiceUpdateResponse.php b/generated/Model/ServiceUpdateResponse.php new file mode 100644 index 00000000..e069f785 --- /dev/null +++ b/generated/Model/ServiceUpdateResponse.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * Optional warning messages + * + * @var list|null + */ + protected $warnings; + /** + * Optional warning messages + * + * @return list|null + */ + public function getWarnings(): ?array + { + return $this->warnings; + } + /** + * Optional warning messages + * + * @param list|null $warnings + * + * @return self + */ + public function setWarnings(?array $warnings): self + { + $this->initialized['warnings'] = true; + $this->warnings = $warnings; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServiceUpdateStatus.php b/generated/Model/ServiceUpdateStatus.php new file mode 100644 index 00000000..58692e68 --- /dev/null +++ b/generated/Model/ServiceUpdateStatus.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $state; + /** + * + * + * @var string|null + */ + protected $startedAt; + /** + * + * + * @var string|null + */ + protected $completedAt; + /** + * + * + * @var string|null + */ + protected $message; + /** + * + * + * @return string|null + */ + public function getState(): ?string + { + return $this->state; + } + /** + * + * + * @param string|null $state + * + * @return self + */ + public function setState(?string $state): self + { + $this->initialized['state'] = true; + $this->state = $state; + return $this; + } + /** + * + * + * @return string|null + */ + public function getStartedAt(): ?string + { + return $this->startedAt; + } + /** + * + * + * @param string|null $startedAt + * + * @return self + */ + public function setStartedAt(?string $startedAt): self + { + $this->initialized['startedAt'] = true; + $this->startedAt = $startedAt; + return $this; + } + /** + * + * + * @return string|null + */ + public function getCompletedAt(): ?string + { + return $this->completedAt; + } + /** + * + * + * @param string|null $completedAt + * + * @return self + */ + public function setCompletedAt(?string $completedAt): self + { + $this->initialized['completedAt'] = true; + $this->completedAt = $completedAt; + return $this; + } + /** + * + * + * @return string|null + */ + public function getMessage(): ?string + { + return $this->message; + } + /** + * + * + * @param string|null $message + * + * @return self + */ + public function setMessage(?string $message): self + { + $this->initialized['message'] = true; + $this->message = $message; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServicesCreatePostBody.php b/generated/Model/ServicesCreatePostBody.php new file mode 100644 index 00000000..76fd40e4 --- /dev/null +++ b/generated/Model/ServicesCreatePostBody.php @@ -0,0 +1,248 @@ +initialized); + } + /** + * Name of the service. + * + * @var string|null + */ + protected $name; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * User modifiable task configuration. + * + * @var TaskSpec|null + */ + protected $taskTemplate; + /** + * Scheduling mode for the service. + * + * @var ServiceSpecMode|null + */ + protected $mode; + /** + * Specification for the update strategy of the service. + * + * @var ServiceSpecUpdateConfig|null + */ + protected $updateConfig; + /** + * Specification for the rollback strategy of the service. + * + * @var ServiceSpecRollbackConfig|null + */ + protected $rollbackConfig; + /** + * Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + + * + * @var list|null + */ + protected $networks; + /** + * Properties that can be configured to access and load balance a service. + * + * @var EndpointSpec|null + */ + protected $endpointSpec; + /** + * Name of the service. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Name of the service. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * User modifiable task configuration. + * + * @return TaskSpec|null + */ + public function getTaskTemplate(): ?TaskSpec + { + return $this->taskTemplate; + } + /** + * User modifiable task configuration. + * + * @param TaskSpec|null $taskTemplate + * + * @return self + */ + public function setTaskTemplate(?TaskSpec $taskTemplate): self + { + $this->initialized['taskTemplate'] = true; + $this->taskTemplate = $taskTemplate; + return $this; + } + /** + * Scheduling mode for the service. + * + * @return ServiceSpecMode|null + */ + public function getMode(): ?ServiceSpecMode + { + return $this->mode; + } + /** + * Scheduling mode for the service. + * + * @param ServiceSpecMode|null $mode + * + * @return self + */ + public function setMode(?ServiceSpecMode $mode): self + { + $this->initialized['mode'] = true; + $this->mode = $mode; + return $this; + } + /** + * Specification for the update strategy of the service. + * + * @return ServiceSpecUpdateConfig|null + */ + public function getUpdateConfig(): ?ServiceSpecUpdateConfig + { + return $this->updateConfig; + } + /** + * Specification for the update strategy of the service. + * + * @param ServiceSpecUpdateConfig|null $updateConfig + * + * @return self + */ + public function setUpdateConfig(?ServiceSpecUpdateConfig $updateConfig): self + { + $this->initialized['updateConfig'] = true; + $this->updateConfig = $updateConfig; + return $this; + } + /** + * Specification for the rollback strategy of the service. + * + * @return ServiceSpecRollbackConfig|null + */ + public function getRollbackConfig(): ?ServiceSpecRollbackConfig + { + return $this->rollbackConfig; + } + /** + * Specification for the rollback strategy of the service. + * + * @param ServiceSpecRollbackConfig|null $rollbackConfig + * + * @return self + */ + public function setRollbackConfig(?ServiceSpecRollbackConfig $rollbackConfig): self + { + $this->initialized['rollbackConfig'] = true; + $this->rollbackConfig = $rollbackConfig; + return $this; + } + /** + * Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + + * + * @return list|null + */ + public function getNetworks(): ?array + { + return $this->networks; + } + /** + * Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + + * + * @param list|null $networks + * + * @return self + */ + public function setNetworks(?array $networks): self + { + $this->initialized['networks'] = true; + $this->networks = $networks; + return $this; + } + /** + * Properties that can be configured to access and load balance a service. + * + * @return EndpointSpec|null + */ + public function getEndpointSpec(): ?EndpointSpec + { + return $this->endpointSpec; + } + /** + * Properties that can be configured to access and load balance a service. + * + * @param EndpointSpec|null $endpointSpec + * + * @return self + */ + public function setEndpointSpec(?EndpointSpec $endpointSpec): self + { + $this->initialized['endpointSpec'] = true; + $this->endpointSpec = $endpointSpec; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ServicesIdUpdatePostBody.php b/generated/Model/ServicesIdUpdatePostBody.php new file mode 100644 index 00000000..65f9b16c --- /dev/null +++ b/generated/Model/ServicesIdUpdatePostBody.php @@ -0,0 +1,248 @@ +initialized); + } + /** + * Name of the service. + * + * @var string|null + */ + protected $name; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * User modifiable task configuration. + * + * @var TaskSpec|null + */ + protected $taskTemplate; + /** + * Scheduling mode for the service. + * + * @var ServiceSpecMode|null + */ + protected $mode; + /** + * Specification for the update strategy of the service. + * + * @var ServiceSpecUpdateConfig|null + */ + protected $updateConfig; + /** + * Specification for the rollback strategy of the service. + * + * @var ServiceSpecRollbackConfig|null + */ + protected $rollbackConfig; + /** + * Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + + * + * @var list|null + */ + protected $networks; + /** + * Properties that can be configured to access and load balance a service. + * + * @var EndpointSpec|null + */ + protected $endpointSpec; + /** + * Name of the service. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Name of the service. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * User modifiable task configuration. + * + * @return TaskSpec|null + */ + public function getTaskTemplate(): ?TaskSpec + { + return $this->taskTemplate; + } + /** + * User modifiable task configuration. + * + * @param TaskSpec|null $taskTemplate + * + * @return self + */ + public function setTaskTemplate(?TaskSpec $taskTemplate): self + { + $this->initialized['taskTemplate'] = true; + $this->taskTemplate = $taskTemplate; + return $this; + } + /** + * Scheduling mode for the service. + * + * @return ServiceSpecMode|null + */ + public function getMode(): ?ServiceSpecMode + { + return $this->mode; + } + /** + * Scheduling mode for the service. + * + * @param ServiceSpecMode|null $mode + * + * @return self + */ + public function setMode(?ServiceSpecMode $mode): self + { + $this->initialized['mode'] = true; + $this->mode = $mode; + return $this; + } + /** + * Specification for the update strategy of the service. + * + * @return ServiceSpecUpdateConfig|null + */ + public function getUpdateConfig(): ?ServiceSpecUpdateConfig + { + return $this->updateConfig; + } + /** + * Specification for the update strategy of the service. + * + * @param ServiceSpecUpdateConfig|null $updateConfig + * + * @return self + */ + public function setUpdateConfig(?ServiceSpecUpdateConfig $updateConfig): self + { + $this->initialized['updateConfig'] = true; + $this->updateConfig = $updateConfig; + return $this; + } + /** + * Specification for the rollback strategy of the service. + * + * @return ServiceSpecRollbackConfig|null + */ + public function getRollbackConfig(): ?ServiceSpecRollbackConfig + { + return $this->rollbackConfig; + } + /** + * Specification for the rollback strategy of the service. + * + * @param ServiceSpecRollbackConfig|null $rollbackConfig + * + * @return self + */ + public function setRollbackConfig(?ServiceSpecRollbackConfig $rollbackConfig): self + { + $this->initialized['rollbackConfig'] = true; + $this->rollbackConfig = $rollbackConfig; + return $this; + } + /** + * Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + + * + * @return list|null + */ + public function getNetworks(): ?array + { + return $this->networks; + } + /** + * Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + + * + * @param list|null $networks + * + * @return self + */ + public function setNetworks(?array $networks): self + { + $this->initialized['networks'] = true; + $this->networks = $networks; + return $this; + } + /** + * Properties that can be configured to access and load balance a service. + * + * @return EndpointSpec|null + */ + public function getEndpointSpec(): ?EndpointSpec + { + return $this->endpointSpec; + } + /** + * Properties that can be configured to access and load balance a service. + * + * @param EndpointSpec|null $endpointSpec + * + * @return self + */ + public function setEndpointSpec(?EndpointSpec $endpointSpec): self + { + $this->initialized['endpointSpec'] = true; + $this->endpointSpec = $endpointSpec; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Swarm.php b/generated/Model/Swarm.php new file mode 100644 index 00000000..2ea6922c --- /dev/null +++ b/generated/Model/Swarm.php @@ -0,0 +1,392 @@ +initialized); + } + /** + * The ID of the swarm. + * + * @var string|null + */ + protected $iD; + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @var ObjectVersion|null + */ + protected $version; + /** + * Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @var string|null + */ + protected $createdAt; + /** + * Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @var string|null + */ + protected $updatedAt; + /** + * User modifiable swarm configuration. + * + * @var SwarmSpec|null + */ + protected $spec; + /** + * Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + + * + * @var TLSInfo|null + */ + protected $tLSInfo; + /** + * Whether there is currently a root CA rotation in progress for the swarm + * + * @var bool|null + */ + protected $rootRotationInProgress; + /** + * DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + + * + * @var int|null + */ + protected $dataPathPort = 4789; + /** + * Default Address Pool specifies default subnet pools for global scope + networks. + + * + * @var list|null + */ + protected $defaultAddrPool; + /** + * SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + + * + * @var int|null + */ + protected $subnetSize = 24; + /** + * JoinTokens contains the tokens workers and managers need to join the swarm. + * + * @var JoinTokens|null + */ + protected $joinTokens; + /** + * The ID of the swarm. + * + * @return string|null + */ + public function getID(): ?string + { + return $this->iD; + } + /** + * The ID of the swarm. + * + * @param string|null $iD + * + * @return self + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @return ObjectVersion|null + */ + public function getVersion(): ?ObjectVersion + { + return $this->version; + } + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @param ObjectVersion|null $version + * + * @return self + */ + public function setVersion(?ObjectVersion $version): self + { + $this->initialized['version'] = true; + $this->version = $version; + return $this; + } + /** + * Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @return string|null + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + /** + * Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @param string|null $createdAt + * + * @return self + */ + public function setCreatedAt(?string $createdAt): self + { + $this->initialized['createdAt'] = true; + $this->createdAt = $createdAt; + return $this; + } + /** + * Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @return string|null + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + /** + * Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + * + * @param string|null $updatedAt + * + * @return self + */ + public function setUpdatedAt(?string $updatedAt): self + { + $this->initialized['updatedAt'] = true; + $this->updatedAt = $updatedAt; + return $this; + } + /** + * User modifiable swarm configuration. + * + * @return SwarmSpec|null + */ + public function getSpec(): ?SwarmSpec + { + return $this->spec; + } + /** + * User modifiable swarm configuration. + * + * @param SwarmSpec|null $spec + * + * @return self + */ + public function setSpec(?SwarmSpec $spec): self + { + $this->initialized['spec'] = true; + $this->spec = $spec; + return $this; + } + /** + * Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + + * + * @return TLSInfo|null + */ + public function getTLSInfo(): ?TLSInfo + { + return $this->tLSInfo; + } + /** + * Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + + * + * @param TLSInfo|null $tLSInfo + * + * @return self + */ + public function setTLSInfo(?TLSInfo $tLSInfo): self + { + $this->initialized['tLSInfo'] = true; + $this->tLSInfo = $tLSInfo; + return $this; + } + /** + * Whether there is currently a root CA rotation in progress for the swarm + * + * @return bool|null + */ + public function getRootRotationInProgress(): ?bool + { + return $this->rootRotationInProgress; + } + /** + * Whether there is currently a root CA rotation in progress for the swarm + * + * @param bool|null $rootRotationInProgress + * + * @return self + */ + public function setRootRotationInProgress(?bool $rootRotationInProgress): self + { + $this->initialized['rootRotationInProgress'] = true; + $this->rootRotationInProgress = $rootRotationInProgress; + return $this; + } + /** + * DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + + * + * @return int|null + */ + public function getDataPathPort(): ?int + { + return $this->dataPathPort; + } + /** + * DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + + * + * @param int|null $dataPathPort + * + * @return self + */ + public function setDataPathPort(?int $dataPathPort): self + { + $this->initialized['dataPathPort'] = true; + $this->dataPathPort = $dataPathPort; + return $this; + } + /** + * Default Address Pool specifies default subnet pools for global scope + networks. + + * + * @return list|null + */ + public function getDefaultAddrPool(): ?array + { + return $this->defaultAddrPool; + } + /** + * Default Address Pool specifies default subnet pools for global scope + networks. + + * + * @param list|null $defaultAddrPool + * + * @return self + */ + public function setDefaultAddrPool(?array $defaultAddrPool): self + { + $this->initialized['defaultAddrPool'] = true; + $this->defaultAddrPool = $defaultAddrPool; + return $this; + } + /** + * SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + + * + * @return int|null + */ + public function getSubnetSize(): ?int + { + return $this->subnetSize; + } + /** + * SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + + * + * @param int|null $subnetSize + * + * @return self + */ + public function setSubnetSize(?int $subnetSize): self + { + $this->initialized['subnetSize'] = true; + $this->subnetSize = $subnetSize; + return $this; + } + /** + * JoinTokens contains the tokens workers and managers need to join the swarm. + * + * @return JoinTokens|null + */ + public function getJoinTokens(): ?JoinTokens + { + return $this->joinTokens; + } + /** + * JoinTokens contains the tokens workers and managers need to join the swarm. + * + * @param JoinTokens|null $joinTokens + * + * @return self + */ + public function setJoinTokens(?JoinTokens $joinTokens): self + { + $this->initialized['joinTokens'] = true; + $this->joinTokens = $joinTokens; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmConfig.php b/generated/Model/SwarmConfig.php deleted file mode 100644 index 4f28bcb4..00000000 --- a/generated/Model/SwarmConfig.php +++ /dev/null @@ -1,103 +0,0 @@ -listenAddr; - } - - /** - * @param string $listenAddr - * - * @return self - */ - public function setListenAddr($listenAddr = null) - { - $this->listenAddr = $listenAddr; - - return $this; - } - - /** - * @return string - */ - public function getAdvertiseAddr() - { - return $this->advertiseAddr; - } - - /** - * @param string $advertiseAddr - * - * @return self - */ - public function setAdvertiseAddr($advertiseAddr = null) - { - $this->advertiseAddr = $advertiseAddr; - - return $this; - } - - /** - * @return bool - */ - public function getForceNewCluster() - { - return $this->forceNewCluster; - } - - /** - * @param bool $forceNewCluster - * - * @return self - */ - public function setForceNewCluster($forceNewCluster = null) - { - $this->forceNewCluster = $forceNewCluster; - - return $this; - } - - /** - * @return SwarmConfigSpec - */ - public function getSpec() - { - return $this->spec; - } - - /** - * @param SwarmConfigSpec $spec - * - * @return self - */ - public function setSpec(?SwarmConfigSpec $spec = null) - { - $this->spec = $spec; - - return $this; - } -} diff --git a/generated/Model/SwarmConfigSpec.php b/generated/Model/SwarmConfigSpec.php deleted file mode 100644 index 58174e77..00000000 --- a/generated/Model/SwarmConfigSpec.php +++ /dev/null @@ -1,103 +0,0 @@ -orchestration; - } - - /** - * @param SwarmConfigSpecOrchestration $orchestration - * - * @return self - */ - public function setOrchestration(?SwarmConfigSpecOrchestration $orchestration = null) - { - $this->orchestration = $orchestration; - - return $this; - } - - /** - * @return SwarmConfigSpecRaft - */ - public function getRaft() - { - return $this->raft; - } - - /** - * @param SwarmConfigSpecRaft $raft - * - * @return self - */ - public function setRaft(?SwarmConfigSpecRaft $raft = null) - { - $this->raft = $raft; - - return $this; - } - - /** - * @return SwarmConfigSpecDispatcher - */ - public function getDispatcher() - { - return $this->dispatcher; - } - - /** - * @param SwarmConfigSpecDispatcher $dispatcher - * - * @return self - */ - public function setDispatcher(?SwarmConfigSpecDispatcher $dispatcher = null) - { - $this->dispatcher = $dispatcher; - - return $this; - } - - /** - * @return SwarmConfigSpecCAConfig - */ - public function getCAConfig() - { - return $this->cAConfig; - } - - /** - * @param SwarmConfigSpecCAConfig $cAConfig - * - * @return self - */ - public function setCAConfig(?SwarmConfigSpecCAConfig $cAConfig = null) - { - $this->cAConfig = $cAConfig; - - return $this; - } -} diff --git a/generated/Model/SwarmConfigSpecCAConfig.php b/generated/Model/SwarmConfigSpecCAConfig.php deleted file mode 100644 index 2bde0ed3..00000000 --- a/generated/Model/SwarmConfigSpecCAConfig.php +++ /dev/null @@ -1,55 +0,0 @@ -nodeCertExpiry; - } - - /** - * @param bool $nodeCertExpiry - * - * @return self - */ - public function setNodeCertExpiry($nodeCertExpiry = null) - { - $this->nodeCertExpiry = $nodeCertExpiry; - - return $this; - } - - /** - * @return SwarmConfigSpecCAConfigExternalCA - */ - public function getExternalCA() - { - return $this->externalCA; - } - - /** - * @param SwarmConfigSpecCAConfigExternalCA $externalCA - * - * @return self - */ - public function setExternalCA(?SwarmConfigSpecCAConfigExternalCA $externalCA = null) - { - $this->externalCA = $externalCA; - - return $this; - } -} diff --git a/generated/Model/SwarmConfigSpecCAConfigExternalCA.php b/generated/Model/SwarmConfigSpecCAConfigExternalCA.php deleted file mode 100644 index 8ab5b3ca..00000000 --- a/generated/Model/SwarmConfigSpecCAConfigExternalCA.php +++ /dev/null @@ -1,79 +0,0 @@ -protocol; - } - - /** - * @param string $protocol - * - * @return self - */ - public function setProtocol($protocol = null) - { - $this->protocol = $protocol; - - return $this; - } - - /** - * @return string - */ - public function getURL() - { - return $this->uRL; - } - - /** - * @param string $uRL - * - * @return self - */ - public function setURL($uRL = null) - { - $this->uRL = $uRL; - - return $this; - } - - /** - * @return string[]|null - */ - public function getOptions() - { - return $this->options; - } - - /** - * @param string[]|null $options - * - * @return self - */ - public function setOptions($options = null) - { - $this->options = $options; - - return $this; - } -} diff --git a/generated/Model/SwarmConfigSpecDispatcher.php b/generated/Model/SwarmConfigSpecDispatcher.php deleted file mode 100644 index 2ab13d3a..00000000 --- a/generated/Model/SwarmConfigSpecDispatcher.php +++ /dev/null @@ -1,31 +0,0 @@ -heartbeatPeriod; - } - - /** - * @param int $heartbeatPeriod - * - * @return self - */ - public function setHeartbeatPeriod($heartbeatPeriod = null) - { - $this->heartbeatPeriod = $heartbeatPeriod; - - return $this; - } -} diff --git a/generated/Model/SwarmConfigSpecOrchestration.php b/generated/Model/SwarmConfigSpecOrchestration.php deleted file mode 100644 index 11feee35..00000000 --- a/generated/Model/SwarmConfigSpecOrchestration.php +++ /dev/null @@ -1,31 +0,0 @@ -taskHistoryRetentionLimit; - } - - /** - * @param int $taskHistoryRetentionLimit - * - * @return self - */ - public function setTaskHistoryRetentionLimit($taskHistoryRetentionLimit = null) - { - $this->taskHistoryRetentionLimit = $taskHistoryRetentionLimit; - - return $this; - } -} diff --git a/generated/Model/SwarmConfigSpecRaft.php b/generated/Model/SwarmConfigSpecRaft.php deleted file mode 100644 index 420c924e..00000000 --- a/generated/Model/SwarmConfigSpecRaft.php +++ /dev/null @@ -1,127 +0,0 @@ -snapshotInterval; - } - - /** - * @param int $snapshotInterval - * - * @return self - */ - public function setSnapshotInterval($snapshotInterval = null) - { - $this->snapshotInterval = $snapshotInterval; - - return $this; - } - - /** - * @return int - */ - public function getKeepOldSnapshots() - { - return $this->keepOldSnapshots; - } - - /** - * @param int $keepOldSnapshots - * - * @return self - */ - public function setKeepOldSnapshots($keepOldSnapshots = null) - { - $this->keepOldSnapshots = $keepOldSnapshots; - - return $this; - } - - /** - * @return int - */ - public function getLogEntriesForSlowFollowers() - { - return $this->logEntriesForSlowFollowers; - } - - /** - * @param int $logEntriesForSlowFollowers - * - * @return self - */ - public function setLogEntriesForSlowFollowers($logEntriesForSlowFollowers = null) - { - $this->logEntriesForSlowFollowers = $logEntriesForSlowFollowers; - - return $this; - } - - /** - * @return int - */ - public function getHeartbeatTick() - { - return $this->heartbeatTick; - } - - /** - * @param int $heartbeatTick - * - * @return self - */ - public function setHeartbeatTick($heartbeatTick = null) - { - $this->heartbeatTick = $heartbeatTick; - - return $this; - } - - /** - * @return int - */ - public function getElectionTick() - { - return $this->electionTick; - } - - /** - * @param int $electionTick - * - * @return self - */ - public function setElectionTick($electionTick = null) - { - $this->electionTick = $electionTick; - - return $this; - } -} diff --git a/generated/Model/SwarmIPAMOptions.php b/generated/Model/SwarmIPAMOptions.php deleted file mode 100644 index d9e94a6d..00000000 --- a/generated/Model/SwarmIPAMOptions.php +++ /dev/null @@ -1,55 +0,0 @@ -driver; - } - - /** - * @param Driver $driver - * - * @return self - */ - public function setDriver(?Driver $driver = null) - { - $this->driver = $driver; - - return $this; - } - - /** - * @return IPAMConfig[]|null - */ - public function getConfigs() - { - return $this->configs; - } - - /** - * @param IPAMConfig[]|null $configs - * - * @return self - */ - public function setConfigs($configs = null) - { - $this->configs = $configs; - - return $this; - } -} diff --git a/generated/Model/SwarmInfo.php b/generated/Model/SwarmInfo.php new file mode 100644 index 00000000..c44145b1 --- /dev/null +++ b/generated/Model/SwarmInfo.php @@ -0,0 +1,279 @@ +initialized); + } + /** + * Unique identifier of for this node in the swarm. + * + * @var string|null + */ + protected $nodeID = ''; + /** + * IP address at which this node can be reached by other nodes in the + swarm. + + * + * @var string|null + */ + protected $nodeAddr = ''; + /** + * Current local status of this node. + * + * @var string|null + */ + protected $localNodeState = ''; + /** + * + * + * @var bool|null + */ + protected $controlAvailable = false; + /** + * + * + * @var string|null + */ + protected $error = ''; + /** + * List of ID's and addresses of other managers in the swarm. + * + * @var list|null + */ + protected $remoteManagers; + /** + * Total number of nodes in the swarm. + * + * @var int|null + */ + protected $nodes; + /** + * Total number of managers in the swarm. + * + * @var int|null + */ + protected $managers; + /** + * ClusterInfo represents information about the swarm as is returned by the + "/info" endpoint. Join-tokens are not included. + + * + * @var ClusterInfo|null + */ + protected $cluster; + /** + * Unique identifier of for this node in the swarm. + * + * @return string|null + */ + public function getNodeID(): ?string + { + return $this->nodeID; + } + /** + * Unique identifier of for this node in the swarm. + * + * @param string|null $nodeID + * + * @return self + */ + public function setNodeID(?string $nodeID): self + { + $this->initialized['nodeID'] = true; + $this->nodeID = $nodeID; + return $this; + } + /** + * IP address at which this node can be reached by other nodes in the + swarm. + + * + * @return string|null + */ + public function getNodeAddr(): ?string + { + return $this->nodeAddr; + } + /** + * IP address at which this node can be reached by other nodes in the + swarm. + + * + * @param string|null $nodeAddr + * + * @return self + */ + public function setNodeAddr(?string $nodeAddr): self + { + $this->initialized['nodeAddr'] = true; + $this->nodeAddr = $nodeAddr; + return $this; + } + /** + * Current local status of this node. + * + * @return string|null + */ + public function getLocalNodeState(): ?string + { + return $this->localNodeState; + } + /** + * Current local status of this node. + * + * @param string|null $localNodeState + * + * @return self + */ + public function setLocalNodeState(?string $localNodeState): self + { + $this->initialized['localNodeState'] = true; + $this->localNodeState = $localNodeState; + return $this; + } + /** + * + * + * @return bool|null + */ + public function getControlAvailable(): ?bool + { + return $this->controlAvailable; + } + /** + * + * + * @param bool|null $controlAvailable + * + * @return self + */ + public function setControlAvailable(?bool $controlAvailable): self + { + $this->initialized['controlAvailable'] = true; + $this->controlAvailable = $controlAvailable; + return $this; + } + /** + * + * + * @return string|null + */ + public function getError(): ?string + { + return $this->error; + } + /** + * + * + * @param string|null $error + * + * @return self + */ + public function setError(?string $error): self + { + $this->initialized['error'] = true; + $this->error = $error; + return $this; + } + /** + * List of ID's and addresses of other managers in the swarm. + * + * @return list|null + */ + public function getRemoteManagers(): ?array + { + return $this->remoteManagers; + } + /** + * List of ID's and addresses of other managers in the swarm. + * + * @param list|null $remoteManagers + * + * @return self + */ + public function setRemoteManagers(?array $remoteManagers): self + { + $this->initialized['remoteManagers'] = true; + $this->remoteManagers = $remoteManagers; + return $this; + } + /** + * Total number of nodes in the swarm. + * + * @return int|null + */ + public function getNodes(): ?int + { + return $this->nodes; + } + /** + * Total number of nodes in the swarm. + * + * @param int|null $nodes + * + * @return self + */ + public function setNodes(?int $nodes): self + { + $this->initialized['nodes'] = true; + $this->nodes = $nodes; + return $this; + } + /** + * Total number of managers in the swarm. + * + * @return int|null + */ + public function getManagers(): ?int + { + return $this->managers; + } + /** + * Total number of managers in the swarm. + * + * @param int|null $managers + * + * @return self + */ + public function setManagers(?int $managers): self + { + $this->initialized['managers'] = true; + $this->managers = $managers; + return $this; + } + /** + * ClusterInfo represents information about the swarm as is returned by the + "/info" endpoint. Join-tokens are not included. + + * + * @return ClusterInfo|null + */ + public function getCluster(): ?ClusterInfo + { + return $this->cluster; + } + /** + * ClusterInfo represents information about the swarm as is returned by the + "/info" endpoint. Join-tokens are not included. + + * + * @param ClusterInfo|null $cluster + * + * @return self + */ + public function setCluster(?ClusterInfo $cluster): self + { + $this->initialized['cluster'] = true; + $this->cluster = $cluster; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmInitPostBody.php b/generated/Model/SwarmInitPostBody.php new file mode 100644 index 00000000..87cd2a01 --- /dev/null +++ b/generated/Model/SwarmInitPostBody.php @@ -0,0 +1,326 @@ +initialized); + } + /** + * Listen address used for inter-manager communication, as well + as determining the networking interface used for the VXLAN + Tunnel Endpoint (VTEP). This can either be an address/port + combination in the form `192.168.1.1:4567`, or an interface + followed by a port number, like `eth0:4567`. If the port number + is omitted, the default swarm listening port is used. + + * + * @var string|null + */ + protected $listenAddr; + /** + * Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + + * + * @var string|null + */ + protected $advertiseAddr; + /** + * Address or interface to use for data path traffic (format: + ``), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + * + * @var string|null + */ + protected $dataPathAddr; + /** + * DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + if no port is set or is set to 0, default port 4789 will be used. + + * + * @var int|null + */ + protected $dataPathPort; + /** + * Default Address Pool specifies default subnet pools for global + scope networks. + + * + * @var list|null + */ + protected $defaultAddrPool; + /** + * Force creation of a new swarm. + * + * @var bool|null + */ + protected $forceNewCluster; + /** + * SubnetSize specifies the subnet size of the networks created + from the default subnet pool. + + * + * @var int|null + */ + protected $subnetSize; + /** + * User modifiable swarm configuration. + * + * @var SwarmSpec|null + */ + protected $spec; + /** + * Listen address used for inter-manager communication, as well + as determining the networking interface used for the VXLAN + Tunnel Endpoint (VTEP). This can either be an address/port + combination in the form `192.168.1.1:4567`, or an interface + followed by a port number, like `eth0:4567`. If the port number + is omitted, the default swarm listening port is used. + + * + * @return string|null + */ + public function getListenAddr(): ?string + { + return $this->listenAddr; + } + /** + * Listen address used for inter-manager communication, as well + as determining the networking interface used for the VXLAN + Tunnel Endpoint (VTEP). This can either be an address/port + combination in the form `192.168.1.1:4567`, or an interface + followed by a port number, like `eth0:4567`. If the port number + is omitted, the default swarm listening port is used. + + * + * @param string|null $listenAddr + * + * @return self + */ + public function setListenAddr(?string $listenAddr): self + { + $this->initialized['listenAddr'] = true; + $this->listenAddr = $listenAddr; + return $this; + } + /** + * Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + + * + * @return string|null + */ + public function getAdvertiseAddr(): ?string + { + return $this->advertiseAddr; + } + /** + * Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + + * + * @param string|null $advertiseAddr + * + * @return self + */ + public function setAdvertiseAddr(?string $advertiseAddr): self + { + $this->initialized['advertiseAddr'] = true; + $this->advertiseAddr = $advertiseAddr; + return $this; + } + /** + * Address or interface to use for data path traffic (format: + ``), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + * + * @return string|null + */ + public function getDataPathAddr(): ?string + { + return $this->dataPathAddr; + } + /** + * Address or interface to use for data path traffic (format: + ``), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + * + * @param string|null $dataPathAddr + * + * @return self + */ + public function setDataPathAddr(?string $dataPathAddr): self + { + $this->initialized['dataPathAddr'] = true; + $this->dataPathAddr = $dataPathAddr; + return $this; + } + /** + * DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + if no port is set or is set to 0, default port 4789 will be used. + + * + * @return int|null + */ + public function getDataPathPort(): ?int + { + return $this->dataPathPort; + } + /** + * DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + if no port is set or is set to 0, default port 4789 will be used. + + * + * @param int|null $dataPathPort + * + * @return self + */ + public function setDataPathPort(?int $dataPathPort): self + { + $this->initialized['dataPathPort'] = true; + $this->dataPathPort = $dataPathPort; + return $this; + } + /** + * Default Address Pool specifies default subnet pools for global + scope networks. + + * + * @return list|null + */ + public function getDefaultAddrPool(): ?array + { + return $this->defaultAddrPool; + } + /** + * Default Address Pool specifies default subnet pools for global + scope networks. + + * + * @param list|null $defaultAddrPool + * + * @return self + */ + public function setDefaultAddrPool(?array $defaultAddrPool): self + { + $this->initialized['defaultAddrPool'] = true; + $this->defaultAddrPool = $defaultAddrPool; + return $this; + } + /** + * Force creation of a new swarm. + * + * @return bool|null + */ + public function getForceNewCluster(): ?bool + { + return $this->forceNewCluster; + } + /** + * Force creation of a new swarm. + * + * @param bool|null $forceNewCluster + * + * @return self + */ + public function setForceNewCluster(?bool $forceNewCluster): self + { + $this->initialized['forceNewCluster'] = true; + $this->forceNewCluster = $forceNewCluster; + return $this; + } + /** + * SubnetSize specifies the subnet size of the networks created + from the default subnet pool. + + * + * @return int|null + */ + public function getSubnetSize(): ?int + { + return $this->subnetSize; + } + /** + * SubnetSize specifies the subnet size of the networks created + from the default subnet pool. + + * + * @param int|null $subnetSize + * + * @return self + */ + public function setSubnetSize(?int $subnetSize): self + { + $this->initialized['subnetSize'] = true; + $this->subnetSize = $subnetSize; + return $this; + } + /** + * User modifiable swarm configuration. + * + * @return SwarmSpec|null + */ + public function getSpec(): ?SwarmSpec + { + return $this->spec; + } + /** + * User modifiable swarm configuration. + * + * @param SwarmSpec|null $spec + * + * @return self + */ + public function setSpec(?SwarmSpec $spec): self + { + $this->initialized['spec'] = true; + $this->spec = $spec; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmJoinConfig.php b/generated/Model/SwarmJoinConfig.php deleted file mode 100644 index b7935a5a..00000000 --- a/generated/Model/SwarmJoinConfig.php +++ /dev/null @@ -1,103 +0,0 @@ -listenAddr; - } - - /** - * @param string $listenAddr - * - * @return self - */ - public function setListenAddr($listenAddr = null) - { - $this->listenAddr = $listenAddr; - - return $this; - } - - /** - * @return string - */ - public function getAdvertiseAddr() - { - return $this->advertiseAddr; - } - - /** - * @param string $advertiseAddr - * - * @return self - */ - public function setAdvertiseAddr($advertiseAddr = null) - { - $this->advertiseAddr = $advertiseAddr; - - return $this; - } - - /** - * @return string[]|null - */ - public function getRemoteAddrs() - { - return $this->remoteAddrs; - } - - /** - * @param string[]|null $remoteAddrs - * - * @return self - */ - public function setRemoteAddrs($remoteAddrs = null) - { - $this->remoteAddrs = $remoteAddrs; - - return $this; - } - - /** - * @return string - */ - public function getJoinToken() - { - return $this->joinToken; - } - - /** - * @param string $joinToken - * - * @return self - */ - public function setJoinToken($joinToken = null) - { - $this->joinToken = $joinToken; - - return $this; - } -} diff --git a/generated/Model/SwarmJoinPostBody.php b/generated/Model/SwarmJoinPostBody.php new file mode 100644 index 00000000..bd102e1f --- /dev/null +++ b/generated/Model/SwarmJoinPostBody.php @@ -0,0 +1,212 @@ +initialized); + } + /** + * Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). + + * + * @var string|null + */ + protected $listenAddr; + /** + * Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + + * + * @var string|null + */ + protected $advertiseAddr; + /** + * Address or interface to use for data path traffic (format: + ``), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + * + * @var string|null + */ + protected $dataPathAddr; + /** + * Addresses of manager nodes already participating in the swarm. + * + * @var list|null + */ + protected $remoteAddrs; + /** + * Secret token for joining this swarm. + * + * @var string|null + */ + protected $joinToken; + /** + * Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). + + * + * @return string|null + */ + public function getListenAddr(): ?string + { + return $this->listenAddr; + } + /** + * Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). + + * + * @param string|null $listenAddr + * + * @return self + */ + public function setListenAddr(?string $listenAddr): self + { + $this->initialized['listenAddr'] = true; + $this->listenAddr = $listenAddr; + return $this; + } + /** + * Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + + * + * @return string|null + */ + public function getAdvertiseAddr(): ?string + { + return $this->advertiseAddr; + } + /** + * Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + + * + * @param string|null $advertiseAddr + * + * @return self + */ + public function setAdvertiseAddr(?string $advertiseAddr): self + { + $this->initialized['advertiseAddr'] = true; + $this->advertiseAddr = $advertiseAddr; + return $this; + } + /** + * Address or interface to use for data path traffic (format: + ``), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + * + * @return string|null + */ + public function getDataPathAddr(): ?string + { + return $this->dataPathAddr; + } + /** + * Address or interface to use for data path traffic (format: + ``), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + * + * @param string|null $dataPathAddr + * + * @return self + */ + public function setDataPathAddr(?string $dataPathAddr): self + { + $this->initialized['dataPathAddr'] = true; + $this->dataPathAddr = $dataPathAddr; + return $this; + } + /** + * Addresses of manager nodes already participating in the swarm. + * + * @return list|null + */ + public function getRemoteAddrs(): ?array + { + return $this->remoteAddrs; + } + /** + * Addresses of manager nodes already participating in the swarm. + * + * @param list|null $remoteAddrs + * + * @return self + */ + public function setRemoteAddrs(?array $remoteAddrs): self + { + $this->initialized['remoteAddrs'] = true; + $this->remoteAddrs = $remoteAddrs; + return $this; + } + /** + * Secret token for joining this swarm. + * + * @return string|null + */ + public function getJoinToken(): ?string + { + return $this->joinToken; + } + /** + * Secret token for joining this swarm. + * + * @param string|null $joinToken + * + * @return self + */ + public function setJoinToken(?string $joinToken): self + { + $this->initialized['joinToken'] = true; + $this->joinToken = $joinToken; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmJoinTokens.php b/generated/Model/SwarmJoinTokens.php deleted file mode 100644 index ac20e6fe..00000000 --- a/generated/Model/SwarmJoinTokens.php +++ /dev/null @@ -1,55 +0,0 @@ -worker; - } - - /** - * @param string $worker - * - * @return self - */ - public function setWorker($worker = null) - { - $this->worker = $worker; - - return $this; - } - - /** - * @return string - */ - public function getManager() - { - return $this->manager; - } - - /** - * @param string $manager - * - * @return self - */ - public function setManager($manager = null) - { - $this->manager = $manager; - - return $this; - } -} diff --git a/generated/Model/SwarmNetwork.php b/generated/Model/SwarmNetwork.php deleted file mode 100644 index ec5e5659..00000000 --- a/generated/Model/SwarmNetwork.php +++ /dev/null @@ -1,175 +0,0 @@ -iD; - } - - /** - * @param string $iD - * - * @return self - */ - public function setID($iD = null) - { - $this->iD = $iD; - - return $this; - } - - /** - * @return NodeVersion - */ - public function getVersion() - { - return $this->version; - } - - /** - * @param NodeVersion $version - * - * @return self - */ - public function setVersion(?NodeVersion $version = null) - { - $this->version = $version; - - return $this; - } - - /** - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->createdAt; - } - - /** - * @param \DateTime $createdAt - * - * @return self - */ - public function setCreatedAt(?\DateTime $createdAt = null) - { - $this->createdAt = $createdAt; - - return $this; - } - - /** - * @return \DateTime - */ - public function getUpdatedAt() - { - return $this->updatedAt; - } - - /** - * @param \DateTime $updatedAt - * - * @return self - */ - public function setUpdatedAt(?\DateTime $updatedAt = null) - { - $this->updatedAt = $updatedAt; - - return $this; - } - - /** - * @return SwarmNetworkSpec - */ - public function getSpec() - { - return $this->spec; - } - - /** - * @param SwarmNetworkSpec $spec - * - * @return self - */ - public function setSpec(?SwarmNetworkSpec $spec = null) - { - $this->spec = $spec; - - return $this; - } - - /** - * @return Driver - */ - public function getDriverState() - { - return $this->driverState; - } - - /** - * @param Driver $driverState - * - * @return self - */ - public function setDriverState(?Driver $driverState = null) - { - $this->driverState = $driverState; - - return $this; - } - - /** - * @return SwarmIPAMOptions - */ - public function getIPAM() - { - return $this->iPAM; - } - - /** - * @param SwarmIPAMOptions $iPAM - * - * @return self - */ - public function setIPAM(?SwarmIPAMOptions $iPAM = null) - { - $this->iPAM = $iPAM; - - return $this; - } -} diff --git a/generated/Model/SwarmNetworkSpec.php b/generated/Model/SwarmNetworkSpec.php deleted file mode 100644 index 3b216f70..00000000 --- a/generated/Model/SwarmNetworkSpec.php +++ /dev/null @@ -1,151 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } - - /** - * @return string[]|null - */ - public function getLabels() - { - return $this->labels; - } - - /** - * @param string[]|null $labels - * - * @return self - */ - public function setLabels($labels = null) - { - $this->labels = $labels; - - return $this; - } - - /** - * @return Driver - */ - public function getDriverConfiguration() - { - return $this->driverConfiguration; - } - - /** - * @param Driver $driverConfiguration - * - * @return self - */ - public function setDriverConfiguration(?Driver $driverConfiguration = null) - { - $this->driverConfiguration = $driverConfiguration; - - return $this; - } - - /** - * @return bool - */ - public function getIPv6Enabled() - { - return $this->iPv6Enabled; - } - - /** - * @param bool $iPv6Enabled - * - * @return self - */ - public function setIPv6Enabled($iPv6Enabled = null) - { - $this->iPv6Enabled = $iPv6Enabled; - - return $this; - } - - /** - * @return bool - */ - public function getInternal() - { - return $this->internal; - } - - /** - * @param bool $internal - * - * @return self - */ - public function setInternal($internal = null) - { - $this->internal = $internal; - - return $this; - } - - /** - * @return SwarmIPAMOptions - */ - public function getIPAM() - { - return $this->iPAM; - } - - /** - * @param SwarmIPAMOptions $iPAM - * - * @return self - */ - public function setIPAM(?SwarmIPAMOptions $iPAM = null) - { - $this->iPAM = $iPAM; - - return $this; - } -} diff --git a/generated/Model/SwarmSpec.php b/generated/Model/SwarmSpec.php new file mode 100644 index 00000000..d0dc6d28 --- /dev/null +++ b/generated/Model/SwarmSpec.php @@ -0,0 +1,239 @@ +initialized); + } + /** + * Name of the swarm. + * + * @var string|null + */ + protected $name; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * Orchestration configuration. + * + * @var SwarmSpecOrchestration|null + */ + protected $orchestration; + /** + * Raft configuration. + * + * @var SwarmSpecRaft|null + */ + protected $raft; + /** + * Dispatcher configuration. + * + * @var SwarmSpecDispatcher|null + */ + protected $dispatcher; + /** + * CA configuration. + * + * @var SwarmSpecCAConfig|null + */ + protected $cAConfig; + /** + * Parameters related to encryption-at-rest. + * + * @var SwarmSpecEncryptionConfig|null + */ + protected $encryptionConfig; + /** + * Defaults for creating tasks in this cluster. + * + * @var SwarmSpecTaskDefaults|null + */ + protected $taskDefaults; + /** + * Name of the swarm. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Name of the swarm. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * Orchestration configuration. + * + * @return SwarmSpecOrchestration|null + */ + public function getOrchestration(): ?SwarmSpecOrchestration + { + return $this->orchestration; + } + /** + * Orchestration configuration. + * + * @param SwarmSpecOrchestration|null $orchestration + * + * @return self + */ + public function setOrchestration(?SwarmSpecOrchestration $orchestration): self + { + $this->initialized['orchestration'] = true; + $this->orchestration = $orchestration; + return $this; + } + /** + * Raft configuration. + * + * @return SwarmSpecRaft|null + */ + public function getRaft(): ?SwarmSpecRaft + { + return $this->raft; + } + /** + * Raft configuration. + * + * @param SwarmSpecRaft|null $raft + * + * @return self + */ + public function setRaft(?SwarmSpecRaft $raft): self + { + $this->initialized['raft'] = true; + $this->raft = $raft; + return $this; + } + /** + * Dispatcher configuration. + * + * @return SwarmSpecDispatcher|null + */ + public function getDispatcher(): ?SwarmSpecDispatcher + { + return $this->dispatcher; + } + /** + * Dispatcher configuration. + * + * @param SwarmSpecDispatcher|null $dispatcher + * + * @return self + */ + public function setDispatcher(?SwarmSpecDispatcher $dispatcher): self + { + $this->initialized['dispatcher'] = true; + $this->dispatcher = $dispatcher; + return $this; + } + /** + * CA configuration. + * + * @return SwarmSpecCAConfig|null + */ + public function getCAConfig(): ?SwarmSpecCAConfig + { + return $this->cAConfig; + } + /** + * CA configuration. + * + * @param SwarmSpecCAConfig|null $cAConfig + * + * @return self + */ + public function setCAConfig(?SwarmSpecCAConfig $cAConfig): self + { + $this->initialized['cAConfig'] = true; + $this->cAConfig = $cAConfig; + return $this; + } + /** + * Parameters related to encryption-at-rest. + * + * @return SwarmSpecEncryptionConfig|null + */ + public function getEncryptionConfig(): ?SwarmSpecEncryptionConfig + { + return $this->encryptionConfig; + } + /** + * Parameters related to encryption-at-rest. + * + * @param SwarmSpecEncryptionConfig|null $encryptionConfig + * + * @return self + */ + public function setEncryptionConfig(?SwarmSpecEncryptionConfig $encryptionConfig): self + { + $this->initialized['encryptionConfig'] = true; + $this->encryptionConfig = $encryptionConfig; + return $this; + } + /** + * Defaults for creating tasks in this cluster. + * + * @return SwarmSpecTaskDefaults|null + */ + public function getTaskDefaults(): ?SwarmSpecTaskDefaults + { + return $this->taskDefaults; + } + /** + * Defaults for creating tasks in this cluster. + * + * @param SwarmSpecTaskDefaults|null $taskDefaults + * + * @return self + */ + public function setTaskDefaults(?SwarmSpecTaskDefaults $taskDefaults): self + { + $this->initialized['taskDefaults'] = true; + $this->taskDefaults = $taskDefaults; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmSpecCAConfig.php b/generated/Model/SwarmSpecCAConfig.php new file mode 100644 index 00000000..b1a4313e --- /dev/null +++ b/generated/Model/SwarmSpecCAConfig.php @@ -0,0 +1,182 @@ +initialized); + } + /** + * The duration node certificates are issued for. + * + * @var int|null + */ + protected $nodeCertExpiry; + /** + * Configuration for forwarding signing requests to an external + certificate authority. + + * + * @var list|null + */ + protected $externalCAs; + /** + * The desired signing CA certificate for all swarm node TLS leaf + certificates, in PEM format. + + * + * @var string|null + */ + protected $signingCACert; + /** + * The desired signing CA key for all swarm node TLS leaf certificates, + in PEM format. + + * + * @var string|null + */ + protected $signingCAKey; + /** + * An integer whose purpose is to force swarm to generate a new + signing CA certificate and key, if none have been specified in + `SigningCACert` and `SigningCAKey` + + * + * @var int|null + */ + protected $forceRotate; + /** + * The duration node certificates are issued for. + * + * @return int|null + */ + public function getNodeCertExpiry(): ?int + { + return $this->nodeCertExpiry; + } + /** + * The duration node certificates are issued for. + * + * @param int|null $nodeCertExpiry + * + * @return self + */ + public function setNodeCertExpiry(?int $nodeCertExpiry): self + { + $this->initialized['nodeCertExpiry'] = true; + $this->nodeCertExpiry = $nodeCertExpiry; + return $this; + } + /** + * Configuration for forwarding signing requests to an external + certificate authority. + + * + * @return list|null + */ + public function getExternalCAs(): ?array + { + return $this->externalCAs; + } + /** + * Configuration for forwarding signing requests to an external + certificate authority. + + * + * @param list|null $externalCAs + * + * @return self + */ + public function setExternalCAs(?array $externalCAs): self + { + $this->initialized['externalCAs'] = true; + $this->externalCAs = $externalCAs; + return $this; + } + /** + * The desired signing CA certificate for all swarm node TLS leaf + certificates, in PEM format. + + * + * @return string|null + */ + public function getSigningCACert(): ?string + { + return $this->signingCACert; + } + /** + * The desired signing CA certificate for all swarm node TLS leaf + certificates, in PEM format. + + * + * @param string|null $signingCACert + * + * @return self + */ + public function setSigningCACert(?string $signingCACert): self + { + $this->initialized['signingCACert'] = true; + $this->signingCACert = $signingCACert; + return $this; + } + /** + * The desired signing CA key for all swarm node TLS leaf certificates, + in PEM format. + + * + * @return string|null + */ + public function getSigningCAKey(): ?string + { + return $this->signingCAKey; + } + /** + * The desired signing CA key for all swarm node TLS leaf certificates, + in PEM format. + + * + * @param string|null $signingCAKey + * + * @return self + */ + public function setSigningCAKey(?string $signingCAKey): self + { + $this->initialized['signingCAKey'] = true; + $this->signingCAKey = $signingCAKey; + return $this; + } + /** + * An integer whose purpose is to force swarm to generate a new + signing CA certificate and key, if none have been specified in + `SigningCACert` and `SigningCAKey` + + * + * @return int|null + */ + public function getForceRotate(): ?int + { + return $this->forceRotate; + } + /** + * An integer whose purpose is to force swarm to generate a new + signing CA certificate and key, if none have been specified in + `SigningCACert` and `SigningCAKey` + + * + * @param int|null $forceRotate + * + * @return self + */ + public function setForceRotate(?int $forceRotate): self + { + $this->initialized['forceRotate'] = true; + $this->forceRotate = $forceRotate; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmSpecCAConfigExternalCAsItem.php b/generated/Model/SwarmSpecCAConfigExternalCAsItem.php new file mode 100644 index 00000000..c055ba65 --- /dev/null +++ b/generated/Model/SwarmSpecCAConfigExternalCAsItem.php @@ -0,0 +1,148 @@ +initialized); + } + /** + * Protocol for communication with the external CA (currently + only `cfssl` is supported). + + * + * @var string|null + */ + protected $protocol = 'cfssl'; + /** + * URL where certificate signing requests should be sent. + * + * @var string|null + */ + protected $uRL; + /** + * An object with key/value pairs that are interpreted as + protocol-specific options for the external CA driver. + + * + * @var array|null + */ + protected $options; + /** + * The root CA certificate (in PEM format) this external CA uses + to issue TLS certificates (assumed to be to the current swarm + root CA certificate if not provided). + + * + * @var string|null + */ + protected $cACert; + /** + * Protocol for communication with the external CA (currently + only `cfssl` is supported). + + * + * @return string|null + */ + public function getProtocol(): ?string + { + return $this->protocol; + } + /** + * Protocol for communication with the external CA (currently + only `cfssl` is supported). + + * + * @param string|null $protocol + * + * @return self + */ + public function setProtocol(?string $protocol): self + { + $this->initialized['protocol'] = true; + $this->protocol = $protocol; + return $this; + } + /** + * URL where certificate signing requests should be sent. + * + * @return string|null + */ + public function getURL(): ?string + { + return $this->uRL; + } + /** + * URL where certificate signing requests should be sent. + * + * @param string|null $uRL + * + * @return self + */ + public function setURL(?string $uRL): self + { + $this->initialized['uRL'] = true; + $this->uRL = $uRL; + return $this; + } + /** + * An object with key/value pairs that are interpreted as + protocol-specific options for the external CA driver. + + * + * @return array|null + */ + public function getOptions(): ?iterable + { + return $this->options; + } + /** + * An object with key/value pairs that are interpreted as + protocol-specific options for the external CA driver. + + * + * @param array|null $options + * + * @return self + */ + public function setOptions(?iterable $options): self + { + $this->initialized['options'] = true; + $this->options = $options; + return $this; + } + /** + * The root CA certificate (in PEM format) this external CA uses + to issue TLS certificates (assumed to be to the current swarm + root CA certificate if not provided). + + * + * @return string|null + */ + public function getCACert(): ?string + { + return $this->cACert; + } + /** + * The root CA certificate (in PEM format) this external CA uses + to issue TLS certificates (assumed to be to the current swarm + root CA certificate if not provided). + + * + * @param string|null $cACert + * + * @return self + */ + public function setCACert(?string $cACert): self + { + $this->initialized['cACert'] = true; + $this->cACert = $cACert; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmSpecDispatcher.php b/generated/Model/SwarmSpecDispatcher.php new file mode 100644 index 00000000..4716d5be --- /dev/null +++ b/generated/Model/SwarmSpecDispatcher.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * The delay for an agent to send a heartbeat to the dispatcher. + * + * @var int|null + */ + protected $heartbeatPeriod; + /** + * The delay for an agent to send a heartbeat to the dispatcher. + * + * @return int|null + */ + public function getHeartbeatPeriod(): ?int + { + return $this->heartbeatPeriod; + } + /** + * The delay for an agent to send a heartbeat to the dispatcher. + * + * @param int|null $heartbeatPeriod + * + * @return self + */ + public function setHeartbeatPeriod(?int $heartbeatPeriod): self + { + $this->initialized['heartbeatPeriod'] = true; + $this->heartbeatPeriod = $heartbeatPeriod; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmSpecEncryptionConfig.php b/generated/Model/SwarmSpecEncryptionConfig.php new file mode 100644 index 00000000..c52b09f4 --- /dev/null +++ b/generated/Model/SwarmSpecEncryptionConfig.php @@ -0,0 +1,49 @@ +initialized); + } + /** + * If set, generate a key and use it to lock data stored on the + managers. + + * + * @var bool|null + */ + protected $autoLockManagers; + /** + * If set, generate a key and use it to lock data stored on the + managers. + + * + * @return bool|null + */ + public function getAutoLockManagers(): ?bool + { + return $this->autoLockManagers; + } + /** + * If set, generate a key and use it to lock data stored on the + managers. + + * + * @param bool|null $autoLockManagers + * + * @return self + */ + public function setAutoLockManagers(?bool $autoLockManagers): self + { + $this->initialized['autoLockManagers'] = true; + $this->autoLockManagers = $autoLockManagers; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmSpecOrchestration.php b/generated/Model/SwarmSpecOrchestration.php new file mode 100644 index 00000000..2d846d47 --- /dev/null +++ b/generated/Model/SwarmSpecOrchestration.php @@ -0,0 +1,49 @@ +initialized); + } + /** + * The number of historic tasks to keep per instance or node. If + negative, never remove completed or failed tasks. + + * + * @var int|null + */ + protected $taskHistoryRetentionLimit; + /** + * The number of historic tasks to keep per instance or node. If + negative, never remove completed or failed tasks. + + * + * @return int|null + */ + public function getTaskHistoryRetentionLimit(): ?int + { + return $this->taskHistoryRetentionLimit; + } + /** + * The number of historic tasks to keep per instance or node. If + negative, never remove completed or failed tasks. + + * + * @param int|null $taskHistoryRetentionLimit + * + * @return self + */ + public function setTaskHistoryRetentionLimit(?int $taskHistoryRetentionLimit): self + { + $this->initialized['taskHistoryRetentionLimit'] = true; + $this->taskHistoryRetentionLimit = $taskHistoryRetentionLimit; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmSpecRaft.php b/generated/Model/SwarmSpecRaft.php new file mode 100644 index 00000000..1bfed085 --- /dev/null +++ b/generated/Model/SwarmSpecRaft.php @@ -0,0 +1,194 @@ +initialized); + } + /** + * The number of log entries between snapshots. + * + * @var int|null + */ + protected $snapshotInterval; + /** + * The number of snapshots to keep beyond the current snapshot. + * + * @var int|null + */ + protected $keepOldSnapshots; + /** + * The number of log entries to keep around to sync up slow followers + after a snapshot is created. + + * + * @var int|null + */ + protected $logEntriesForSlowFollowers; + /** + * The number of ticks that a follower will wait for a message from + the leader before becoming a candidate and starting an election. + `ElectionTick` must be greater than `HeartbeatTick`. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + + * + * @var int|null + */ + protected $electionTick; + /** + * The number of ticks between heartbeats. Every HeartbeatTick ticks, + the leader will send a heartbeat to the followers. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + + * + * @var int|null + */ + protected $heartbeatTick; + /** + * The number of log entries between snapshots. + * + * @return int|null + */ + public function getSnapshotInterval(): ?int + { + return $this->snapshotInterval; + } + /** + * The number of log entries between snapshots. + * + * @param int|null $snapshotInterval + * + * @return self + */ + public function setSnapshotInterval(?int $snapshotInterval): self + { + $this->initialized['snapshotInterval'] = true; + $this->snapshotInterval = $snapshotInterval; + return $this; + } + /** + * The number of snapshots to keep beyond the current snapshot. + * + * @return int|null + */ + public function getKeepOldSnapshots(): ?int + { + return $this->keepOldSnapshots; + } + /** + * The number of snapshots to keep beyond the current snapshot. + * + * @param int|null $keepOldSnapshots + * + * @return self + */ + public function setKeepOldSnapshots(?int $keepOldSnapshots): self + { + $this->initialized['keepOldSnapshots'] = true; + $this->keepOldSnapshots = $keepOldSnapshots; + return $this; + } + /** + * The number of log entries to keep around to sync up slow followers + after a snapshot is created. + + * + * @return int|null + */ + public function getLogEntriesForSlowFollowers(): ?int + { + return $this->logEntriesForSlowFollowers; + } + /** + * The number of log entries to keep around to sync up slow followers + after a snapshot is created. + + * + * @param int|null $logEntriesForSlowFollowers + * + * @return self + */ + public function setLogEntriesForSlowFollowers(?int $logEntriesForSlowFollowers): self + { + $this->initialized['logEntriesForSlowFollowers'] = true; + $this->logEntriesForSlowFollowers = $logEntriesForSlowFollowers; + return $this; + } + /** + * The number of ticks that a follower will wait for a message from + the leader before becoming a candidate and starting an election. + `ElectionTick` must be greater than `HeartbeatTick`. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + + * + * @return int|null + */ + public function getElectionTick(): ?int + { + return $this->electionTick; + } + /** + * The number of ticks that a follower will wait for a message from + the leader before becoming a candidate and starting an election. + `ElectionTick` must be greater than `HeartbeatTick`. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + + * + * @param int|null $electionTick + * + * @return self + */ + public function setElectionTick(?int $electionTick): self + { + $this->initialized['electionTick'] = true; + $this->electionTick = $electionTick; + return $this; + } + /** + * The number of ticks between heartbeats. Every HeartbeatTick ticks, + the leader will send a heartbeat to the followers. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + + * + * @return int|null + */ + public function getHeartbeatTick(): ?int + { + return $this->heartbeatTick; + } + /** + * The number of ticks between heartbeats. Every HeartbeatTick ticks, + the leader will send a heartbeat to the followers. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + + * + * @param int|null $heartbeatTick + * + * @return self + */ + public function setHeartbeatTick(?int $heartbeatTick): self + { + $this->initialized['heartbeatTick'] = true; + $this->heartbeatTick = $heartbeatTick; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmSpecTaskDefaults.php b/generated/Model/SwarmSpecTaskDefaults.php new file mode 100644 index 00000000..d6d82443 --- /dev/null +++ b/generated/Model/SwarmSpecTaskDefaults.php @@ -0,0 +1,58 @@ +initialized); + } + /** + * The log driver to use for tasks created in the orchestrator if + unspecified by a service. + + Updating this value only affects new tasks. Existing tasks continue + to use their previously configured log driver until recreated. + + * + * @var SwarmSpecTaskDefaultsLogDriver|null + */ + protected $logDriver; + /** + * The log driver to use for tasks created in the orchestrator if + unspecified by a service. + + Updating this value only affects new tasks. Existing tasks continue + to use their previously configured log driver until recreated. + + * + * @return SwarmSpecTaskDefaultsLogDriver|null + */ + public function getLogDriver(): ?SwarmSpecTaskDefaultsLogDriver + { + return $this->logDriver; + } + /** + * The log driver to use for tasks created in the orchestrator if + unspecified by a service. + + Updating this value only affects new tasks. Existing tasks continue + to use their previously configured log driver until recreated. + + * + * @param SwarmSpecTaskDefaultsLogDriver|null $logDriver + * + * @return self + */ + public function setLogDriver(?SwarmSpecTaskDefaultsLogDriver $logDriver): self + { + $this->initialized['logDriver'] = true; + $this->logDriver = $logDriver; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmSpecTaskDefaultsLogDriver.php b/generated/Model/SwarmSpecTaskDefaultsLogDriver.php new file mode 100644 index 00000000..0163ce02 --- /dev/null +++ b/generated/Model/SwarmSpecTaskDefaultsLogDriver.php @@ -0,0 +1,77 @@ +initialized); + } + /** + * The log driver to use as a default for new tasks. + * + * @var string|null + */ + protected $name; + /** + * Driver-specific options for the selected log driver, specified + as key/value pairs. + + * + * @var array|null + */ + protected $options; + /** + * The log driver to use as a default for new tasks. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * The log driver to use as a default for new tasks. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * Driver-specific options for the selected log driver, specified + as key/value pairs. + + * + * @return array|null + */ + public function getOptions(): ?iterable + { + return $this->options; + } + /** + * Driver-specific options for the selected log driver, specified + as key/value pairs. + + * + * @param array|null $options + * + * @return self + */ + public function setOptions(?iterable $options): self + { + $this->initialized['options'] = true; + $this->options = $options; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmUnlockPostBody.php b/generated/Model/SwarmUnlockPostBody.php new file mode 100644 index 00000000..729e6c31 --- /dev/null +++ b/generated/Model/SwarmUnlockPostBody.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * The swarm's unlock key. + * + * @var string|null + */ + protected $unlockKey; + /** + * The swarm's unlock key. + * + * @return string|null + */ + public function getUnlockKey(): ?string + { + return $this->unlockKey; + } + /** + * The swarm's unlock key. + * + * @param string|null $unlockKey + * + * @return self + */ + public function setUnlockKey(?string $unlockKey): self + { + $this->initialized['unlockKey'] = true; + $this->unlockKey = $unlockKey; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmUnlockkeyGetResponse200.php b/generated/Model/SwarmUnlockkeyGetResponse200.php new file mode 100644 index 00000000..37706a92 --- /dev/null +++ b/generated/Model/SwarmUnlockkeyGetResponse200.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * The swarm's unlock key. + * + * @var string|null + */ + protected $unlockKey; + /** + * The swarm's unlock key. + * + * @return string|null + */ + public function getUnlockKey(): ?string + { + return $this->unlockKey; + } + /** + * The swarm's unlock key. + * + * @param string|null $unlockKey + * + * @return self + */ + public function setUnlockKey(?string $unlockKey): self + { + $this->initialized['unlockKey'] = true; + $this->unlockKey = $unlockKey; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SwarmUpdateConfig.php b/generated/Model/SwarmUpdateConfig.php deleted file mode 100644 index 16d51efe..00000000 --- a/generated/Model/SwarmUpdateConfig.php +++ /dev/null @@ -1,151 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } - - /** - * @return SwarmConfigSpecOrchestration - */ - public function getOrchestration() - { - return $this->orchestration; - } - - /** - * @param SwarmConfigSpecOrchestration $orchestration - * - * @return self - */ - public function setOrchestration(?SwarmConfigSpecOrchestration $orchestration = null) - { - $this->orchestration = $orchestration; - - return $this; - } - - /** - * @return SwarmConfigSpecRaft - */ - public function getRaft() - { - return $this->raft; - } - - /** - * @param SwarmConfigSpecRaft $raft - * - * @return self - */ - public function setRaft(?SwarmConfigSpecRaft $raft = null) - { - $this->raft = $raft; - - return $this; - } - - /** - * @return SwarmConfigSpecDispatcher - */ - public function getDispatcher() - { - return $this->dispatcher; - } - - /** - * @param SwarmConfigSpecDispatcher $dispatcher - * - * @return self - */ - public function setDispatcher(?SwarmConfigSpecDispatcher $dispatcher = null) - { - $this->dispatcher = $dispatcher; - - return $this; - } - - /** - * @return SwarmConfigSpecCAConfig - */ - public function getCAConfig() - { - return $this->cAConfig; - } - - /** - * @param SwarmConfigSpecCAConfig $cAConfig - * - * @return self - */ - public function setCAConfig(?SwarmConfigSpecCAConfig $cAConfig = null) - { - $this->cAConfig = $cAConfig; - - return $this; - } - - /** - * @return SwarmJoinTokens - */ - public function getJoinTokens() - { - return $this->joinTokens; - } - - /** - * @param SwarmJoinTokens $joinTokens - * - * @return self - */ - public function setJoinTokens(?SwarmJoinTokens $joinTokens = null) - { - $this->joinTokens = $joinTokens; - - return $this; - } -} diff --git a/generated/Model/SystemDfGetResponse200.php b/generated/Model/SystemDfGetResponse200.php new file mode 100644 index 00000000..77bd1b73 --- /dev/null +++ b/generated/Model/SystemDfGetResponse200.php @@ -0,0 +1,155 @@ +initialized); + } + /** + * + * + * @var int|null + */ + protected $layersSize; + /** + * + * + * @var list|null + */ + protected $images; + /** + * + * + * @var list|null + */ + protected $containers; + /** + * + * + * @var list|null + */ + protected $volumes; + /** + * + * + * @var list|null + */ + protected $buildCache; + /** + * + * + * @return int|null + */ + public function getLayersSize(): ?int + { + return $this->layersSize; + } + /** + * + * + * @param int|null $layersSize + * + * @return self + */ + public function setLayersSize(?int $layersSize): self + { + $this->initialized['layersSize'] = true; + $this->layersSize = $layersSize; + return $this; + } + /** + * + * + * @return list|null + */ + public function getImages(): ?array + { + return $this->images; + } + /** + * + * + * @param list|null $images + * + * @return self + */ + public function setImages(?array $images): self + { + $this->initialized['images'] = true; + $this->images = $images; + return $this; + } + /** + * + * + * @return list|null + */ + public function getContainers(): ?array + { + return $this->containers; + } + /** + * + * + * @param list|null $containers + * + * @return self + */ + public function setContainers(?array $containers): self + { + $this->initialized['containers'] = true; + $this->containers = $containers; + return $this; + } + /** + * + * + * @return list|null + */ + public function getVolumes(): ?array + { + return $this->volumes; + } + /** + * + * + * @param list|null $volumes + * + * @return self + */ + public function setVolumes(?array $volumes): self + { + $this->initialized['volumes'] = true; + $this->volumes = $volumes; + return $this; + } + /** + * + * + * @return list|null + */ + public function getBuildCache(): ?array + { + return $this->buildCache; + } + /** + * + * + * @param list|null $buildCache + * + * @return self + */ + public function setBuildCache(?array $buildCache): self + { + $this->initialized['buildCache'] = true; + $this->buildCache = $buildCache; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SystemInfo.php b/generated/Model/SystemInfo.php new file mode 100644 index 00000000..40361b02 --- /dev/null +++ b/generated/Model/SystemInfo.php @@ -0,0 +1,2297 @@ +initialized); + } + /** + * Unique identifier of the daemon. + +


+ + > **Note**: The format of the ID itself is not part of the API, and + > should not be considered stable. + + * + * @var string|null + */ + protected $iD; + /** + * Total number of containers on the host. + * + * @var int|null + */ + protected $containers; + /** + * Number of containers with status `"running"`. + * + * @var int|null + */ + protected $containersRunning; + /** + * Number of containers with status `"paused"`. + * + * @var int|null + */ + protected $containersPaused; + /** + * Number of containers with status `"stopped"`. + * + * @var int|null + */ + protected $containersStopped; + /** + * Total number of images on the host. + + Both _tagged_ and _untagged_ (dangling) images are counted. + + * + * @var int|null + */ + protected $images; + /** + * Name of the storage driver in use. + * + * @var string|null + */ + protected $driver; + /** + * Information specific to the storage driver, provided as + "label" / "value" pairs. + + This information is provided by the storage driver, and formatted + in a way consistent with the output of `docker info` on the command + line. + +


+ + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + + * + * @var list>|null + */ + protected $driverStatus; + /** + * Root directory of persistent Docker state. + + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + on Windows. + + * + * @var string|null + */ + protected $dockerRootDir; + /** + * Available plugins per type. + +


+ + > **Note**: Only unmanaged (V1) plugins are included in this list. + > V1 plugins are "lazily" loaded, and are not returned in this list + > if there is no resource using the plugin. + + * + * @var PluginsInfo|null + */ + protected $plugins; + /** + * Indicates if the host has memory limit support enabled. + * + * @var bool|null + */ + protected $memoryLimit; + /** + * Indicates if the host has memory swap limit support enabled. + * + * @var bool|null + */ + protected $swapLimit; + /** + * Indicates if the host has kernel memory TCP limit support enabled. This + field is omitted if not supported. + + Kernel memory TCP limits are not supported when using cgroups v2, which + does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. + + * + * @var bool|null + */ + protected $kernelMemoryTCP; + /** + * Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + the host. + + * + * @var bool|null + */ + protected $cpuCfsPeriod; + /** + * Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + the host. + + * + * @var bool|null + */ + protected $cpuCfsQuota; + /** + * Indicates if CPU Shares limiting is supported by the host. + * + * @var bool|null + */ + protected $cPUShares; + /** + * Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. + + See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) + + * + * @var bool|null + */ + protected $cPUSet; + /** + * Indicates if the host kernel has PID limit support enabled. + * + * @var bool|null + */ + protected $pidsLimit; + /** + * Indicates if OOM killer disable is supported on the host. + * + * @var bool|null + */ + protected $oomKillDisable; + /** + * Indicates IPv4 forwarding is enabled. + * + * @var bool|null + */ + protected $iPv4Forwarding; + /** + * Indicates if `bridge-nf-call-iptables` is available on the host. + * + * @var bool|null + */ + protected $bridgeNfIptables; + /** + * Indicates if `bridge-nf-call-ip6tables` is available on the host. + * + * @var bool|null + */ + protected $bridgeNfIp6tables; + /** + * Indicates if the daemon is running in debug-mode / with debug-level + logging enabled. + + * + * @var bool|null + */ + protected $debug; + /** + * The total number of file Descriptors in use by the daemon process. + + This information is only returned if debug-mode is enabled. + + * + * @var int|null + */ + protected $nFd; + /** + * The number of goroutines that currently exist. + + This information is only returned if debug-mode is enabled. + + * + * @var int|null + */ + protected $nGoroutines; + /** + * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + format with nano-seconds. + + * + * @var string|null + */ + protected $systemTime; + /** + * The logging driver to use as a default for new containers. + * + * @var string|null + */ + protected $loggingDriver; + /** + * The driver to use for managing cgroups. + * + * @var string|null + */ + protected $cgroupDriver = 'cgroupfs'; + /** + * The version of the cgroup. + * + * @var string|null + */ + protected $cgroupVersion = '1'; + /** + * Number of event listeners subscribed. + * + * @var int|null + */ + protected $nEventsListener; + /** + * Kernel version of the host. + + On Linux, this information obtained from `uname`. On Windows this + information is queried from the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ + registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. + + * + * @var string|null + */ + protected $kernelVersion; + /** + * Name of the host's operating system, for example: "Ubuntu 24.04 LTS" + or "Windows Server 2016 Datacenter" + + * + * @var string|null + */ + protected $operatingSystem; + /** + * Version of the host's operating system + +


+ + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + + * + * @var string|null + */ + protected $oSVersion; + /** + * Generic type of the operating system of the host, as returned by the + Go runtime (`GOOS`). + + Currently returned values are "linux" and "windows". A full list of + possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + + * + * @var string|null + */ + protected $oSType; + /** + * Hardware architecture of the host, as returned by the Go runtime + (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + + * + * @var string|null + */ + protected $architecture; + /** + * The number of logical CPUs usable by the daemon. + + The number of available CPUs is checked by querying the operating + system when the daemon starts. Changes to operating system CPU + allocation after the daemon is started are not reflected. + + * + * @var int|null + */ + protected $nCPU; + /** + * Total amount of physical memory available on the host, in bytes. + * + * @var int|null + */ + protected $memTotal; + /** + * Address / URL of the index server that is used for image search, + and as a default for user authentication for Docker Hub and Docker Cloud. + + * + * @var string|null + */ + protected $indexServerAddress = 'https://index.docker.io/v1/'; + /** + * RegistryServiceConfig stores daemon registry services configuration. + * + * @var RegistryServiceConfig|null + */ + protected $registryConfig; + /** + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @var list|null + */ + protected $genericResources; + /** + * HTTP-proxy configured for the daemon. This value is obtained from the + [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + + * + * @var string|null + */ + protected $httpProxy; + /** + * HTTPS-proxy configured for the daemon. This value is obtained from the + [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + + * + * @var string|null + */ + protected $httpsProxy; + /** + * Comma-separated list of domain extensions for which no proxy should be + used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + environment variable. + + Containers do not automatically inherit this configuration. + + * + * @var string|null + */ + protected $noProxy; + /** + * Hostname of the host. + * + * @var string|null + */ + protected $name; + /** + * User-defined labels (key/value metadata) as set on the daemon. + +


+ + > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + > set through the daemon configuration, and _node_ labels, set from a + > manager node in the Swarm. Node labels are not included in this + > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + > on a manager node in the Swarm. + + * + * @var list|null + */ + protected $labels; + /** + * Indicates if experimental features are enabled on the daemon. + * + * @var bool|null + */ + protected $experimentalBuild; + /** + * Version string of the daemon. + * + * @var string|null + */ + protected $serverVersion; + /** + * List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtimes configured on the daemon. Keys hold the "name" used to + reference the runtime. + + The Docker daemon relies on an OCI compliant runtime (invoked via the + `containerd` daemon) as its interface to the Linux kernel namespaces, + cgroups, and SELinux. + + The default runtime is `runc`, and automatically configured. Additional + runtimes can be configured by the user and will be listed here. + + * + * @var array|null + */ + protected $runtimes; + /** + * Name of the default OCI runtime that is used when starting containers. + + The default can be overridden per-container at create time. + + * + * @var string|null + */ + protected $defaultRuntime = 'runc'; + /** + * Represents generic information about swarm. + * + * @var SwarmInfo|null + */ + protected $swarm; + /** + * Indicates if live restore is enabled. + + If enabled, containers are kept running when the daemon is shutdown + or upon daemon start if running containers are detected. + + * + * @var bool|null + */ + protected $liveRestoreEnabled = false; + /** + * Represents the isolation technology to use as a default for containers. + The supported values are platform-specific. + + If no isolation value is specified on daemon start, on Windows client, + the default is `hyperv`, and on Windows server, the default is `process`. + + This option is currently not used on other platforms. + + * + * @var string|null + */ + protected $isolation = 'default'; + /** + * Name and, optional, path of the `docker-init` binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + + * + * @var string|null + */ + protected $initBinary; + /** + * Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + + * + * @var Commit|null + */ + protected $containerdCommit; + /** + * Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + + * + * @var Commit|null + */ + protected $runcCommit; + /** + * Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + + * + * @var Commit|null + */ + protected $initCommit; + /** + * List of security features that are enabled on the daemon, such as + apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + no-new-privileges. + + Additional configuration options for each security feature may + be present, and are included as a comma-separated list of key/value + pairs. + + * + * @var list|null + */ + protected $securityOptions; + /** + * Reports a summary of the product license on the daemon. + + If a commercial license has been applied to the daemon, information + such as number of nodes, and expiration are included. + + * + * @var string|null + */ + protected $productLicense; + /** + * List of custom default address pools for local networks, which can be + specified in the daemon.json file or dockerd option. + + Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + 10.10.[0-255].0/24 address pools. + + * + * @var list|null + */ + protected $defaultAddressPools; + /** + * List of warnings / informational messages about missing features, or + issues related to the daemon configuration. + + These messages can be printed by the client as information to the user. + + * + * @var list|null + */ + protected $warnings; + /** + * List of directories where (Container Device Interface) CDI + specifications are located. + + These specifications define vendor-specific modifications to an OCI + runtime specification for a container being created. + + An empty list indicates that CDI device injection is disabled. + + Note that since using CDI device injection requires the daemon to have + experimental enabled. For non-experimental daemons an empty list will + always be returned. + + * + * @var list|null + */ + protected $cDISpecDirs; + /** + * Information for connecting to the containerd instance that is used by the daemon. + This is included for debugging purposes only. + + * + * @var ContainerdInfo|null + */ + protected $containerd; + /** + * Unique identifier of the daemon. + +


+ + > **Note**: The format of the ID itself is not part of the API, and + > should not be considered stable. + + * + * @return string|null + */ + public function getID(): ?string + { + return $this->iD; + } + /** + * Unique identifier of the daemon. + +


+ + > **Note**: The format of the ID itself is not part of the API, and + > should not be considered stable. + + * + * @param string|null $iD + * + * @return self + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + return $this; + } + /** + * Total number of containers on the host. + * + * @return int|null + */ + public function getContainers(): ?int + { + return $this->containers; + } + /** + * Total number of containers on the host. + * + * @param int|null $containers + * + * @return self + */ + public function setContainers(?int $containers): self + { + $this->initialized['containers'] = true; + $this->containers = $containers; + return $this; + } + /** + * Number of containers with status `"running"`. + * + * @return int|null + */ + public function getContainersRunning(): ?int + { + return $this->containersRunning; + } + /** + * Number of containers with status `"running"`. + * + * @param int|null $containersRunning + * + * @return self + */ + public function setContainersRunning(?int $containersRunning): self + { + $this->initialized['containersRunning'] = true; + $this->containersRunning = $containersRunning; + return $this; + } + /** + * Number of containers with status `"paused"`. + * + * @return int|null + */ + public function getContainersPaused(): ?int + { + return $this->containersPaused; + } + /** + * Number of containers with status `"paused"`. + * + * @param int|null $containersPaused + * + * @return self + */ + public function setContainersPaused(?int $containersPaused): self + { + $this->initialized['containersPaused'] = true; + $this->containersPaused = $containersPaused; + return $this; + } + /** + * Number of containers with status `"stopped"`. + * + * @return int|null + */ + public function getContainersStopped(): ?int + { + return $this->containersStopped; + } + /** + * Number of containers with status `"stopped"`. + * + * @param int|null $containersStopped + * + * @return self + */ + public function setContainersStopped(?int $containersStopped): self + { + $this->initialized['containersStopped'] = true; + $this->containersStopped = $containersStopped; + return $this; + } + /** + * Total number of images on the host. + + Both _tagged_ and _untagged_ (dangling) images are counted. + + * + * @return int|null + */ + public function getImages(): ?int + { + return $this->images; + } + /** + * Total number of images on the host. + + Both _tagged_ and _untagged_ (dangling) images are counted. + + * + * @param int|null $images + * + * @return self + */ + public function setImages(?int $images): self + { + $this->initialized['images'] = true; + $this->images = $images; + return $this; + } + /** + * Name of the storage driver in use. + * + * @return string|null + */ + public function getDriver(): ?string + { + return $this->driver; + } + /** + * Name of the storage driver in use. + * + * @param string|null $driver + * + * @return self + */ + public function setDriver(?string $driver): self + { + $this->initialized['driver'] = true; + $this->driver = $driver; + return $this; + } + /** + * Information specific to the storage driver, provided as + "label" / "value" pairs. + + This information is provided by the storage driver, and formatted + in a way consistent with the output of `docker info` on the command + line. + +


+ + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + + * + * @return list>|null + */ + public function getDriverStatus(): ?array + { + return $this->driverStatus; + } + /** + * Information specific to the storage driver, provided as + "label" / "value" pairs. + + This information is provided by the storage driver, and formatted + in a way consistent with the output of `docker info` on the command + line. + +


+ + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + + * + * @param list>|null $driverStatus + * + * @return self + */ + public function setDriverStatus(?array $driverStatus): self + { + $this->initialized['driverStatus'] = true; + $this->driverStatus = $driverStatus; + return $this; + } + /** + * Root directory of persistent Docker state. + + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + on Windows. + + * + * @return string|null + */ + public function getDockerRootDir(): ?string + { + return $this->dockerRootDir; + } + /** + * Root directory of persistent Docker state. + + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + on Windows. + + * + * @param string|null $dockerRootDir + * + * @return self + */ + public function setDockerRootDir(?string $dockerRootDir): self + { + $this->initialized['dockerRootDir'] = true; + $this->dockerRootDir = $dockerRootDir; + return $this; + } + /** + * Available plugins per type. + +


+ + > **Note**: Only unmanaged (V1) plugins are included in this list. + > V1 plugins are "lazily" loaded, and are not returned in this list + > if there is no resource using the plugin. + + * + * @return PluginsInfo|null + */ + public function getPlugins(): ?PluginsInfo + { + return $this->plugins; + } + /** + * Available plugins per type. + +


+ + > **Note**: Only unmanaged (V1) plugins are included in this list. + > V1 plugins are "lazily" loaded, and are not returned in this list + > if there is no resource using the plugin. + + * + * @param PluginsInfo|null $plugins + * + * @return self + */ + public function setPlugins(?PluginsInfo $plugins): self + { + $this->initialized['plugins'] = true; + $this->plugins = $plugins; + return $this; + } + /** + * Indicates if the host has memory limit support enabled. + * + * @return bool|null + */ + public function getMemoryLimit(): ?bool + { + return $this->memoryLimit; + } + /** + * Indicates if the host has memory limit support enabled. + * + * @param bool|null $memoryLimit + * + * @return self + */ + public function setMemoryLimit(?bool $memoryLimit): self + { + $this->initialized['memoryLimit'] = true; + $this->memoryLimit = $memoryLimit; + return $this; + } + /** + * Indicates if the host has memory swap limit support enabled. + * + * @return bool|null + */ + public function getSwapLimit(): ?bool + { + return $this->swapLimit; + } + /** + * Indicates if the host has memory swap limit support enabled. + * + * @param bool|null $swapLimit + * + * @return self + */ + public function setSwapLimit(?bool $swapLimit): self + { + $this->initialized['swapLimit'] = true; + $this->swapLimit = $swapLimit; + return $this; + } + /** + * Indicates if the host has kernel memory TCP limit support enabled. This + field is omitted if not supported. + + Kernel memory TCP limits are not supported when using cgroups v2, which + does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. + + * + * @return bool|null + */ + public function getKernelMemoryTCP(): ?bool + { + return $this->kernelMemoryTCP; + } + /** + * Indicates if the host has kernel memory TCP limit support enabled. This + field is omitted if not supported. + + Kernel memory TCP limits are not supported when using cgroups v2, which + does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. + + * + * @param bool|null $kernelMemoryTCP + * + * @return self + */ + public function setKernelMemoryTCP(?bool $kernelMemoryTCP): self + { + $this->initialized['kernelMemoryTCP'] = true; + $this->kernelMemoryTCP = $kernelMemoryTCP; + return $this; + } + /** + * Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + the host. + + * + * @return bool|null + */ + public function getCpuCfsPeriod(): ?bool + { + return $this->cpuCfsPeriod; + } + /** + * Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + the host. + + * + * @param bool|null $cpuCfsPeriod + * + * @return self + */ + public function setCpuCfsPeriod(?bool $cpuCfsPeriod): self + { + $this->initialized['cpuCfsPeriod'] = true; + $this->cpuCfsPeriod = $cpuCfsPeriod; + return $this; + } + /** + * Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + the host. + + * + * @return bool|null + */ + public function getCpuCfsQuota(): ?bool + { + return $this->cpuCfsQuota; + } + /** + * Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + the host. + + * + * @param bool|null $cpuCfsQuota + * + * @return self + */ + public function setCpuCfsQuota(?bool $cpuCfsQuota): self + { + $this->initialized['cpuCfsQuota'] = true; + $this->cpuCfsQuota = $cpuCfsQuota; + return $this; + } + /** + * Indicates if CPU Shares limiting is supported by the host. + * + * @return bool|null + */ + public function getCPUShares(): ?bool + { + return $this->cPUShares; + } + /** + * Indicates if CPU Shares limiting is supported by the host. + * + * @param bool|null $cPUShares + * + * @return self + */ + public function setCPUShares(?bool $cPUShares): self + { + $this->initialized['cPUShares'] = true; + $this->cPUShares = $cPUShares; + return $this; + } + /** + * Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. + + See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) + + * + * @return bool|null + */ + public function getCPUSet(): ?bool + { + return $this->cPUSet; + } + /** + * Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. + + See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) + + * + * @param bool|null $cPUSet + * + * @return self + */ + public function setCPUSet(?bool $cPUSet): self + { + $this->initialized['cPUSet'] = true; + $this->cPUSet = $cPUSet; + return $this; + } + /** + * Indicates if the host kernel has PID limit support enabled. + * + * @return bool|null + */ + public function getPidsLimit(): ?bool + { + return $this->pidsLimit; + } + /** + * Indicates if the host kernel has PID limit support enabled. + * + * @param bool|null $pidsLimit + * + * @return self + */ + public function setPidsLimit(?bool $pidsLimit): self + { + $this->initialized['pidsLimit'] = true; + $this->pidsLimit = $pidsLimit; + return $this; + } + /** + * Indicates if OOM killer disable is supported on the host. + * + * @return bool|null + */ + public function getOomKillDisable(): ?bool + { + return $this->oomKillDisable; + } + /** + * Indicates if OOM killer disable is supported on the host. + * + * @param bool|null $oomKillDisable + * + * @return self + */ + public function setOomKillDisable(?bool $oomKillDisable): self + { + $this->initialized['oomKillDisable'] = true; + $this->oomKillDisable = $oomKillDisable; + return $this; + } + /** + * Indicates IPv4 forwarding is enabled. + * + * @return bool|null + */ + public function getIPv4Forwarding(): ?bool + { + return $this->iPv4Forwarding; + } + /** + * Indicates IPv4 forwarding is enabled. + * + * @param bool|null $iPv4Forwarding + * + * @return self + */ + public function setIPv4Forwarding(?bool $iPv4Forwarding): self + { + $this->initialized['iPv4Forwarding'] = true; + $this->iPv4Forwarding = $iPv4Forwarding; + return $this; + } + /** + * Indicates if `bridge-nf-call-iptables` is available on the host. + * + * @return bool|null + */ + public function getBridgeNfIptables(): ?bool + { + return $this->bridgeNfIptables; + } + /** + * Indicates if `bridge-nf-call-iptables` is available on the host. + * + * @param bool|null $bridgeNfIptables + * + * @return self + */ + public function setBridgeNfIptables(?bool $bridgeNfIptables): self + { + $this->initialized['bridgeNfIptables'] = true; + $this->bridgeNfIptables = $bridgeNfIptables; + return $this; + } + /** + * Indicates if `bridge-nf-call-ip6tables` is available on the host. + * + * @return bool|null + */ + public function getBridgeNfIp6tables(): ?bool + { + return $this->bridgeNfIp6tables; + } + /** + * Indicates if `bridge-nf-call-ip6tables` is available on the host. + * + * @param bool|null $bridgeNfIp6tables + * + * @return self + */ + public function setBridgeNfIp6tables(?bool $bridgeNfIp6tables): self + { + $this->initialized['bridgeNfIp6tables'] = true; + $this->bridgeNfIp6tables = $bridgeNfIp6tables; + return $this; + } + /** + * Indicates if the daemon is running in debug-mode / with debug-level + logging enabled. + + * + * @return bool|null + */ + public function getDebug(): ?bool + { + return $this->debug; + } + /** + * Indicates if the daemon is running in debug-mode / with debug-level + logging enabled. + + * + * @param bool|null $debug + * + * @return self + */ + public function setDebug(?bool $debug): self + { + $this->initialized['debug'] = true; + $this->debug = $debug; + return $this; + } + /** + * The total number of file Descriptors in use by the daemon process. + + This information is only returned if debug-mode is enabled. + + * + * @return int|null + */ + public function getNFd(): ?int + { + return $this->nFd; + } + /** + * The total number of file Descriptors in use by the daemon process. + + This information is only returned if debug-mode is enabled. + + * + * @param int|null $nFd + * + * @return self + */ + public function setNFd(?int $nFd): self + { + $this->initialized['nFd'] = true; + $this->nFd = $nFd; + return $this; + } + /** + * The number of goroutines that currently exist. + + This information is only returned if debug-mode is enabled. + + * + * @return int|null + */ + public function getNGoroutines(): ?int + { + return $this->nGoroutines; + } + /** + * The number of goroutines that currently exist. + + This information is only returned if debug-mode is enabled. + + * + * @param int|null $nGoroutines + * + * @return self + */ + public function setNGoroutines(?int $nGoroutines): self + { + $this->initialized['nGoroutines'] = true; + $this->nGoroutines = $nGoroutines; + return $this; + } + /** + * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + format with nano-seconds. + + * + * @return string|null + */ + public function getSystemTime(): ?string + { + return $this->systemTime; + } + /** + * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + format with nano-seconds. + + * + * @param string|null $systemTime + * + * @return self + */ + public function setSystemTime(?string $systemTime): self + { + $this->initialized['systemTime'] = true; + $this->systemTime = $systemTime; + return $this; + } + /** + * The logging driver to use as a default for new containers. + * + * @return string|null + */ + public function getLoggingDriver(): ?string + { + return $this->loggingDriver; + } + /** + * The logging driver to use as a default for new containers. + * + * @param string|null $loggingDriver + * + * @return self + */ + public function setLoggingDriver(?string $loggingDriver): self + { + $this->initialized['loggingDriver'] = true; + $this->loggingDriver = $loggingDriver; + return $this; + } + /** + * The driver to use for managing cgroups. + * + * @return string|null + */ + public function getCgroupDriver(): ?string + { + return $this->cgroupDriver; + } + /** + * The driver to use for managing cgroups. + * + * @param string|null $cgroupDriver + * + * @return self + */ + public function setCgroupDriver(?string $cgroupDriver): self + { + $this->initialized['cgroupDriver'] = true; + $this->cgroupDriver = $cgroupDriver; + return $this; + } + /** + * The version of the cgroup. + * + * @return string|null + */ + public function getCgroupVersion(): ?string + { + return $this->cgroupVersion; + } + /** + * The version of the cgroup. + * + * @param string|null $cgroupVersion + * + * @return self + */ + public function setCgroupVersion(?string $cgroupVersion): self + { + $this->initialized['cgroupVersion'] = true; + $this->cgroupVersion = $cgroupVersion; + return $this; + } + /** + * Number of event listeners subscribed. + * + * @return int|null + */ + public function getNEventsListener(): ?int + { + return $this->nEventsListener; + } + /** + * Number of event listeners subscribed. + * + * @param int|null $nEventsListener + * + * @return self + */ + public function setNEventsListener(?int $nEventsListener): self + { + $this->initialized['nEventsListener'] = true; + $this->nEventsListener = $nEventsListener; + return $this; + } + /** + * Kernel version of the host. + + On Linux, this information obtained from `uname`. On Windows this + information is queried from the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ + registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. + + * + * @return string|null + */ + public function getKernelVersion(): ?string + { + return $this->kernelVersion; + } + /** + * Kernel version of the host. + + On Linux, this information obtained from `uname`. On Windows this + information is queried from the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ + registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. + + * + * @param string|null $kernelVersion + * + * @return self + */ + public function setKernelVersion(?string $kernelVersion): self + { + $this->initialized['kernelVersion'] = true; + $this->kernelVersion = $kernelVersion; + return $this; + } + /** + * Name of the host's operating system, for example: "Ubuntu 24.04 LTS" + or "Windows Server 2016 Datacenter" + + * + * @return string|null + */ + public function getOperatingSystem(): ?string + { + return $this->operatingSystem; + } + /** + * Name of the host's operating system, for example: "Ubuntu 24.04 LTS" + or "Windows Server 2016 Datacenter" + + * + * @param string|null $operatingSystem + * + * @return self + */ + public function setOperatingSystem(?string $operatingSystem): self + { + $this->initialized['operatingSystem'] = true; + $this->operatingSystem = $operatingSystem; + return $this; + } + /** + * Version of the host's operating system + +


+ + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + + * + * @return string|null + */ + public function getOSVersion(): ?string + { + return $this->oSVersion; + } + /** + * Version of the host's operating system + +


+ + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + + * + * @param string|null $oSVersion + * + * @return self + */ + public function setOSVersion(?string $oSVersion): self + { + $this->initialized['oSVersion'] = true; + $this->oSVersion = $oSVersion; + return $this; + } + /** + * Generic type of the operating system of the host, as returned by the + Go runtime (`GOOS`). + + Currently returned values are "linux" and "windows". A full list of + possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + + * + * @return string|null + */ + public function getOSType(): ?string + { + return $this->oSType; + } + /** + * Generic type of the operating system of the host, as returned by the + Go runtime (`GOOS`). + + Currently returned values are "linux" and "windows". A full list of + possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + + * + * @param string|null $oSType + * + * @return self + */ + public function setOSType(?string $oSType): self + { + $this->initialized['oSType'] = true; + $this->oSType = $oSType; + return $this; + } + /** + * Hardware architecture of the host, as returned by the Go runtime + (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + + * + * @return string|null + */ + public function getArchitecture(): ?string + { + return $this->architecture; + } + /** + * Hardware architecture of the host, as returned by the Go runtime + (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + + * + * @param string|null $architecture + * + * @return self + */ + public function setArchitecture(?string $architecture): self + { + $this->initialized['architecture'] = true; + $this->architecture = $architecture; + return $this; + } + /** + * The number of logical CPUs usable by the daemon. + + The number of available CPUs is checked by querying the operating + system when the daemon starts. Changes to operating system CPU + allocation after the daemon is started are not reflected. + + * + * @return int|null + */ + public function getNCPU(): ?int + { + return $this->nCPU; + } + /** + * The number of logical CPUs usable by the daemon. + + The number of available CPUs is checked by querying the operating + system when the daemon starts. Changes to operating system CPU + allocation after the daemon is started are not reflected. + + * + * @param int|null $nCPU + * + * @return self + */ + public function setNCPU(?int $nCPU): self + { + $this->initialized['nCPU'] = true; + $this->nCPU = $nCPU; + return $this; + } + /** + * Total amount of physical memory available on the host, in bytes. + * + * @return int|null + */ + public function getMemTotal(): ?int + { + return $this->memTotal; + } + /** + * Total amount of physical memory available on the host, in bytes. + * + * @param int|null $memTotal + * + * @return self + */ + public function setMemTotal(?int $memTotal): self + { + $this->initialized['memTotal'] = true; + $this->memTotal = $memTotal; + return $this; + } + /** + * Address / URL of the index server that is used for image search, + and as a default for user authentication for Docker Hub and Docker Cloud. + + * + * @return string|null + */ + public function getIndexServerAddress(): ?string + { + return $this->indexServerAddress; + } + /** + * Address / URL of the index server that is used for image search, + and as a default for user authentication for Docker Hub and Docker Cloud. + + * + * @param string|null $indexServerAddress + * + * @return self + */ + public function setIndexServerAddress(?string $indexServerAddress): self + { + $this->initialized['indexServerAddress'] = true; + $this->indexServerAddress = $indexServerAddress; + return $this; + } + /** + * RegistryServiceConfig stores daemon registry services configuration. + * + * @return RegistryServiceConfig|null + */ + public function getRegistryConfig(): ?RegistryServiceConfig + { + return $this->registryConfig; + } + /** + * RegistryServiceConfig stores daemon registry services configuration. + * + * @param RegistryServiceConfig|null $registryConfig + * + * @return self + */ + public function setRegistryConfig(?RegistryServiceConfig $registryConfig): self + { + $this->initialized['registryConfig'] = true; + $this->registryConfig = $registryConfig; + return $this; + } + /** + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @return list|null + */ + public function getGenericResources(): ?array + { + return $this->genericResources; + } + /** + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @param list|null $genericResources + * + * @return self + */ + public function setGenericResources(?array $genericResources): self + { + $this->initialized['genericResources'] = true; + $this->genericResources = $genericResources; + return $this; + } + /** + * HTTP-proxy configured for the daemon. This value is obtained from the + [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + + * + * @return string|null + */ + public function getHttpProxy(): ?string + { + return $this->httpProxy; + } + /** + * HTTP-proxy configured for the daemon. This value is obtained from the + [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + + * + * @param string|null $httpProxy + * + * @return self + */ + public function setHttpProxy(?string $httpProxy): self + { + $this->initialized['httpProxy'] = true; + $this->httpProxy = $httpProxy; + return $this; + } + /** + * HTTPS-proxy configured for the daemon. This value is obtained from the + [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + + * + * @return string|null + */ + public function getHttpsProxy(): ?string + { + return $this->httpsProxy; + } + /** + * HTTPS-proxy configured for the daemon. This value is obtained from the + [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + + * + * @param string|null $httpsProxy + * + * @return self + */ + public function setHttpsProxy(?string $httpsProxy): self + { + $this->initialized['httpsProxy'] = true; + $this->httpsProxy = $httpsProxy; + return $this; + } + /** + * Comma-separated list of domain extensions for which no proxy should be + used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + environment variable. + + Containers do not automatically inherit this configuration. + + * + * @return string|null + */ + public function getNoProxy(): ?string + { + return $this->noProxy; + } + /** + * Comma-separated list of domain extensions for which no proxy should be + used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + environment variable. + + Containers do not automatically inherit this configuration. + + * + * @param string|null $noProxy + * + * @return self + */ + public function setNoProxy(?string $noProxy): self + { + $this->initialized['noProxy'] = true; + $this->noProxy = $noProxy; + return $this; + } + /** + * Hostname of the host. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Hostname of the host. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * User-defined labels (key/value metadata) as set on the daemon. + +


+ + > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + > set through the daemon configuration, and _node_ labels, set from a + > manager node in the Swarm. Node labels are not included in this + > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + > on a manager node in the Swarm. + + * + * @return list|null + */ + public function getLabels(): ?array + { + return $this->labels; + } + /** + * User-defined labels (key/value metadata) as set on the daemon. + +


+ + > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + > set through the daemon configuration, and _node_ labels, set from a + > manager node in the Swarm. Node labels are not included in this + > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + > on a manager node in the Swarm. + + * + * @param list|null $labels + * + * @return self + */ + public function setLabels(?array $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * Indicates if experimental features are enabled on the daemon. + * + * @return bool|null + */ + public function getExperimentalBuild(): ?bool + { + return $this->experimentalBuild; + } + /** + * Indicates if experimental features are enabled on the daemon. + * + * @param bool|null $experimentalBuild + * + * @return self + */ + public function setExperimentalBuild(?bool $experimentalBuild): self + { + $this->initialized['experimentalBuild'] = true; + $this->experimentalBuild = $experimentalBuild; + return $this; + } + /** + * Version string of the daemon. + * + * @return string|null + */ + public function getServerVersion(): ?string + { + return $this->serverVersion; + } + /** + * Version string of the daemon. + * + * @param string|null $serverVersion + * + * @return self + */ + public function setServerVersion(?string $serverVersion): self + { + $this->initialized['serverVersion'] = true; + $this->serverVersion = $serverVersion; + return $this; + } + /** + * List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtimes configured on the daemon. Keys hold the "name" used to + reference the runtime. + + The Docker daemon relies on an OCI compliant runtime (invoked via the + `containerd` daemon) as its interface to the Linux kernel namespaces, + cgroups, and SELinux. + + The default runtime is `runc`, and automatically configured. Additional + runtimes can be configured by the user and will be listed here. + + * + * @return array|null + */ + public function getRuntimes(): ?iterable + { + return $this->runtimes; + } + /** + * List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtimes configured on the daemon. Keys hold the "name" used to + reference the runtime. + + The Docker daemon relies on an OCI compliant runtime (invoked via the + `containerd` daemon) as its interface to the Linux kernel namespaces, + cgroups, and SELinux. + + The default runtime is `runc`, and automatically configured. Additional + runtimes can be configured by the user and will be listed here. + + * + * @param array|null $runtimes + * + * @return self + */ + public function setRuntimes(?iterable $runtimes): self + { + $this->initialized['runtimes'] = true; + $this->runtimes = $runtimes; + return $this; + } + /** + * Name of the default OCI runtime that is used when starting containers. + + The default can be overridden per-container at create time. + + * + * @return string|null + */ + public function getDefaultRuntime(): ?string + { + return $this->defaultRuntime; + } + /** + * Name of the default OCI runtime that is used when starting containers. + + The default can be overridden per-container at create time. + + * + * @param string|null $defaultRuntime + * + * @return self + */ + public function setDefaultRuntime(?string $defaultRuntime): self + { + $this->initialized['defaultRuntime'] = true; + $this->defaultRuntime = $defaultRuntime; + return $this; + } + /** + * Represents generic information about swarm. + * + * @return SwarmInfo|null + */ + public function getSwarm(): ?SwarmInfo + { + return $this->swarm; + } + /** + * Represents generic information about swarm. + * + * @param SwarmInfo|null $swarm + * + * @return self + */ + public function setSwarm(?SwarmInfo $swarm): self + { + $this->initialized['swarm'] = true; + $this->swarm = $swarm; + return $this; + } + /** + * Indicates if live restore is enabled. + + If enabled, containers are kept running when the daemon is shutdown + or upon daemon start if running containers are detected. + + * + * @return bool|null + */ + public function getLiveRestoreEnabled(): ?bool + { + return $this->liveRestoreEnabled; + } + /** + * Indicates if live restore is enabled. + + If enabled, containers are kept running when the daemon is shutdown + or upon daemon start if running containers are detected. + + * + * @param bool|null $liveRestoreEnabled + * + * @return self + */ + public function setLiveRestoreEnabled(?bool $liveRestoreEnabled): self + { + $this->initialized['liveRestoreEnabled'] = true; + $this->liveRestoreEnabled = $liveRestoreEnabled; + return $this; + } + /** + * Represents the isolation technology to use as a default for containers. + The supported values are platform-specific. + + If no isolation value is specified on daemon start, on Windows client, + the default is `hyperv`, and on Windows server, the default is `process`. + + This option is currently not used on other platforms. + + * + * @return string|null + */ + public function getIsolation(): ?string + { + return $this->isolation; + } + /** + * Represents the isolation technology to use as a default for containers. + The supported values are platform-specific. + + If no isolation value is specified on daemon start, on Windows client, + the default is `hyperv`, and on Windows server, the default is `process`. + + This option is currently not used on other platforms. + + * + * @param string|null $isolation + * + * @return self + */ + public function setIsolation(?string $isolation): self + { + $this->initialized['isolation'] = true; + $this->isolation = $isolation; + return $this; + } + /** + * Name and, optional, path of the `docker-init` binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + + * + * @return string|null + */ + public function getInitBinary(): ?string + { + return $this->initBinary; + } + /** + * Name and, optional, path of the `docker-init` binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + + * + * @param string|null $initBinary + * + * @return self + */ + public function setInitBinary(?string $initBinary): self + { + $this->initialized['initBinary'] = true; + $this->initBinary = $initBinary; + return $this; + } + /** + * Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + + * + * @return Commit|null + */ + public function getContainerdCommit(): ?Commit + { + return $this->containerdCommit; + } + /** + * Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + + * + * @param Commit|null $containerdCommit + * + * @return self + */ + public function setContainerdCommit(?Commit $containerdCommit): self + { + $this->initialized['containerdCommit'] = true; + $this->containerdCommit = $containerdCommit; + return $this; + } + /** + * Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + + * + * @return Commit|null + */ + public function getRuncCommit(): ?Commit + { + return $this->runcCommit; + } + /** + * Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + + * + * @param Commit|null $runcCommit + * + * @return self + */ + public function setRuncCommit(?Commit $runcCommit): self + { + $this->initialized['runcCommit'] = true; + $this->runcCommit = $runcCommit; + return $this; + } + /** + * Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + + * + * @return Commit|null + */ + public function getInitCommit(): ?Commit + { + return $this->initCommit; + } + /** + * Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + + * + * @param Commit|null $initCommit + * + * @return self + */ + public function setInitCommit(?Commit $initCommit): self + { + $this->initialized['initCommit'] = true; + $this->initCommit = $initCommit; + return $this; + } + /** + * List of security features that are enabled on the daemon, such as + apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + no-new-privileges. + + Additional configuration options for each security feature may + be present, and are included as a comma-separated list of key/value + pairs. + + * + * @return list|null + */ + public function getSecurityOptions(): ?array + { + return $this->securityOptions; + } + /** + * List of security features that are enabled on the daemon, such as + apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + no-new-privileges. + + Additional configuration options for each security feature may + be present, and are included as a comma-separated list of key/value + pairs. + + * + * @param list|null $securityOptions + * + * @return self + */ + public function setSecurityOptions(?array $securityOptions): self + { + $this->initialized['securityOptions'] = true; + $this->securityOptions = $securityOptions; + return $this; + } + /** + * Reports a summary of the product license on the daemon. + + If a commercial license has been applied to the daemon, information + such as number of nodes, and expiration are included. + + * + * @return string|null + */ + public function getProductLicense(): ?string + { + return $this->productLicense; + } + /** + * Reports a summary of the product license on the daemon. + + If a commercial license has been applied to the daemon, information + such as number of nodes, and expiration are included. + + * + * @param string|null $productLicense + * + * @return self + */ + public function setProductLicense(?string $productLicense): self + { + $this->initialized['productLicense'] = true; + $this->productLicense = $productLicense; + return $this; + } + /** + * List of custom default address pools for local networks, which can be + specified in the daemon.json file or dockerd option. + + Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + 10.10.[0-255].0/24 address pools. + + * + * @return list|null + */ + public function getDefaultAddressPools(): ?array + { + return $this->defaultAddressPools; + } + /** + * List of custom default address pools for local networks, which can be + specified in the daemon.json file or dockerd option. + + Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + 10.10.[0-255].0/24 address pools. + + * + * @param list|null $defaultAddressPools + * + * @return self + */ + public function setDefaultAddressPools(?array $defaultAddressPools): self + { + $this->initialized['defaultAddressPools'] = true; + $this->defaultAddressPools = $defaultAddressPools; + return $this; + } + /** + * List of warnings / informational messages about missing features, or + issues related to the daemon configuration. + + These messages can be printed by the client as information to the user. + + * + * @return list|null + */ + public function getWarnings(): ?array + { + return $this->warnings; + } + /** + * List of warnings / informational messages about missing features, or + issues related to the daemon configuration. + + These messages can be printed by the client as information to the user. + + * + * @param list|null $warnings + * + * @return self + */ + public function setWarnings(?array $warnings): self + { + $this->initialized['warnings'] = true; + $this->warnings = $warnings; + return $this; + } + /** + * List of directories where (Container Device Interface) CDI + specifications are located. + + These specifications define vendor-specific modifications to an OCI + runtime specification for a container being created. + + An empty list indicates that CDI device injection is disabled. + + Note that since using CDI device injection requires the daemon to have + experimental enabled. For non-experimental daemons an empty list will + always be returned. + + * + * @return list|null + */ + public function getCDISpecDirs(): ?array + { + return $this->cDISpecDirs; + } + /** + * List of directories where (Container Device Interface) CDI + specifications are located. + + These specifications define vendor-specific modifications to an OCI + runtime specification for a container being created. + + An empty list indicates that CDI device injection is disabled. + + Note that since using CDI device injection requires the daemon to have + experimental enabled. For non-experimental daemons an empty list will + always be returned. + + * + * @param list|null $cDISpecDirs + * + * @return self + */ + public function setCDISpecDirs(?array $cDISpecDirs): self + { + $this->initialized['cDISpecDirs'] = true; + $this->cDISpecDirs = $cDISpecDirs; + return $this; + } + /** + * Information for connecting to the containerd instance that is used by the daemon. + This is included for debugging purposes only. + + * + * @return ContainerdInfo|null + */ + public function getContainerd(): ?ContainerdInfo + { + return $this->containerd; + } + /** + * Information for connecting to the containerd instance that is used by the daemon. + This is included for debugging purposes only. + + * + * @param ContainerdInfo|null $containerd + * + * @return self + */ + public function setContainerd(?ContainerdInfo $containerd): self + { + $this->initialized['containerd'] = true; + $this->containerd = $containerd; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SystemInfoDefaultAddressPoolsItem.php b/generated/Model/SystemInfoDefaultAddressPoolsItem.php new file mode 100644 index 00000000..d151a3d3 --- /dev/null +++ b/generated/Model/SystemInfoDefaultAddressPoolsItem.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * The network address in CIDR format + * + * @var string|null + */ + protected $base; + /** + * The network pool size + * + * @var int|null + */ + protected $size; + /** + * The network address in CIDR format + * + * @return string|null + */ + public function getBase(): ?string + { + return $this->base; + } + /** + * The network address in CIDR format + * + * @param string|null $base + * + * @return self + */ + public function setBase(?string $base): self + { + $this->initialized['base'] = true; + $this->base = $base; + return $this; + } + /** + * The network pool size + * + * @return int|null + */ + public function getSize(): ?int + { + return $this->size; + } + /** + * The network pool size + * + * @param int|null $size + * + * @return self + */ + public function setSize(?int $size): self + { + $this->initialized['size'] = true; + $this->size = $size; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SystemInformation.php b/generated/Model/SystemInformation.php deleted file mode 100644 index 9581cad8..00000000 --- a/generated/Model/SystemInformation.php +++ /dev/null @@ -1,1039 +0,0 @@ -architecture; - } - - /** - * @param string $architecture - * - * @return self - */ - public function setArchitecture($architecture = null) - { - $this->architecture = $architecture; - - return $this; - } - - /** - * @return string - */ - public function getClusterStore() - { - return $this->clusterStore; - } - - /** - * @param string $clusterStore - * - * @return self - */ - public function setClusterStore($clusterStore = null) - { - $this->clusterStore = $clusterStore; - - return $this; - } - - /** - * @return string - */ - public function getCgroupDriver() - { - return $this->cgroupDriver; - } - - /** - * @param string $cgroupDriver - * - * @return self - */ - public function setCgroupDriver($cgroupDriver = null) - { - $this->cgroupDriver = $cgroupDriver; - - return $this; - } - - /** - * @return int - */ - public function getContainers() - { - return $this->containers; - } - - /** - * @param int $containers - * - * @return self - */ - public function setContainers($containers = null) - { - $this->containers = $containers; - - return $this; - } - - /** - * @return int - */ - public function getContainersRunning() - { - return $this->containersRunning; - } - - /** - * @param int $containersRunning - * - * @return self - */ - public function setContainersRunning($containersRunning = null) - { - $this->containersRunning = $containersRunning; - - return $this; - } - - /** - * @return int - */ - public function getContainersStopped() - { - return $this->containersStopped; - } - - /** - * @param int $containersStopped - * - * @return self - */ - public function setContainersStopped($containersStopped = null) - { - $this->containersStopped = $containersStopped; - - return $this; - } - - /** - * @return int - */ - public function getContainersPaused() - { - return $this->containersPaused; - } - - /** - * @param int $containersPaused - * - * @return self - */ - public function setContainersPaused($containersPaused = null) - { - $this->containersPaused = $containersPaused; - - return $this; - } - - /** - * @return bool - */ - public function getCpuCfsPeriod() - { - return $this->cpuCfsPeriod; - } - - /** - * @param bool $cpuCfsPeriod - * - * @return self - */ - public function setCpuCfsPeriod($cpuCfsPeriod = null) - { - $this->cpuCfsPeriod = $cpuCfsPeriod; - - return $this; - } - - /** - * @return bool - */ - public function getCpuCfsQuota() - { - return $this->cpuCfsQuota; - } - - /** - * @param bool $cpuCfsQuota - * - * @return self - */ - public function setCpuCfsQuota($cpuCfsQuota = null) - { - $this->cpuCfsQuota = $cpuCfsQuota; - - return $this; - } - - /** - * @return bool - */ - public function getDebug() - { - return $this->debug; - } - - /** - * @param bool $debug - * - * @return self - */ - public function setDebug($debug = null) - { - $this->debug = $debug; - - return $this; - } - - /** - * @return string - */ - public function getDiscoveryBackend() - { - return $this->discoveryBackend; - } - - /** - * @param string $discoveryBackend - * - * @return self - */ - public function setDiscoveryBackend($discoveryBackend = null) - { - $this->discoveryBackend = $discoveryBackend; - - return $this; - } - - /** - * @return string - */ - public function getDockerRootDir() - { - return $this->dockerRootDir; - } - - /** - * @param string $dockerRootDir - * - * @return self - */ - public function setDockerRootDir($dockerRootDir = null) - { - $this->dockerRootDir = $dockerRootDir; - - return $this; - } - - /** - * @return string - */ - public function getDriver() - { - return $this->driver; - } - - /** - * @param string $driver - * - * @return self - */ - public function setDriver($driver = null) - { - $this->driver = $driver; - - return $this; - } - - /** - * @return string[][]|null[]|null - */ - public function getDriverStatus() - { - return $this->driverStatus; - } - - /** - * @param string[][]|null[]|null $driverStatus - * - * @return self - */ - public function setDriverStatus($driverStatus = null) - { - $this->driverStatus = $driverStatus; - - return $this; - } - - /** - * @return string[][]|null[]|null - */ - public function getSystemStatus() - { - return $this->systemStatus; - } - - /** - * @param string[][]|null[]|null $systemStatus - * - * @return self - */ - public function setSystemStatus($systemStatus = null) - { - $this->systemStatus = $systemStatus; - - return $this; - } - - /** - * @return bool - */ - public function getExperimentalBuild() - { - return $this->experimentalBuild; - } - - /** - * @param bool $experimentalBuild - * - * @return self - */ - public function setExperimentalBuild($experimentalBuild = null) - { - $this->experimentalBuild = $experimentalBuild; - - return $this; - } - - /** - * @return string - */ - public function getHttpProxy() - { - return $this->httpProxy; - } - - /** - * @param string $httpProxy - * - * @return self - */ - public function setHttpProxy($httpProxy = null) - { - $this->httpProxy = $httpProxy; - - return $this; - } - - /** - * @return string - */ - public function getHttpsProxy() - { - return $this->httpsProxy; - } - - /** - * @param string $httpsProxy - * - * @return self - */ - public function setHttpsProxy($httpsProxy = null) - { - $this->httpsProxy = $httpsProxy; - - return $this; - } - - /** - * @return string - */ - public function getID() - { - return $this->iD; - } - - /** - * @param string $iD - * - * @return self - */ - public function setID($iD = null) - { - $this->iD = $iD; - - return $this; - } - - /** - * @return bool - */ - public function getIPv4Forwarding() - { - return $this->iPv4Forwarding; - } - - /** - * @param bool $iPv4Forwarding - * - * @return self - */ - public function setIPv4Forwarding($iPv4Forwarding = null) - { - $this->iPv4Forwarding = $iPv4Forwarding; - - return $this; - } - - /** - * @return int - */ - public function getImages() - { - return $this->images; - } - - /** - * @param int $images - * - * @return self - */ - public function setImages($images = null) - { - $this->images = $images; - - return $this; - } - - /** - * @return string - */ - public function getIndexServerAddress() - { - return $this->indexServerAddress; - } - - /** - * @param string $indexServerAddress - * - * @return self - */ - public function setIndexServerAddress($indexServerAddress = null) - { - $this->indexServerAddress = $indexServerAddress; - - return $this; - } - - /** - * @return string - */ - public function getInitPath() - { - return $this->initPath; - } - - /** - * @param string $initPath - * - * @return self - */ - public function setInitPath($initPath = null) - { - $this->initPath = $initPath; - - return $this; - } - - /** - * @return string - */ - public function getInitSha1() - { - return $this->initSha1; - } - - /** - * @param string $initSha1 - * - * @return self - */ - public function setInitSha1($initSha1 = null) - { - $this->initSha1 = $initSha1; - - return $this; - } - - /** - * @return bool - */ - public function getKernelMemory() - { - return $this->kernelMemory; - } - - /** - * @param bool $kernelMemory - * - * @return self - */ - public function setKernelMemory($kernelMemory = null) - { - $this->kernelMemory = $kernelMemory; - - return $this; - } - - /** - * @return string - */ - public function getKernelVersion() - { - return $this->kernelVersion; - } - - /** - * @param string $kernelVersion - * - * @return self - */ - public function setKernelVersion($kernelVersion = null) - { - $this->kernelVersion = $kernelVersion; - - return $this; - } - - /** - * @return string[]|null - */ - public function getLabels() - { - return $this->labels; - } - - /** - * @param string[]|null $labels - * - * @return self - */ - public function setLabels($labels = null) - { - $this->labels = $labels; - - return $this; - } - - /** - * @return int - */ - public function getMemTotal() - { - return $this->memTotal; - } - - /** - * @param int $memTotal - * - * @return self - */ - public function setMemTotal($memTotal = null) - { - $this->memTotal = $memTotal; - - return $this; - } - - /** - * @return bool - */ - public function getMemoryLimit() - { - return $this->memoryLimit; - } - - /** - * @param bool $memoryLimit - * - * @return self - */ - public function setMemoryLimit($memoryLimit = null) - { - $this->memoryLimit = $memoryLimit; - - return $this; - } - - /** - * @return int - */ - public function getNCPU() - { - return $this->nCPU; - } - - /** - * @param int $nCPU - * - * @return self - */ - public function setNCPU($nCPU = null) - { - $this->nCPU = $nCPU; - - return $this; - } - - /** - * @return int - */ - public function getNEventsListener() - { - return $this->nEventsListener; - } - - /** - * @param int $nEventsListener - * - * @return self - */ - public function setNEventsListener($nEventsListener = null) - { - $this->nEventsListener = $nEventsListener; - - return $this; - } - - /** - * @return int - */ - public function getNFd() - { - return $this->nFd; - } - - /** - * @param int $nFd - * - * @return self - */ - public function setNFd($nFd = null) - { - $this->nFd = $nFd; - - return $this; - } - - /** - * @return int - */ - public function getNGoroutines() - { - return $this->nGoroutines; - } - - /** - * @param int $nGoroutines - * - * @return self - */ - public function setNGoroutines($nGoroutines = null) - { - $this->nGoroutines = $nGoroutines; - - return $this; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getNoProxy() - { - return $this->noProxy; - } - - /** - * @param string $noProxy - * - * @return self - */ - public function setNoProxy($noProxy = null) - { - $this->noProxy = $noProxy; - - return $this; - } - - /** - * @return bool - */ - public function getOomKillDisable() - { - return $this->oomKillDisable; - } - - /** - * @param bool $oomKillDisable - * - * @return self - */ - public function setOomKillDisable($oomKillDisable = null) - { - $this->oomKillDisable = $oomKillDisable; - - return $this; - } - - /** - * @return string - */ - public function getOSType() - { - return $this->oSType; - } - - /** - * @param string $oSType - * - * @return self - */ - public function setOSType($oSType = null) - { - $this->oSType = $oSType; - - return $this; - } - - /** - * @return string - */ - public function getOperatingSystem() - { - return $this->operatingSystem; - } - - /** - * @param string $operatingSystem - * - * @return self - */ - public function setOperatingSystem($operatingSystem = null) - { - $this->operatingSystem = $operatingSystem; - - return $this; - } - - /** - * @return RegistryConfig - */ - public function getRegistryConfig() - { - return $this->registryConfig; - } - - /** - * @param RegistryConfig $registryConfig - * - * @return self - */ - public function setRegistryConfig(?RegistryConfig $registryConfig = null) - { - $this->registryConfig = $registryConfig; - - return $this; - } - - /** - * @return string[]|null - */ - public function getSecurityOptions() - { - return $this->securityOptions; - } - - /** - * @param string[]|null $securityOptions - * - * @return self - */ - public function setSecurityOptions($securityOptions = null) - { - $this->securityOptions = $securityOptions; - - return $this; - } - - /** - * @return bool - */ - public function getSwapLimit() - { - return $this->swapLimit; - } - - /** - * @param bool $swapLimit - * - * @return self - */ - public function setSwapLimit($swapLimit = null) - { - $this->swapLimit = $swapLimit; - - return $this; - } - - /** - * @return string - */ - public function getSystemTime() - { - return $this->systemTime; - } - - /** - * @param string $systemTime - * - * @return self - */ - public function setSystemTime($systemTime = null) - { - $this->systemTime = $systemTime; - - return $this; - } - - /** - * @return string - */ - public function getServerVersion() - { - return $this->serverVersion; - } - - /** - * @param string $serverVersion - * - * @return self - */ - public function setServerVersion($serverVersion = null) - { - $this->serverVersion = $serverVersion; - - return $this; - } -} diff --git a/generated/Model/SystemVersion.php b/generated/Model/SystemVersion.php new file mode 100644 index 00000000..53999bdc --- /dev/null +++ b/generated/Model/SystemVersion.php @@ -0,0 +1,375 @@ +initialized); + } + /** + * + * + * @var SystemVersionPlatform|null + */ + protected $platform; + /** + * Information about system components + * + * @var list|null + */ + protected $components; + /** + * The version of the daemon + * + * @var string|null + */ + protected $version; + /** + * The default (and highest) API version that is supported by the daemon + * + * @var string|null + */ + protected $apiVersion; + /** + * The minimum API version that is supported by the daemon + * + * @var string|null + */ + protected $minAPIVersion; + /** + * The Git commit of the source code that was used to build the daemon + * + * @var string|null + */ + protected $gitCommit; + /** + * The version Go used to compile the daemon, and the version of the Go + runtime in use. + + * + * @var string|null + */ + protected $goVersion; + /** + * The operating system that the daemon is running on ("linux" or "windows") + * + * @var string|null + */ + protected $os; + /** + * The architecture that the daemon is running on + * + * @var string|null + */ + protected $arch; + /** + * The kernel version (`uname -r`) that the daemon is running on. + + This field is omitted when empty. + + * + * @var string|null + */ + protected $kernelVersion; + /** + * Indicates if the daemon is started with experimental features enabled. + + This field is omitted when empty / false. + + * + * @var bool|null + */ + protected $experimental; + /** + * The date and time that the daemon was compiled. + * + * @var string|null + */ + protected $buildTime; + /** + * + * + * @return SystemVersionPlatform|null + */ + public function getPlatform(): ?SystemVersionPlatform + { + return $this->platform; + } + /** + * + * + * @param SystemVersionPlatform|null $platform + * + * @return self + */ + public function setPlatform(?SystemVersionPlatform $platform): self + { + $this->initialized['platform'] = true; + $this->platform = $platform; + return $this; + } + /** + * Information about system components + * + * @return list|null + */ + public function getComponents(): ?array + { + return $this->components; + } + /** + * Information about system components + * + * @param list|null $components + * + * @return self + */ + public function setComponents(?array $components): self + { + $this->initialized['components'] = true; + $this->components = $components; + return $this; + } + /** + * The version of the daemon + * + * @return string|null + */ + public function getVersion(): ?string + { + return $this->version; + } + /** + * The version of the daemon + * + * @param string|null $version + * + * @return self + */ + public function setVersion(?string $version): self + { + $this->initialized['version'] = true; + $this->version = $version; + return $this; + } + /** + * The default (and highest) API version that is supported by the daemon + * + * @return string|null + */ + public function getApiVersion(): ?string + { + return $this->apiVersion; + } + /** + * The default (and highest) API version that is supported by the daemon + * + * @param string|null $apiVersion + * + * @return self + */ + public function setApiVersion(?string $apiVersion): self + { + $this->initialized['apiVersion'] = true; + $this->apiVersion = $apiVersion; + return $this; + } + /** + * The minimum API version that is supported by the daemon + * + * @return string|null + */ + public function getMinAPIVersion(): ?string + { + return $this->minAPIVersion; + } + /** + * The minimum API version that is supported by the daemon + * + * @param string|null $minAPIVersion + * + * @return self + */ + public function setMinAPIVersion(?string $minAPIVersion): self + { + $this->initialized['minAPIVersion'] = true; + $this->minAPIVersion = $minAPIVersion; + return $this; + } + /** + * The Git commit of the source code that was used to build the daemon + * + * @return string|null + */ + public function getGitCommit(): ?string + { + return $this->gitCommit; + } + /** + * The Git commit of the source code that was used to build the daemon + * + * @param string|null $gitCommit + * + * @return self + */ + public function setGitCommit(?string $gitCommit): self + { + $this->initialized['gitCommit'] = true; + $this->gitCommit = $gitCommit; + return $this; + } + /** + * The version Go used to compile the daemon, and the version of the Go + runtime in use. + + * + * @return string|null + */ + public function getGoVersion(): ?string + { + return $this->goVersion; + } + /** + * The version Go used to compile the daemon, and the version of the Go + runtime in use. + + * + * @param string|null $goVersion + * + * @return self + */ + public function setGoVersion(?string $goVersion): self + { + $this->initialized['goVersion'] = true; + $this->goVersion = $goVersion; + return $this; + } + /** + * The operating system that the daemon is running on ("linux" or "windows") + * + * @return string|null + */ + public function getOs(): ?string + { + return $this->os; + } + /** + * The operating system that the daemon is running on ("linux" or "windows") + * + * @param string|null $os + * + * @return self + */ + public function setOs(?string $os): self + { + $this->initialized['os'] = true; + $this->os = $os; + return $this; + } + /** + * The architecture that the daemon is running on + * + * @return string|null + */ + public function getArch(): ?string + { + return $this->arch; + } + /** + * The architecture that the daemon is running on + * + * @param string|null $arch + * + * @return self + */ + public function setArch(?string $arch): self + { + $this->initialized['arch'] = true; + $this->arch = $arch; + return $this; + } + /** + * The kernel version (`uname -r`) that the daemon is running on. + + This field is omitted when empty. + + * + * @return string|null + */ + public function getKernelVersion(): ?string + { + return $this->kernelVersion; + } + /** + * The kernel version (`uname -r`) that the daemon is running on. + + This field is omitted when empty. + + * + * @param string|null $kernelVersion + * + * @return self + */ + public function setKernelVersion(?string $kernelVersion): self + { + $this->initialized['kernelVersion'] = true; + $this->kernelVersion = $kernelVersion; + return $this; + } + /** + * Indicates if the daemon is started with experimental features enabled. + + This field is omitted when empty / false. + + * + * @return bool|null + */ + public function getExperimental(): ?bool + { + return $this->experimental; + } + /** + * Indicates if the daemon is started with experimental features enabled. + + This field is omitted when empty / false. + + * + * @param bool|null $experimental + * + * @return self + */ + public function setExperimental(?bool $experimental): self + { + $this->initialized['experimental'] = true; + $this->experimental = $experimental; + return $this; + } + /** + * The date and time that the daemon was compiled. + * + * @return string|null + */ + public function getBuildTime(): ?string + { + return $this->buildTime; + } + /** + * The date and time that the daemon was compiled. + * + * @param string|null $buildTime + * + * @return self + */ + public function setBuildTime(?string $buildTime): self + { + $this->initialized['buildTime'] = true; + $this->buildTime = $buildTime; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SystemVersionComponentsItem.php b/generated/Model/SystemVersionComponentsItem.php new file mode 100644 index 00000000..eb863450 --- /dev/null +++ b/generated/Model/SystemVersionComponentsItem.php @@ -0,0 +1,117 @@ +initialized); + } + /** + * Name of the component + * + * @var string|null + */ + protected $name; + /** + * Version of the component + * + * @var string|null + */ + protected $version; + /** + * Key/value pairs of strings with additional information about the + component. These values are intended for informational purposes + only, and their content is not defined, and not part of the API + specification. + + These messages can be printed by the client as information to the user. + + * + * @var mixed|null + */ + protected $details; + /** + * Name of the component + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Name of the component + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * Version of the component + * + * @return string|null + */ + public function getVersion(): ?string + { + return $this->version; + } + /** + * Version of the component + * + * @param string|null $version + * + * @return self + */ + public function setVersion(?string $version): self + { + $this->initialized['version'] = true; + $this->version = $version; + return $this; + } + /** + * Key/value pairs of strings with additional information about the + component. These values are intended for informational purposes + only, and their content is not defined, and not part of the API + specification. + + These messages can be printed by the client as information to the user. + + * + * @return mixed + */ + public function getDetails() + { + return $this->details; + } + /** + * Key/value pairs of strings with additional information about the + component. These values are intended for informational purposes + only, and their content is not defined, and not part of the API + specification. + + These messages can be printed by the client as information to the user. + + * + * @param mixed $details + * + * @return self + */ + public function setDetails($details): self + { + $this->initialized['details'] = true; + $this->details = $details; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/SystemVersionPlatform.php b/generated/Model/SystemVersionPlatform.php new file mode 100644 index 00000000..a454ca5e --- /dev/null +++ b/generated/Model/SystemVersionPlatform.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $name; + /** + * + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TLSInfo.php b/generated/Model/TLSInfo.php new file mode 100644 index 00000000..2ed42512 --- /dev/null +++ b/generated/Model/TLSInfo.php @@ -0,0 +1,105 @@ +initialized); + } + /** + * The root CA certificate(s) that are used to validate leaf TLS + certificates. + + * + * @var string|null + */ + protected $trustRoot; + /** + * The base64-url-safe-encoded raw subject bytes of the issuer. + * + * @var string|null + */ + protected $certIssuerSubject; + /** + * The base64-url-safe-encoded raw public key bytes of the issuer. + * + * @var string|null + */ + protected $certIssuerPublicKey; + /** + * The root CA certificate(s) that are used to validate leaf TLS + certificates. + + * + * @return string|null + */ + public function getTrustRoot(): ?string + { + return $this->trustRoot; + } + /** + * The root CA certificate(s) that are used to validate leaf TLS + certificates. + + * + * @param string|null $trustRoot + * + * @return self + */ + public function setTrustRoot(?string $trustRoot): self + { + $this->initialized['trustRoot'] = true; + $this->trustRoot = $trustRoot; + return $this; + } + /** + * The base64-url-safe-encoded raw subject bytes of the issuer. + * + * @return string|null + */ + public function getCertIssuerSubject(): ?string + { + return $this->certIssuerSubject; + } + /** + * The base64-url-safe-encoded raw subject bytes of the issuer. + * + * @param string|null $certIssuerSubject + * + * @return self + */ + public function setCertIssuerSubject(?string $certIssuerSubject): self + { + $this->initialized['certIssuerSubject'] = true; + $this->certIssuerSubject = $certIssuerSubject; + return $this; + } + /** + * The base64-url-safe-encoded raw public key bytes of the issuer. + * + * @return string|null + */ + public function getCertIssuerPublicKey(): ?string + { + return $this->certIssuerPublicKey; + } + /** + * The base64-url-safe-encoded raw public key bytes of the issuer. + * + * @param string|null $certIssuerPublicKey + * + * @return self + */ + public function setCertIssuerPublicKey(?string $certIssuerPublicKey): self + { + $this->initialized['certIssuerPublicKey'] = true; + $this->certIssuerPublicKey = $certIssuerPublicKey; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Task.php b/generated/Model/Task.php index 53c4d50b..954aca60 100644 --- a/generated/Model/Task.php +++ b/generated/Model/Task.php @@ -5,339 +5,469 @@ class Task { /** - * @var string + * @var array */ - protected $iD; + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } /** - * @var NodeVersion + * The ID of the task. + * + * @var string|null */ + protected $iD; + /** + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @var ObjectVersion|null + */ protected $version; /** - * @var \DateTime + * + * + * @var string|null */ protected $createdAt; /** - * @var \DateTime + * + * + * @var string|null */ protected $updatedAt; /** - * @var string + * Name of the task. + * + * @var string|null */ protected $name; /** - * @var TaskSpec + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * User modifiable task configuration. + * + * @var TaskSpec|null */ protected $spec; /** - * @var string + * The ID of the service this task is part of. + * + * @var string|null */ protected $serviceID; /** - * @var int + * + * + * @var int|null */ - protected $instance; + protected $slot; /** - * @var string + * The ID of the node that this task is on. + * + * @var string|null */ protected $nodeID; /** - * @var Annotations - */ - protected $serviceAnnotations; + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @var list|null + */ + protected $assignedGenericResources; /** - * @var TaskStatus + * represents the status of a task. + * + * @var TaskStatus|null */ protected $status; /** - * @var string + * + * + * @var string|null */ protected $desiredState; /** - * @var NetworkAttachment[]|null - */ - protected $networksAttachments; - /** - * @var Endpoint - */ - protected $endpoint; - - /** - * @return string + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @var ObjectVersion|null + */ + protected $jobIteration; + /** + * The ID of the task. + * + * @return string|null */ - public function getID() + public function getID(): ?string { return $this->iD; } - /** - * @param string $iD + * The ID of the task. + * + * @param string|null $iD * * @return self */ - public function setID($iD = null) + public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; - return $this; } - /** - * @return NodeVersion - */ - public function getVersion() + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @return ObjectVersion|null + */ + public function getVersion(): ?ObjectVersion { return $this->version; } - /** - * @param NodeVersion $version - * - * @return self - */ - public function setVersion(?NodeVersion $version = null) + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @param ObjectVersion|null $version + * + * @return self + */ + public function setVersion(?ObjectVersion $version): self { + $this->initialized['version'] = true; $this->version = $version; - return $this; } - /** - * @return \DateTime + * + * + * @return string|null */ - public function getCreatedAt() + public function getCreatedAt(): ?string { return $this->createdAt; } - /** - * @param \DateTime $createdAt + * + * + * @param string|null $createdAt * * @return self */ - public function setCreatedAt(?\DateTime $createdAt = null) + public function setCreatedAt(?string $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; - return $this; } - /** - * @return \DateTime + * + * + * @return string|null */ - public function getUpdatedAt() + public function getUpdatedAt(): ?string { return $this->updatedAt; } - /** - * @param \DateTime $updatedAt + * + * + * @param string|null $updatedAt * * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt = null) + public function setUpdatedAt(?string $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; - return $this; } - /** - * @return string + * Name of the task. + * + * @return string|null */ - public function getName() + public function getName(): ?string { return $this->name; } - /** - * @param string $name + * Name of the task. + * + * @param string|null $name * * @return self */ - public function setName($name = null) + public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return TaskSpec + * User-defined key/value metadata. + * + * @return array|null */ - public function getSpec() + public function getLabels(): ?iterable { - return $this->spec; + return $this->labels; } - /** - * @param TaskSpec $spec + * User-defined key/value metadata. + * + * @param array|null $labels * * @return self */ - public function setSpec(?TaskSpec $spec = null) + public function setLabels(?iterable $labels): self { - $this->spec = $spec; - + $this->initialized['labels'] = true; + $this->labels = $labels; return $this; } - /** - * @return string + * User modifiable task configuration. + * + * @return TaskSpec|null */ - public function getServiceID() + public function getSpec(): ?TaskSpec { - return $this->serviceID; + return $this->spec; } - /** - * @param string $serviceID + * User modifiable task configuration. + * + * @param TaskSpec|null $spec * * @return self */ - public function setServiceID($serviceID = null) + public function setSpec(?TaskSpec $spec): self { - $this->serviceID = $serviceID; - + $this->initialized['spec'] = true; + $this->spec = $spec; return $this; } - /** - * @return int + * The ID of the service this task is part of. + * + * @return string|null */ - public function getInstance() + public function getServiceID(): ?string { - return $this->instance; + return $this->serviceID; } - /** - * @param int $instance + * The ID of the service this task is part of. + * + * @param string|null $serviceID * * @return self */ - public function setInstance($instance = null) + public function setServiceID(?string $serviceID): self { - $this->instance = $instance; - + $this->initialized['serviceID'] = true; + $this->serviceID = $serviceID; return $this; } - /** - * @return string + * + * + * @return int|null */ - public function getNodeID() + public function getSlot(): ?int { - return $this->nodeID; + return $this->slot; } - /** - * @param string $nodeID + * + * + * @param int|null $slot * * @return self */ - public function setNodeID($nodeID = null) + public function setSlot(?int $slot): self { - $this->nodeID = $nodeID; - + $this->initialized['slot'] = true; + $this->slot = $slot; return $this; } - /** - * @return Annotations + * The ID of the node that this task is on. + * + * @return string|null */ - public function getServiceAnnotations() + public function getNodeID(): ?string { - return $this->serviceAnnotations; + return $this->nodeID; } - /** - * @param Annotations $serviceAnnotations + * The ID of the node that this task is on. + * + * @param string|null $nodeID * * @return self */ - public function setServiceAnnotations(?Annotations $serviceAnnotations = null) + public function setNodeID(?string $nodeID): self { - $this->serviceAnnotations = $serviceAnnotations; - + $this->initialized['nodeID'] = true; + $this->nodeID = $nodeID; return $this; } - /** - * @return TaskStatus - */ - public function getStatus() + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @return list|null + */ + public function getAssignedGenericResources(): ?array { - return $this->status; + return $this->assignedGenericResources; } - /** - * @param TaskStatus $status - * - * @return self - */ - public function setStatus(?TaskStatus $status = null) + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @param list|null $assignedGenericResources + * + * @return self + */ + public function setAssignedGenericResources(?array $assignedGenericResources): self { - $this->status = $status; - + $this->initialized['assignedGenericResources'] = true; + $this->assignedGenericResources = $assignedGenericResources; return $this; } - /** - * @return string + * represents the status of a task. + * + * @return TaskStatus|null */ - public function getDesiredState() + public function getStatus(): ?TaskStatus { - return $this->desiredState; + return $this->status; } - /** - * @param string $desiredState + * represents the status of a task. + * + * @param TaskStatus|null $status * * @return self */ - public function setDesiredState($desiredState = null) + public function setStatus(?TaskStatus $status): self { - $this->desiredState = $desiredState; - + $this->initialized['status'] = true; + $this->status = $status; return $this; } - /** - * @return NetworkAttachment[]|null + * + * + * @return string|null */ - public function getNetworksAttachments() + public function getDesiredState(): ?string { - return $this->networksAttachments; + return $this->desiredState; } - /** - * @param NetworkAttachment[]|null $networksAttachments + * + * + * @param string|null $desiredState * * @return self */ - public function setNetworksAttachments($networksAttachments = null) + public function setDesiredState(?string $desiredState): self { - $this->networksAttachments = $networksAttachments; - + $this->initialized['desiredState'] = true; + $this->desiredState = $desiredState; return $this; } - /** - * @return Endpoint - */ - public function getEndpoint() + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @return ObjectVersion|null + */ + public function getJobIteration(): ?ObjectVersion { - return $this->endpoint; + return $this->jobIteration; } - /** - * @param Endpoint $endpoint - * - * @return self - */ - public function setEndpoint(?Endpoint $endpoint = null) + * The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + + * + * @param ObjectVersion|null $jobIteration + * + * @return self + */ + public function setJobIteration(?ObjectVersion $jobIteration): self { - $this->endpoint = $endpoint; - + $this->initialized['jobIteration'] = true; + $this->jobIteration = $jobIteration; return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/TaskSpec.php b/generated/Model/TaskSpec.php index 344ab8a8..e4225d3b 100644 --- a/generated/Model/TaskSpec.php +++ b/generated/Model/TaskSpec.php @@ -5,99 +5,393 @@ class TaskSpec { /** - * @var ContainerSpec + * @var array */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * Plugin spec for the service. *(Experimental release only.)* + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + + * + * @var TaskSpecPluginSpec|null + */ + protected $pluginSpec; + /** + * Container spec for the service. + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + + * + * @var TaskSpecContainerSpec|null + */ protected $containerSpec; /** - * @var TaskSpecResourceRequirements - */ + * Read-only spec type for non-swarm containers attached to swarm overlay + networks. + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + + * + * @var TaskSpecNetworkAttachmentSpec|null + */ + protected $networkAttachmentSpec; + /** + * Resource requirements which apply to each individual container created + as part of the service. + + * + * @var TaskSpecResources|null + */ protected $resources; /** - * @var TaskSpecRestartPolicy - */ + * Specification for the restart policy which applies to containers + created as part of this service. + + * + * @var TaskSpecRestartPolicy|null + */ protected $restartPolicy; /** - * @var TaskSpecPlacement + * + * + * @var TaskSpecPlacement|null */ protected $placement; - /** - * @return ContainerSpec + * A counter that triggers an update even if no relevant parameters have + been changed. + + * + * @var int|null + */ + protected $forceUpdate; + /** + * Runtime is the type of runtime specified for the task executor. + * + * @var string|null */ - public function getContainerSpec() + protected $runtime; + /** + * Specifies which networks the service should attach to. + * + * @var list|null + */ + protected $networks; + /** + * Specifies the log driver to use for tasks created from this spec. If + not present, the default one for the swarm will be used, finally + falling back to the engine default if not specified. + + * + * @var TaskSpecLogDriver|null + */ + protected $logDriver; + /** + * Plugin spec for the service. *(Experimental release only.)* + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + + * + * @return TaskSpecPluginSpec|null + */ + public function getPluginSpec(): ?TaskSpecPluginSpec + { + return $this->pluginSpec; + } + /** + * Plugin spec for the service. *(Experimental release only.)* + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + + * + * @param TaskSpecPluginSpec|null $pluginSpec + * + * @return self + */ + public function setPluginSpec(?TaskSpecPluginSpec $pluginSpec): self + { + $this->initialized['pluginSpec'] = true; + $this->pluginSpec = $pluginSpec; + return $this; + } + /** + * Container spec for the service. + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + + * + * @return TaskSpecContainerSpec|null + */ + public function getContainerSpec(): ?TaskSpecContainerSpec { return $this->containerSpec; } - /** - * @param ContainerSpec $containerSpec - * - * @return self - */ - public function setContainerSpec(?ContainerSpec $containerSpec = null) + * Container spec for the service. + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + + * + * @param TaskSpecContainerSpec|null $containerSpec + * + * @return self + */ + public function setContainerSpec(?TaskSpecContainerSpec $containerSpec): self { + $this->initialized['containerSpec'] = true; $this->containerSpec = $containerSpec; - return $this; } - /** - * @return TaskSpecResourceRequirements - */ - public function getResources() + * Read-only spec type for non-swarm containers attached to swarm overlay + networks. + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + + * + * @return TaskSpecNetworkAttachmentSpec|null + */ + public function getNetworkAttachmentSpec(): ?TaskSpecNetworkAttachmentSpec + { + return $this->networkAttachmentSpec; + } + /** + * Read-only spec type for non-swarm containers attached to swarm overlay + networks. + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + + * + * @param TaskSpecNetworkAttachmentSpec|null $networkAttachmentSpec + * + * @return self + */ + public function setNetworkAttachmentSpec(?TaskSpecNetworkAttachmentSpec $networkAttachmentSpec): self + { + $this->initialized['networkAttachmentSpec'] = true; + $this->networkAttachmentSpec = $networkAttachmentSpec; + return $this; + } + /** + * Resource requirements which apply to each individual container created + as part of the service. + + * + * @return TaskSpecResources|null + */ + public function getResources(): ?TaskSpecResources { return $this->resources; } - /** - * @param TaskSpecResourceRequirements $resources + * Resource requirements which apply to each individual container created + as part of the service. + + * + * @param TaskSpecResources|null $resources + * + * @return self + */ + public function setResources(?TaskSpecResources $resources): self + { + $this->initialized['resources'] = true; + $this->resources = $resources; + return $this; + } + /** + * Specification for the restart policy which applies to containers + created as part of this service. + + * + * @return TaskSpecRestartPolicy|null + */ + public function getRestartPolicy(): ?TaskSpecRestartPolicy + { + return $this->restartPolicy; + } + /** + * Specification for the restart policy which applies to containers + created as part of this service. + + * + * @param TaskSpecRestartPolicy|null $restartPolicy + * + * @return self + */ + public function setRestartPolicy(?TaskSpecRestartPolicy $restartPolicy): self + { + $this->initialized['restartPolicy'] = true; + $this->restartPolicy = $restartPolicy; + return $this; + } + /** + * + * + * @return TaskSpecPlacement|null + */ + public function getPlacement(): ?TaskSpecPlacement + { + return $this->placement; + } + /** + * + * + * @param TaskSpecPlacement|null $placement * * @return self */ - public function setResources(?TaskSpecResourceRequirements $resources = null) + public function setPlacement(?TaskSpecPlacement $placement): self { - $this->resources = $resources; - + $this->initialized['placement'] = true; + $this->placement = $placement; return $this; } - /** - * @return TaskSpecRestartPolicy + * A counter that triggers an update even if no relevant parameters have + been changed. + + * + * @return int|null + */ + public function getForceUpdate(): ?int + { + return $this->forceUpdate; + } + /** + * A counter that triggers an update even if no relevant parameters have + been changed. + + * + * @param int|null $forceUpdate + * + * @return self + */ + public function setForceUpdate(?int $forceUpdate): self + { + $this->initialized['forceUpdate'] = true; + $this->forceUpdate = $forceUpdate; + return $this; + } + /** + * Runtime is the type of runtime specified for the task executor. + * + * @return string|null */ - public function getRestartPolicy() + public function getRuntime(): ?string { - return $this->restartPolicy; + return $this->runtime; } - /** - * @param TaskSpecRestartPolicy $restartPolicy + * Runtime is the type of runtime specified for the task executor. + * + * @param string|null $runtime * * @return self */ - public function setRestartPolicy(?TaskSpecRestartPolicy $restartPolicy = null) + public function setRuntime(?string $runtime): self { - $this->restartPolicy = $restartPolicy; - + $this->initialized['runtime'] = true; + $this->runtime = $runtime; return $this; } - /** - * @return TaskSpecPlacement + * Specifies which networks the service should attach to. + * + * @return list|null */ - public function getPlacement() + public function getNetworks(): ?array { - return $this->placement; + return $this->networks; } - /** - * @param TaskSpecPlacement $placement + * Specifies which networks the service should attach to. + * + * @param list|null $networks * * @return self */ - public function setPlacement(?TaskSpecPlacement $placement = null) + public function setNetworks(?array $networks): self { - $this->placement = $placement; - + $this->initialized['networks'] = true; + $this->networks = $networks; + return $this; + } + /** + * Specifies the log driver to use for tasks created from this spec. If + not present, the default one for the swarm will be used, finally + falling back to the engine default if not specified. + + * + * @return TaskSpecLogDriver|null + */ + public function getLogDriver(): ?TaskSpecLogDriver + { + return $this->logDriver; + } + /** + * Specifies the log driver to use for tasks created from this spec. If + not present, the default one for the swarm will be used, finally + falling back to the engine default if not specified. + + * + * @param TaskSpecLogDriver|null $logDriver + * + * @return self + */ + public function setLogDriver(?TaskSpecLogDriver $logDriver): self + { + $this->initialized['logDriver'] = true; + $this->logDriver = $logDriver; return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/TaskSpecContainerSpec.php b/generated/Model/TaskSpecContainerSpec.php new file mode 100644 index 00000000..18bfa5ab --- /dev/null +++ b/generated/Model/TaskSpecContainerSpec.php @@ -0,0 +1,907 @@ +initialized); + } + /** + * The image name to use for the container + * + * @var string|null + */ + protected $image; + /** + * User-defined key/value data. + * + * @var array|null + */ + protected $labels; + /** + * The command to be run in the image. + * + * @var list|null + */ + protected $command; + /** + * Arguments to the command. + * + * @var list|null + */ + protected $args; + /** + * The hostname to use for the container, as a valid + [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. + + * + * @var string|null + */ + protected $hostname; + /** + * A list of environment variables in the form `VAR=value`. + * + * @var list|null + */ + protected $env; + /** + * The working directory for commands to run in. + * + * @var string|null + */ + protected $dir; + /** + * The user inside the container. + * + * @var string|null + */ + protected $user; + /** + * A list of additional groups that the container process will run as. + * + * @var list|null + */ + protected $groups; + /** + * Security options for the container + * + * @var TaskSpecContainerSpecPrivileges|null + */ + protected $privileges; + /** + * Whether a pseudo-TTY should be allocated. + * + * @var bool|null + */ + protected $tTY; + /** + * Open `stdin` + * + * @var bool|null + */ + protected $openStdin; + /** + * Mount the container's root filesystem as read only. + * + * @var bool|null + */ + protected $readOnly; + /** + * Specification for mounts to be added to containers created as part + of the service. + + * + * @var list|null + */ + protected $mounts; + /** + * Signal to stop the container. + * + * @var string|null + */ + protected $stopSignal; + /** + * Amount of time to wait for the container to terminate before + forcefully killing it. + + * + * @var int|null + */ + protected $stopGracePeriod; + /** + * A test to perform to check that the container is healthy. + * + * @var HealthConfig|null + */ + protected $healthCheck; + /** + * A list of hostname/IP mappings to add to the container's `hosts` + file. The format of extra hosts is specified in the + [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + man page: + + IP_address canonical_hostname [aliases...] + + * + * @var list|null + */ + protected $hosts; + /** + * Specification for DNS related configurations in resolver configuration + file (`resolv.conf`). + + * + * @var TaskSpecContainerSpecDNSConfig|null + */ + protected $dNSConfig; + /** + * Secrets contains references to zero or more secrets that will be + exposed to the service. + + * + * @var list|null + */ + protected $secrets; + /** + * An integer value containing the score given to the container in + order to tune OOM killer preferences. + + * + * @var int|null + */ + protected $oomScoreAdj; + /** + * Configs contains references to zero or more configs that will be + exposed to the service. + + * + * @var list|null + */ + protected $configs; + /** + * Isolation technology of the containers running the service. + (Windows only) + + * + * @var string|null + */ + protected $isolation; + /** + * Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + + * + * @var bool|null + */ + protected $init; + /** + * Set kernel namedspaced parameters (sysctls) in the container. + The Sysctls option on services accepts the same sysctls as the + are supported on containers. Note that while the same sysctls are + supported, no guarantees or checks are made about their + suitability for a clustered environment, and it's up to the user + to determine whether a given sysctl will work properly in a + Service. + + * + * @var array|null + */ + protected $sysctls; + /** + * A list of kernel capabilities to add to the default set + for the container. + + * + * @var list|null + */ + protected $capabilityAdd; + /** + * A list of kernel capabilities to drop from the default set + for the container. + + * + * @var list|null + */ + protected $capabilityDrop; + /** + * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + * + * @var list|null + */ + protected $ulimits; + /** + * The image name to use for the container + * + * @return string|null + */ + public function getImage(): ?string + { + return $this->image; + } + /** + * The image name to use for the container + * + * @param string|null $image + * + * @return self + */ + public function setImage(?string $image): self + { + $this->initialized['image'] = true; + $this->image = $image; + return $this; + } + /** + * User-defined key/value data. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value data. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * The command to be run in the image. + * + * @return list|null + */ + public function getCommand(): ?array + { + return $this->command; + } + /** + * The command to be run in the image. + * + * @param list|null $command + * + * @return self + */ + public function setCommand(?array $command): self + { + $this->initialized['command'] = true; + $this->command = $command; + return $this; + } + /** + * Arguments to the command. + * + * @return list|null + */ + public function getArgs(): ?array + { + return $this->args; + } + /** + * Arguments to the command. + * + * @param list|null $args + * + * @return self + */ + public function setArgs(?array $args): self + { + $this->initialized['args'] = true; + $this->args = $args; + return $this; + } + /** + * The hostname to use for the container, as a valid + [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. + + * + * @return string|null + */ + public function getHostname(): ?string + { + return $this->hostname; + } + /** + * The hostname to use for the container, as a valid + [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. + + * + * @param string|null $hostname + * + * @return self + */ + public function setHostname(?string $hostname): self + { + $this->initialized['hostname'] = true; + $this->hostname = $hostname; + return $this; + } + /** + * A list of environment variables in the form `VAR=value`. + * + * @return list|null + */ + public function getEnv(): ?array + { + return $this->env; + } + /** + * A list of environment variables in the form `VAR=value`. + * + * @param list|null $env + * + * @return self + */ + public function setEnv(?array $env): self + { + $this->initialized['env'] = true; + $this->env = $env; + return $this; + } + /** + * The working directory for commands to run in. + * + * @return string|null + */ + public function getDir(): ?string + { + return $this->dir; + } + /** + * The working directory for commands to run in. + * + * @param string|null $dir + * + * @return self + */ + public function setDir(?string $dir): self + { + $this->initialized['dir'] = true; + $this->dir = $dir; + return $this; + } + /** + * The user inside the container. + * + * @return string|null + */ + public function getUser(): ?string + { + return $this->user; + } + /** + * The user inside the container. + * + * @param string|null $user + * + * @return self + */ + public function setUser(?string $user): self + { + $this->initialized['user'] = true; + $this->user = $user; + return $this; + } + /** + * A list of additional groups that the container process will run as. + * + * @return list|null + */ + public function getGroups(): ?array + { + return $this->groups; + } + /** + * A list of additional groups that the container process will run as. + * + * @param list|null $groups + * + * @return self + */ + public function setGroups(?array $groups): self + { + $this->initialized['groups'] = true; + $this->groups = $groups; + return $this; + } + /** + * Security options for the container + * + * @return TaskSpecContainerSpecPrivileges|null + */ + public function getPrivileges(): ?TaskSpecContainerSpecPrivileges + { + return $this->privileges; + } + /** + * Security options for the container + * + * @param TaskSpecContainerSpecPrivileges|null $privileges + * + * @return self + */ + public function setPrivileges(?TaskSpecContainerSpecPrivileges $privileges): self + { + $this->initialized['privileges'] = true; + $this->privileges = $privileges; + return $this; + } + /** + * Whether a pseudo-TTY should be allocated. + * + * @return bool|null + */ + public function getTTY(): ?bool + { + return $this->tTY; + } + /** + * Whether a pseudo-TTY should be allocated. + * + * @param bool|null $tTY + * + * @return self + */ + public function setTTY(?bool $tTY): self + { + $this->initialized['tTY'] = true; + $this->tTY = $tTY; + return $this; + } + /** + * Open `stdin` + * + * @return bool|null + */ + public function getOpenStdin(): ?bool + { + return $this->openStdin; + } + /** + * Open `stdin` + * + * @param bool|null $openStdin + * + * @return self + */ + public function setOpenStdin(?bool $openStdin): self + { + $this->initialized['openStdin'] = true; + $this->openStdin = $openStdin; + return $this; + } + /** + * Mount the container's root filesystem as read only. + * + * @return bool|null + */ + public function getReadOnly(): ?bool + { + return $this->readOnly; + } + /** + * Mount the container's root filesystem as read only. + * + * @param bool|null $readOnly + * + * @return self + */ + public function setReadOnly(?bool $readOnly): self + { + $this->initialized['readOnly'] = true; + $this->readOnly = $readOnly; + return $this; + } + /** + * Specification for mounts to be added to containers created as part + of the service. + + * + * @return list|null + */ + public function getMounts(): ?array + { + return $this->mounts; + } + /** + * Specification for mounts to be added to containers created as part + of the service. + + * + * @param list|null $mounts + * + * @return self + */ + public function setMounts(?array $mounts): self + { + $this->initialized['mounts'] = true; + $this->mounts = $mounts; + return $this; + } + /** + * Signal to stop the container. + * + * @return string|null + */ + public function getStopSignal(): ?string + { + return $this->stopSignal; + } + /** + * Signal to stop the container. + * + * @param string|null $stopSignal + * + * @return self + */ + public function setStopSignal(?string $stopSignal): self + { + $this->initialized['stopSignal'] = true; + $this->stopSignal = $stopSignal; + return $this; + } + /** + * Amount of time to wait for the container to terminate before + forcefully killing it. + + * + * @return int|null + */ + public function getStopGracePeriod(): ?int + { + return $this->stopGracePeriod; + } + /** + * Amount of time to wait for the container to terminate before + forcefully killing it. + + * + * @param int|null $stopGracePeriod + * + * @return self + */ + public function setStopGracePeriod(?int $stopGracePeriod): self + { + $this->initialized['stopGracePeriod'] = true; + $this->stopGracePeriod = $stopGracePeriod; + return $this; + } + /** + * A test to perform to check that the container is healthy. + * + * @return HealthConfig|null + */ + public function getHealthCheck(): ?HealthConfig + { + return $this->healthCheck; + } + /** + * A test to perform to check that the container is healthy. + * + * @param HealthConfig|null $healthCheck + * + * @return self + */ + public function setHealthCheck(?HealthConfig $healthCheck): self + { + $this->initialized['healthCheck'] = true; + $this->healthCheck = $healthCheck; + return $this; + } + /** + * A list of hostname/IP mappings to add to the container's `hosts` + file. The format of extra hosts is specified in the + [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + man page: + + IP_address canonical_hostname [aliases...] + + * + * @return list|null + */ + public function getHosts(): ?array + { + return $this->hosts; + } + /** + * A list of hostname/IP mappings to add to the container's `hosts` + file. The format of extra hosts is specified in the + [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + man page: + + IP_address canonical_hostname [aliases...] + + * + * @param list|null $hosts + * + * @return self + */ + public function setHosts(?array $hosts): self + { + $this->initialized['hosts'] = true; + $this->hosts = $hosts; + return $this; + } + /** + * Specification for DNS related configurations in resolver configuration + file (`resolv.conf`). + + * + * @return TaskSpecContainerSpecDNSConfig|null + */ + public function getDNSConfig(): ?TaskSpecContainerSpecDNSConfig + { + return $this->dNSConfig; + } + /** + * Specification for DNS related configurations in resolver configuration + file (`resolv.conf`). + + * + * @param TaskSpecContainerSpecDNSConfig|null $dNSConfig + * + * @return self + */ + public function setDNSConfig(?TaskSpecContainerSpecDNSConfig $dNSConfig): self + { + $this->initialized['dNSConfig'] = true; + $this->dNSConfig = $dNSConfig; + return $this; + } + /** + * Secrets contains references to zero or more secrets that will be + exposed to the service. + + * + * @return list|null + */ + public function getSecrets(): ?array + { + return $this->secrets; + } + /** + * Secrets contains references to zero or more secrets that will be + exposed to the service. + + * + * @param list|null $secrets + * + * @return self + */ + public function setSecrets(?array $secrets): self + { + $this->initialized['secrets'] = true; + $this->secrets = $secrets; + return $this; + } + /** + * An integer value containing the score given to the container in + order to tune OOM killer preferences. + + * + * @return int|null + */ + public function getOomScoreAdj(): ?int + { + return $this->oomScoreAdj; + } + /** + * An integer value containing the score given to the container in + order to tune OOM killer preferences. + + * + * @param int|null $oomScoreAdj + * + * @return self + */ + public function setOomScoreAdj(?int $oomScoreAdj): self + { + $this->initialized['oomScoreAdj'] = true; + $this->oomScoreAdj = $oomScoreAdj; + return $this; + } + /** + * Configs contains references to zero or more configs that will be + exposed to the service. + + * + * @return list|null + */ + public function getConfigs(): ?array + { + return $this->configs; + } + /** + * Configs contains references to zero or more configs that will be + exposed to the service. + + * + * @param list|null $configs + * + * @return self + */ + public function setConfigs(?array $configs): self + { + $this->initialized['configs'] = true; + $this->configs = $configs; + return $this; + } + /** + * Isolation technology of the containers running the service. + (Windows only) + + * + * @return string|null + */ + public function getIsolation(): ?string + { + return $this->isolation; + } + /** + * Isolation technology of the containers running the service. + (Windows only) + + * + * @param string|null $isolation + * + * @return self + */ + public function setIsolation(?string $isolation): self + { + $this->initialized['isolation'] = true; + $this->isolation = $isolation; + return $this; + } + /** + * Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + + * + * @return bool|null + */ + public function getInit(): ?bool + { + return $this->init; + } + /** + * Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + + * + * @param bool|null $init + * + * @return self + */ + public function setInit(?bool $init): self + { + $this->initialized['init'] = true; + $this->init = $init; + return $this; + } + /** + * Set kernel namedspaced parameters (sysctls) in the container. + The Sysctls option on services accepts the same sysctls as the + are supported on containers. Note that while the same sysctls are + supported, no guarantees or checks are made about their + suitability for a clustered environment, and it's up to the user + to determine whether a given sysctl will work properly in a + Service. + + * + * @return array|null + */ + public function getSysctls(): ?iterable + { + return $this->sysctls; + } + /** + * Set kernel namedspaced parameters (sysctls) in the container. + The Sysctls option on services accepts the same sysctls as the + are supported on containers. Note that while the same sysctls are + supported, no guarantees or checks are made about their + suitability for a clustered environment, and it's up to the user + to determine whether a given sysctl will work properly in a + Service. + + * + * @param array|null $sysctls + * + * @return self + */ + public function setSysctls(?iterable $sysctls): self + { + $this->initialized['sysctls'] = true; + $this->sysctls = $sysctls; + return $this; + } + /** + * A list of kernel capabilities to add to the default set + for the container. + + * + * @return list|null + */ + public function getCapabilityAdd(): ?array + { + return $this->capabilityAdd; + } + /** + * A list of kernel capabilities to add to the default set + for the container. + + * + * @param list|null $capabilityAdd + * + * @return self + */ + public function setCapabilityAdd(?array $capabilityAdd): self + { + $this->initialized['capabilityAdd'] = true; + $this->capabilityAdd = $capabilityAdd; + return $this; + } + /** + * A list of kernel capabilities to drop from the default set + for the container. + + * + * @return list|null + */ + public function getCapabilityDrop(): ?array + { + return $this->capabilityDrop; + } + /** + * A list of kernel capabilities to drop from the default set + for the container. + + * + * @param list|null $capabilityDrop + * + * @return self + */ + public function setCapabilityDrop(?array $capabilityDrop): self + { + $this->initialized['capabilityDrop'] = true; + $this->capabilityDrop = $capabilityDrop; + return $this; + } + /** + * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + * + * @return list|null + */ + public function getUlimits(): ?array + { + return $this->ulimits; + } + /** + * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + * + * @param list|null $ulimits + * + * @return self + */ + public function setUlimits(?array $ulimits): self + { + $this->initialized['ulimits'] = true; + $this->ulimits = $ulimits; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecContainerSpecConfigsItem.php b/generated/Model/TaskSpecContainerSpecConfigsItem.php new file mode 100644 index 00000000..1710292b --- /dev/null +++ b/generated/Model/TaskSpecContainerSpecConfigsItem.php @@ -0,0 +1,178 @@ +initialized); + } + /** + * File represents a specific target that is backed by a file. + +


+ + > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive + + * + * @var TaskSpecContainerSpecConfigsItemFile|null + */ + protected $file; + /** + * Runtime represents a target that is not mounted into the + container but is used by the task + +


+ + > **Note**: `Configs.File` and `Configs.Runtime` are mutually + > exclusive + + * + * @var mixed|null + */ + protected $runtime; + /** + * ConfigID represents the ID of the specific config that we're + referencing. + + * + * @var string|null + */ + protected $configID; + /** + * ConfigName is the name of the config that this references, + but this is just provided for lookup/display purposes. The + config in the reference will be identified by its ID. + + * + * @var string|null + */ + protected $configName; + /** + * File represents a specific target that is backed by a file. + +


+ + > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive + + * + * @return TaskSpecContainerSpecConfigsItemFile|null + */ + public function getFile(): ?TaskSpecContainerSpecConfigsItemFile + { + return $this->file; + } + /** + * File represents a specific target that is backed by a file. + +


+ + > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive + + * + * @param TaskSpecContainerSpecConfigsItemFile|null $file + * + * @return self + */ + public function setFile(?TaskSpecContainerSpecConfigsItemFile $file): self + { + $this->initialized['file'] = true; + $this->file = $file; + return $this; + } + /** + * Runtime represents a target that is not mounted into the + container but is used by the task + +


+ + > **Note**: `Configs.File` and `Configs.Runtime` are mutually + > exclusive + + * + * @return mixed + */ + public function getRuntime() + { + return $this->runtime; + } + /** + * Runtime represents a target that is not mounted into the + container but is used by the task + +


+ + > **Note**: `Configs.File` and `Configs.Runtime` are mutually + > exclusive + + * + * @param mixed $runtime + * + * @return self + */ + public function setRuntime($runtime): self + { + $this->initialized['runtime'] = true; + $this->runtime = $runtime; + return $this; + } + /** + * ConfigID represents the ID of the specific config that we're + referencing. + + * + * @return string|null + */ + public function getConfigID(): ?string + { + return $this->configID; + } + /** + * ConfigID represents the ID of the specific config that we're + referencing. + + * + * @param string|null $configID + * + * @return self + */ + public function setConfigID(?string $configID): self + { + $this->initialized['configID'] = true; + $this->configID = $configID; + return $this; + } + /** + * ConfigName is the name of the config that this references, + but this is just provided for lookup/display purposes. The + config in the reference will be identified by its ID. + + * + * @return string|null + */ + public function getConfigName(): ?string + { + return $this->configName; + } + /** + * ConfigName is the name of the config that this references, + but this is just provided for lookup/display purposes. The + config in the reference will be identified by its ID. + + * + * @param string|null $configName + * + * @return self + */ + public function setConfigName(?string $configName): self + { + $this->initialized['configName'] = true; + $this->configName = $configName; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecContainerSpecConfigsItemFile.php b/generated/Model/TaskSpecContainerSpecConfigsItemFile.php new file mode 100644 index 00000000..14f86ed7 --- /dev/null +++ b/generated/Model/TaskSpecContainerSpecConfigsItemFile.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * Name represents the final filename in the filesystem. + * + * @var string|null + */ + protected $name; + /** + * UID represents the file UID. + * + * @var string|null + */ + protected $uID; + /** + * GID represents the file GID. + * + * @var string|null + */ + protected $gID; + /** + * Mode represents the FileMode of the file. + * + * @var int|null + */ + protected $mode; + /** + * Name represents the final filename in the filesystem. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Name represents the final filename in the filesystem. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * UID represents the file UID. + * + * @return string|null + */ + public function getUID(): ?string + { + return $this->uID; + } + /** + * UID represents the file UID. + * + * @param string|null $uID + * + * @return self + */ + public function setUID(?string $uID): self + { + $this->initialized['uID'] = true; + $this->uID = $uID; + return $this; + } + /** + * GID represents the file GID. + * + * @return string|null + */ + public function getGID(): ?string + { + return $this->gID; + } + /** + * GID represents the file GID. + * + * @param string|null $gID + * + * @return self + */ + public function setGID(?string $gID): self + { + $this->initialized['gID'] = true; + $this->gID = $gID; + return $this; + } + /** + * Mode represents the FileMode of the file. + * + * @return int|null + */ + public function getMode(): ?int + { + return $this->mode; + } + /** + * Mode represents the FileMode of the file. + * + * @param int|null $mode + * + * @return self + */ + public function setMode(?int $mode): self + { + $this->initialized['mode'] = true; + $this->mode = $mode; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecContainerSpecDNSConfig.php b/generated/Model/TaskSpecContainerSpecDNSConfig.php new file mode 100644 index 00000000..5ee8a0fc --- /dev/null +++ b/generated/Model/TaskSpecContainerSpecDNSConfig.php @@ -0,0 +1,105 @@ +initialized); + } + /** + * The IP addresses of the name servers. + * + * @var list|null + */ + protected $nameservers; + /** + * A search list for host-name lookup. + * + * @var list|null + */ + protected $search; + /** + * A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + + * + * @var list|null + */ + protected $options; + /** + * The IP addresses of the name servers. + * + * @return list|null + */ + public function getNameservers(): ?array + { + return $this->nameservers; + } + /** + * The IP addresses of the name servers. + * + * @param list|null $nameservers + * + * @return self + */ + public function setNameservers(?array $nameservers): self + { + $this->initialized['nameservers'] = true; + $this->nameservers = $nameservers; + return $this; + } + /** + * A search list for host-name lookup. + * + * @return list|null + */ + public function getSearch(): ?array + { + return $this->search; + } + /** + * A search list for host-name lookup. + * + * @param list|null $search + * + * @return self + */ + public function setSearch(?array $search): self + { + $this->initialized['search'] = true; + $this->search = $search; + return $this; + } + /** + * A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + + * + * @return list|null + */ + public function getOptions(): ?array + { + return $this->options; + } + /** + * A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + + * + * @param list|null $options + * + * @return self + */ + public function setOptions(?array $options): self + { + $this->initialized['options'] = true; + $this->options = $options; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecContainerSpecPrivileges.php b/generated/Model/TaskSpecContainerSpecPrivileges.php new file mode 100644 index 00000000..e633ebbb --- /dev/null +++ b/generated/Model/TaskSpecContainerSpecPrivileges.php @@ -0,0 +1,155 @@ +initialized); + } + /** + * CredentialSpec for managed service account (Windows only) + * + * @var TaskSpecContainerSpecPrivilegesCredentialSpec|null + */ + protected $credentialSpec; + /** + * SELinux labels of the container + * + * @var TaskSpecContainerSpecPrivilegesSELinuxContext|null + */ + protected $sELinuxContext; + /** + * Options for configuring seccomp on the container + * + * @var TaskSpecContainerSpecPrivilegesSeccomp|null + */ + protected $seccomp; + /** + * Options for configuring AppArmor on the container + * + * @var TaskSpecContainerSpecPrivilegesAppArmor|null + */ + protected $appArmor; + /** + * Configuration of the no_new_privs bit in the container + * + * @var bool|null + */ + protected $noNewPrivileges; + /** + * CredentialSpec for managed service account (Windows only) + * + * @return TaskSpecContainerSpecPrivilegesCredentialSpec|null + */ + public function getCredentialSpec(): ?TaskSpecContainerSpecPrivilegesCredentialSpec + { + return $this->credentialSpec; + } + /** + * CredentialSpec for managed service account (Windows only) + * + * @param TaskSpecContainerSpecPrivilegesCredentialSpec|null $credentialSpec + * + * @return self + */ + public function setCredentialSpec(?TaskSpecContainerSpecPrivilegesCredentialSpec $credentialSpec): self + { + $this->initialized['credentialSpec'] = true; + $this->credentialSpec = $credentialSpec; + return $this; + } + /** + * SELinux labels of the container + * + * @return TaskSpecContainerSpecPrivilegesSELinuxContext|null + */ + public function getSELinuxContext(): ?TaskSpecContainerSpecPrivilegesSELinuxContext + { + return $this->sELinuxContext; + } + /** + * SELinux labels of the container + * + * @param TaskSpecContainerSpecPrivilegesSELinuxContext|null $sELinuxContext + * + * @return self + */ + public function setSELinuxContext(?TaskSpecContainerSpecPrivilegesSELinuxContext $sELinuxContext): self + { + $this->initialized['sELinuxContext'] = true; + $this->sELinuxContext = $sELinuxContext; + return $this; + } + /** + * Options for configuring seccomp on the container + * + * @return TaskSpecContainerSpecPrivilegesSeccomp|null + */ + public function getSeccomp(): ?TaskSpecContainerSpecPrivilegesSeccomp + { + return $this->seccomp; + } + /** + * Options for configuring seccomp on the container + * + * @param TaskSpecContainerSpecPrivilegesSeccomp|null $seccomp + * + * @return self + */ + public function setSeccomp(?TaskSpecContainerSpecPrivilegesSeccomp $seccomp): self + { + $this->initialized['seccomp'] = true; + $this->seccomp = $seccomp; + return $this; + } + /** + * Options for configuring AppArmor on the container + * + * @return TaskSpecContainerSpecPrivilegesAppArmor|null + */ + public function getAppArmor(): ?TaskSpecContainerSpecPrivilegesAppArmor + { + return $this->appArmor; + } + /** + * Options for configuring AppArmor on the container + * + * @param TaskSpecContainerSpecPrivilegesAppArmor|null $appArmor + * + * @return self + */ + public function setAppArmor(?TaskSpecContainerSpecPrivilegesAppArmor $appArmor): self + { + $this->initialized['appArmor'] = true; + $this->appArmor = $appArmor; + return $this; + } + /** + * Configuration of the no_new_privs bit in the container + * + * @return bool|null + */ + public function getNoNewPrivileges(): ?bool + { + return $this->noNewPrivileges; + } + /** + * Configuration of the no_new_privs bit in the container + * + * @param bool|null $noNewPrivileges + * + * @return self + */ + public function setNoNewPrivileges(?bool $noNewPrivileges): self + { + $this->initialized['noNewPrivileges'] = true; + $this->noNewPrivileges = $noNewPrivileges; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecContainerSpecPrivilegesAppArmor.php b/generated/Model/TaskSpecContainerSpecPrivilegesAppArmor.php new file mode 100644 index 00000000..3fdc1d0f --- /dev/null +++ b/generated/Model/TaskSpecContainerSpecPrivilegesAppArmor.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $mode; + /** + * + * + * @return string|null + */ + public function getMode(): ?string + { + return $this->mode; + } + /** + * + * + * @param string|null $mode + * + * @return self + */ + public function setMode(?string $mode): self + { + $this->initialized['mode'] = true; + $this->mode = $mode; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecContainerSpecPrivilegesCredentialSpec.php b/generated/Model/TaskSpecContainerSpecPrivilegesCredentialSpec.php new file mode 100644 index 00000000..1f8b77d7 --- /dev/null +++ b/generated/Model/TaskSpecContainerSpecPrivilegesCredentialSpec.php @@ -0,0 +1,192 @@ +initialized); + } + /** + * Load credential spec from a Swarm Config with the given ID. + The specified config must also be present in the Configs + field with the Runtime property set. + +


+ + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + + * + * @var string|null + */ + protected $config; + /** + * Load credential spec from this file. The file is read by + the daemon, and must be present in the `CredentialSpecs` + subdirectory in the docker data directory, which defaults + to `C:\ProgramData\Docker\` on Windows. + + For example, specifying `spec.json` loads + `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + +


+ + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + + * + * @var string|null + */ + protected $file; + /** + * Load credential spec from this value in the Windows + registry. The specified registry value must be located in: + + `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + +


+ + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + + * + * @var string|null + */ + protected $registry; + /** + * Load credential spec from a Swarm Config with the given ID. + The specified config must also be present in the Configs + field with the Runtime property set. + +


+ + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + + * + * @return string|null + */ + public function getConfig(): ?string + { + return $this->config; + } + /** + * Load credential spec from a Swarm Config with the given ID. + The specified config must also be present in the Configs + field with the Runtime property set. + +


+ + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + + * + * @param string|null $config + * + * @return self + */ + public function setConfig(?string $config): self + { + $this->initialized['config'] = true; + $this->config = $config; + return $this; + } + /** + * Load credential spec from this file. The file is read by + the daemon, and must be present in the `CredentialSpecs` + subdirectory in the docker data directory, which defaults + to `C:\ProgramData\Docker\` on Windows. + + For example, specifying `spec.json` loads + `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + +


+ + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + + * + * @return string|null + */ + public function getFile(): ?string + { + return $this->file; + } + /** + * Load credential spec from this file. The file is read by + the daemon, and must be present in the `CredentialSpecs` + subdirectory in the docker data directory, which defaults + to `C:\ProgramData\Docker\` on Windows. + + For example, specifying `spec.json` loads + `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + +


+ + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + + * + * @param string|null $file + * + * @return self + */ + public function setFile(?string $file): self + { + $this->initialized['file'] = true; + $this->file = $file; + return $this; + } + /** + * Load credential spec from this value in the Windows + registry. The specified registry value must be located in: + + `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + +


+ + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + + * + * @return string|null + */ + public function getRegistry(): ?string + { + return $this->registry; + } + /** + * Load credential spec from this value in the Windows + registry. The specified registry value must be located in: + + `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + +


+ + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + + * + * @param string|null $registry + * + * @return self + */ + public function setRegistry(?string $registry): self + { + $this->initialized['registry'] = true; + $this->registry = $registry; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecContainerSpecPrivilegesSELinuxContext.php b/generated/Model/TaskSpecContainerSpecPrivilegesSELinuxContext.php new file mode 100644 index 00000000..009cd9e0 --- /dev/null +++ b/generated/Model/TaskSpecContainerSpecPrivilegesSELinuxContext.php @@ -0,0 +1,155 @@ +initialized); + } + /** + * Disable SELinux + * + * @var bool|null + */ + protected $disable; + /** + * SELinux user label + * + * @var string|null + */ + protected $user; + /** + * SELinux role label + * + * @var string|null + */ + protected $role; + /** + * SELinux type label + * + * @var string|null + */ + protected $type; + /** + * SELinux level label + * + * @var string|null + */ + protected $level; + /** + * Disable SELinux + * + * @return bool|null + */ + public function getDisable(): ?bool + { + return $this->disable; + } + /** + * Disable SELinux + * + * @param bool|null $disable + * + * @return self + */ + public function setDisable(?bool $disable): self + { + $this->initialized['disable'] = true; + $this->disable = $disable; + return $this; + } + /** + * SELinux user label + * + * @return string|null + */ + public function getUser(): ?string + { + return $this->user; + } + /** + * SELinux user label + * + * @param string|null $user + * + * @return self + */ + public function setUser(?string $user): self + { + $this->initialized['user'] = true; + $this->user = $user; + return $this; + } + /** + * SELinux role label + * + * @return string|null + */ + public function getRole(): ?string + { + return $this->role; + } + /** + * SELinux role label + * + * @param string|null $role + * + * @return self + */ + public function setRole(?string $role): self + { + $this->initialized['role'] = true; + $this->role = $role; + return $this; + } + /** + * SELinux type label + * + * @return string|null + */ + public function getType(): ?string + { + return $this->type; + } + /** + * SELinux type label + * + * @param string|null $type + * + * @return self + */ + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + return $this; + } + /** + * SELinux level label + * + * @return string|null + */ + public function getLevel(): ?string + { + return $this->level; + } + /** + * SELinux level label + * + * @param string|null $level + * + * @return self + */ + public function setLevel(?string $level): self + { + $this->initialized['level'] = true; + $this->level = $level; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecContainerSpecPrivilegesSeccomp.php b/generated/Model/TaskSpecContainerSpecPrivilegesSeccomp.php new file mode 100644 index 00000000..26f7e8c8 --- /dev/null +++ b/generated/Model/TaskSpecContainerSpecPrivilegesSeccomp.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $mode; + /** + * The custom seccomp profile as a json object + * + * @var string|null + */ + protected $profile; + /** + * + * + * @return string|null + */ + public function getMode(): ?string + { + return $this->mode; + } + /** + * + * + * @param string|null $mode + * + * @return self + */ + public function setMode(?string $mode): self + { + $this->initialized['mode'] = true; + $this->mode = $mode; + return $this; + } + /** + * The custom seccomp profile as a json object + * + * @return string|null + */ + public function getProfile(): ?string + { + return $this->profile; + } + /** + * The custom seccomp profile as a json object + * + * @param string|null $profile + * + * @return self + */ + public function setProfile(?string $profile): self + { + $this->initialized['profile'] = true; + $this->profile = $profile; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecContainerSpecSecretsItem.php b/generated/Model/TaskSpecContainerSpecSecretsItem.php new file mode 100644 index 00000000..f13bb5be --- /dev/null +++ b/generated/Model/TaskSpecContainerSpecSecretsItem.php @@ -0,0 +1,114 @@ +initialized); + } + /** + * File represents a specific target that is backed by a file. + * + * @var TaskSpecContainerSpecSecretsItemFile|null + */ + protected $file; + /** + * SecretID represents the ID of the specific secret that we're + referencing. + + * + * @var string|null + */ + protected $secretID; + /** + * SecretName is the name of the secret that this references, + but this is just provided for lookup/display purposes. The + secret in the reference will be identified by its ID. + + * + * @var string|null + */ + protected $secretName; + /** + * File represents a specific target that is backed by a file. + * + * @return TaskSpecContainerSpecSecretsItemFile|null + */ + public function getFile(): ?TaskSpecContainerSpecSecretsItemFile + { + return $this->file; + } + /** + * File represents a specific target that is backed by a file. + * + * @param TaskSpecContainerSpecSecretsItemFile|null $file + * + * @return self + */ + public function setFile(?TaskSpecContainerSpecSecretsItemFile $file): self + { + $this->initialized['file'] = true; + $this->file = $file; + return $this; + } + /** + * SecretID represents the ID of the specific secret that we're + referencing. + + * + * @return string|null + */ + public function getSecretID(): ?string + { + return $this->secretID; + } + /** + * SecretID represents the ID of the specific secret that we're + referencing. + + * + * @param string|null $secretID + * + * @return self + */ + public function setSecretID(?string $secretID): self + { + $this->initialized['secretID'] = true; + $this->secretID = $secretID; + return $this; + } + /** + * SecretName is the name of the secret that this references, + but this is just provided for lookup/display purposes. The + secret in the reference will be identified by its ID. + + * + * @return string|null + */ + public function getSecretName(): ?string + { + return $this->secretName; + } + /** + * SecretName is the name of the secret that this references, + but this is just provided for lookup/display purposes. The + secret in the reference will be identified by its ID. + + * + * @param string|null $secretName + * + * @return self + */ + public function setSecretName(?string $secretName): self + { + $this->initialized['secretName'] = true; + $this->secretName = $secretName; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecContainerSpecSecretsItemFile.php b/generated/Model/TaskSpecContainerSpecSecretsItemFile.php new file mode 100644 index 00000000..9b5f5f6c --- /dev/null +++ b/generated/Model/TaskSpecContainerSpecSecretsItemFile.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * Name represents the final filename in the filesystem. + * + * @var string|null + */ + protected $name; + /** + * UID represents the file UID. + * + * @var string|null + */ + protected $uID; + /** + * GID represents the file GID. + * + * @var string|null + */ + protected $gID; + /** + * Mode represents the FileMode of the file. + * + * @var int|null + */ + protected $mode; + /** + * Name represents the final filename in the filesystem. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Name represents the final filename in the filesystem. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * UID represents the file UID. + * + * @return string|null + */ + public function getUID(): ?string + { + return $this->uID; + } + /** + * UID represents the file UID. + * + * @param string|null $uID + * + * @return self + */ + public function setUID(?string $uID): self + { + $this->initialized['uID'] = true; + $this->uID = $uID; + return $this; + } + /** + * GID represents the file GID. + * + * @return string|null + */ + public function getGID(): ?string + { + return $this->gID; + } + /** + * GID represents the file GID. + * + * @param string|null $gID + * + * @return self + */ + public function setGID(?string $gID): self + { + $this->initialized['gID'] = true; + $this->gID = $gID; + return $this; + } + /** + * Mode represents the FileMode of the file. + * + * @return int|null + */ + public function getMode(): ?int + { + return $this->mode; + } + /** + * Mode represents the FileMode of the file. + * + * @param int|null $mode + * + * @return self + */ + public function setMode(?int $mode): self + { + $this->initialized['mode'] = true; + $this->mode = $mode; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecContainerSpecUlimitsItem.php b/generated/Model/TaskSpecContainerSpecUlimitsItem.php new file mode 100644 index 00000000..7fb90de0 --- /dev/null +++ b/generated/Model/TaskSpecContainerSpecUlimitsItem.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * Name of ulimit + * + * @var string|null + */ + protected $name; + /** + * Soft limit + * + * @var int|null + */ + protected $soft; + /** + * Hard limit + * + * @var int|null + */ + protected $hard; + /** + * Name of ulimit + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * Name of ulimit + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * Soft limit + * + * @return int|null + */ + public function getSoft(): ?int + { + return $this->soft; + } + /** + * Soft limit + * + * @param int|null $soft + * + * @return self + */ + public function setSoft(?int $soft): self + { + $this->initialized['soft'] = true; + $this->soft = $soft; + return $this; + } + /** + * Hard limit + * + * @return int|null + */ + public function getHard(): ?int + { + return $this->hard; + } + /** + * Hard limit + * + * @param int|null $hard + * + * @return self + */ + public function setHard(?int $hard): self + { + $this->initialized['hard'] = true; + $this->hard = $hard; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecLogDriver.php b/generated/Model/TaskSpecLogDriver.php new file mode 100644 index 00000000..d0543844 --- /dev/null +++ b/generated/Model/TaskSpecLogDriver.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $name; + /** + * + * + * @var array|null + */ + protected $options; + /** + * + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * + * + * @return array|null + */ + public function getOptions(): ?iterable + { + return $this->options; + } + /** + * + * + * @param array|null $options + * + * @return self + */ + public function setOptions(?iterable $options): self + { + $this->initialized['options'] = true; + $this->options = $options; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecNetworkAttachmentSpec.php b/generated/Model/TaskSpecNetworkAttachmentSpec.php new file mode 100644 index 00000000..8191ba1e --- /dev/null +++ b/generated/Model/TaskSpecNetworkAttachmentSpec.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * ID of the container represented by this task + * + * @var string|null + */ + protected $containerID; + /** + * ID of the container represented by this task + * + * @return string|null + */ + public function getContainerID(): ?string + { + return $this->containerID; + } + /** + * ID of the container represented by this task + * + * @param string|null $containerID + * + * @return self + */ + public function setContainerID(?string $containerID): self + { + $this->initialized['containerID'] = true; + $this->containerID = $containerID; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecPlacement.php b/generated/Model/TaskSpecPlacement.php index 847e0355..a2362dd1 100644 --- a/generated/Model/TaskSpecPlacement.php +++ b/generated/Model/TaskSpecPlacement.php @@ -5,27 +5,207 @@ class TaskSpecPlacement { /** - * @var string[]|null + * @var array */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * An array of constraint expressions to limit the set of nodes where + a task can be scheduled. Constraint expressions can either use a + _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + nodes that satisfy every expression (AND match). Constraints can + match node or Docker Engine labels as follows: + + node attribute | matches | example + ---------------------|--------------------------------|----------------------------------------------- + `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + `node.hostname` | Node hostname | `node.hostname!=node-2` + `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + `node.platform.os` | Node operating system | `node.platform.os==windows` + `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + `node.labels` | User-defined node labels | `node.labels.security==high` + `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04` + + `engine.labels` apply to Docker Engine labels like operating system, + drivers, etc. Swarm administrators add `node.labels` for operational + purposes by using the [`node update endpoint`](#operation/NodeUpdate). + + * + * @var list|null + */ protected $constraints; - /** - * @return string[]|null - */ - public function getConstraints() + * Preferences provide a way to make the scheduler aware of factors + such as topology. They are provided in order from highest to + lowest precedence. + + * + * @var list|null + */ + protected $preferences; + /** + * Maximum number of replicas for per node (default value is 0, which + is unlimited) + + * + * @var int|null + */ + protected $maxReplicas = 0; + /** + * Platforms stores all the platforms that the service's image can + run on. This field is used in the platform filter for scheduling. + If empty, then the platform filter is off, meaning there are no + scheduling restrictions. + + * + * @var list|null + */ + protected $platforms; + /** + * An array of constraint expressions to limit the set of nodes where + a task can be scheduled. Constraint expressions can either use a + _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + nodes that satisfy every expression (AND match). Constraints can + match node or Docker Engine labels as follows: + + node attribute | matches | example + ---------------------|--------------------------------|----------------------------------------------- + `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + `node.hostname` | Node hostname | `node.hostname!=node-2` + `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + `node.platform.os` | Node operating system | `node.platform.os==windows` + `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + `node.labels` | User-defined node labels | `node.labels.security==high` + `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04` + + `engine.labels` apply to Docker Engine labels like operating system, + drivers, etc. Swarm administrators add `node.labels` for operational + purposes by using the [`node update endpoint`](#operation/NodeUpdate). + + * + * @return list|null + */ + public function getConstraints(): ?array { return $this->constraints; } - /** - * @param string[]|null $constraints - * - * @return self - */ - public function setConstraints($constraints = null) + * An array of constraint expressions to limit the set of nodes where + a task can be scheduled. Constraint expressions can either use a + _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + nodes that satisfy every expression (AND match). Constraints can + match node or Docker Engine labels as follows: + + node attribute | matches | example + ---------------------|--------------------------------|----------------------------------------------- + `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + `node.hostname` | Node hostname | `node.hostname!=node-2` + `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + `node.platform.os` | Node operating system | `node.platform.os==windows` + `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + `node.labels` | User-defined node labels | `node.labels.security==high` + `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04` + + `engine.labels` apply to Docker Engine labels like operating system, + drivers, etc. Swarm administrators add `node.labels` for operational + purposes by using the [`node update endpoint`](#operation/NodeUpdate). + + * + * @param list|null $constraints + * + * @return self + */ + public function setConstraints(?array $constraints): self { + $this->initialized['constraints'] = true; $this->constraints = $constraints; - return $this; } -} + /** + * Preferences provide a way to make the scheduler aware of factors + such as topology. They are provided in order from highest to + lowest precedence. + + * + * @return list|null + */ + public function getPreferences(): ?array + { + return $this->preferences; + } + /** + * Preferences provide a way to make the scheduler aware of factors + such as topology. They are provided in order from highest to + lowest precedence. + + * + * @param list|null $preferences + * + * @return self + */ + public function setPreferences(?array $preferences): self + { + $this->initialized['preferences'] = true; + $this->preferences = $preferences; + return $this; + } + /** + * Maximum number of replicas for per node (default value is 0, which + is unlimited) + + * + * @return int|null + */ + public function getMaxReplicas(): ?int + { + return $this->maxReplicas; + } + /** + * Maximum number of replicas for per node (default value is 0, which + is unlimited) + + * + * @param int|null $maxReplicas + * + * @return self + */ + public function setMaxReplicas(?int $maxReplicas): self + { + $this->initialized['maxReplicas'] = true; + $this->maxReplicas = $maxReplicas; + return $this; + } + /** + * Platforms stores all the platforms that the service's image can + run on. This field is used in the platform filter for scheduling. + If empty, then the platform filter is off, meaning there are no + scheduling restrictions. + + * + * @return list|null + */ + public function getPlatforms(): ?array + { + return $this->platforms; + } + /** + * Platforms stores all the platforms that the service's image can + run on. This field is used in the platform filter for scheduling. + If empty, then the platform filter is off, meaning there are no + scheduling restrictions. + + * + * @param list|null $platforms + * + * @return self + */ + public function setPlatforms(?array $platforms): self + { + $this->initialized['platforms'] = true; + $this->platforms = $platforms; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecPlacementPreferencesItem.php b/generated/Model/TaskSpecPlacementPreferencesItem.php new file mode 100644 index 00000000..f2fdacac --- /dev/null +++ b/generated/Model/TaskSpecPlacementPreferencesItem.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * + * + * @var TaskSpecPlacementPreferencesItemSpread|null + */ + protected $spread; + /** + * + * + * @return TaskSpecPlacementPreferencesItemSpread|null + */ + public function getSpread(): ?TaskSpecPlacementPreferencesItemSpread + { + return $this->spread; + } + /** + * + * + * @param TaskSpecPlacementPreferencesItemSpread|null $spread + * + * @return self + */ + public function setSpread(?TaskSpecPlacementPreferencesItemSpread $spread): self + { + $this->initialized['spread'] = true; + $this->spread = $spread; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecPlacementPreferencesItemSpread.php b/generated/Model/TaskSpecPlacementPreferencesItemSpread.php new file mode 100644 index 00000000..e3b28c09 --- /dev/null +++ b/generated/Model/TaskSpecPlacementPreferencesItemSpread.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * label descriptor, such as `engine.labels.az`. + * + * @var string|null + */ + protected $spreadDescriptor; + /** + * label descriptor, such as `engine.labels.az`. + * + * @return string|null + */ + public function getSpreadDescriptor(): ?string + { + return $this->spreadDescriptor; + } + /** + * label descriptor, such as `engine.labels.az`. + * + * @param string|null $spreadDescriptor + * + * @return self + */ + public function setSpreadDescriptor(?string $spreadDescriptor): self + { + $this->initialized['spreadDescriptor'] = true; + $this->spreadDescriptor = $spreadDescriptor; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecPluginSpec.php b/generated/Model/TaskSpecPluginSpec.php new file mode 100644 index 00000000..12a72b23 --- /dev/null +++ b/generated/Model/TaskSpecPluginSpec.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * The name or 'alias' to use for the plugin. + * + * @var string|null + */ + protected $name; + /** + * The plugin image reference to use. + * + * @var string|null + */ + protected $remote; + /** + * Disable the plugin once scheduled. + * + * @var bool|null + */ + protected $disabled; + /** + * + * + * @var list|null + */ + protected $pluginPrivilege; + /** + * The name or 'alias' to use for the plugin. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * The name or 'alias' to use for the plugin. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * The plugin image reference to use. + * + * @return string|null + */ + public function getRemote(): ?string + { + return $this->remote; + } + /** + * The plugin image reference to use. + * + * @param string|null $remote + * + * @return self + */ + public function setRemote(?string $remote): self + { + $this->initialized['remote'] = true; + $this->remote = $remote; + return $this; + } + /** + * Disable the plugin once scheduled. + * + * @return bool|null + */ + public function getDisabled(): ?bool + { + return $this->disabled; + } + /** + * Disable the plugin once scheduled. + * + * @param bool|null $disabled + * + * @return self + */ + public function setDisabled(?bool $disabled): self + { + $this->initialized['disabled'] = true; + $this->disabled = $disabled; + return $this; + } + /** + * + * + * @return list|null + */ + public function getPluginPrivilege(): ?array + { + return $this->pluginPrivilege; + } + /** + * + * + * @param list|null $pluginPrivilege + * + * @return self + */ + public function setPluginPrivilege(?array $pluginPrivilege): self + { + $this->initialized['pluginPrivilege'] = true; + $this->pluginPrivilege = $pluginPrivilege; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecResourceRequirements.php b/generated/Model/TaskSpecResourceRequirements.php deleted file mode 100644 index 570602a4..00000000 --- a/generated/Model/TaskSpecResourceRequirements.php +++ /dev/null @@ -1,55 +0,0 @@ -limits; - } - - /** - * @param NodeResources $limits - * - * @return self - */ - public function setLimits(?NodeResources $limits = null) - { - $this->limits = $limits; - - return $this; - } - - /** - * @return NodeResources - */ - public function getReservations() - { - return $this->reservations; - } - - /** - * @param NodeResources $reservations - * - * @return self - */ - public function setReservations(?NodeResources $reservations = null) - { - $this->reservations = $reservations; - - return $this; - } -} diff --git a/generated/Model/TaskSpecResources.php b/generated/Model/TaskSpecResources.php new file mode 100644 index 00000000..afcc4b93 --- /dev/null +++ b/generated/Model/TaskSpecResources.php @@ -0,0 +1,77 @@ +initialized); + } + /** + * An object describing a limit on resources which can be requested by a task. + * + * @var Limit|null + */ + protected $limits; + /** + * An object describing the resources which can be advertised by a node and + requested by a task. + + * + * @var ResourceObject|null + */ + protected $reservations; + /** + * An object describing a limit on resources which can be requested by a task. + * + * @return Limit|null + */ + public function getLimits(): ?Limit + { + return $this->limits; + } + /** + * An object describing a limit on resources which can be requested by a task. + * + * @param Limit|null $limits + * + * @return self + */ + public function setLimits(?Limit $limits): self + { + $this->initialized['limits'] = true; + $this->limits = $limits; + return $this; + } + /** + * An object describing the resources which can be advertised by a node and + requested by a task. + + * + * @return ResourceObject|null + */ + public function getReservations(): ?ResourceObject + { + return $this->reservations; + } + /** + * An object describing the resources which can be advertised by a node and + requested by a task. + + * + * @param ResourceObject|null $reservations + * + * @return self + */ + public function setReservations(?ResourceObject $reservations): self + { + $this->initialized['reservations'] = true; + $this->reservations = $reservations; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/TaskSpecRestartPolicy.php b/generated/Model/TaskSpecRestartPolicy.php index 14791716..84ec6cd6 100644 --- a/generated/Model/TaskSpecRestartPolicy.php +++ b/generated/Model/TaskSpecRestartPolicy.php @@ -5,99 +5,135 @@ class TaskSpecRestartPolicy { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * Condition for restart. + * + * @var string|null */ protected $condition; /** - * @var int + * Delay between restart attempts. + * + * @var int|null */ protected $delay; /** - * @var int - */ - protected $maxAttempts; + * Maximum attempts to restart a given container before giving up + (default value is 0, which is ignored). + + * + * @var int|null + */ + protected $maxAttempts = 0; /** - * @var int - */ - protected $window; - + * Windows is the time window used to evaluate the restart policy + (default value is 0, which is unbounded). + + * + * @var int|null + */ + protected $window = 0; /** - * @return string + * Condition for restart. + * + * @return string|null */ - public function getCondition() + public function getCondition(): ?string { return $this->condition; } - /** - * @param string $condition + * Condition for restart. + * + * @param string|null $condition * * @return self */ - public function setCondition($condition = null) + public function setCondition(?string $condition): self { + $this->initialized['condition'] = true; $this->condition = $condition; - return $this; } - /** - * @return int + * Delay between restart attempts. + * + * @return int|null */ - public function getDelay() + public function getDelay(): ?int { return $this->delay; } - /** - * @param int $delay + * Delay between restart attempts. + * + * @param int|null $delay * * @return self */ - public function setDelay($delay = null) + public function setDelay(?int $delay): self { + $this->initialized['delay'] = true; $this->delay = $delay; - return $this; } - /** - * @return int - */ - public function getMaxAttempts() + * Maximum attempts to restart a given container before giving up + (default value is 0, which is ignored). + + * + * @return int|null + */ + public function getMaxAttempts(): ?int { return $this->maxAttempts; } - /** - * @param int $maxAttempts - * - * @return self - */ - public function setMaxAttempts($maxAttempts = null) + * Maximum attempts to restart a given container before giving up + (default value is 0, which is ignored). + + * + * @param int|null $maxAttempts + * + * @return self + */ + public function setMaxAttempts(?int $maxAttempts): self { + $this->initialized['maxAttempts'] = true; $this->maxAttempts = $maxAttempts; - return $this; } - /** - * @return int - */ - public function getWindow() + * Windows is the time window used to evaluate the restart policy + (default value is 0, which is unbounded). + + * + * @return int|null + */ + public function getWindow(): ?int { return $this->window; } - /** - * @param int $window - * - * @return self - */ - public function setWindow($window = null) + * Windows is the time window used to evaluate the restart policy + (default value is 0, which is unbounded). + + * + * @param int|null $window + * + * @return self + */ + public function setWindow(?int $window): self { + $this->initialized['window'] = true; $this->window = $window; - return $this; } -} +} \ No newline at end of file diff --git a/generated/Model/TaskStatus.php b/generated/Model/TaskStatus.php index 82873456..8ea03a4a 100644 --- a/generated/Model/TaskStatus.php +++ b/generated/Model/TaskStatus.php @@ -5,123 +5,179 @@ class TaskStatus { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * + * + * @var string|null */ protected $timestamp; /** - * @var string + * + * + * @var string|null */ protected $state; /** - * @var string + * + * + * @var string|null */ protected $message; /** - * @var string + * + * + * @var string|null */ protected $err; /** - * @var ContainerStatus + * represents the status of a container. + * + * @var ContainerStatus|null */ protected $containerStatus; - /** - * @return string + * represents the port status of a task's host ports whose service has published host ports + * + * @var PortStatus|null */ - public function getTimestamp() + protected $portStatus; + /** + * + * + * @return string|null + */ + public function getTimestamp(): ?string { return $this->timestamp; } - /** - * @param string $timestamp + * + * + * @param string|null $timestamp * * @return self */ - public function setTimestamp($timestamp = null) + public function setTimestamp(?string $timestamp): self { + $this->initialized['timestamp'] = true; $this->timestamp = $timestamp; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getState() + public function getState(): ?string { return $this->state; } - /** - * @param string $state + * + * + * @param string|null $state * * @return self */ - public function setState($state = null) + public function setState(?string $state): self { + $this->initialized['state'] = true; $this->state = $state; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getMessage() + public function getMessage(): ?string { return $this->message; } - /** - * @param string $message + * + * + * @param string|null $message * * @return self */ - public function setMessage($message = null) + public function setMessage(?string $message): self { + $this->initialized['message'] = true; $this->message = $message; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getErr() + public function getErr(): ?string { return $this->err; } - /** - * @param string $err + * + * + * @param string|null $err * * @return self */ - public function setErr($err = null) + public function setErr(?string $err): self { + $this->initialized['err'] = true; $this->err = $err; - return $this; } - /** - * @return ContainerStatus + * represents the status of a container. + * + * @return ContainerStatus|null */ - public function getContainerStatus() + public function getContainerStatus(): ?ContainerStatus { return $this->containerStatus; } - /** - * @param ContainerStatus $containerStatus + * represents the status of a container. + * + * @param ContainerStatus|null $containerStatus * * @return self */ - public function setContainerStatus(?ContainerStatus $containerStatus = null) + public function setContainerStatus(?ContainerStatus $containerStatus): self { + $this->initialized['containerStatus'] = true; $this->containerStatus = $containerStatus; - return $this; } -} + /** + * represents the port status of a task's host ports whose service has published host ports + * + * @return PortStatus|null + */ + public function getPortStatus(): ?PortStatus + { + return $this->portStatus; + } + /** + * represents the port status of a task's host ports whose service has published host ports + * + * @param PortStatus|null $portStatus + * + * @return self + */ + public function setPortStatus(?PortStatus $portStatus): self + { + $this->initialized['portStatus'] = true; + $this->portStatus = $portStatus; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/ThrottleDevice.php b/generated/Model/ThrottleDevice.php new file mode 100644 index 00000000..da520087 --- /dev/null +++ b/generated/Model/ThrottleDevice.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * Device path + * + * @var string|null + */ + protected $path; + /** + * Rate + * + * @var int|null + */ + protected $rate; + /** + * Device path + * + * @return string|null + */ + public function getPath(): ?string + { + return $this->path; + } + /** + * Device path + * + * @param string|null $path + * + * @return self + */ + public function setPath(?string $path): self + { + $this->initialized['path'] = true; + $this->path = $path; + return $this; + } + /** + * Rate + * + * @return int|null + */ + public function getRate(): ?int + { + return $this->rate; + } + /** + * Rate + * + * @param int|null $rate + * + * @return self + */ + public function setRate(?int $rate): self + { + $this->initialized['rate'] = true; + $this->rate = $rate; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/Ulimit.php b/generated/Model/Ulimit.php deleted file mode 100644 index 5715cd82..00000000 --- a/generated/Model/Ulimit.php +++ /dev/null @@ -1,79 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } - - /** - * @return int - */ - public function getSoft() - { - return $this->soft; - } - - /** - * @param int $soft - * - * @return self - */ - public function setSoft($soft = null) - { - $this->soft = $soft; - - return $this; - } - - /** - * @return int - */ - public function getHard() - { - return $this->hard; - } - - /** - * @param int $hard - * - * @return self - */ - public function setHard($hard = null) - { - $this->hard = $hard; - - return $this; - } -} diff --git a/generated/Model/UpdateConfig.php b/generated/Model/UpdateConfig.php deleted file mode 100644 index 01e4a2b4..00000000 --- a/generated/Model/UpdateConfig.php +++ /dev/null @@ -1,79 +0,0 @@ -parallelism; - } - - /** - * @param int $parallelism - * - * @return self - */ - public function setParallelism($parallelism = null) - { - $this->parallelism = $parallelism; - - return $this; - } - - /** - * @return int - */ - public function getDelay() - { - return $this->delay; - } - - /** - * @param int $delay - * - * @return self - */ - public function setDelay($delay = null) - { - $this->delay = $delay; - - return $this; - } - - /** - * @return string - */ - public function getFailureAction() - { - return $this->failureAction; - } - - /** - * @param string $failureAction - * - * @return self - */ - public function setFailureAction($failureAction = null) - { - $this->failureAction = $failureAction; - - return $this; - } -} diff --git a/generated/Model/UpdateStatus.php b/generated/Model/UpdateStatus.php deleted file mode 100644 index 8486bd11..00000000 --- a/generated/Model/UpdateStatus.php +++ /dev/null @@ -1,103 +0,0 @@ -state; - } - - /** - * @param string $state - * - * @return self - */ - public function setState($state = null) - { - $this->state = $state; - - return $this; - } - - /** - * @return \DateTime - */ - public function getStartedAt() - { - return $this->startedAt; - } - - /** - * @param \DateTime $startedAt - * - * @return self - */ - public function setStartedAt(?\DateTime $startedAt = null) - { - $this->startedAt = $startedAt; - - return $this; - } - - /** - * @return \DateTime - */ - public function getCompletedAt() - { - return $this->completedAt; - } - - /** - * @param \DateTime $completedAt - * - * @return self - */ - public function setCompletedAt(?\DateTime $completedAt = null) - { - $this->completedAt = $completedAt; - - return $this; - } - - /** - * @return string - */ - public function getMessage() - { - return $this->message; - } - - /** - * @param string $message - * - * @return self - */ - public function setMessage($message = null) - { - $this->message = $message; - - return $this; - } -} diff --git a/generated/Model/Version.php b/generated/Model/Version.php deleted file mode 100644 index 7327ecf4..00000000 --- a/generated/Model/Version.php +++ /dev/null @@ -1,223 +0,0 @@ -version; - } - - /** - * @param string $version - * - * @return self - */ - public function setVersion($version = null) - { - $this->version = $version; - - return $this; - } - - /** - * @return string - */ - public function getOs() - { - return $this->os; - } - - /** - * @param string $os - * - * @return self - */ - public function setOs($os = null) - { - $this->os = $os; - - return $this; - } - - /** - * @return string - */ - public function getKernelVersion() - { - return $this->kernelVersion; - } - - /** - * @param string $kernelVersion - * - * @return self - */ - public function setKernelVersion($kernelVersion = null) - { - $this->kernelVersion = $kernelVersion; - - return $this; - } - - /** - * @return string - */ - public function getGoVersion() - { - return $this->goVersion; - } - - /** - * @param string $goVersion - * - * @return self - */ - public function setGoVersion($goVersion = null) - { - $this->goVersion = $goVersion; - - return $this; - } - - /** - * @return string - */ - public function getGitCommit() - { - return $this->gitCommit; - } - - /** - * @param string $gitCommit - * - * @return self - */ - public function setGitCommit($gitCommit = null) - { - $this->gitCommit = $gitCommit; - - return $this; - } - - /** - * @return string - */ - public function getArch() - { - return $this->arch; - } - - /** - * @param string $arch - * - * @return self - */ - public function setArch($arch = null) - { - $this->arch = $arch; - - return $this; - } - - /** - * @return string - */ - public function getApiVersion() - { - return $this->apiVersion; - } - - /** - * @param string $apiVersion - * - * @return self - */ - public function setApiVersion($apiVersion = null) - { - $this->apiVersion = $apiVersion; - - return $this; - } - - /** - * @return bool - */ - public function getExperimental() - { - return $this->experimental; - } - - /** - * @param bool $experimental - * - * @return self - */ - public function setExperimental($experimental = null) - { - $this->experimental = $experimental; - - return $this; - } - - /** - * @return string - */ - public function getBuildTime() - { - return $this->buildTime; - } - - /** - * @param string $buildTime - * - * @return self - */ - public function setBuildTime($buildTime = null) - { - $this->buildTime = $buildTime; - - return $this; - } -} diff --git a/generated/Model/Volume.php b/generated/Model/Volume.php index ca707172..22e1448c 100644 --- a/generated/Model/Volume.php +++ b/generated/Model/Volume.php @@ -5,75 +5,327 @@ class Volume { /** - * @var string + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return array_key_exists($property, $this->initialized); + } + /** + * Name of the volume. + * + * @var string|null */ protected $name; /** - * @var string + * Name of the volume driver used by the volume. + * + * @var string|null */ protected $driver; /** - * @var string + * Mount path of the volume on the host. + * + * @var string|null */ protected $mountpoint; - /** - * @return string + * Date/Time the volume was created. + * + * @var string|null + */ + protected $createdAt; + /** + * Low-level details about the volume, provided by the volume driver. + Details are returned as a map with key/value pairs: + `{"key":"value","key2":"value2"}`. + + The `Status` field is optional, and is omitted if the volume driver + does not support this feature. + + * + * @var array|null + */ + protected $status; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * The level at which the volume exists. Either `global` for cluster-wide, + or `local` for machine level. + + * + * @var string|null + */ + protected $scope = 'local'; + /** + * Options and information specific to, and only present on, Swarm CSI + cluster volumes. + + * + * @var ClusterVolume|null + */ + protected $clusterVolume; + /** + * The driver specific options used when creating the volume. + * + * @var array|null */ - public function getName() + protected $options; + /** + * Usage details about the volume. This information is used by the + `GET /system/df` endpoint, and omitted in other endpoints. + + * + * @var VolumeUsageData|null + */ + protected $usageData; + /** + * Name of the volume. + * + * @return string|null + */ + public function getName(): ?string { return $this->name; } - /** - * @param string $name + * Name of the volume. + * + * @param string|null $name * * @return self */ - public function setName($name = null) + public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string + * Name of the volume driver used by the volume. + * + * @return string|null */ - public function getDriver() + public function getDriver(): ?string { return $this->driver; } - /** - * @param string $driver + * Name of the volume driver used by the volume. + * + * @param string|null $driver * * @return self */ - public function setDriver($driver = null) + public function setDriver(?string $driver): self { + $this->initialized['driver'] = true; $this->driver = $driver; - return $this; } - /** - * @return string + * Mount path of the volume on the host. + * + * @return string|null */ - public function getMountpoint() + public function getMountpoint(): ?string { return $this->mountpoint; } - /** - * @param string $mountpoint + * Mount path of the volume on the host. + * + * @param string|null $mountpoint * * @return self */ - public function setMountpoint($mountpoint = null) + public function setMountpoint(?string $mountpoint): self { + $this->initialized['mountpoint'] = true; $this->mountpoint = $mountpoint; - return $this; } -} + /** + * Date/Time the volume was created. + * + * @return string|null + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + /** + * Date/Time the volume was created. + * + * @param string|null $createdAt + * + * @return self + */ + public function setCreatedAt(?string $createdAt): self + { + $this->initialized['createdAt'] = true; + $this->createdAt = $createdAt; + return $this; + } + /** + * Low-level details about the volume, provided by the volume driver. + Details are returned as a map with key/value pairs: + `{"key":"value","key2":"value2"}`. + + The `Status` field is optional, and is omitted if the volume driver + does not support this feature. + + * + * @return array|null + */ + public function getStatus(): ?iterable + { + return $this->status; + } + /** + * Low-level details about the volume, provided by the volume driver. + Details are returned as a map with key/value pairs: + `{"key":"value","key2":"value2"}`. + + The `Status` field is optional, and is omitted if the volume driver + does not support this feature. + + * + * @param array|null $status + * + * @return self + */ + public function setStatus(?iterable $status): self + { + $this->initialized['status'] = true; + $this->status = $status; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * The level at which the volume exists. Either `global` for cluster-wide, + or `local` for machine level. + + * + * @return string|null + */ + public function getScope(): ?string + { + return $this->scope; + } + /** + * The level at which the volume exists. Either `global` for cluster-wide, + or `local` for machine level. + + * + * @param string|null $scope + * + * @return self + */ + public function setScope(?string $scope): self + { + $this->initialized['scope'] = true; + $this->scope = $scope; + return $this; + } + /** + * Options and information specific to, and only present on, Swarm CSI + cluster volumes. + + * + * @return ClusterVolume|null + */ + public function getClusterVolume(): ?ClusterVolume + { + return $this->clusterVolume; + } + /** + * Options and information specific to, and only present on, Swarm CSI + cluster volumes. + + * + * @param ClusterVolume|null $clusterVolume + * + * @return self + */ + public function setClusterVolume(?ClusterVolume $clusterVolume): self + { + $this->initialized['clusterVolume'] = true; + $this->clusterVolume = $clusterVolume; + return $this; + } + /** + * The driver specific options used when creating the volume. + * + * @return array|null + */ + public function getOptions(): ?iterable + { + return $this->options; + } + /** + * The driver specific options used when creating the volume. + * + * @param array|null $options + * + * @return self + */ + public function setOptions(?iterable $options): self + { + $this->initialized['options'] = true; + $this->options = $options; + return $this; + } + /** + * Usage details about the volume. This information is used by the + `GET /system/df` endpoint, and omitted in other endpoints. + + * + * @return VolumeUsageData|null + */ + public function getUsageData(): ?VolumeUsageData + { + return $this->usageData; + } + /** + * Usage details about the volume. This information is used by the + `GET /system/df` endpoint, and omitted in other endpoints. + + * + * @param VolumeUsageData|null $usageData + * + * @return self + */ + public function setUsageData(?VolumeUsageData $usageData): self + { + $this->initialized['usageData'] = true; + $this->usageData = $usageData; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/VolumeConfig.php b/generated/Model/VolumeConfig.php deleted file mode 100644 index 068986d6..00000000 --- a/generated/Model/VolumeConfig.php +++ /dev/null @@ -1,79 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName($name = null) - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getDriver() - { - return $this->driver; - } - - /** - * @param string $driver - * - * @return self - */ - public function setDriver($driver = null) - { - $this->driver = $driver; - - return $this; - } - - /** - * @return string[] - */ - public function getDriverOpts() - { - return $this->driverOpts; - } - - /** - * @param string[] $driverOpts - * - * @return self - */ - public function setDriverOpts(?\ArrayObject $driverOpts = null) - { - $this->driverOpts = $driverOpts; - - return $this; - } -} diff --git a/generated/Model/VolumeCreateOptions.php b/generated/Model/VolumeCreateOptions.php new file mode 100644 index 00000000..51bcfb03 --- /dev/null +++ b/generated/Model/VolumeCreateOptions.php @@ -0,0 +1,161 @@ +initialized); + } + /** + * The new volume's name. If not specified, Docker generates a name. + * + * @var string|null + */ + protected $name; + /** + * Name of the volume driver to use. + * + * @var string|null + */ + protected $driver = 'local'; + /** + * A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + + * + * @var array|null + */ + protected $driverOpts; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * Cluster-specific options used to create the volume. + * + * @var ClusterVolumeSpec|null + */ + protected $clusterVolumeSpec; + /** + * The new volume's name. If not specified, Docker generates a name. + * + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + /** + * The new volume's name. If not specified, Docker generates a name. + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + return $this; + } + /** + * Name of the volume driver to use. + * + * @return string|null + */ + public function getDriver(): ?string + { + return $this->driver; + } + /** + * Name of the volume driver to use. + * + * @param string|null $driver + * + * @return self + */ + public function setDriver(?string $driver): self + { + $this->initialized['driver'] = true; + $this->driver = $driver; + return $this; + } + /** + * A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + + * + * @return array|null + */ + public function getDriverOpts(): ?iterable + { + return $this->driverOpts; + } + /** + * A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + + * + * @param array|null $driverOpts + * + * @return self + */ + public function setDriverOpts(?iterable $driverOpts): self + { + $this->initialized['driverOpts'] = true; + $this->driverOpts = $driverOpts; + return $this; + } + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + /** + * User-defined key/value metadata. + * + * @param array|null $labels + * + * @return self + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + return $this; + } + /** + * Cluster-specific options used to create the volume. + * + * @return ClusterVolumeSpec|null + */ + public function getClusterVolumeSpec(): ?ClusterVolumeSpec + { + return $this->clusterVolumeSpec; + } + /** + * Cluster-specific options used to create the volume. + * + * @param ClusterVolumeSpec|null $clusterVolumeSpec + * + * @return self + */ + public function setClusterVolumeSpec(?ClusterVolumeSpec $clusterVolumeSpec): self + { + $this->initialized['clusterVolumeSpec'] = true; + $this->clusterVolumeSpec = $clusterVolumeSpec; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/VolumeList.php b/generated/Model/VolumeList.php deleted file mode 100644 index 29cef879..00000000 --- a/generated/Model/VolumeList.php +++ /dev/null @@ -1,31 +0,0 @@ -volumes; - } - - /** - * @param Volume[]|null $volumes - * - * @return self - */ - public function setVolumes($volumes = null) - { - $this->volumes = $volumes; - - return $this; - } -} diff --git a/generated/Model/VolumeListResponse.php b/generated/Model/VolumeListResponse.php new file mode 100644 index 00000000..df1f2744 --- /dev/null +++ b/generated/Model/VolumeListResponse.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * List of volumes + * + * @var list|null + */ + protected $volumes; + /** + * Warnings that occurred when fetching the list of volumes. + * + * @var list|null + */ + protected $warnings; + /** + * List of volumes + * + * @return list|null + */ + public function getVolumes(): ?array + { + return $this->volumes; + } + /** + * List of volumes + * + * @param list|null $volumes + * + * @return self + */ + public function setVolumes(?array $volumes): self + { + $this->initialized['volumes'] = true; + $this->volumes = $volumes; + return $this; + } + /** + * Warnings that occurred when fetching the list of volumes. + * + * @return list|null + */ + public function getWarnings(): ?array + { + return $this->warnings; + } + /** + * Warnings that occurred when fetching the list of volumes. + * + * @param list|null $warnings + * + * @return self + */ + public function setWarnings(?array $warnings): self + { + $this->initialized['warnings'] = true; + $this->warnings = $warnings; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/VolumeUsageData.php b/generated/Model/VolumeUsageData.php new file mode 100644 index 00000000..c53d00e2 --- /dev/null +++ b/generated/Model/VolumeUsageData.php @@ -0,0 +1,89 @@ +initialized); + } + /** + * Amount of disk space used by the volume (in bytes). This information + is only available for volumes created with the `"local"` volume + driver. For volumes created with other volume drivers, this field + is set to `-1` ("not available") + + * + * @var int|null + */ + protected $size = -1; + /** + * The number of containers referencing this volume. This field + is set to `-1` if the reference-count is not available. + + * + * @var int|null + */ + protected $refCount = -1; + /** + * Amount of disk space used by the volume (in bytes). This information + is only available for volumes created with the `"local"` volume + driver. For volumes created with other volume drivers, this field + is set to `-1` ("not available") + + * + * @return int|null + */ + public function getSize(): ?int + { + return $this->size; + } + /** + * Amount of disk space used by the volume (in bytes). This information + is only available for volumes created with the `"local"` volume + driver. For volumes created with other volume drivers, this field + is set to `-1` ("not available") + + * + * @param int|null $size + * + * @return self + */ + public function setSize(?int $size): self + { + $this->initialized['size'] = true; + $this->size = $size; + return $this; + } + /** + * The number of containers referencing this volume. This field + is set to `-1` if the reference-count is not available. + + * + * @return int|null + */ + public function getRefCount(): ?int + { + return $this->refCount; + } + /** + * The number of containers referencing this volume. This field + is set to `-1` if the reference-count is not available. + + * + * @param int|null $refCount + * + * @return self + */ + public function setRefCount(?int $refCount): self + { + $this->initialized['refCount'] = true; + $this->refCount = $refCount; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/VolumesNamePutBody.php b/generated/Model/VolumesNamePutBody.php new file mode 100644 index 00000000..c072e342 --- /dev/null +++ b/generated/Model/VolumesNamePutBody.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * Cluster-specific options used to create the volume. + * + * @var ClusterVolumeSpec|null + */ + protected $spec; + /** + * Cluster-specific options used to create the volume. + * + * @return ClusterVolumeSpec|null + */ + public function getSpec(): ?ClusterVolumeSpec + { + return $this->spec; + } + /** + * Cluster-specific options used to create the volume. + * + * @param ClusterVolumeSpec|null $spec + * + * @return self + */ + public function setSpec(?ClusterVolumeSpec $spec): self + { + $this->initialized['spec'] = true; + $this->spec = $spec; + return $this; + } +} \ No newline at end of file diff --git a/generated/Model/VolumesPrunePostResponse200.php b/generated/Model/VolumesPrunePostResponse200.php new file mode 100644 index 00000000..e914b254 --- /dev/null +++ b/generated/Model/VolumesPrunePostResponse200.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * Volumes that were deleted + * + * @var list|null + */ + protected $volumesDeleted; + /** + * Disk space reclaimed in bytes + * + * @var int|null + */ + protected $spaceReclaimed; + /** + * Volumes that were deleted + * + * @return list|null + */ + public function getVolumesDeleted(): ?array + { + return $this->volumesDeleted; + } + /** + * Volumes that were deleted + * + * @param list|null $volumesDeleted + * + * @return self + */ + public function setVolumesDeleted(?array $volumesDeleted): self + { + $this->initialized['volumesDeleted'] = true; + $this->volumesDeleted = $volumesDeleted; + return $this; + } + /** + * Disk space reclaimed in bytes + * + * @return int|null + */ + public function getSpaceReclaimed(): ?int + { + return $this->spaceReclaimed; + } + /** + * Disk space reclaimed in bytes + * + * @param int|null $spaceReclaimed + * + * @return self + */ + public function setSpaceReclaimed(?int $spaceReclaimed): self + { + $this->initialized['spaceReclaimed'] = true; + $this->spaceReclaimed = $spaceReclaimed; + return $this; + } +} \ No newline at end of file diff --git a/generated/Normalizer/AddressNormalizer.php b/generated/Normalizer/AddressNormalizer.php new file mode 100644 index 00000000..7c1e02cc --- /dev/null +++ b/generated/Normalizer/AddressNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class AddressNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Address::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Address::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Address(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Addr', $data) && $data['Addr'] !== null) { + $object->setAddr($data['Addr']); + } + elseif (\array_key_exists('Addr', $data) && $data['Addr'] === null) { + $object->setAddr(null); + } + if (\array_key_exists('PrefixLen', $data) && $data['PrefixLen'] !== null) { + $object->setPrefixLen($data['PrefixLen']); + } + elseif (\array_key_exists('PrefixLen', $data) && $data['PrefixLen'] === null) { + $object->setPrefixLen(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); + } + if ($object->isInitialized('prefixLen') && null !== $object->getPrefixLen()) { + $data['PrefixLen'] = $object->getPrefixLen(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Address::class => false]; + } + } +} else { + class AddressNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Address::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Address::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Address(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Addr', $data) && $data['Addr'] !== null) { + $object->setAddr($data['Addr']); + } + elseif (\array_key_exists('Addr', $data) && $data['Addr'] === null) { + $object->setAddr(null); + } + if (\array_key_exists('PrefixLen', $data) && $data['PrefixLen'] !== null) { + $object->setPrefixLen($data['PrefixLen']); + } + elseif (\array_key_exists('PrefixLen', $data) && $data['PrefixLen'] === null) { + $object->setPrefixLen(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); + } + if ($object->isInitialized('prefixLen') && null !== $object->getPrefixLen()) { + $data['PrefixLen'] = $object->getPrefixLen(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Address::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/AnnotationsNormalizer.php b/generated/Normalizer/AnnotationsNormalizer.php deleted file mode 100644 index b57e9e1b..00000000 --- a/generated/Normalizer/AnnotationsNormalizer.php +++ /dev/null @@ -1,83 +0,0 @@ -setName($data->{'Name'}); - } - if (property_exists($data, 'Labels')) { - $value = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_1) { - $values[$key] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Labels'})) { - $value = $data->{'Labels'}; - } - $object->setLabels($value); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - $value = $object->getLabels(); - if (is_object($object->getLabels())) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value_1) { - $values->{$key} = $value_1; - } - $value = $values; - } - if (is_null($object->getLabels())) { - $value = $object->getLabels(); - } - $data->{'Labels'} = $value; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/AuthConfigNormalizer.php b/generated/Normalizer/AuthConfigNormalizer.php index 37263cde..0429851d 100644 --- a/generated/Normalizer/AuthConfigNormalizer.php +++ b/generated/Normalizer/AuthConfigNormalizer.php @@ -2,80 +2,171 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class AuthConfigNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\AuthConfig') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\AuthConfig) { - return true; - } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class AuthConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\AuthConfig(); - if (property_exists($data, 'username')) { - $object->setUsername($data->{'username'}); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\AuthConfig::class; } - if (property_exists($data, 'password')) { - $object->setPassword($data->{'password'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\AuthConfig::class; } - if (property_exists($data, 'email')) { - $object->setEmail($data->{'email'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\AuthConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('username', $data) && $data['username'] !== null) { + $object->setUsername($data['username']); + } + elseif (\array_key_exists('username', $data) && $data['username'] === null) { + $object->setUsername(null); + } + if (\array_key_exists('password', $data) && $data['password'] !== null) { + $object->setPassword($data['password']); + } + elseif (\array_key_exists('password', $data) && $data['password'] === null) { + $object->setPassword(null); + } + if (\array_key_exists('email', $data) && $data['email'] !== null) { + $object->setEmail($data['email']); + } + elseif (\array_key_exists('email', $data) && $data['email'] === null) { + $object->setEmail(null); + } + if (\array_key_exists('serveraddress', $data) && $data['serveraddress'] !== null) { + $object->setServeraddress($data['serveraddress']); + } + elseif (\array_key_exists('serveraddress', $data) && $data['serveraddress'] === null) { + $object->setServeraddress(null); + } + return $object; } - if (property_exists($data, 'serveraddress')) { - $object->setServeraddress($data->{'serveraddress'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('username') && null !== $object->getUsername()) { + $data['username'] = $object->getUsername(); + } + if ($object->isInitialized('password') && null !== $object->getPassword()) { + $data['password'] = $object->getPassword(); + } + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $data['email'] = $object->getEmail(); + } + if ($object->isInitialized('serveraddress') && null !== $object->getServeraddress()) { + $data['serveraddress'] = $object->getServeraddress(); + } + return $data; } - if (property_exists($data, 'registrytoken')) { - $object->setRegistrytoken($data->{'registrytoken'}); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\AuthConfig::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class AuthConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getUsername()) { - $data->{'username'} = $object->getUsername(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\AuthConfig::class; } - if (null !== $object->getPassword()) { - $data->{'password'} = $object->getPassword(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\AuthConfig::class; } - if (null !== $object->getEmail()) { - $data->{'email'} = $object->getEmail(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\AuthConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('username', $data) && $data['username'] !== null) { + $object->setUsername($data['username']); + } + elseif (\array_key_exists('username', $data) && $data['username'] === null) { + $object->setUsername(null); + } + if (\array_key_exists('password', $data) && $data['password'] !== null) { + $object->setPassword($data['password']); + } + elseif (\array_key_exists('password', $data) && $data['password'] === null) { + $object->setPassword(null); + } + if (\array_key_exists('email', $data) && $data['email'] !== null) { + $object->setEmail($data['email']); + } + elseif (\array_key_exists('email', $data) && $data['email'] === null) { + $object->setEmail(null); + } + if (\array_key_exists('serveraddress', $data) && $data['serveraddress'] !== null) { + $object->setServeraddress($data['serveraddress']); + } + elseif (\array_key_exists('serveraddress', $data) && $data['serveraddress'] === null) { + $object->setServeraddress(null); + } + return $object; } - if (null !== $object->getServeraddress()) { - $data->{'serveraddress'} = $object->getServeraddress(); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('username') && null !== $object->getUsername()) { + $data['username'] = $object->getUsername(); + } + if ($object->isInitialized('password') && null !== $object->getPassword()) { + $data['password'] = $object->getPassword(); + } + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $data['email'] = $object->getEmail(); + } + if ($object->isInitialized('serveraddress') && null !== $object->getServeraddress()) { + $data['serveraddress'] = $object->getServeraddress(); + } + return $data; } - if (null !== $object->getRegistrytoken()) { - $data->{'registrytoken'} = $object->getRegistrytoken(); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\AuthConfig::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/AuthPostResponse200Normalizer.php b/generated/Normalizer/AuthPostResponse200Normalizer.php new file mode 100644 index 00000000..7015d488 --- /dev/null +++ b/generated/Normalizer/AuthPostResponse200Normalizer.php @@ -0,0 +1,132 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class AuthPostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\AuthPostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\AuthPostResponse200::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\AuthPostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($data['Status']); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('IdentityToken', $data) && $data['IdentityToken'] !== null) { + $object->setIdentityToken($data['IdentityToken']); + } + elseif (\array_key_exists('IdentityToken', $data) && $data['IdentityToken'] === null) { + $object->setIdentityToken(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Status'] = $object->getStatus(); + if ($object->isInitialized('identityToken') && null !== $object->getIdentityToken()) { + $data['IdentityToken'] = $object->getIdentityToken(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\AuthPostResponse200::class => false]; + } + } +} else { + class AuthPostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\AuthPostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\AuthPostResponse200::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\AuthPostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($data['Status']); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('IdentityToken', $data) && $data['IdentityToken'] !== null) { + $object->setIdentityToken($data['IdentityToken']); + } + elseif (\array_key_exists('IdentityToken', $data) && $data['IdentityToken'] === null) { + $object->setIdentityToken(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Status'] = $object->getStatus(); + if ($object->isInitialized('identityToken') && null !== $object->getIdentityToken()) { + $data['IdentityToken'] = $object->getIdentityToken(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\AuthPostResponse200::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/AuthResultNormalizer.php b/generated/Normalizer/AuthResultNormalizer.php deleted file mode 100644 index 8965cc43..00000000 --- a/generated/Normalizer/AuthResultNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setStatus($data->{'Status'}); - } - if (property_exists($data, 'IdentityToken')) { - $object->setIdentityToken($data->{'IdentityToken'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getStatus()) { - $data->{'Status'} = $object->getStatus(); - } - if (null !== $object->getIdentityToken()) { - $data->{'IdentityToken'} = $object->getIdentityToken(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/BuildCacheNormalizer.php b/generated/Normalizer/BuildCacheNormalizer.php new file mode 100644 index 00000000..113730f6 --- /dev/null +++ b/generated/Normalizer/BuildCacheNormalizer.php @@ -0,0 +1,314 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class BuildCacheNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\BuildCache::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\BuildCache::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\BuildCache(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Parent', $data) && $data['Parent'] !== null) { + $object->setParent($data['Parent']); + } + elseif (\array_key_exists('Parent', $data) && $data['Parent'] === null) { + $object->setParent(null); + } + if (\array_key_exists('Parents', $data) && $data['Parents'] !== null) { + $values = []; + foreach ($data['Parents'] as $value) { + $values[] = $value; + } + $object->setParents($values); + } + elseif (\array_key_exists('Parents', $data) && $data['Parents'] === null) { + $object->setParents(null); + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('InUse', $data) && $data['InUse'] !== null) { + $object->setInUse($data['InUse']); + } + elseif (\array_key_exists('InUse', $data) && $data['InUse'] === null) { + $object->setInUse(null); + } + if (\array_key_exists('Shared', $data) && $data['Shared'] !== null) { + $object->setShared($data['Shared']); + } + elseif (\array_key_exists('Shared', $data) && $data['Shared'] === null) { + $object->setShared(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('LastUsedAt', $data) && $data['LastUsedAt'] !== null) { + $object->setLastUsedAt($data['LastUsedAt']); + } + elseif (\array_key_exists('LastUsedAt', $data) && $data['LastUsedAt'] === null) { + $object->setLastUsedAt(null); + } + if (\array_key_exists('UsageCount', $data) && $data['UsageCount'] !== null) { + $object->setUsageCount($data['UsageCount']); + } + elseif (\array_key_exists('UsageCount', $data) && $data['UsageCount'] === null) { + $object->setUsageCount(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('parent') && null !== $object->getParent()) { + $data['Parent'] = $object->getParent(); + } + if ($object->isInitialized('parents') && null !== $object->getParents()) { + $values = []; + foreach ($object->getParents() as $value) { + $values[] = $value; + } + $data['Parents'] = $values; + } + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['Description'] = $object->getDescription(); + } + if ($object->isInitialized('inUse') && null !== $object->getInUse()) { + $data['InUse'] = $object->getInUse(); + } + if ($object->isInitialized('shared') && null !== $object->getShared()) { + $data['Shared'] = $object->getShared(); + } + if ($object->isInitialized('size') && null !== $object->getSize()) { + $data['Size'] = $object->getSize(); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('lastUsedAt') && null !== $object->getLastUsedAt()) { + $data['LastUsedAt'] = $object->getLastUsedAt(); + } + if ($object->isInitialized('usageCount') && null !== $object->getUsageCount()) { + $data['UsageCount'] = $object->getUsageCount(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\BuildCache::class => false]; + } + } +} else { + class BuildCacheNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\BuildCache::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\BuildCache::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\BuildCache(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Parent', $data) && $data['Parent'] !== null) { + $object->setParent($data['Parent']); + } + elseif (\array_key_exists('Parent', $data) && $data['Parent'] === null) { + $object->setParent(null); + } + if (\array_key_exists('Parents', $data) && $data['Parents'] !== null) { + $values = []; + foreach ($data['Parents'] as $value) { + $values[] = $value; + } + $object->setParents($values); + } + elseif (\array_key_exists('Parents', $data) && $data['Parents'] === null) { + $object->setParents(null); + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('InUse', $data) && $data['InUse'] !== null) { + $object->setInUse($data['InUse']); + } + elseif (\array_key_exists('InUse', $data) && $data['InUse'] === null) { + $object->setInUse(null); + } + if (\array_key_exists('Shared', $data) && $data['Shared'] !== null) { + $object->setShared($data['Shared']); + } + elseif (\array_key_exists('Shared', $data) && $data['Shared'] === null) { + $object->setShared(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('LastUsedAt', $data) && $data['LastUsedAt'] !== null) { + $object->setLastUsedAt($data['LastUsedAt']); + } + elseif (\array_key_exists('LastUsedAt', $data) && $data['LastUsedAt'] === null) { + $object->setLastUsedAt(null); + } + if (\array_key_exists('UsageCount', $data) && $data['UsageCount'] !== null) { + $object->setUsageCount($data['UsageCount']); + } + elseif (\array_key_exists('UsageCount', $data) && $data['UsageCount'] === null) { + $object->setUsageCount(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('parent') && null !== $object->getParent()) { + $data['Parent'] = $object->getParent(); + } + if ($object->isInitialized('parents') && null !== $object->getParents()) { + $values = []; + foreach ($object->getParents() as $value) { + $values[] = $value; + } + $data['Parents'] = $values; + } + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['Description'] = $object->getDescription(); + } + if ($object->isInitialized('inUse') && null !== $object->getInUse()) { + $data['InUse'] = $object->getInUse(); + } + if ($object->isInitialized('shared') && null !== $object->getShared()) { + $data['Shared'] = $object->getShared(); + } + if ($object->isInitialized('size') && null !== $object->getSize()) { + $data['Size'] = $object->getSize(); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('lastUsedAt') && null !== $object->getLastUsedAt()) { + $data['LastUsedAt'] = $object->getLastUsedAt(); + } + if ($object->isInitialized('usageCount') && null !== $object->getUsageCount()) { + $data['UsageCount'] = $object->getUsageCount(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\BuildCache::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/BuildInfoNormalizer.php b/generated/Normalizer/BuildInfoNormalizer.php index 4475f4d0..0e1ea677 100644 --- a/generated/Normalizer/BuildInfoNormalizer.php +++ b/generated/Normalizer/BuildInfoNormalizer.php @@ -2,92 +2,243 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class BuildInfoNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\BuildInfo') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class BuildInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\BuildInfo) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\BuildInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\BuildInfo::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\BuildInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && $data['id'] !== null) { + $object->setId($data['id']); + } + elseif (\array_key_exists('id', $data) && $data['id'] === null) { + $object->setId(null); + } + if (\array_key_exists('stream', $data) && $data['stream'] !== null) { + $object->setStream($data['stream']); + } + elseif (\array_key_exists('stream', $data) && $data['stream'] === null) { + $object->setStream(null); + } + if (\array_key_exists('error', $data) && $data['error'] !== null) { + $object->setError($data['error']); + } + elseif (\array_key_exists('error', $data) && $data['error'] === null) { + $object->setError(null); + } + if (\array_key_exists('errorDetail', $data) && $data['errorDetail'] !== null) { + $object->setErrorDetail($this->denormalizer->denormalize($data['errorDetail'], \Docker\API\Model\ErrorDetail::class, 'json', $context)); + } + elseif (\array_key_exists('errorDetail', $data) && $data['errorDetail'] === null) { + $object->setErrorDetail(null); + } + if (\array_key_exists('status', $data) && $data['status'] !== null) { + $object->setStatus($data['status']); + } + elseif (\array_key_exists('status', $data) && $data['status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('progress', $data) && $data['progress'] !== null) { + $object->setProgress($data['progress']); + } + elseif (\array_key_exists('progress', $data) && $data['progress'] === null) { + $object->setProgress(null); + } + if (\array_key_exists('progressDetail', $data) && $data['progressDetail'] !== null) { + $object->setProgressDetail($this->denormalizer->denormalize($data['progressDetail'], \Docker\API\Model\ProgressDetail::class, 'json', $context)); + } + elseif (\array_key_exists('progressDetail', $data) && $data['progressDetail'] === null) { + $object->setProgressDetail(null); + } + if (\array_key_exists('aux', $data) && $data['aux'] !== null) { + $object->setAux($this->denormalizer->denormalize($data['aux'], \Docker\API\Model\ImageID::class, 'json', $context)); + } + elseif (\array_key_exists('aux', $data) && $data['aux'] === null) { + $object->setAux(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + if ($object->isInitialized('stream') && null !== $object->getStream()) { + $data['stream'] = $object->getStream(); + } + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['error'] = $object->getError(); + } + if ($object->isInitialized('errorDetail') && null !== $object->getErrorDetail()) { + $data['errorDetail'] = $this->normalizer->normalize($object->getErrorDetail(), 'json', $context); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['status'] = $object->getStatus(); + } + if ($object->isInitialized('progress') && null !== $object->getProgress()) { + $data['progress'] = $object->getProgress(); + } + if ($object->isInitialized('progressDetail') && null !== $object->getProgressDetail()) { + $data['progressDetail'] = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); + } + if ($object->isInitialized('aux') && null !== $object->getAux()) { + $data['aux'] = $this->normalizer->normalize($object->getAux(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\BuildInfo::class => false]; } - - return false; } - - public function denormalize($data, $class, $format = null, array $context = []) +} else { + class BuildInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\BuildInfo(); - if (property_exists($data, 'id')) { - $object->setId($data->{'id'}); - } - if (property_exists($data, 'stream')) { - $object->setStream($data->{'stream'}); - } - if (property_exists($data, 'error')) { - $object->setError($data->{'error'}); - } - if (property_exists($data, 'errorDetail')) { - $object->setErrorDetail($this->serializer->denormalize($data->{'errorDetail'}, 'Docker\\API\\Model\\ErrorDetail', 'raw', $context)); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\BuildInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\BuildInfo::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\BuildInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && $data['id'] !== null) { + $object->setId($data['id']); + } + elseif (\array_key_exists('id', $data) && $data['id'] === null) { + $object->setId(null); + } + if (\array_key_exists('stream', $data) && $data['stream'] !== null) { + $object->setStream($data['stream']); + } + elseif (\array_key_exists('stream', $data) && $data['stream'] === null) { + $object->setStream(null); + } + if (\array_key_exists('error', $data) && $data['error'] !== null) { + $object->setError($data['error']); + } + elseif (\array_key_exists('error', $data) && $data['error'] === null) { + $object->setError(null); + } + if (\array_key_exists('errorDetail', $data) && $data['errorDetail'] !== null) { + $object->setErrorDetail($this->denormalizer->denormalize($data['errorDetail'], \Docker\API\Model\ErrorDetail::class, 'json', $context)); + } + elseif (\array_key_exists('errorDetail', $data) && $data['errorDetail'] === null) { + $object->setErrorDetail(null); + } + if (\array_key_exists('status', $data) && $data['status'] !== null) { + $object->setStatus($data['status']); + } + elseif (\array_key_exists('status', $data) && $data['status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('progress', $data) && $data['progress'] !== null) { + $object->setProgress($data['progress']); + } + elseif (\array_key_exists('progress', $data) && $data['progress'] === null) { + $object->setProgress(null); + } + if (\array_key_exists('progressDetail', $data) && $data['progressDetail'] !== null) { + $object->setProgressDetail($this->denormalizer->denormalize($data['progressDetail'], \Docker\API\Model\ProgressDetail::class, 'json', $context)); + } + elseif (\array_key_exists('progressDetail', $data) && $data['progressDetail'] === null) { + $object->setProgressDetail(null); + } + if (\array_key_exists('aux', $data) && $data['aux'] !== null) { + $object->setAux($this->denormalizer->denormalize($data['aux'], \Docker\API\Model\ImageID::class, 'json', $context)); + } + elseif (\array_key_exists('aux', $data) && $data['aux'] === null) { + $object->setAux(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + if ($object->isInitialized('stream') && null !== $object->getStream()) { + $data['stream'] = $object->getStream(); + } + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['error'] = $object->getError(); + } + if ($object->isInitialized('errorDetail') && null !== $object->getErrorDetail()) { + $data['errorDetail'] = $this->normalizer->normalize($object->getErrorDetail(), 'json', $context); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['status'] = $object->getStatus(); + } + if ($object->isInitialized('progress') && null !== $object->getProgress()) { + $data['progress'] = $object->getProgress(); + } + if ($object->isInitialized('progressDetail') && null !== $object->getProgressDetail()) { + $data['progressDetail'] = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); + } + if ($object->isInitialized('aux') && null !== $object->getAux()) { + $data['aux'] = $this->normalizer->normalize($object->getAux(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\BuildInfo::class => false]; } - if (property_exists($data, 'status')) { - $object->setStatus($data->{'status'}); - } - if (property_exists($data, 'progress')) { - $object->setProgress($data->{'progress'}); - } - if (property_exists($data, 'progressDetail')) { - $object->setProgressDetail($this->serializer->denormalize($data->{'progressDetail'}, 'Docker\\API\\Model\\ProgressDetail', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'id'} = $object->getId(); - } - if (null !== $object->getStream()) { - $data->{'stream'} = $object->getStream(); - } - if (null !== $object->getError()) { - $data->{'error'} = $object->getError(); - } - if (null !== $object->getErrorDetail()) { - $data->{'errorDetail'} = json_decode($this->serializer->normalize($object->getErrorDetail(), 'raw', $context)); - } - if (null !== $object->getStatus()) { - $data->{'status'} = $object->getStatus(); - } - if (null !== $object->getProgress()) { - $data->{'progress'} = $object->getProgress(); - } - if (null !== $object->getProgressDetail()) { - $data->{'progressDetail'} = json_decode($this->serializer->normalize($object->getProgressDetail(), 'raw', $context)); - } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/BuildPrunePostResponse200Normalizer.php b/generated/Normalizer/BuildPrunePostResponse200Normalizer.php new file mode 100644 index 00000000..aed9fa90 --- /dev/null +++ b/generated/Normalizer/BuildPrunePostResponse200Normalizer.php @@ -0,0 +1,152 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class BuildPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\BuildPrunePostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\BuildPrunePostResponse200::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\BuildPrunePostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CachesDeleted', $data) && $data['CachesDeleted'] !== null) { + $values = []; + foreach ($data['CachesDeleted'] as $value) { + $values[] = $value; + } + $object->setCachesDeleted($values); + } + elseif (\array_key_exists('CachesDeleted', $data) && $data['CachesDeleted'] === null) { + $object->setCachesDeleted(null); + } + if (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] !== null) { + $object->setSpaceReclaimed($data['SpaceReclaimed']); + } + elseif (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] === null) { + $object->setSpaceReclaimed(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('cachesDeleted') && null !== $object->getCachesDeleted()) { + $values = []; + foreach ($object->getCachesDeleted() as $value) { + $values[] = $value; + } + $data['CachesDeleted'] = $values; + } + if ($object->isInitialized('spaceReclaimed') && null !== $object->getSpaceReclaimed()) { + $data['SpaceReclaimed'] = $object->getSpaceReclaimed(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\BuildPrunePostResponse200::class => false]; + } + } +} else { + class BuildPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\BuildPrunePostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\BuildPrunePostResponse200::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\BuildPrunePostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CachesDeleted', $data) && $data['CachesDeleted'] !== null) { + $values = []; + foreach ($data['CachesDeleted'] as $value) { + $values[] = $value; + } + $object->setCachesDeleted($values); + } + elseif (\array_key_exists('CachesDeleted', $data) && $data['CachesDeleted'] === null) { + $object->setCachesDeleted(null); + } + if (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] !== null) { + $object->setSpaceReclaimed($data['SpaceReclaimed']); + } + elseif (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] === null) { + $object->setSpaceReclaimed(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('cachesDeleted') && null !== $object->getCachesDeleted()) { + $values = []; + foreach ($object->getCachesDeleted() as $value) { + $values[] = $value; + } + $data['CachesDeleted'] = $values; + } + if ($object->isInitialized('spaceReclaimed') && null !== $object->getSpaceReclaimed()) { + $data['SpaceReclaimed'] = $object->getSpaceReclaimed(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\BuildPrunePostResponse200::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ClusterInfoNormalizer.php b/generated/Normalizer/ClusterInfoNormalizer.php new file mode 100644 index 00000000..639eca27 --- /dev/null +++ b/generated/Normalizer/ClusterInfoNormalizer.php @@ -0,0 +1,296 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ClusterInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterInfo::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\SwarmSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] !== null) { + $object->setTLSInfo($this->denormalizer->denormalize($data['TLSInfo'], \Docker\API\Model\TLSInfo::class, 'json', $context)); + } + elseif (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] === null) { + $object->setTLSInfo(null); + } + if (\array_key_exists('RootRotationInProgress', $data) && $data['RootRotationInProgress'] !== null) { + $object->setRootRotationInProgress($data['RootRotationInProgress']); + } + elseif (\array_key_exists('RootRotationInProgress', $data) && $data['RootRotationInProgress'] === null) { + $object->setRootRotationInProgress(null); + } + if (\array_key_exists('DataPathPort', $data) && $data['DataPathPort'] !== null) { + $object->setDataPathPort($data['DataPathPort']); + } + elseif (\array_key_exists('DataPathPort', $data) && $data['DataPathPort'] === null) { + $object->setDataPathPort(null); + } + if (\array_key_exists('DefaultAddrPool', $data) && $data['DefaultAddrPool'] !== null) { + $values = []; + foreach ($data['DefaultAddrPool'] as $value) { + $values[] = $value; + } + $object->setDefaultAddrPool($values); + } + elseif (\array_key_exists('DefaultAddrPool', $data) && $data['DefaultAddrPool'] === null) { + $object->setDefaultAddrPool(null); + } + if (\array_key_exists('SubnetSize', $data) && $data['SubnetSize'] !== null) { + $object->setSubnetSize($data['SubnetSize']); + } + elseif (\array_key_exists('SubnetSize', $data) && $data['SubnetSize'] === null) { + $object->setSubnetSize(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('tLSInfo') && null !== $object->getTLSInfo()) { + $data['TLSInfo'] = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); + } + if ($object->isInitialized('rootRotationInProgress') && null !== $object->getRootRotationInProgress()) { + $data['RootRotationInProgress'] = $object->getRootRotationInProgress(); + } + if ($object->isInitialized('dataPathPort') && null !== $object->getDataPathPort()) { + $data['DataPathPort'] = $object->getDataPathPort(); + } + if ($object->isInitialized('defaultAddrPool') && null !== $object->getDefaultAddrPool()) { + $values = []; + foreach ($object->getDefaultAddrPool() as $value) { + $values[] = $value; + } + $data['DefaultAddrPool'] = $values; + } + if ($object->isInitialized('subnetSize') && null !== $object->getSubnetSize()) { + $data['SubnetSize'] = $object->getSubnetSize(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterInfo::class => false]; + } + } +} else { + class ClusterInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterInfo::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\SwarmSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] !== null) { + $object->setTLSInfo($this->denormalizer->denormalize($data['TLSInfo'], \Docker\API\Model\TLSInfo::class, 'json', $context)); + } + elseif (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] === null) { + $object->setTLSInfo(null); + } + if (\array_key_exists('RootRotationInProgress', $data) && $data['RootRotationInProgress'] !== null) { + $object->setRootRotationInProgress($data['RootRotationInProgress']); + } + elseif (\array_key_exists('RootRotationInProgress', $data) && $data['RootRotationInProgress'] === null) { + $object->setRootRotationInProgress(null); + } + if (\array_key_exists('DataPathPort', $data) && $data['DataPathPort'] !== null) { + $object->setDataPathPort($data['DataPathPort']); + } + elseif (\array_key_exists('DataPathPort', $data) && $data['DataPathPort'] === null) { + $object->setDataPathPort(null); + } + if (\array_key_exists('DefaultAddrPool', $data) && $data['DefaultAddrPool'] !== null) { + $values = []; + foreach ($data['DefaultAddrPool'] as $value) { + $values[] = $value; + } + $object->setDefaultAddrPool($values); + } + elseif (\array_key_exists('DefaultAddrPool', $data) && $data['DefaultAddrPool'] === null) { + $object->setDefaultAddrPool(null); + } + if (\array_key_exists('SubnetSize', $data) && $data['SubnetSize'] !== null) { + $object->setSubnetSize($data['SubnetSize']); + } + elseif (\array_key_exists('SubnetSize', $data) && $data['SubnetSize'] === null) { + $object->setSubnetSize(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('tLSInfo') && null !== $object->getTLSInfo()) { + $data['TLSInfo'] = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); + } + if ($object->isInitialized('rootRotationInProgress') && null !== $object->getRootRotationInProgress()) { + $data['RootRotationInProgress'] = $object->getRootRotationInProgress(); + } + if ($object->isInitialized('dataPathPort') && null !== $object->getDataPathPort()) { + $data['DataPathPort'] = $object->getDataPathPort(); + } + if ($object->isInitialized('defaultAddrPool') && null !== $object->getDefaultAddrPool()) { + $values = []; + foreach ($object->getDefaultAddrPool() as $value) { + $values[] = $value; + } + $data['DefaultAddrPool'] = $values; + } + if ($object->isInitialized('subnetSize') && null !== $object->getSubnetSize()) { + $data['SubnetSize'] = $object->getSubnetSize(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterInfo::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ClusterVolumeInfoNormalizer.php b/generated/Normalizer/ClusterVolumeInfoNormalizer.php new file mode 100644 index 00000000..31103db9 --- /dev/null +++ b/generated/Normalizer/ClusterVolumeInfoNormalizer.php @@ -0,0 +1,220 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ClusterVolumeInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumeInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumeInfo::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumeInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CapacityBytes', $data) && $data['CapacityBytes'] !== null) { + $object->setCapacityBytes($data['CapacityBytes']); + } + elseif (\array_key_exists('CapacityBytes', $data) && $data['CapacityBytes'] === null) { + $object->setCapacityBytes(null); + } + if (\array_key_exists('VolumeContext', $data) && $data['VolumeContext'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['VolumeContext'] as $key => $value) { + $values[$key] = $value; + } + $object->setVolumeContext($values); + } + elseif (\array_key_exists('VolumeContext', $data) && $data['VolumeContext'] === null) { + $object->setVolumeContext(null); + } + if (\array_key_exists('VolumeID', $data) && $data['VolumeID'] !== null) { + $object->setVolumeID($data['VolumeID']); + } + elseif (\array_key_exists('VolumeID', $data) && $data['VolumeID'] === null) { + $object->setVolumeID(null); + } + if (\array_key_exists('AccessibleTopology', $data) && $data['AccessibleTopology'] !== null) { + $values_1 = []; + foreach ($data['AccessibleTopology'] as $value_1) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value_1 as $key_1 => $value_2) { + $values_2[$key_1] = $value_2; + } + $values_1[] = $values_2; + } + $object->setAccessibleTopology($values_1); + } + elseif (\array_key_exists('AccessibleTopology', $data) && $data['AccessibleTopology'] === null) { + $object->setAccessibleTopology(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('capacityBytes') && null !== $object->getCapacityBytes()) { + $data['CapacityBytes'] = $object->getCapacityBytes(); + } + if ($object->isInitialized('volumeContext') && null !== $object->getVolumeContext()) { + $values = []; + foreach ($object->getVolumeContext() as $key => $value) { + $values[$key] = $value; + } + $data['VolumeContext'] = $values; + } + if ($object->isInitialized('volumeID') && null !== $object->getVolumeID()) { + $data['VolumeID'] = $object->getVolumeID(); + } + if ($object->isInitialized('accessibleTopology') && null !== $object->getAccessibleTopology()) { + $values_1 = []; + foreach ($object->getAccessibleTopology() as $value_1) { + $values_2 = []; + foreach ($value_1 as $key_1 => $value_2) { + $values_2[$key_1] = $value_2; + } + $values_1[] = $values_2; + } + $data['AccessibleTopology'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeInfo::class => false]; + } + } +} else { + class ClusterVolumeInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumeInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumeInfo::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumeInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CapacityBytes', $data) && $data['CapacityBytes'] !== null) { + $object->setCapacityBytes($data['CapacityBytes']); + } + elseif (\array_key_exists('CapacityBytes', $data) && $data['CapacityBytes'] === null) { + $object->setCapacityBytes(null); + } + if (\array_key_exists('VolumeContext', $data) && $data['VolumeContext'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['VolumeContext'] as $key => $value) { + $values[$key] = $value; + } + $object->setVolumeContext($values); + } + elseif (\array_key_exists('VolumeContext', $data) && $data['VolumeContext'] === null) { + $object->setVolumeContext(null); + } + if (\array_key_exists('VolumeID', $data) && $data['VolumeID'] !== null) { + $object->setVolumeID($data['VolumeID']); + } + elseif (\array_key_exists('VolumeID', $data) && $data['VolumeID'] === null) { + $object->setVolumeID(null); + } + if (\array_key_exists('AccessibleTopology', $data) && $data['AccessibleTopology'] !== null) { + $values_1 = []; + foreach ($data['AccessibleTopology'] as $value_1) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value_1 as $key_1 => $value_2) { + $values_2[$key_1] = $value_2; + } + $values_1[] = $values_2; + } + $object->setAccessibleTopology($values_1); + } + elseif (\array_key_exists('AccessibleTopology', $data) && $data['AccessibleTopology'] === null) { + $object->setAccessibleTopology(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('capacityBytes') && null !== $object->getCapacityBytes()) { + $data['CapacityBytes'] = $object->getCapacityBytes(); + } + if ($object->isInitialized('volumeContext') && null !== $object->getVolumeContext()) { + $values = []; + foreach ($object->getVolumeContext() as $key => $value) { + $values[$key] = $value; + } + $data['VolumeContext'] = $values; + } + if ($object->isInitialized('volumeID') && null !== $object->getVolumeID()) { + $data['VolumeID'] = $object->getVolumeID(); + } + if ($object->isInitialized('accessibleTopology') && null !== $object->getAccessibleTopology()) { + $values_1 = []; + foreach ($object->getAccessibleTopology() as $value_1) { + $values_2 = []; + foreach ($value_1 as $key_1 => $value_2) { + $values_2[$key_1] = $value_2; + } + $values_1[] = $values_2; + } + $data['AccessibleTopology'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeInfo::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ClusterVolumeNormalizer.php b/generated/Normalizer/ClusterVolumeNormalizer.php new file mode 100644 index 00000000..8d915afb --- /dev/null +++ b/generated/Normalizer/ClusterVolumeNormalizer.php @@ -0,0 +1,242 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ClusterVolumeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolume::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolume::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolume(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\ClusterVolumeSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('Info', $data) && $data['Info'] !== null) { + $object->setInfo($this->denormalizer->denormalize($data['Info'], \Docker\API\Model\ClusterVolumeInfo::class, 'json', $context)); + } + elseif (\array_key_exists('Info', $data) && $data['Info'] === null) { + $object->setInfo(null); + } + if (\array_key_exists('PublishStatus', $data) && $data['PublishStatus'] !== null) { + $values = []; + foreach ($data['PublishStatus'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ClusterVolumePublishStatusItem::class, 'json', $context); + } + $object->setPublishStatus($values); + } + elseif (\array_key_exists('PublishStatus', $data) && $data['PublishStatus'] === null) { + $object->setPublishStatus(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('info') && null !== $object->getInfo()) { + $data['Info'] = $this->normalizer->normalize($object->getInfo(), 'json', $context); + } + if ($object->isInitialized('publishStatus') && null !== $object->getPublishStatus()) { + $values = []; + foreach ($object->getPublishStatus() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['PublishStatus'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolume::class => false]; + } + } +} else { + class ClusterVolumeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolume::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolume::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolume(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\ClusterVolumeSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('Info', $data) && $data['Info'] !== null) { + $object->setInfo($this->denormalizer->denormalize($data['Info'], \Docker\API\Model\ClusterVolumeInfo::class, 'json', $context)); + } + elseif (\array_key_exists('Info', $data) && $data['Info'] === null) { + $object->setInfo(null); + } + if (\array_key_exists('PublishStatus', $data) && $data['PublishStatus'] !== null) { + $values = []; + foreach ($data['PublishStatus'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ClusterVolumePublishStatusItem::class, 'json', $context); + } + $object->setPublishStatus($values); + } + elseif (\array_key_exists('PublishStatus', $data) && $data['PublishStatus'] === null) { + $object->setPublishStatus(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('info') && null !== $object->getInfo()) { + $data['Info'] = $this->normalizer->normalize($object->getInfo(), 'json', $context); + } + if ($object->isInitialized('publishStatus') && null !== $object->getPublishStatus()) { + $values = []; + foreach ($object->getPublishStatus() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['PublishStatus'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolume::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ClusterVolumePublishStatusItemNormalizer.php b/generated/Normalizer/ClusterVolumePublishStatusItemNormalizer.php new file mode 100644 index 00000000..9298bd16 --- /dev/null +++ b/generated/Normalizer/ClusterVolumePublishStatusItemNormalizer.php @@ -0,0 +1,170 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ClusterVolumePublishStatusItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumePublishStatusItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumePublishStatusItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumePublishStatusItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NodeID', $data) && $data['NodeID'] !== null) { + $object->setNodeID($data['NodeID']); + } + elseif (\array_key_exists('NodeID', $data) && $data['NodeID'] === null) { + $object->setNodeID(null); + } + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); + } + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); + } + if (\array_key_exists('PublishContext', $data) && $data['PublishContext'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['PublishContext'] as $key => $value) { + $values[$key] = $value; + } + $object->setPublishContext($values); + } + elseif (\array_key_exists('PublishContext', $data) && $data['PublishContext'] === null) { + $object->setPublishContext(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('nodeID') && null !== $object->getNodeID()) { + $data['NodeID'] = $object->getNodeID(); + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); + } + if ($object->isInitialized('publishContext') && null !== $object->getPublishContext()) { + $values = []; + foreach ($object->getPublishContext() as $key => $value) { + $values[$key] = $value; + } + $data['PublishContext'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumePublishStatusItem::class => false]; + } + } +} else { + class ClusterVolumePublishStatusItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumePublishStatusItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumePublishStatusItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumePublishStatusItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NodeID', $data) && $data['NodeID'] !== null) { + $object->setNodeID($data['NodeID']); + } + elseif (\array_key_exists('NodeID', $data) && $data['NodeID'] === null) { + $object->setNodeID(null); + } + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); + } + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); + } + if (\array_key_exists('PublishContext', $data) && $data['PublishContext'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['PublishContext'] as $key => $value) { + $values[$key] = $value; + } + $object->setPublishContext($values); + } + elseif (\array_key_exists('PublishContext', $data) && $data['PublishContext'] === null) { + $object->setPublishContext(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('nodeID') && null !== $object->getNodeID()) { + $data['NodeID'] = $object->getNodeID(); + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); + } + if ($object->isInitialized('publishContext') && null !== $object->getPublishContext()) { + $values = []; + foreach ($object->getPublishContext() as $key => $value) { + $values[$key] = $value; + } + $data['PublishContext'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumePublishStatusItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer.php b/generated/Normalizer/ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer.php new file mode 100644 index 00000000..c4eb8627 --- /dev/null +++ b/generated/Normalizer/ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer.php @@ -0,0 +1,200 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Requisite', $data) && $data['Requisite'] !== null) { + $values = []; + foreach ($data['Requisite'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $object->setRequisite($values); + } + elseif (\array_key_exists('Requisite', $data) && $data['Requisite'] === null) { + $object->setRequisite(null); + } + if (\array_key_exists('Preferred', $data) && $data['Preferred'] !== null) { + $values_2 = []; + foreach ($data['Preferred'] as $value_2) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value_2 as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $values_2[] = $values_3; + } + $object->setPreferred($values_2); + } + elseif (\array_key_exists('Preferred', $data) && $data['Preferred'] === null) { + $object->setPreferred(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('requisite') && null !== $object->getRequisite()) { + $values = []; + foreach ($object->getRequisite() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $data['Requisite'] = $values; + } + if ($object->isInitialized('preferred') && null !== $object->getPreferred()) { + $values_2 = []; + foreach ($object->getPreferred() as $value_2) { + $values_3 = []; + foreach ($value_2 as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $values_2[] = $values_3; + } + $data['Preferred'] = $values_2; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class => false]; + } + } +} else { + class ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Requisite', $data) && $data['Requisite'] !== null) { + $values = []; + foreach ($data['Requisite'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $object->setRequisite($values); + } + elseif (\array_key_exists('Requisite', $data) && $data['Requisite'] === null) { + $object->setRequisite(null); + } + if (\array_key_exists('Preferred', $data) && $data['Preferred'] !== null) { + $values_2 = []; + foreach ($data['Preferred'] as $value_2) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value_2 as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $values_2[] = $values_3; + } + $object->setPreferred($values_2); + } + elseif (\array_key_exists('Preferred', $data) && $data['Preferred'] === null) { + $object->setPreferred(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('requisite') && null !== $object->getRequisite()) { + $values = []; + foreach ($object->getRequisite() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $data['Requisite'] = $values; + } + if ($object->isInitialized('preferred') && null !== $object->getPreferred()) { + $values_2 = []; + foreach ($object->getPreferred() as $value_2) { + $values_3 = []; + foreach ($value_2 as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $values_2[] = $values_3; + } + $data['Preferred'] = $values_2; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ClusterVolumeSpecAccessModeCapacityRangeNormalizer.php b/generated/Normalizer/ClusterVolumeSpecAccessModeCapacityRangeNormalizer.php new file mode 100644 index 00000000..5446c459 --- /dev/null +++ b/generated/Normalizer/ClusterVolumeSpecAccessModeCapacityRangeNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ClusterVolumeSpecAccessModeCapacityRangeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('RequiredBytes', $data) && $data['RequiredBytes'] !== null) { + $object->setRequiredBytes($data['RequiredBytes']); + } + elseif (\array_key_exists('RequiredBytes', $data) && $data['RequiredBytes'] === null) { + $object->setRequiredBytes(null); + } + if (\array_key_exists('LimitBytes', $data) && $data['LimitBytes'] !== null) { + $object->setLimitBytes($data['LimitBytes']); + } + elseif (\array_key_exists('LimitBytes', $data) && $data['LimitBytes'] === null) { + $object->setLimitBytes(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('requiredBytes') && null !== $object->getRequiredBytes()) { + $data['RequiredBytes'] = $object->getRequiredBytes(); + } + if ($object->isInitialized('limitBytes') && null !== $object->getLimitBytes()) { + $data['LimitBytes'] = $object->getLimitBytes(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class => false]; + } + } +} else { + class ClusterVolumeSpecAccessModeCapacityRangeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('RequiredBytes', $data) && $data['RequiredBytes'] !== null) { + $object->setRequiredBytes($data['RequiredBytes']); + } + elseif (\array_key_exists('RequiredBytes', $data) && $data['RequiredBytes'] === null) { + $object->setRequiredBytes(null); + } + if (\array_key_exists('LimitBytes', $data) && $data['LimitBytes'] !== null) { + $object->setLimitBytes($data['LimitBytes']); + } + elseif (\array_key_exists('LimitBytes', $data) && $data['LimitBytes'] === null) { + $object->setLimitBytes(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('requiredBytes') && null !== $object->getRequiredBytes()) { + $data['RequiredBytes'] = $object->getRequiredBytes(); + } + if ($object->isInitialized('limitBytes') && null !== $object->getLimitBytes()) { + $data['LimitBytes'] = $object->getLimitBytes(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ClusterVolumeSpecAccessModeNormalizer.php b/generated/Normalizer/ClusterVolumeSpecAccessModeNormalizer.php new file mode 100644 index 00000000..e246be60 --- /dev/null +++ b/generated/Normalizer/ClusterVolumeSpecAccessModeNormalizer.php @@ -0,0 +1,242 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ClusterVolumeSpecAccessModeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumeSpecAccessMode::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumeSpecAccessMode::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumeSpecAccessMode(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Scope', $data) && $data['Scope'] !== null) { + $object->setScope($data['Scope']); + } + elseif (\array_key_exists('Scope', $data) && $data['Scope'] === null) { + $object->setScope(null); + } + if (\array_key_exists('Sharing', $data) && $data['Sharing'] !== null) { + $object->setSharing($data['Sharing']); + } + elseif (\array_key_exists('Sharing', $data) && $data['Sharing'] === null) { + $object->setSharing(null); + } + if (\array_key_exists('MountVolume', $data) && $data['MountVolume'] !== null) { + $object->setMountVolume($data['MountVolume']); + } + elseif (\array_key_exists('MountVolume', $data) && $data['MountVolume'] === null) { + $object->setMountVolume(null); + } + if (\array_key_exists('Secrets', $data) && $data['Secrets'] !== null) { + $values = []; + foreach ($data['Secrets'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class, 'json', $context); + } + $object->setSecrets($values); + } + elseif (\array_key_exists('Secrets', $data) && $data['Secrets'] === null) { + $object->setSecrets(null); + } + if (\array_key_exists('AccessibilityRequirements', $data) && $data['AccessibilityRequirements'] !== null) { + $object->setAccessibilityRequirements($this->denormalizer->denormalize($data['AccessibilityRequirements'], \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class, 'json', $context)); + } + elseif (\array_key_exists('AccessibilityRequirements', $data) && $data['AccessibilityRequirements'] === null) { + $object->setAccessibilityRequirements(null); + } + if (\array_key_exists('CapacityRange', $data) && $data['CapacityRange'] !== null) { + $object->setCapacityRange($this->denormalizer->denormalize($data['CapacityRange'], \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class, 'json', $context)); + } + elseif (\array_key_exists('CapacityRange', $data) && $data['CapacityRange'] === null) { + $object->setCapacityRange(null); + } + if (\array_key_exists('Availability', $data) && $data['Availability'] !== null) { + $object->setAvailability($data['Availability']); + } + elseif (\array_key_exists('Availability', $data) && $data['Availability'] === null) { + $object->setAvailability(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('scope') && null !== $object->getScope()) { + $data['Scope'] = $object->getScope(); + } + if ($object->isInitialized('sharing') && null !== $object->getSharing()) { + $data['Sharing'] = $object->getSharing(); + } + if ($object->isInitialized('mountVolume') && null !== $object->getMountVolume()) { + $data['MountVolume'] = $object->getMountVolume(); + } + if ($object->isInitialized('secrets') && null !== $object->getSecrets()) { + $values = []; + foreach ($object->getSecrets() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Secrets'] = $values; + } + if ($object->isInitialized('accessibilityRequirements') && null !== $object->getAccessibilityRequirements()) { + $data['AccessibilityRequirements'] = $this->normalizer->normalize($object->getAccessibilityRequirements(), 'json', $context); + } + if ($object->isInitialized('capacityRange') && null !== $object->getCapacityRange()) { + $data['CapacityRange'] = $this->normalizer->normalize($object->getCapacityRange(), 'json', $context); + } + if ($object->isInitialized('availability') && null !== $object->getAvailability()) { + $data['Availability'] = $object->getAvailability(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessMode::class => false]; + } + } +} else { + class ClusterVolumeSpecAccessModeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumeSpecAccessMode::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumeSpecAccessMode::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumeSpecAccessMode(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Scope', $data) && $data['Scope'] !== null) { + $object->setScope($data['Scope']); + } + elseif (\array_key_exists('Scope', $data) && $data['Scope'] === null) { + $object->setScope(null); + } + if (\array_key_exists('Sharing', $data) && $data['Sharing'] !== null) { + $object->setSharing($data['Sharing']); + } + elseif (\array_key_exists('Sharing', $data) && $data['Sharing'] === null) { + $object->setSharing(null); + } + if (\array_key_exists('MountVolume', $data) && $data['MountVolume'] !== null) { + $object->setMountVolume($data['MountVolume']); + } + elseif (\array_key_exists('MountVolume', $data) && $data['MountVolume'] === null) { + $object->setMountVolume(null); + } + if (\array_key_exists('Secrets', $data) && $data['Secrets'] !== null) { + $values = []; + foreach ($data['Secrets'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class, 'json', $context); + } + $object->setSecrets($values); + } + elseif (\array_key_exists('Secrets', $data) && $data['Secrets'] === null) { + $object->setSecrets(null); + } + if (\array_key_exists('AccessibilityRequirements', $data) && $data['AccessibilityRequirements'] !== null) { + $object->setAccessibilityRequirements($this->denormalizer->denormalize($data['AccessibilityRequirements'], \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class, 'json', $context)); + } + elseif (\array_key_exists('AccessibilityRequirements', $data) && $data['AccessibilityRequirements'] === null) { + $object->setAccessibilityRequirements(null); + } + if (\array_key_exists('CapacityRange', $data) && $data['CapacityRange'] !== null) { + $object->setCapacityRange($this->denormalizer->denormalize($data['CapacityRange'], \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class, 'json', $context)); + } + elseif (\array_key_exists('CapacityRange', $data) && $data['CapacityRange'] === null) { + $object->setCapacityRange(null); + } + if (\array_key_exists('Availability', $data) && $data['Availability'] !== null) { + $object->setAvailability($data['Availability']); + } + elseif (\array_key_exists('Availability', $data) && $data['Availability'] === null) { + $object->setAvailability(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('scope') && null !== $object->getScope()) { + $data['Scope'] = $object->getScope(); + } + if ($object->isInitialized('sharing') && null !== $object->getSharing()) { + $data['Sharing'] = $object->getSharing(); + } + if ($object->isInitialized('mountVolume') && null !== $object->getMountVolume()) { + $data['MountVolume'] = $object->getMountVolume(); + } + if ($object->isInitialized('secrets') && null !== $object->getSecrets()) { + $values = []; + foreach ($object->getSecrets() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Secrets'] = $values; + } + if ($object->isInitialized('accessibilityRequirements') && null !== $object->getAccessibilityRequirements()) { + $data['AccessibilityRequirements'] = $this->normalizer->normalize($object->getAccessibilityRequirements(), 'json', $context); + } + if ($object->isInitialized('capacityRange') && null !== $object->getCapacityRange()) { + $data['CapacityRange'] = $this->normalizer->normalize($object->getCapacityRange(), 'json', $context); + } + if ($object->isInitialized('availability') && null !== $object->getAvailability()) { + $data['Availability'] = $object->getAvailability(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessMode::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ClusterVolumeSpecAccessModeSecretsItemNormalizer.php b/generated/Normalizer/ClusterVolumeSpecAccessModeSecretsItemNormalizer.php new file mode 100644 index 00000000..08f123af --- /dev/null +++ b/generated/Normalizer/ClusterVolumeSpecAccessModeSecretsItemNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ClusterVolumeSpecAccessModeSecretsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Key', $data) && $data['Key'] !== null) { + $object->setKey($data['Key']); + } + elseif (\array_key_exists('Key', $data) && $data['Key'] === null) { + $object->setKey(null); + } + if (\array_key_exists('Secret', $data) && $data['Secret'] !== null) { + $object->setSecret($data['Secret']); + } + elseif (\array_key_exists('Secret', $data) && $data['Secret'] === null) { + $object->setSecret(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('key') && null !== $object->getKey()) { + $data['Key'] = $object->getKey(); + } + if ($object->isInitialized('secret') && null !== $object->getSecret()) { + $data['Secret'] = $object->getSecret(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class => false]; + } + } +} else { + class ClusterVolumeSpecAccessModeSecretsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Key', $data) && $data['Key'] !== null) { + $object->setKey($data['Key']); + } + elseif (\array_key_exists('Key', $data) && $data['Key'] === null) { + $object->setKey(null); + } + if (\array_key_exists('Secret', $data) && $data['Secret'] !== null) { + $object->setSecret($data['Secret']); + } + elseif (\array_key_exists('Secret', $data) && $data['Secret'] === null) { + $object->setSecret(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('key') && null !== $object->getKey()) { + $data['Key'] = $object->getKey(); + } + if ($object->isInitialized('secret') && null !== $object->getSecret()) { + $data['Secret'] = $object->getSecret(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ClusterVolumeSpecNormalizer.php b/generated/Normalizer/ClusterVolumeSpecNormalizer.php new file mode 100644 index 00000000..fcee7d2c --- /dev/null +++ b/generated/Normalizer/ClusterVolumeSpecNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ClusterVolumeSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumeSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumeSpec::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumeSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Group', $data) && $data['Group'] !== null) { + $object->setGroup($data['Group']); + } + elseif (\array_key_exists('Group', $data) && $data['Group'] === null) { + $object->setGroup(null); + } + if (\array_key_exists('AccessMode', $data) && $data['AccessMode'] !== null) { + $object->setAccessMode($this->denormalizer->denormalize($data['AccessMode'], \Docker\API\Model\ClusterVolumeSpecAccessMode::class, 'json', $context)); + } + elseif (\array_key_exists('AccessMode', $data) && $data['AccessMode'] === null) { + $object->setAccessMode(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('group') && null !== $object->getGroup()) { + $data['Group'] = $object->getGroup(); + } + if ($object->isInitialized('accessMode') && null !== $object->getAccessMode()) { + $data['AccessMode'] = $this->normalizer->normalize($object->getAccessMode(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpec::class => false]; + } + } +} else { + class ClusterVolumeSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ClusterVolumeSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ClusterVolumeSpec::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ClusterVolumeSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Group', $data) && $data['Group'] !== null) { + $object->setGroup($data['Group']); + } + elseif (\array_key_exists('Group', $data) && $data['Group'] === null) { + $object->setGroup(null); + } + if (\array_key_exists('AccessMode', $data) && $data['AccessMode'] !== null) { + $object->setAccessMode($this->denormalizer->denormalize($data['AccessMode'], \Docker\API\Model\ClusterVolumeSpecAccessMode::class, 'json', $context)); + } + elseif (\array_key_exists('AccessMode', $data) && $data['AccessMode'] === null) { + $object->setAccessMode(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('group') && null !== $object->getGroup()) { + $data['Group'] = $object->getGroup(); + } + if ($object->isInitialized('accessMode') && null !== $object->getAccessMode()) { + $data['AccessMode'] = $this->normalizer->normalize($object->getAccessMode(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpec::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/CommitNormalizer.php b/generated/Normalizer/CommitNormalizer.php new file mode 100644 index 00000000..21c7c3f5 --- /dev/null +++ b/generated/Normalizer/CommitNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CommitNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Commit::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Commit::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Commit(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Expected', $data) && $data['Expected'] !== null) { + $object->setExpected($data['Expected']); + } + elseif (\array_key_exists('Expected', $data) && $data['Expected'] === null) { + $object->setExpected(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('expected') && null !== $object->getExpected()) { + $data['Expected'] = $object->getExpected(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Commit::class => false]; + } + } +} else { + class CommitNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Commit::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Commit::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Commit(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Expected', $data) && $data['Expected'] !== null) { + $object->setExpected($data['Expected']); + } + elseif (\array_key_exists('Expected', $data) && $data['Expected'] === null) { + $object->setExpected(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('expected') && null !== $object->getExpected()) { + $data['Expected'] = $object->getExpected(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Commit::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/CommitResultNormalizer.php b/generated/Normalizer/CommitResultNormalizer.php deleted file mode 100644 index 6ed02546..00000000 --- a/generated/Normalizer/CommitResultNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -setId($data->{'Id'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ConfigNormalizer.php b/generated/Normalizer/ConfigNormalizer.php new file mode 100644 index 00000000..4dca1cc1 --- /dev/null +++ b/generated/Normalizer/ConfigNormalizer.php @@ -0,0 +1,190 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Config::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Config::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Config(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\ConfigSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Config::class => false]; + } + } +} else { + class ConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Config::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Config::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Config(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\ConfigSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Config::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ConfigReferenceNormalizer.php b/generated/Normalizer/ConfigReferenceNormalizer.php new file mode 100644 index 00000000..176dd635 --- /dev/null +++ b/generated/Normalizer/ConfigReferenceNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ConfigReferenceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ConfigReference::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ConfigReference::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ConfigReference(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Network', $data) && $data['Network'] !== null) { + $object->setNetwork($data['Network']); + } + elseif (\array_key_exists('Network', $data) && $data['Network'] === null) { + $object->setNetwork(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('network') && null !== $object->getNetwork()) { + $data['Network'] = $object->getNetwork(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ConfigReference::class => false]; + } + } +} else { + class ConfigReferenceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ConfigReference::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ConfigReference::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ConfigReference(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Network', $data) && $data['Network'] !== null) { + $object->setNetwork($data['Network']); + } + elseif (\array_key_exists('Network', $data) && $data['Network'] === null) { + $object->setNetwork(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('network') && null !== $object->getNetwork()) { + $data['Network'] = $object->getNetwork(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ConfigReference::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ConfigSpecNormalizer.php b/generated/Normalizer/ConfigSpecNormalizer.php new file mode 100644 index 00000000..5f0812a1 --- /dev/null +++ b/generated/Normalizer/ConfigSpecNormalizer.php @@ -0,0 +1,188 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ConfigSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ConfigSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ConfigSpec::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ConfigSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Data', $data) && $data['Data'] !== null) { + $object->setData($data['Data']); + } + elseif (\array_key_exists('Data', $data) && $data['Data'] === null) { + $object->setData(null); + } + if (\array_key_exists('Templating', $data) && $data['Templating'] !== null) { + $object->setTemplating($this->denormalizer->denormalize($data['Templating'], \Docker\API\Model\Driver::class, 'json', $context)); + } + elseif (\array_key_exists('Templating', $data) && $data['Templating'] === null) { + $object->setTemplating(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('data') && null !== $object->getData()) { + $data['Data'] = $object->getData(); + } + if ($object->isInitialized('templating') && null !== $object->getTemplating()) { + $data['Templating'] = $this->normalizer->normalize($object->getTemplating(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ConfigSpec::class => false]; + } + } +} else { + class ConfigSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ConfigSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ConfigSpec::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ConfigSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Data', $data) && $data['Data'] !== null) { + $object->setData($data['Data']); + } + elseif (\array_key_exists('Data', $data) && $data['Data'] === null) { + $object->setData(null); + } + if (\array_key_exists('Templating', $data) && $data['Templating'] !== null) { + $object->setTemplating($this->denormalizer->denormalize($data['Templating'], \Docker\API\Model\Driver::class, 'json', $context)); + } + elseif (\array_key_exists('Templating', $data) && $data['Templating'] === null) { + $object->setTemplating(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('data') && null !== $object->getData()) { + $data['Data'] = $object->getData(); + } + if ($object->isInitialized('templating') && null !== $object->getTemplating()) { + $data['Templating'] = $this->normalizer->normalize($object->getTemplating(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ConfigSpec::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ConfigsCreatePostBodyNormalizer.php b/generated/Normalizer/ConfigsCreatePostBodyNormalizer.php new file mode 100644 index 00000000..7b195787 --- /dev/null +++ b/generated/Normalizer/ConfigsCreatePostBodyNormalizer.php @@ -0,0 +1,188 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ConfigsCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ConfigsCreatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ConfigsCreatePostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ConfigsCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Data', $data) && $data['Data'] !== null) { + $object->setData($data['Data']); + } + elseif (\array_key_exists('Data', $data) && $data['Data'] === null) { + $object->setData(null); + } + if (\array_key_exists('Templating', $data) && $data['Templating'] !== null) { + $object->setTemplating($this->denormalizer->denormalize($data['Templating'], \Docker\API\Model\Driver::class, 'json', $context)); + } + elseif (\array_key_exists('Templating', $data) && $data['Templating'] === null) { + $object->setTemplating(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('data') && null !== $object->getData()) { + $data['Data'] = $object->getData(); + } + if ($object->isInitialized('templating') && null !== $object->getTemplating()) { + $data['Templating'] = $this->normalizer->normalize($object->getTemplating(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ConfigsCreatePostBody::class => false]; + } + } +} else { + class ConfigsCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ConfigsCreatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ConfigsCreatePostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ConfigsCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Data', $data) && $data['Data'] !== null) { + $object->setData($data['Data']); + } + elseif (\array_key_exists('Data', $data) && $data['Data'] === null) { + $object->setData(null); + } + if (\array_key_exists('Templating', $data) && $data['Templating'] !== null) { + $object->setTemplating($this->denormalizer->denormalize($data['Templating'], \Docker\API\Model\Driver::class, 'json', $context)); + } + elseif (\array_key_exists('Templating', $data) && $data['Templating'] === null) { + $object->setTemplating(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('data') && null !== $object->getData()) { + $data['Data'] = $object->getData(); + } + if ($object->isInitialized('templating') && null !== $object->getTemplating()) { + $data['Templating'] = $this->normalizer->normalize($object->getTemplating(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ConfigsCreatePostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainerChangeNormalizer.php b/generated/Normalizer/ContainerChangeNormalizer.php deleted file mode 100644 index 2e2bc41a..00000000 --- a/generated/Normalizer/ContainerChangeNormalizer.php +++ /dev/null @@ -1,62 +0,0 @@ -setPath($data->{'Path'}); - } - if (property_exists($data, 'Kind')) { - $object->setKind($data->{'Kind'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); - } - if (null !== $object->getKind()) { - $data->{'Kind'} = $object->getKind(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerConfigNormalizer.php b/generated/Normalizer/ContainerConfigNormalizer.php index 731cdb43..7c2be583 100644 --- a/generated/Normalizer/ContainerConfigNormalizer.php +++ b/generated/Normalizer/ContainerConfigNormalizer.php @@ -2,306 +2,677 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class ContainerConfigNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\ContainerConfig') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\ContainerConfig) { - return true; - } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainerConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\ContainerConfig(); - if (property_exists($data, 'Hostname')) { - $object->setHostname($data->{'Hostname'}); - } - if (property_exists($data, 'Domainname')) { - $object->setDomainname($data->{'Domainname'}); - } - if (property_exists($data, 'User')) { - $object->setUser($data->{'User'}); - } - if (property_exists($data, 'AttachStdin')) { - $object->setAttachStdin($data->{'AttachStdin'}); - } - if (property_exists($data, 'AttachStdout')) { - $object->setAttachStdout($data->{'AttachStdout'}); - } - if (property_exists($data, 'AttachStderr')) { - $object->setAttachStderr($data->{'AttachStderr'}); - } - if (property_exists($data, 'Tty')) { - $object->setTty($data->{'Tty'}); - } - if (property_exists($data, 'OpenStdin')) { - $object->setOpenStdin($data->{'OpenStdin'}); - } - if (property_exists($data, 'StdinOnce')) { - $object->setStdinOnce($data->{'StdinOnce'}); - } - if (property_exists($data, 'Env')) { - $value = $data->{'Env'}; - if (is_array($data->{'Env'})) { - $values = []; - foreach ($data->{'Env'} as $value_1) { - $values[] = $value_1; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Hostname', $data) && $data['Hostname'] !== null) { + $object->setHostname($data['Hostname']); + } + elseif (\array_key_exists('Hostname', $data) && $data['Hostname'] === null) { + $object->setHostname(null); + } + if (\array_key_exists('Domainname', $data) && $data['Domainname'] !== null) { + $object->setDomainname($data['Domainname']); + } + elseif (\array_key_exists('Domainname', $data) && $data['Domainname'] === null) { + $object->setDomainname(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] !== null) { + $object->setAttachStdin($data['AttachStdin']); + } + elseif (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] === null) { + $object->setAttachStdin(null); + } + if (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] !== null) { + $object->setAttachStdout($data['AttachStdout']); + } + elseif (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] === null) { + $object->setAttachStdout(null); + } + if (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] !== null) { + $object->setAttachStderr($data['AttachStderr']); + } + elseif (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] === null) { + $object->setAttachStderr(null); + } + if (\array_key_exists('ExposedPorts', $data) && $data['ExposedPorts'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['ExposedPorts'] as $key => $value) { + $values[$key] = $value; } - $value = $values; + $object->setExposedPorts($values); } - if (is_null($data->{'Env'})) { - $value = $data->{'Env'}; + elseif (\array_key_exists('ExposedPorts', $data) && $data['ExposedPorts'] === null) { + $object->setExposedPorts(null); } - $object->setEnv($value); - } - if (property_exists($data, 'Cmd')) { - $value_2 = $data->{'Cmd'}; - if (is_array($data->{'Cmd'})) { + if (\array_key_exists('Tty', $data) && $data['Tty'] !== null) { + $object->setTty($data['Tty']); + } + elseif (\array_key_exists('Tty', $data) && $data['Tty'] === null) { + $object->setTty(null); + } + if (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] !== null) { + $object->setOpenStdin($data['OpenStdin']); + } + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); + } + if (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] !== null) { + $object->setStdinOnce($data['StdinOnce']); + } + elseif (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] === null) { + $object->setStdinOnce(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { $values_1 = []; - foreach ($data->{'Cmd'} as $value_3) { - $values_1[] = $value_3; + foreach ($data['Env'] as $value_1) { + $values_1[] = $value_1; } - $value_2 = $values_1; + $object->setEnv($values_1); } - if (is_string($data->{'Cmd'})) { - $value_2 = $data->{'Cmd'}; + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); } - $object->setCmd($value_2); - } - if (property_exists($data, 'Entrypoint')) { - $value_4 = $data->{'Entrypoint'}; - if (is_array($data->{'Entrypoint'})) { + if (\array_key_exists('Cmd', $data) && $data['Cmd'] !== null) { $values_2 = []; - foreach ($data->{'Entrypoint'} as $value_5) { - $values_2[] = $value_5; + foreach ($data['Cmd'] as $value_2) { + $values_2[] = $value_2; } - $value_4 = $values_2; + $object->setCmd($values_2); } - if (is_string($data->{'Entrypoint'})) { - $value_4 = $data->{'Entrypoint'}; + elseif (\array_key_exists('Cmd', $data) && $data['Cmd'] === null) { + $object->setCmd(null); } - $object->setEntrypoint($value_4); - } - if (property_exists($data, 'Image')) { - $object->setImage($data->{'Image'}); - } - if (property_exists($data, 'Labels')) { - $value_6 = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { + if (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] !== null) { + $object->setHealthcheck($this->denormalizer->denormalize($data['Healthcheck'], \Docker\API\Model\HealthConfig::class, 'json', $context)); + } + elseif (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] === null) { + $object->setHealthcheck(null); + } + if (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] !== null) { + $object->setArgsEscaped($data['ArgsEscaped']); + } + elseif (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] === null) { + $object->setArgsEscaped(null); + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); + } + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('Volumes', $data) && $data['Volumes'] !== null) { $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_7) { - $values_3[$key] = $value_7; + foreach ($data['Volumes'] as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; } - $value_6 = $values_3; + $object->setVolumes($values_3); } - if (is_null($data->{'Labels'})) { - $value_6 = $data->{'Labels'}; + elseif (\array_key_exists('Volumes', $data) && $data['Volumes'] === null) { + $object->setVolumes(null); } - $object->setLabels($value_6); - } - if (property_exists($data, 'Volumes')) { - $value_8 = $data->{'Volumes'}; - if (is_object($data->{'Volumes'})) { - $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Volumes'} as $key_1 => $value_9) { - $values_4[$key_1] = $value_9; + if (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] !== null) { + $object->setWorkingDir($data['WorkingDir']); + } + elseif (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] === null) { + $object->setWorkingDir(null); + } + if (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] !== null) { + $values_4 = []; + foreach ($data['Entrypoint'] as $value_4) { + $values_4[] = $value_4; } - $value_8 = $values_4; + $object->setEntrypoint($values_4); } - if (is_null($data->{'Volumes'})) { - $value_8 = $data->{'Volumes'}; + elseif (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] === null) { + $object->setEntrypoint(null); } - $object->setVolumes($value_8); - } - if (property_exists($data, 'WorkingDir')) { - $object->setWorkingDir($data->{'WorkingDir'}); - } - if (property_exists($data, 'NetworkDisabled')) { - $object->setNetworkDisabled($data->{'NetworkDisabled'}); - } - if (property_exists($data, 'MacAddress')) { - $object->setMacAddress($data->{'MacAddress'}); - } - if (property_exists($data, 'ExposedPorts')) { - $value_10 = $data->{'ExposedPorts'}; - if (is_object($data->{'ExposedPorts'})) { - $values_5 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'ExposedPorts'} as $key_2 => $value_11) { - $values_5[$key_2] = $value_11; + if (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] !== null) { + $object->setNetworkDisabled($data['NetworkDisabled']); + } + elseif (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] === null) { + $object->setNetworkDisabled(null); + } + if (\array_key_exists('MacAddress', $data) && $data['MacAddress'] !== null) { + $object->setMacAddress($data['MacAddress']); + } + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); + } + if (\array_key_exists('OnBuild', $data) && $data['OnBuild'] !== null) { + $values_5 = []; + foreach ($data['OnBuild'] as $value_5) { + $values_5[] = $value_5; } - $value_10 = $values_5; + $object->setOnBuild($values_5); } - if (is_null($data->{'ExposedPorts'})) { - $value_10 = $data->{'ExposedPorts'}; + elseif (\array_key_exists('OnBuild', $data) && $data['OnBuild'] === null) { + $object->setOnBuild(null); } - $object->setExposedPorts($value_10); - } - if (property_exists($data, 'StopSignal')) { - $object->setStopSignal($data->{'StopSignal'}); + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; + } + $object->setLabels($values_6); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('StopSignal', $data) && $data['StopSignal'] !== null) { + $object->setStopSignal($data['StopSignal']); + } + elseif (\array_key_exists('StopSignal', $data) && $data['StopSignal'] === null) { + $object->setStopSignal(null); + } + if (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] !== null) { + $object->setStopTimeout($data['StopTimeout']); + } + elseif (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] === null) { + $object->setStopTimeout(null); + } + if (\array_key_exists('Shell', $data) && $data['Shell'] !== null) { + $values_7 = []; + foreach ($data['Shell'] as $value_7) { + $values_7[] = $value_7; + } + $object->setShell($values_7); + } + elseif (\array_key_exists('Shell', $data) && $data['Shell'] === null) { + $object->setShell(null); + } + return $object; } - if (property_exists($data, 'HostConfig')) { - $object->setHostConfig($this->serializer->denormalize($data->{'HostConfig'}, 'Docker\\API\\Model\\HostConfig', 'raw', $context)); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); + } + if ($object->isInitialized('domainname') && null !== $object->getDomainname()) { + $data['Domainname'] = $object->getDomainname(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); + } + if ($object->isInitialized('attachStdin') && null !== $object->getAttachStdin()) { + $data['AttachStdin'] = $object->getAttachStdin(); + } + if ($object->isInitialized('attachStdout') && null !== $object->getAttachStdout()) { + $data['AttachStdout'] = $object->getAttachStdout(); + } + if ($object->isInitialized('attachStderr') && null !== $object->getAttachStderr()) { + $data['AttachStderr'] = $object->getAttachStderr(); + } + if ($object->isInitialized('exposedPorts') && null !== $object->getExposedPorts()) { + $values = []; + foreach ($object->getExposedPorts() as $key => $value) { + $values[$key] = $value; + } + $data['ExposedPorts'] = $values; + } + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); + } + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); + } + if ($object->isInitialized('stdinOnce') && null !== $object->getStdinOnce()) { + $data['StdinOnce'] = $object->getStdinOnce(); + } + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_1 = []; + foreach ($object->getEnv() as $value_1) { + $values_1[] = $value_1; + } + $data['Env'] = $values_1; + } + if ($object->isInitialized('cmd') && null !== $object->getCmd()) { + $values_2 = []; + foreach ($object->getCmd() as $value_2) { + $values_2[] = $value_2; + } + $data['Cmd'] = $values_2; + } + if ($object->isInitialized('healthcheck') && null !== $object->getHealthcheck()) { + $data['Healthcheck'] = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context); + } + if ($object->isInitialized('argsEscaped') && null !== $object->getArgsEscaped()) { + $data['ArgsEscaped'] = $object->getArgsEscaped(); + } + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); + } + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values_3 = []; + foreach ($object->getVolumes() as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $data['Volumes'] = $values_3; + } + if ($object->isInitialized('workingDir') && null !== $object->getWorkingDir()) { + $data['WorkingDir'] = $object->getWorkingDir(); + } + if ($object->isInitialized('entrypoint') && null !== $object->getEntrypoint()) { + $values_4 = []; + foreach ($object->getEntrypoint() as $value_4) { + $values_4[] = $value_4; + } + $data['Entrypoint'] = $values_4; + } + if ($object->isInitialized('networkDisabled') && null !== $object->getNetworkDisabled()) { + $data['NetworkDisabled'] = $object->getNetworkDisabled(); + } + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); + } + if ($object->isInitialized('onBuild') && null !== $object->getOnBuild()) { + $values_5 = []; + foreach ($object->getOnBuild() as $value_5) { + $values_5[] = $value_5; + } + $data['OnBuild'] = $values_5; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_6 = []; + foreach ($object->getLabels() as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; + } + $data['Labels'] = $values_6; + } + if ($object->isInitialized('stopSignal') && null !== $object->getStopSignal()) { + $data['StopSignal'] = $object->getStopSignal(); + } + if ($object->isInitialized('stopTimeout') && null !== $object->getStopTimeout()) { + $data['StopTimeout'] = $object->getStopTimeout(); + } + if ($object->isInitialized('shell') && null !== $object->getShell()) { + $values_7 = []; + foreach ($object->getShell() as $value_7) { + $values_7[] = $value_7; + } + $data['Shell'] = $values_7; + } + return $data; } - if (property_exists($data, 'NetworkingConfig')) { - $object->setNetworkingConfig($this->serializer->denormalize($data->{'NetworkingConfig'}, 'Docker\\API\\Model\\NetworkingConfig', 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerConfig::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class ContainerConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getHostname()) { - $data->{'Hostname'} = $object->getHostname(); - } - if (null !== $object->getDomainname()) { - $data->{'Domainname'} = $object->getDomainname(); - } - if (null !== $object->getUser()) { - $data->{'User'} = $object->getUser(); - } - if (null !== $object->getAttachStdin()) { - $data->{'AttachStdin'} = $object->getAttachStdin(); - } - if (null !== $object->getAttachStdout()) { - $data->{'AttachStdout'} = $object->getAttachStdout(); - } - if (null !== $object->getAttachStderr()) { - $data->{'AttachStderr'} = $object->getAttachStderr(); - } - if (null !== $object->getTty()) { - $data->{'Tty'} = $object->getTty(); - } - if (null !== $object->getOpenStdin()) { - $data->{'OpenStdin'} = $object->getOpenStdin(); - } - if (null !== $object->getStdinOnce()) { - $data->{'StdinOnce'} = $object->getStdinOnce(); - } - $value = $object->getEnv(); - if (is_array($object->getEnv())) { - $values = []; - foreach ($object->getEnv() as $value_1) { - $values[] = $value_1; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $value = $values; - } - if (is_null($object->getEnv())) { - $value = $object->getEnv(); - } - $data->{'Env'} = $value; - if (null !== $object->getCmd()) { - $value_2 = $object->getCmd(); - if (is_array($object->getCmd())) { + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Hostname', $data) && $data['Hostname'] !== null) { + $object->setHostname($data['Hostname']); + } + elseif (\array_key_exists('Hostname', $data) && $data['Hostname'] === null) { + $object->setHostname(null); + } + if (\array_key_exists('Domainname', $data) && $data['Domainname'] !== null) { + $object->setDomainname($data['Domainname']); + } + elseif (\array_key_exists('Domainname', $data) && $data['Domainname'] === null) { + $object->setDomainname(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] !== null) { + $object->setAttachStdin($data['AttachStdin']); + } + elseif (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] === null) { + $object->setAttachStdin(null); + } + if (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] !== null) { + $object->setAttachStdout($data['AttachStdout']); + } + elseif (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] === null) { + $object->setAttachStdout(null); + } + if (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] !== null) { + $object->setAttachStderr($data['AttachStderr']); + } + elseif (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] === null) { + $object->setAttachStderr(null); + } + if (\array_key_exists('ExposedPorts', $data) && $data['ExposedPorts'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['ExposedPorts'] as $key => $value) { + $values[$key] = $value; + } + $object->setExposedPorts($values); + } + elseif (\array_key_exists('ExposedPorts', $data) && $data['ExposedPorts'] === null) { + $object->setExposedPorts(null); + } + if (\array_key_exists('Tty', $data) && $data['Tty'] !== null) { + $object->setTty($data['Tty']); + } + elseif (\array_key_exists('Tty', $data) && $data['Tty'] === null) { + $object->setTty(null); + } + if (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] !== null) { + $object->setOpenStdin($data['OpenStdin']); + } + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); + } + if (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] !== null) { + $object->setStdinOnce($data['StdinOnce']); + } + elseif (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] === null) { + $object->setStdinOnce(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { $values_1 = []; - foreach ($object->getCmd() as $value_3) { - $values_1[] = $value_3; + foreach ($data['Env'] as $value_1) { + $values_1[] = $value_1; } - $value_2 = $values_1; + $object->setEnv($values_1); } - if (is_string($object->getCmd())) { - $value_2 = $object->getCmd(); + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); } - $data->{'Cmd'} = $value_2; - } - if (null !== $object->getEntrypoint()) { - $value_4 = $object->getEntrypoint(); - if (is_array($object->getEntrypoint())) { + if (\array_key_exists('Cmd', $data) && $data['Cmd'] !== null) { $values_2 = []; - foreach ($object->getEntrypoint() as $value_5) { - $values_2[] = $value_5; + foreach ($data['Cmd'] as $value_2) { + $values_2[] = $value_2; } - $value_4 = $values_2; + $object->setCmd($values_2); } - if (is_string($object->getEntrypoint())) { - $value_4 = $object->getEntrypoint(); + elseif (\array_key_exists('Cmd', $data) && $data['Cmd'] === null) { + $object->setCmd(null); } - $data->{'Entrypoint'} = $value_4; - } - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); - } - $value_6 = $object->getLabels(); - if (is_object($object->getLabels())) { - $values_3 = new \stdClass(); - foreach ($object->getLabels() as $key => $value_7) { - $values_3->{$key} = $value_7; + if (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] !== null) { + $object->setHealthcheck($this->denormalizer->denormalize($data['Healthcheck'], \Docker\API\Model\HealthConfig::class, 'json', $context)); } - $value_6 = $values_3; - } - if (is_null($object->getLabels())) { - $value_6 = $object->getLabels(); - } - $data->{'Labels'} = $value_6; - $value_8 = $object->getVolumes(); - if (is_object($object->getVolumes())) { - $values_4 = new \stdClass(); - foreach ($object->getVolumes() as $key_1 => $value_9) { - $values_4->{$key_1} = $value_9; - } - $value_8 = $values_4; - } - if (is_null($object->getVolumes())) { - $value_8 = $object->getVolumes(); - } - $data->{'Volumes'} = $value_8; - if (null !== $object->getWorkingDir()) { - $data->{'WorkingDir'} = $object->getWorkingDir(); - } - if (null !== $object->getNetworkDisabled()) { - $data->{'NetworkDisabled'} = $object->getNetworkDisabled(); - } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); - } - $value_10 = $object->getExposedPorts(); - if (is_object($object->getExposedPorts())) { - $values_5 = new \stdClass(); - foreach ($object->getExposedPorts() as $key_2 => $value_11) { - $values_5->{$key_2} = $value_11; + elseif (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] === null) { + $object->setHealthcheck(null); } - $value_10 = $values_5; - } - if (is_null($object->getExposedPorts())) { - $value_10 = $object->getExposedPorts(); - } - $data->{'ExposedPorts'} = $value_10; - if (null !== $object->getStopSignal()) { - $data->{'StopSignal'} = $object->getStopSignal(); - } - if (null !== $object->getHostConfig()) { - $data->{'HostConfig'} = json_decode($this->serializer->normalize($object->getHostConfig(), 'raw', $context)); + if (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] !== null) { + $object->setArgsEscaped($data['ArgsEscaped']); + } + elseif (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] === null) { + $object->setArgsEscaped(null); + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); + } + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('Volumes', $data) && $data['Volumes'] !== null) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Volumes'] as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $object->setVolumes($values_3); + } + elseif (\array_key_exists('Volumes', $data) && $data['Volumes'] === null) { + $object->setVolumes(null); + } + if (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] !== null) { + $object->setWorkingDir($data['WorkingDir']); + } + elseif (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] === null) { + $object->setWorkingDir(null); + } + if (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] !== null) { + $values_4 = []; + foreach ($data['Entrypoint'] as $value_4) { + $values_4[] = $value_4; + } + $object->setEntrypoint($values_4); + } + elseif (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] === null) { + $object->setEntrypoint(null); + } + if (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] !== null) { + $object->setNetworkDisabled($data['NetworkDisabled']); + } + elseif (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] === null) { + $object->setNetworkDisabled(null); + } + if (\array_key_exists('MacAddress', $data) && $data['MacAddress'] !== null) { + $object->setMacAddress($data['MacAddress']); + } + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); + } + if (\array_key_exists('OnBuild', $data) && $data['OnBuild'] !== null) { + $values_5 = []; + foreach ($data['OnBuild'] as $value_5) { + $values_5[] = $value_5; + } + $object->setOnBuild($values_5); + } + elseif (\array_key_exists('OnBuild', $data) && $data['OnBuild'] === null) { + $object->setOnBuild(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; + } + $object->setLabels($values_6); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('StopSignal', $data) && $data['StopSignal'] !== null) { + $object->setStopSignal($data['StopSignal']); + } + elseif (\array_key_exists('StopSignal', $data) && $data['StopSignal'] === null) { + $object->setStopSignal(null); + } + if (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] !== null) { + $object->setStopTimeout($data['StopTimeout']); + } + elseif (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] === null) { + $object->setStopTimeout(null); + } + if (\array_key_exists('Shell', $data) && $data['Shell'] !== null) { + $values_7 = []; + foreach ($data['Shell'] as $value_7) { + $values_7[] = $value_7; + } + $object->setShell($values_7); + } + elseif (\array_key_exists('Shell', $data) && $data['Shell'] === null) { + $object->setShell(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); + } + if ($object->isInitialized('domainname') && null !== $object->getDomainname()) { + $data['Domainname'] = $object->getDomainname(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); + } + if ($object->isInitialized('attachStdin') && null !== $object->getAttachStdin()) { + $data['AttachStdin'] = $object->getAttachStdin(); + } + if ($object->isInitialized('attachStdout') && null !== $object->getAttachStdout()) { + $data['AttachStdout'] = $object->getAttachStdout(); + } + if ($object->isInitialized('attachStderr') && null !== $object->getAttachStderr()) { + $data['AttachStderr'] = $object->getAttachStderr(); + } + if ($object->isInitialized('exposedPorts') && null !== $object->getExposedPorts()) { + $values = []; + foreach ($object->getExposedPorts() as $key => $value) { + $values[$key] = $value; + } + $data['ExposedPorts'] = $values; + } + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); + } + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); + } + if ($object->isInitialized('stdinOnce') && null !== $object->getStdinOnce()) { + $data['StdinOnce'] = $object->getStdinOnce(); + } + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_1 = []; + foreach ($object->getEnv() as $value_1) { + $values_1[] = $value_1; + } + $data['Env'] = $values_1; + } + if ($object->isInitialized('cmd') && null !== $object->getCmd()) { + $values_2 = []; + foreach ($object->getCmd() as $value_2) { + $values_2[] = $value_2; + } + $data['Cmd'] = $values_2; + } + if ($object->isInitialized('healthcheck') && null !== $object->getHealthcheck()) { + $data['Healthcheck'] = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context); + } + if ($object->isInitialized('argsEscaped') && null !== $object->getArgsEscaped()) { + $data['ArgsEscaped'] = $object->getArgsEscaped(); + } + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); + } + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values_3 = []; + foreach ($object->getVolumes() as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $data['Volumes'] = $values_3; + } + if ($object->isInitialized('workingDir') && null !== $object->getWorkingDir()) { + $data['WorkingDir'] = $object->getWorkingDir(); + } + if ($object->isInitialized('entrypoint') && null !== $object->getEntrypoint()) { + $values_4 = []; + foreach ($object->getEntrypoint() as $value_4) { + $values_4[] = $value_4; + } + $data['Entrypoint'] = $values_4; + } + if ($object->isInitialized('networkDisabled') && null !== $object->getNetworkDisabled()) { + $data['NetworkDisabled'] = $object->getNetworkDisabled(); + } + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); + } + if ($object->isInitialized('onBuild') && null !== $object->getOnBuild()) { + $values_5 = []; + foreach ($object->getOnBuild() as $value_5) { + $values_5[] = $value_5; + } + $data['OnBuild'] = $values_5; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_6 = []; + foreach ($object->getLabels() as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; + } + $data['Labels'] = $values_6; + } + if ($object->isInitialized('stopSignal') && null !== $object->getStopSignal()) { + $data['StopSignal'] = $object->getStopSignal(); + } + if ($object->isInitialized('stopTimeout') && null !== $object->getStopTimeout()) { + $data['StopTimeout'] = $object->getStopTimeout(); + } + if ($object->isInitialized('shell') && null !== $object->getShell()) { + $values_7 = []; + foreach ($object->getShell() as $value_7) { + $values_7[] = $value_7; + } + $data['Shell'] = $values_7; + } + return $data; } - if (null !== $object->getNetworkingConfig()) { - $data->{'NetworkingConfig'} = json_decode($this->serializer->normalize($object->getNetworkingConfig(), 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerConfig::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/ContainerConnectNormalizer.php b/generated/Normalizer/ContainerConnectNormalizer.php deleted file mode 100644 index 6a240f2c..00000000 --- a/generated/Normalizer/ContainerConnectNormalizer.php +++ /dev/null @@ -1,71 +0,0 @@ -setContainer($data->{'Container'}); - } - if (property_exists($data, 'EndpointConfig')) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'EndpointConfig'} as $key => $value) { - $values[$key] = $this->serializer->denormalize($value, 'Docker\\API\\Model\\EndpointConfig', 'raw', $context); - } - $object->setEndpointConfig($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getContainer()) { - $data->{'Container'} = $object->getContainer(); - } - if (null !== $object->getEndpointConfig()) { - $values = new \stdClass(); - foreach ($object->getEndpointConfig() as $key => $value) { - $values->{$key} = $value; - } - $data->{'EndpointConfig'} = $values; - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerCreateResponseNormalizer.php b/generated/Normalizer/ContainerCreateResponseNormalizer.php new file mode 100644 index 00000000..a1e9c1bd --- /dev/null +++ b/generated/Normalizer/ContainerCreateResponseNormalizer.php @@ -0,0 +1,144 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainerCreateResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerCreateResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerCreateResponse::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerCreateResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values = []; + foreach ($data['Warnings'] as $value) { + $values[] = $value; + } + $object->setWarnings($values); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Id'] = $object->getId(); + $values = []; + foreach ($object->getWarnings() as $value) { + $values[] = $value; + } + $data['Warnings'] = $values; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerCreateResponse::class => false]; + } + } +} else { + class ContainerCreateResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerCreateResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerCreateResponse::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerCreateResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values = []; + foreach ($data['Warnings'] as $value) { + $values[] = $value; + } + $object->setWarnings($values); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Id'] = $object->getId(); + $values = []; + foreach ($object->getWarnings() as $value) { + $values[] = $value; + } + $data['Warnings'] = $values; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerCreateResponse::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainerCreateResultNormalizer.php b/generated/Normalizer/ContainerCreateResultNormalizer.php deleted file mode 100644 index d5eb6da4..00000000 --- a/generated/Normalizer/ContainerCreateResultNormalizer.php +++ /dev/null @@ -1,83 +0,0 @@ -setId($data->{'Id'}); - } - if (property_exists($data, 'Warnings')) { - $value = $data->{'Warnings'}; - if (is_array($data->{'Warnings'})) { - $values = []; - foreach ($data->{'Warnings'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Warnings'})) { - $value = $data->{'Warnings'}; - } - $object->setWarnings($value); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - $value = $object->getWarnings(); - if (is_array($object->getWarnings())) { - $values = []; - foreach ($object->getWarnings() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getWarnings())) { - $value = $object->getWarnings(); - } - $data->{'Warnings'} = $value; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerDisconnectNormalizer.php b/generated/Normalizer/ContainerDisconnectNormalizer.php deleted file mode 100644 index 787704d7..00000000 --- a/generated/Normalizer/ContainerDisconnectNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setContainer($data->{'Container'}); - } - if (property_exists($data, 'Force')) { - $object->setForce($data->{'Force'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getContainer()) { - $data->{'Container'} = $object->getContainer(); - } - if (null !== $object->getForce()) { - $data->{'Force'} = $object->getForce(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerInfoNormalizer.php b/generated/Normalizer/ContainerInfoNormalizer.php deleted file mode 100644 index d38d0784..00000000 --- a/generated/Normalizer/ContainerInfoNormalizer.php +++ /dev/null @@ -1,227 +0,0 @@ -setId($data->{'Id'}); - } - if (property_exists($data, 'Names')) { - $value = $data->{'Names'}; - if (is_array($data->{'Names'})) { - $values = []; - foreach ($data->{'Names'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Names'})) { - $value = $data->{'Names'}; - } - $object->setNames($value); - } - if (property_exists($data, 'Image')) { - $object->setImage($data->{'Image'}); - } - if (property_exists($data, 'ImageID')) { - $object->setImageID($data->{'ImageID'}); - } - if (property_exists($data, 'Command')) { - $object->setCommand($data->{'Command'}); - } - if (property_exists($data, 'Created')) { - $object->setCreated($data->{'Created'}); - } - if (property_exists($data, 'State')) { - $object->setState($data->{'State'}); - } - if (property_exists($data, 'Status')) { - $object->setStatus($data->{'Status'}); - } - if (property_exists($data, 'Ports')) { - $value_2 = $data->{'Ports'}; - if (is_array($data->{'Ports'})) { - $values_1 = []; - foreach ($data->{'Ports'} as $value_3) { - $values_1[] = $this->serializer->denormalize($value_3, 'Docker\\API\\Model\\Port', 'raw', $context); - } - $value_2 = $values_1; - } - if (is_null($data->{'Ports'})) { - $value_2 = $data->{'Ports'}; - } - $object->setPorts($value_2); - } - if (property_exists($data, 'Labels')) { - $value_4 = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { - $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_5) { - $values_2[$key] = $value_5; - } - $value_4 = $values_2; - } - if (is_null($data->{'Labels'})) { - $value_4 = $data->{'Labels'}; - } - $object->setLabels($value_4); - } - if (property_exists($data, 'SizeRw')) { - $object->setSizeRw($data->{'SizeRw'}); - } - if (property_exists($data, 'SizeRootFs')) { - $object->setSizeRootFs($data->{'SizeRootFs'}); - } - if (property_exists($data, 'HostConfig')) { - $object->setHostConfig($this->serializer->denormalize($data->{'HostConfig'}, 'Docker\\API\\Model\\HostConfig', 'raw', $context)); - } - if (property_exists($data, 'NetworkSettings')) { - $object->setNetworkSettings($this->serializer->denormalize($data->{'NetworkSettings'}, 'Docker\\API\\Model\\NetworkConfig', 'raw', $context)); - } - if (property_exists($data, 'Mounts')) { - $value_6 = $data->{'Mounts'}; - if (is_array($data->{'Mounts'})) { - $values_3 = []; - foreach ($data->{'Mounts'} as $value_7) { - $values_3[] = $this->serializer->denormalize($value_7, 'Docker\\API\\Model\\Mount', 'raw', $context); - } - $value_6 = $values_3; - } - if (is_null($data->{'Mounts'})) { - $value_6 = $data->{'Mounts'}; - } - $object->setMounts($value_6); - } - if (property_exists($data, 'Node')) { - $object->setNode($this->serializer->denormalize($data->{'Node'}, 'Docker\\API\\Model\\ContainerNode', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - $value = $object->getNames(); - if (is_array($object->getNames())) { - $values = []; - foreach ($object->getNames() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getNames())) { - $value = $object->getNames(); - } - $data->{'Names'} = $value; - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); - } - if (null !== $object->getImageID()) { - $data->{'ImageID'} = $object->getImageID(); - } - if (null !== $object->getCommand()) { - $data->{'Command'} = $object->getCommand(); - } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); - } - if (null !== $object->getState()) { - $data->{'State'} = $object->getState(); - } - if (null !== $object->getStatus()) { - $data->{'Status'} = $object->getStatus(); - } - $value_2 = $object->getPorts(); - if (is_array($object->getPorts())) { - $values_1 = []; - foreach ($object->getPorts() as $value_3) { - $values_1[] = $value_3; - } - $value_2 = $values_1; - } - if (is_null($object->getPorts())) { - $value_2 = $object->getPorts(); - } - $data->{'Ports'} = $value_2; - $value_4 = $object->getLabels(); - if (is_object($object->getLabels())) { - $values_2 = new \stdClass(); - foreach ($object->getLabels() as $key => $value_5) { - $values_2->{$key} = $value_5; - } - $value_4 = $values_2; - } - if (is_null($object->getLabels())) { - $value_4 = $object->getLabels(); - } - $data->{'Labels'} = $value_4; - if (null !== $object->getSizeRw()) { - $data->{'SizeRw'} = $object->getSizeRw(); - } - if (null !== $object->getSizeRootFs()) { - $data->{'SizeRootFs'} = $object->getSizeRootFs(); - } - if (null !== $object->getHostConfig()) { - $data->{'HostConfig'} = json_decode($this->serializer->normalize($object->getHostConfig(), 'raw', $context)); - } - if (null !== $object->getNetworkSettings()) { - $data->{'NetworkSettings'} = json_decode($this->serializer->normalize($object->getNetworkSettings(), 'raw', $context)); - } - $value_6 = $object->getMounts(); - if (is_array($object->getMounts())) { - $values_3 = []; - foreach ($object->getMounts() as $value_7) { - $values_3[] = $value_7; - } - $value_6 = $values_3; - } - if (is_null($object->getMounts())) { - $value_6 = $object->getMounts(); - } - $data->{'Mounts'} = $value_6; - if (null !== $object->getNode()) { - $data->{'Node'} = json_decode($this->serializer->normalize($object->getNode(), 'raw', $context)); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerNetworkNormalizer.php b/generated/Normalizer/ContainerNetworkNormalizer.php deleted file mode 100644 index cd6c225a..00000000 --- a/generated/Normalizer/ContainerNetworkNormalizer.php +++ /dev/null @@ -1,104 +0,0 @@ -setNetworkID($data->{'NetworkID'}); - } - if (property_exists($data, 'EndpointID')) { - $object->setEndpointID($data->{'EndpointID'}); - } - if (property_exists($data, 'Gateway')) { - $object->setGateway($data->{'Gateway'}); - } - if (property_exists($data, 'IPAddress')) { - $object->setIPAddress($data->{'IPAddress'}); - } - if (property_exists($data, 'IPPrefixLen')) { - $object->setIPPrefixLen($data->{'IPPrefixLen'}); - } - if (property_exists($data, 'IPv6Gateway')) { - $object->setIPv6Gateway($data->{'IPv6Gateway'}); - } - if (property_exists($data, 'GlobalIPv6Address')) { - $object->setGlobalIPv6Address($data->{'GlobalIPv6Address'}); - } - if (property_exists($data, 'GlobalIPv6PrefixLen')) { - $object->setGlobalIPv6PrefixLen($data->{'GlobalIPv6PrefixLen'}); - } - if (property_exists($data, 'MacAddress')) { - $object->setMacAddress($data->{'MacAddress'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getNetworkID()) { - $data->{'NetworkID'} = $object->getNetworkID(); - } - if (null !== $object->getEndpointID()) { - $data->{'EndpointID'} = $object->getEndpointID(); - } - if (null !== $object->getGateway()) { - $data->{'Gateway'} = $object->getGateway(); - } - if (null !== $object->getIPAddress()) { - $data->{'IPAddress'} = $object->getIPAddress(); - } - if (null !== $object->getIPPrefixLen()) { - $data->{'IPPrefixLen'} = $object->getIPPrefixLen(); - } - if (null !== $object->getIPv6Gateway()) { - $data->{'IPv6Gateway'} = $object->getIPv6Gateway(); - } - if (null !== $object->getGlobalIPv6Address()) { - $data->{'GlobalIPv6Address'} = $object->getGlobalIPv6Address(); - } - if (null !== $object->getGlobalIPv6PrefixLen()) { - $data->{'GlobalIPv6PrefixLen'} = $object->getGlobalIPv6PrefixLen(); - } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerNodeNormalizer.php b/generated/Normalizer/ContainerNodeNormalizer.php deleted file mode 100644 index fec19f83..00000000 --- a/generated/Normalizer/ContainerNodeNormalizer.php +++ /dev/null @@ -1,75 +0,0 @@ -setId($data->{'Id'}); - } - if (property_exists($data, 'Ip')) { - $object->setIp($data->{'Ip'}); - } - if (property_exists($data, 'Addr')) { - $object->setAddr($data->{'Addr'}); - } - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getIp()) { - $data->{'Ip'} = $object->getIp(); - } - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); - } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerNormalizer.php b/generated/Normalizer/ContainerNormalizer.php deleted file mode 100644 index 7c42edd7..00000000 --- a/generated/Normalizer/ContainerNormalizer.php +++ /dev/null @@ -1,223 +0,0 @@ -setAppArmorProfile($data->{'AppArmorProfile'}); - } - if (property_exists($data, 'Args')) { - $value = $data->{'Args'}; - if (is_array($data->{'Args'})) { - $values = []; - foreach ($data->{'Args'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Args'})) { - $value = $data->{'Args'}; - } - $object->setArgs($value); - } - if (property_exists($data, 'Config')) { - $object->setConfig($this->serializer->denormalize($data->{'Config'}, 'Docker\\API\\Model\\ContainerConfig', 'raw', $context)); - } - if (property_exists($data, 'Created')) { - $object->setCreated($data->{'Created'}); - } - if (property_exists($data, 'Driver')) { - $object->setDriver($data->{'Driver'}); - } - if (property_exists($data, 'ExecDriver')) { - $object->setExecDriver($data->{'ExecDriver'}); - } - if (property_exists($data, 'ExecIDs')) { - $object->setExecIDs($data->{'ExecIDs'}); - } - if (property_exists($data, 'HostConfig')) { - $object->setHostConfig($this->serializer->denormalize($data->{'HostConfig'}, 'Docker\\API\\Model\\HostConfig', 'raw', $context)); - } - if (property_exists($data, 'HostnamePath')) { - $object->setHostnamePath($data->{'HostnamePath'}); - } - if (property_exists($data, 'HostsPath')) { - $object->setHostsPath($data->{'HostsPath'}); - } - if (property_exists($data, 'LogPath')) { - $object->setLogPath($data->{'LogPath'}); - } - if (property_exists($data, 'Id')) { - $object->setId($data->{'Id'}); - } - if (property_exists($data, 'Image')) { - $object->setImage($data->{'Image'}); - } - if (property_exists($data, 'MountLabel')) { - $object->setMountLabel($data->{'MountLabel'}); - } - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'NetworkSettings')) { - $object->setNetworkSettings($this->serializer->denormalize($data->{'NetworkSettings'}, 'Docker\\API\\Model\\NetworkConfig', 'raw', $context)); - } - if (property_exists($data, 'Path')) { - $object->setPath($data->{'Path'}); - } - if (property_exists($data, 'ProcessLabel')) { - $object->setProcessLabel($data->{'ProcessLabel'}); - } - if (property_exists($data, 'ResolvConfPath')) { - $object->setResolvConfPath($data->{'ResolvConfPath'}); - } - if (property_exists($data, 'RestartCount')) { - $object->setRestartCount($data->{'RestartCount'}); - } - if (property_exists($data, 'State')) { - $object->setState($this->serializer->denormalize($data->{'State'}, 'Docker\\API\\Model\\ContainerState', 'raw', $context)); - } - if (property_exists($data, 'Mounts')) { - $value_2 = $data->{'Mounts'}; - if (is_array($data->{'Mounts'})) { - $values_1 = []; - foreach ($data->{'Mounts'} as $value_3) { - $values_1[] = $this->serializer->denormalize($value_3, 'Docker\\API\\Model\\Mount', 'raw', $context); - } - $value_2 = $values_1; - } - if (is_null($data->{'Mounts'})) { - $value_2 = $data->{'Mounts'}; - } - $object->setMounts($value_2); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getAppArmorProfile()) { - $data->{'AppArmorProfile'} = $object->getAppArmorProfile(); - } - $value = $object->getArgs(); - if (is_array($object->getArgs())) { - $values = []; - foreach ($object->getArgs() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getArgs())) { - $value = $object->getArgs(); - } - $data->{'Args'} = $value; - if (null !== $object->getConfig()) { - $data->{'Config'} = json_decode($this->serializer->normalize($object->getConfig(), 'raw', $context)); - } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); - } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); - } - if (null !== $object->getExecDriver()) { - $data->{'ExecDriver'} = $object->getExecDriver(); - } - if (null !== $object->getExecIDs()) { - $data->{'ExecIDs'} = $object->getExecIDs(); - } - if (null !== $object->getHostConfig()) { - $data->{'HostConfig'} = json_decode($this->serializer->normalize($object->getHostConfig(), 'raw', $context)); - } - if (null !== $object->getHostnamePath()) { - $data->{'HostnamePath'} = $object->getHostnamePath(); - } - if (null !== $object->getHostsPath()) { - $data->{'HostsPath'} = $object->getHostsPath(); - } - if (null !== $object->getLogPath()) { - $data->{'LogPath'} = $object->getLogPath(); - } - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); - } - if (null !== $object->getMountLabel()) { - $data->{'MountLabel'} = $object->getMountLabel(); - } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getNetworkSettings()) { - $data->{'NetworkSettings'} = json_decode($this->serializer->normalize($object->getNetworkSettings(), 'raw', $context)); - } - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); - } - if (null !== $object->getProcessLabel()) { - $data->{'ProcessLabel'} = $object->getProcessLabel(); - } - if (null !== $object->getResolvConfPath()) { - $data->{'ResolvConfPath'} = $object->getResolvConfPath(); - } - if (null !== $object->getRestartCount()) { - $data->{'RestartCount'} = $object->getRestartCount(); - } - if (null !== $object->getState()) { - $data->{'State'} = json_decode($this->serializer->normalize($object->getState(), 'raw', $context)); - } - $value_2 = $object->getMounts(); - if (is_array($object->getMounts())) { - $values_1 = []; - foreach ($object->getMounts() as $value_3) { - $values_1[] = $value_3; - } - $value_2 = $values_1; - } - if (is_null($object->getMounts())) { - $value_2 = $object->getMounts(); - } - $data->{'Mounts'} = $value_2; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerSpecMountBindOptionsNormalizer.php b/generated/Normalizer/ContainerSpecMountBindOptionsNormalizer.php deleted file mode 100644 index 5d3673aa..00000000 --- a/generated/Normalizer/ContainerSpecMountBindOptionsNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -setPropagation($data->{'Propagation'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getPropagation()) { - $data->{'Propagation'} = $object->getPropagation(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerSpecMountNormalizer.php b/generated/Normalizer/ContainerSpecMountNormalizer.php deleted file mode 100644 index 98184725..00000000 --- a/generated/Normalizer/ContainerSpecMountNormalizer.php +++ /dev/null @@ -1,87 +0,0 @@ -setType($data->{'Type'}); - } - if (property_exists($data, 'Source')) { - $object->setSource($data->{'Source'}); - } - if (property_exists($data, 'Target')) { - $object->setTarget($data->{'Target'}); - } - if (property_exists($data, 'ReadOnly')) { - $object->setReadOnly($data->{'ReadOnly'}); - } - if (property_exists($data, 'BindOptions')) { - $object->setBindOptions($this->serializer->denormalize($data->{'BindOptions'}, 'Docker\\API\\Model\\ContainerSpecMountBindOptions', 'raw', $context)); - } - if (property_exists($data, 'VolumeOptions')) { - $object->setVolumeOptions($this->serializer->denormalize($data->{'VolumeOptions'}, 'Docker\\API\\Model\\ContainerSpecMountVolumeOptions', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); - } - if (null !== $object->getSource()) { - $data->{'Source'} = $object->getSource(); - } - if (null !== $object->getTarget()) { - $data->{'Target'} = $object->getTarget(); - } - if (null !== $object->getReadOnly()) { - $data->{'ReadOnly'} = $object->getReadOnly(); - } - if (null !== $object->getBindOptions()) { - $data->{'BindOptions'} = json_decode($this->serializer->normalize($object->getBindOptions(), 'raw', $context)); - } - if (null !== $object->getVolumeOptions()) { - $data->{'VolumeOptions'} = json_decode($this->serializer->normalize($object->getVolumeOptions(), 'raw', $context)); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerSpecMountVolumeOptionsNormalizer.php b/generated/Normalizer/ContainerSpecMountVolumeOptionsNormalizer.php deleted file mode 100644 index 8ce905ff..00000000 --- a/generated/Normalizer/ContainerSpecMountVolumeOptionsNormalizer.php +++ /dev/null @@ -1,89 +0,0 @@ -setNoCopy($data->{'NoCopy'}); - } - if (property_exists($data, 'Labels')) { - $value = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_1) { - $values[$key] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Labels'})) { - $value = $data->{'Labels'}; - } - $object->setLabels($value); - } - if (property_exists($data, 'DriverConfig')) { - $object->setDriverConfig($this->serializer->denormalize($data->{'DriverConfig'}, 'Docker\\API\\Model\\Driver', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getNoCopy()) { - $data->{'NoCopy'} = $object->getNoCopy(); - } - $value = $object->getLabels(); - if (is_object($object->getLabels())) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value_1) { - $values->{$key} = $value_1; - } - $value = $values; - } - if (is_null($object->getLabels())) { - $value = $object->getLabels(); - } - $data->{'Labels'} = $value; - if (null !== $object->getDriverConfig()) { - $data->{'DriverConfig'} = json_decode($this->serializer->normalize($object->getDriverConfig(), 'raw', $context)); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerSpecNormalizer.php b/generated/Normalizer/ContainerSpecNormalizer.php deleted file mode 100644 index 50616bec..00000000 --- a/generated/Normalizer/ContainerSpecNormalizer.php +++ /dev/null @@ -1,205 +0,0 @@ -setImage($data->{'Image'}); - } - if (property_exists($data, 'Labels')) { - $value = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_1) { - $values[$key] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Labels'})) { - $value = $data->{'Labels'}; - } - $object->setLabels($value); - } - if (property_exists($data, 'Command')) { - $value_2 = $data->{'Command'}; - if (is_array($data->{'Command'})) { - $values_1 = []; - foreach ($data->{'Command'} as $value_3) { - $values_1[] = $value_3; - } - $value_2 = $values_1; - } - if (is_null($data->{'Command'})) { - $value_2 = $data->{'Command'}; - } - $object->setCommand($value_2); - } - if (property_exists($data, 'Args')) { - $value_4 = $data->{'Args'}; - if (is_array($data->{'Args'})) { - $values_2 = []; - foreach ($data->{'Args'} as $value_5) { - $values_2[] = $value_5; - } - $value_4 = $values_2; - } - if (is_null($data->{'Args'})) { - $value_4 = $data->{'Args'}; - } - $object->setArgs($value_4); - } - if (property_exists($data, 'Env')) { - $value_6 = $data->{'Env'}; - if (is_array($data->{'Env'})) { - $values_3 = []; - foreach ($data->{'Env'} as $value_7) { - $values_3[] = $value_7; - } - $value_6 = $values_3; - } - if (is_null($data->{'Env'})) { - $value_6 = $data->{'Env'}; - } - $object->setEnv($value_6); - } - if (property_exists($data, 'Dir')) { - $object->setDir($data->{'Dir'}); - } - if (property_exists($data, 'User')) { - $object->setUser($data->{'User'}); - } - if (property_exists($data, 'Mounts')) { - $value_8 = $data->{'Mounts'}; - if (is_array($data->{'Mounts'})) { - $values_4 = []; - foreach ($data->{'Mounts'} as $value_9) { - $values_4[] = $this->serializer->denormalize($value_9, 'Docker\\API\\Model\\ContainerSpecMount', 'raw', $context); - } - $value_8 = $values_4; - } - if (is_null($data->{'Mounts'})) { - $value_8 = $data->{'Mounts'}; - } - $object->setMounts($value_8); - } - if (property_exists($data, 'StopGracePeriod')) { - $object->setStopGracePeriod($data->{'StopGracePeriod'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); - } - $value = $object->getLabels(); - if (is_object($object->getLabels())) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value_1) { - $values->{$key} = $value_1; - } - $value = $values; - } - if (is_null($object->getLabels())) { - $value = $object->getLabels(); - } - $data->{'Labels'} = $value; - $value_2 = $object->getCommand(); - if (is_array($object->getCommand())) { - $values_1 = []; - foreach ($object->getCommand() as $value_3) { - $values_1[] = $value_3; - } - $value_2 = $values_1; - } - if (is_null($object->getCommand())) { - $value_2 = $object->getCommand(); - } - $data->{'Command'} = $value_2; - $value_4 = $object->getArgs(); - if (is_array($object->getArgs())) { - $values_2 = []; - foreach ($object->getArgs() as $value_5) { - $values_2[] = $value_5; - } - $value_4 = $values_2; - } - if (is_null($object->getArgs())) { - $value_4 = $object->getArgs(); - } - $data->{'Args'} = $value_4; - $value_6 = $object->getEnv(); - if (is_array($object->getEnv())) { - $values_3 = []; - foreach ($object->getEnv() as $value_7) { - $values_3[] = $value_7; - } - $value_6 = $values_3; - } - if (is_null($object->getEnv())) { - $value_6 = $object->getEnv(); - } - $data->{'Env'} = $value_6; - if (null !== $object->getDir()) { - $data->{'Dir'} = $object->getDir(); - } - if (null !== $object->getUser()) { - $data->{'User'} = $object->getUser(); - } - $value_8 = $object->getMounts(); - if (is_array($object->getMounts())) { - $values_4 = []; - foreach ($object->getMounts() as $value_9) { - $values_4[] = $value_9; - } - $value_8 = $values_4; - } - if (is_null($object->getMounts())) { - $value_8 = $object->getMounts(); - } - $data->{'Mounts'} = $value_8; - if (null !== $object->getStopGracePeriod()) { - $data->{'StopGracePeriod'} = $object->getStopGracePeriod(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerStateNormalizer.php b/generated/Normalizer/ContainerStateNormalizer.php index c58acbd7..286ca029 100644 --- a/generated/Normalizer/ContainerStateNormalizer.php +++ b/generated/Normalizer/ContainerStateNormalizer.php @@ -2,104 +2,315 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class ContainerStateNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\ContainerState') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\ContainerState) { - return true; - } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainerStateNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\ContainerState(); - if (property_exists($data, 'Error')) { - $object->setError($data->{'Error'}); - } - if (property_exists($data, 'ExitCode')) { - $object->setExitCode($data->{'ExitCode'}); - } - if (property_exists($data, 'FinishedAt')) { - $object->setFinishedAt($data->{'FinishedAt'}); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerState::class; } - if (property_exists($data, 'OOMKilled')) { - $object->setOOMKilled($data->{'OOMKilled'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerState::class; } - if (property_exists($data, 'Paused')) { - $object->setPaused($data->{'Paused'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerState(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($data['Status']); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('Running', $data) && $data['Running'] !== null) { + $object->setRunning($data['Running']); + } + elseif (\array_key_exists('Running', $data) && $data['Running'] === null) { + $object->setRunning(null); + } + if (\array_key_exists('Paused', $data) && $data['Paused'] !== null) { + $object->setPaused($data['Paused']); + } + elseif (\array_key_exists('Paused', $data) && $data['Paused'] === null) { + $object->setPaused(null); + } + if (\array_key_exists('Restarting', $data) && $data['Restarting'] !== null) { + $object->setRestarting($data['Restarting']); + } + elseif (\array_key_exists('Restarting', $data) && $data['Restarting'] === null) { + $object->setRestarting(null); + } + if (\array_key_exists('OOMKilled', $data) && $data['OOMKilled'] !== null) { + $object->setOOMKilled($data['OOMKilled']); + } + elseif (\array_key_exists('OOMKilled', $data) && $data['OOMKilled'] === null) { + $object->setOOMKilled(null); + } + if (\array_key_exists('Dead', $data) && $data['Dead'] !== null) { + $object->setDead($data['Dead']); + } + elseif (\array_key_exists('Dead', $data) && $data['Dead'] === null) { + $object->setDead(null); + } + if (\array_key_exists('Pid', $data) && $data['Pid'] !== null) { + $object->setPid($data['Pid']); + } + elseif (\array_key_exists('Pid', $data) && $data['Pid'] === null) { + $object->setPid(null); + } + if (\array_key_exists('ExitCode', $data) && $data['ExitCode'] !== null) { + $object->setExitCode($data['ExitCode']); + } + elseif (\array_key_exists('ExitCode', $data) && $data['ExitCode'] === null) { + $object->setExitCode(null); + } + if (\array_key_exists('Error', $data) && $data['Error'] !== null) { + $object->setError($data['Error']); + } + elseif (\array_key_exists('Error', $data) && $data['Error'] === null) { + $object->setError(null); + } + if (\array_key_exists('StartedAt', $data) && $data['StartedAt'] !== null) { + $object->setStartedAt($data['StartedAt']); + } + elseif (\array_key_exists('StartedAt', $data) && $data['StartedAt'] === null) { + $object->setStartedAt(null); + } + if (\array_key_exists('FinishedAt', $data) && $data['FinishedAt'] !== null) { + $object->setFinishedAt($data['FinishedAt']); + } + elseif (\array_key_exists('FinishedAt', $data) && $data['FinishedAt'] === null) { + $object->setFinishedAt(null); + } + if (\array_key_exists('Health', $data) && $data['Health'] !== null) { + $object->setHealth($this->denormalizer->denormalize($data['Health'], \Docker\API\Model\Health::class, 'json', $context)); + } + elseif (\array_key_exists('Health', $data) && $data['Health'] === null) { + $object->setHealth(null); + } + return $object; } - if (property_exists($data, 'Pid')) { - $object->setPid($data->{'Pid'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['Status'] = $object->getStatus(); + } + if ($object->isInitialized('running') && null !== $object->getRunning()) { + $data['Running'] = $object->getRunning(); + } + if ($object->isInitialized('paused') && null !== $object->getPaused()) { + $data['Paused'] = $object->getPaused(); + } + if ($object->isInitialized('restarting') && null !== $object->getRestarting()) { + $data['Restarting'] = $object->getRestarting(); + } + if ($object->isInitialized('oOMKilled') && null !== $object->getOOMKilled()) { + $data['OOMKilled'] = $object->getOOMKilled(); + } + if ($object->isInitialized('dead') && null !== $object->getDead()) { + $data['Dead'] = $object->getDead(); + } + if ($object->isInitialized('pid') && null !== $object->getPid()) { + $data['Pid'] = $object->getPid(); + } + if ($object->isInitialized('exitCode') && null !== $object->getExitCode()) { + $data['ExitCode'] = $object->getExitCode(); + } + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['Error'] = $object->getError(); + } + if ($object->isInitialized('startedAt') && null !== $object->getStartedAt()) { + $data['StartedAt'] = $object->getStartedAt(); + } + if ($object->isInitialized('finishedAt') && null !== $object->getFinishedAt()) { + $data['FinishedAt'] = $object->getFinishedAt(); + } + if ($object->isInitialized('health') && null !== $object->getHealth()) { + $data['Health'] = $this->normalizer->normalize($object->getHealth(), 'json', $context); + } + return $data; } - if (property_exists($data, 'Restarting')) { - $object->setRestarting($data->{'Restarting'}); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerState::class => false]; } - if (property_exists($data, 'Running')) { - $object->setRunning($data->{'Running'}); - } - if (property_exists($data, 'StartedAt')) { - $object->setStartedAt($data->{'StartedAt'}); - } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class ContainerStateNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getError()) { - $data->{'Error'} = $object->getError(); - } - if (null !== $object->getExitCode()) { - $data->{'ExitCode'} = $object->getExitCode(); - } - if (null !== $object->getFinishedAt()) { - $data->{'FinishedAt'} = $object->getFinishedAt(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerState::class; } - if (null !== $object->getOOMKilled()) { - $data->{'OOMKilled'} = $object->getOOMKilled(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerState::class; } - if (null !== $object->getPaused()) { - $data->{'Paused'} = $object->getPaused(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerState(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($data['Status']); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('Running', $data) && $data['Running'] !== null) { + $object->setRunning($data['Running']); + } + elseif (\array_key_exists('Running', $data) && $data['Running'] === null) { + $object->setRunning(null); + } + if (\array_key_exists('Paused', $data) && $data['Paused'] !== null) { + $object->setPaused($data['Paused']); + } + elseif (\array_key_exists('Paused', $data) && $data['Paused'] === null) { + $object->setPaused(null); + } + if (\array_key_exists('Restarting', $data) && $data['Restarting'] !== null) { + $object->setRestarting($data['Restarting']); + } + elseif (\array_key_exists('Restarting', $data) && $data['Restarting'] === null) { + $object->setRestarting(null); + } + if (\array_key_exists('OOMKilled', $data) && $data['OOMKilled'] !== null) { + $object->setOOMKilled($data['OOMKilled']); + } + elseif (\array_key_exists('OOMKilled', $data) && $data['OOMKilled'] === null) { + $object->setOOMKilled(null); + } + if (\array_key_exists('Dead', $data) && $data['Dead'] !== null) { + $object->setDead($data['Dead']); + } + elseif (\array_key_exists('Dead', $data) && $data['Dead'] === null) { + $object->setDead(null); + } + if (\array_key_exists('Pid', $data) && $data['Pid'] !== null) { + $object->setPid($data['Pid']); + } + elseif (\array_key_exists('Pid', $data) && $data['Pid'] === null) { + $object->setPid(null); + } + if (\array_key_exists('ExitCode', $data) && $data['ExitCode'] !== null) { + $object->setExitCode($data['ExitCode']); + } + elseif (\array_key_exists('ExitCode', $data) && $data['ExitCode'] === null) { + $object->setExitCode(null); + } + if (\array_key_exists('Error', $data) && $data['Error'] !== null) { + $object->setError($data['Error']); + } + elseif (\array_key_exists('Error', $data) && $data['Error'] === null) { + $object->setError(null); + } + if (\array_key_exists('StartedAt', $data) && $data['StartedAt'] !== null) { + $object->setStartedAt($data['StartedAt']); + } + elseif (\array_key_exists('StartedAt', $data) && $data['StartedAt'] === null) { + $object->setStartedAt(null); + } + if (\array_key_exists('FinishedAt', $data) && $data['FinishedAt'] !== null) { + $object->setFinishedAt($data['FinishedAt']); + } + elseif (\array_key_exists('FinishedAt', $data) && $data['FinishedAt'] === null) { + $object->setFinishedAt(null); + } + if (\array_key_exists('Health', $data) && $data['Health'] !== null) { + $object->setHealth($this->denormalizer->denormalize($data['Health'], \Docker\API\Model\Health::class, 'json', $context)); + } + elseif (\array_key_exists('Health', $data) && $data['Health'] === null) { + $object->setHealth(null); + } + return $object; } - if (null !== $object->getPid()) { - $data->{'Pid'} = $object->getPid(); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['Status'] = $object->getStatus(); + } + if ($object->isInitialized('running') && null !== $object->getRunning()) { + $data['Running'] = $object->getRunning(); + } + if ($object->isInitialized('paused') && null !== $object->getPaused()) { + $data['Paused'] = $object->getPaused(); + } + if ($object->isInitialized('restarting') && null !== $object->getRestarting()) { + $data['Restarting'] = $object->getRestarting(); + } + if ($object->isInitialized('oOMKilled') && null !== $object->getOOMKilled()) { + $data['OOMKilled'] = $object->getOOMKilled(); + } + if ($object->isInitialized('dead') && null !== $object->getDead()) { + $data['Dead'] = $object->getDead(); + } + if ($object->isInitialized('pid') && null !== $object->getPid()) { + $data['Pid'] = $object->getPid(); + } + if ($object->isInitialized('exitCode') && null !== $object->getExitCode()) { + $data['ExitCode'] = $object->getExitCode(); + } + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['Error'] = $object->getError(); + } + if ($object->isInitialized('startedAt') && null !== $object->getStartedAt()) { + $data['StartedAt'] = $object->getStartedAt(); + } + if ($object->isInitialized('finishedAt') && null !== $object->getFinishedAt()) { + $data['FinishedAt'] = $object->getFinishedAt(); + } + if ($object->isInitialized('health') && null !== $object->getHealth()) { + $data['Health'] = $this->normalizer->normalize($object->getHealth(), 'json', $context); + } + return $data; } - if (null !== $object->getRestarting()) { - $data->{'Restarting'} = $object->getRestarting(); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerState::class => false]; } - if (null !== $object->getRunning()) { - $data->{'Running'} = $object->getRunning(); - } - if (null !== $object->getStartedAt()) { - $data->{'StartedAt'} = $object->getStartedAt(); - } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/ContainerStatusNormalizer.php b/generated/Normalizer/ContainerStatusNormalizer.php index 275e458d..79c3be32 100644 --- a/generated/Normalizer/ContainerStatusNormalizer.php +++ b/generated/Normalizer/ContainerStatusNormalizer.php @@ -2,68 +2,153 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class ContainerStatusNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainerStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\ContainerStatus') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerStatus::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\ContainerStatus) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerStatus::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\ContainerStatus(); - if (property_exists($data, 'ContainerID')) { - $object->setContainerID($data->{'ContainerID'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ContainerID', $data) && $data['ContainerID'] !== null) { + $object->setContainerID($data['ContainerID']); + } + elseif (\array_key_exists('ContainerID', $data) && $data['ContainerID'] === null) { + $object->setContainerID(null); + } + if (\array_key_exists('PID', $data) && $data['PID'] !== null) { + $object->setPID($data['PID']); + } + elseif (\array_key_exists('PID', $data) && $data['PID'] === null) { + $object->setPID(null); + } + if (\array_key_exists('ExitCode', $data) && $data['ExitCode'] !== null) { + $object->setExitCode($data['ExitCode']); + } + elseif (\array_key_exists('ExitCode', $data) && $data['ExitCode'] === null) { + $object->setExitCode(null); + } + return $object; } - if (property_exists($data, 'PID')) { - $object->setPID($data->{'PID'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('containerID') && null !== $object->getContainerID()) { + $data['ContainerID'] = $object->getContainerID(); + } + if ($object->isInitialized('pID') && null !== $object->getPID()) { + $data['PID'] = $object->getPID(); + } + if ($object->isInitialized('exitCode') && null !== $object->getExitCode()) { + $data['ExitCode'] = $object->getExitCode(); + } + return $data; } - if (property_exists($data, 'ExitCode')) { - $object->setExitCode($data->{'ExitCode'}); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerStatus::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class ContainerStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getContainerID()) { - $data->{'ContainerID'} = $object->getContainerID(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerStatus::class; } - if (null !== $object->getPID()) { - $data->{'PID'} = $object->getPID(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerStatus::class; } - if (null !== $object->getExitCode()) { - $data->{'ExitCode'} = $object->getExitCode(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ContainerID', $data) && $data['ContainerID'] !== null) { + $object->setContainerID($data['ContainerID']); + } + elseif (\array_key_exists('ContainerID', $data) && $data['ContainerID'] === null) { + $object->setContainerID(null); + } + if (\array_key_exists('PID', $data) && $data['PID'] !== null) { + $object->setPID($data['PID']); + } + elseif (\array_key_exists('PID', $data) && $data['PID'] === null) { + $object->setPID(null); + } + if (\array_key_exists('ExitCode', $data) && $data['ExitCode'] !== null) { + $object->setExitCode($data['ExitCode']); + } + elseif (\array_key_exists('ExitCode', $data) && $data['ExitCode'] === null) { + $object->setExitCode(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('containerID') && null !== $object->getContainerID()) { + $data['ContainerID'] = $object->getContainerID(); + } + if ($object->isInitialized('pID') && null !== $object->getPID()) { + $data['PID'] = $object->getPID(); + } + if ($object->isInitialized('exitCode') && null !== $object->getExitCode()) { + $data['ExitCode'] = $object->getExitCode(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerStatus::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/ContainerSummaryHostConfigNormalizer.php b/generated/Normalizer/ContainerSummaryHostConfigNormalizer.php new file mode 100644 index 00000000..faf6d377 --- /dev/null +++ b/generated/Normalizer/ContainerSummaryHostConfigNormalizer.php @@ -0,0 +1,152 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainerSummaryHostConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerSummaryHostConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerSummaryHostConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerSummaryHostConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NetworkMode', $data) && $data['NetworkMode'] !== null) { + $object->setNetworkMode($data['NetworkMode']); + } + elseif (\array_key_exists('NetworkMode', $data) && $data['NetworkMode'] === null) { + $object->setNetworkMode(null); + } + if (\array_key_exists('Annotations', $data) && $data['Annotations'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Annotations'] as $key => $value) { + $values[$key] = $value; + } + $object->setAnnotations($values); + } + elseif (\array_key_exists('Annotations', $data) && $data['Annotations'] === null) { + $object->setAnnotations(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('networkMode') && null !== $object->getNetworkMode()) { + $data['NetworkMode'] = $object->getNetworkMode(); + } + if ($object->isInitialized('annotations') && null !== $object->getAnnotations()) { + $values = []; + foreach ($object->getAnnotations() as $key => $value) { + $values[$key] = $value; + } + $data['Annotations'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerSummaryHostConfig::class => false]; + } + } +} else { + class ContainerSummaryHostConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerSummaryHostConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerSummaryHostConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerSummaryHostConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NetworkMode', $data) && $data['NetworkMode'] !== null) { + $object->setNetworkMode($data['NetworkMode']); + } + elseif (\array_key_exists('NetworkMode', $data) && $data['NetworkMode'] === null) { + $object->setNetworkMode(null); + } + if (\array_key_exists('Annotations', $data) && $data['Annotations'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Annotations'] as $key => $value) { + $values[$key] = $value; + } + $object->setAnnotations($values); + } + elseif (\array_key_exists('Annotations', $data) && $data['Annotations'] === null) { + $object->setAnnotations(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('networkMode') && null !== $object->getNetworkMode()) { + $data['NetworkMode'] = $object->getNetworkMode(); + } + if ($object->isInitialized('annotations') && null !== $object->getAnnotations()) { + $values = []; + foreach ($object->getAnnotations() as $key => $value) { + $values[$key] = $value; + } + $data['Annotations'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerSummaryHostConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainerSummaryNetworkSettingsNormalizer.php b/generated/Normalizer/ContainerSummaryNetworkSettingsNormalizer.php new file mode 100644 index 00000000..56f3cf0f --- /dev/null +++ b/generated/Normalizer/ContainerSummaryNetworkSettingsNormalizer.php @@ -0,0 +1,134 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainerSummaryNetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerSummaryNetworkSettings::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerSummaryNetworkSettings::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerSummaryNetworkSettings(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Networks', $data) && $data['Networks'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Networks'] as $key => $value) { + $values[$key] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointSettings::class, 'json', $context); + } + $object->setNetworks($values); + } + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values = []; + foreach ($object->getNetworks() as $key => $value) { + $values[$key] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Networks'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerSummaryNetworkSettings::class => false]; + } + } +} else { + class ContainerSummaryNetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerSummaryNetworkSettings::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerSummaryNetworkSettings::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerSummaryNetworkSettings(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Networks', $data) && $data['Networks'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Networks'] as $key => $value) { + $values[$key] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointSettings::class, 'json', $context); + } + $object->setNetworks($values); + } + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values = []; + foreach ($object->getNetworks() as $key => $value) { + $values[$key] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Networks'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerSummaryNetworkSettings::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainerSummaryNormalizer.php b/generated/Normalizer/ContainerSummaryNormalizer.php new file mode 100644 index 00000000..164359db --- /dev/null +++ b/generated/Normalizer/ContainerSummaryNormalizer.php @@ -0,0 +1,434 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainerSummaryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerSummary::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerSummary::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerSummary(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Names', $data) && $data['Names'] !== null) { + $values = []; + foreach ($data['Names'] as $value) { + $values[] = $value; + } + $object->setNames($values); + } + elseif (\array_key_exists('Names', $data) && $data['Names'] === null) { + $object->setNames(null); + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); + } + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('ImageID', $data) && $data['ImageID'] !== null) { + $object->setImageID($data['ImageID']); + } + elseif (\array_key_exists('ImageID', $data) && $data['ImageID'] === null) { + $object->setImageID(null); + } + if (\array_key_exists('Command', $data) && $data['Command'] !== null) { + $object->setCommand($data['Command']); + } + elseif (\array_key_exists('Command', $data) && $data['Command'] === null) { + $object->setCommand(null); + } + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); + } + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); + } + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { + $values_1 = []; + foreach ($data['Ports'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\Port::class, 'json', $context); + } + $object->setPorts($values_1); + } + elseif (\array_key_exists('Ports', $data) && $data['Ports'] === null) { + $object->setPorts(null); + } + if (\array_key_exists('SizeRw', $data) && $data['SizeRw'] !== null) { + $object->setSizeRw($data['SizeRw']); + } + elseif (\array_key_exists('SizeRw', $data) && $data['SizeRw'] === null) { + $object->setSizeRw(null); + } + if (\array_key_exists('SizeRootFs', $data) && $data['SizeRootFs'] !== null) { + $object->setSizeRootFs($data['SizeRootFs']); + } + elseif (\array_key_exists('SizeRootFs', $data) && $data['SizeRootFs'] === null) { + $object->setSizeRootFs(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value_2) { + $values_2[$key] = $value_2; + } + $object->setLabels($values_2); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); + } + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($data['Status']); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('HostConfig', $data) && $data['HostConfig'] !== null) { + $object->setHostConfig($this->denormalizer->denormalize($data['HostConfig'], \Docker\API\Model\ContainerSummaryHostConfig::class, 'json', $context)); + } + elseif (\array_key_exists('HostConfig', $data) && $data['HostConfig'] === null) { + $object->setHostConfig(null); + } + if (\array_key_exists('NetworkSettings', $data) && $data['NetworkSettings'] !== null) { + $object->setNetworkSettings($this->denormalizer->denormalize($data['NetworkSettings'], \Docker\API\Model\ContainerSummaryNetworkSettings::class, 'json', $context)); + } + elseif (\array_key_exists('NetworkSettings', $data) && $data['NetworkSettings'] === null) { + $object->setNetworkSettings(null); + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values_3 = []; + foreach ($data['Mounts'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\MountPoint::class, 'json', $context); + } + $object->setMounts($values_3); + } + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); + } + if ($object->isInitialized('names') && null !== $object->getNames()) { + $values = []; + foreach ($object->getNames() as $value) { + $values[] = $value; + } + $data['Names'] = $values; + } + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); + } + if ($object->isInitialized('imageID') && null !== $object->getImageID()) { + $data['ImageID'] = $object->getImageID(); + } + if ($object->isInitialized('command') && null !== $object->getCommand()) { + $data['Command'] = $object->getCommand(); + } + if ($object->isInitialized('created') && null !== $object->getCreated()) { + $data['Created'] = $object->getCreated(); + } + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values_1 = []; + foreach ($object->getPorts() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Ports'] = $values_1; + } + if ($object->isInitialized('sizeRw') && null !== $object->getSizeRw()) { + $data['SizeRw'] = $object->getSizeRw(); + } + if ($object->isInitialized('sizeRootFs') && null !== $object->getSizeRootFs()) { + $data['SizeRootFs'] = $object->getSizeRootFs(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_2 = []; + foreach ($object->getLabels() as $key => $value_2) { + $values_2[$key] = $value_2; + } + $data['Labels'] = $values_2; + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['Status'] = $object->getStatus(); + } + if ($object->isInitialized('hostConfig') && null !== $object->getHostConfig()) { + $data['HostConfig'] = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); + } + if ($object->isInitialized('networkSettings') && null !== $object->getNetworkSettings()) { + $data['NetworkSettings'] = $this->normalizer->normalize($object->getNetworkSettings(), 'json', $context); + } + if ($object->isInitialized('mounts') && null !== $object->getMounts()) { + $values_3 = []; + foreach ($object->getMounts() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['Mounts'] = $values_3; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerSummary::class => false]; + } + } +} else { + class ContainerSummaryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerSummary::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerSummary::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerSummary(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Names', $data) && $data['Names'] !== null) { + $values = []; + foreach ($data['Names'] as $value) { + $values[] = $value; + } + $object->setNames($values); + } + elseif (\array_key_exists('Names', $data) && $data['Names'] === null) { + $object->setNames(null); + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); + } + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('ImageID', $data) && $data['ImageID'] !== null) { + $object->setImageID($data['ImageID']); + } + elseif (\array_key_exists('ImageID', $data) && $data['ImageID'] === null) { + $object->setImageID(null); + } + if (\array_key_exists('Command', $data) && $data['Command'] !== null) { + $object->setCommand($data['Command']); + } + elseif (\array_key_exists('Command', $data) && $data['Command'] === null) { + $object->setCommand(null); + } + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); + } + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); + } + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { + $values_1 = []; + foreach ($data['Ports'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\Port::class, 'json', $context); + } + $object->setPorts($values_1); + } + elseif (\array_key_exists('Ports', $data) && $data['Ports'] === null) { + $object->setPorts(null); + } + if (\array_key_exists('SizeRw', $data) && $data['SizeRw'] !== null) { + $object->setSizeRw($data['SizeRw']); + } + elseif (\array_key_exists('SizeRw', $data) && $data['SizeRw'] === null) { + $object->setSizeRw(null); + } + if (\array_key_exists('SizeRootFs', $data) && $data['SizeRootFs'] !== null) { + $object->setSizeRootFs($data['SizeRootFs']); + } + elseif (\array_key_exists('SizeRootFs', $data) && $data['SizeRootFs'] === null) { + $object->setSizeRootFs(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value_2) { + $values_2[$key] = $value_2; + } + $object->setLabels($values_2); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); + } + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($data['Status']); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('HostConfig', $data) && $data['HostConfig'] !== null) { + $object->setHostConfig($this->denormalizer->denormalize($data['HostConfig'], \Docker\API\Model\ContainerSummaryHostConfig::class, 'json', $context)); + } + elseif (\array_key_exists('HostConfig', $data) && $data['HostConfig'] === null) { + $object->setHostConfig(null); + } + if (\array_key_exists('NetworkSettings', $data) && $data['NetworkSettings'] !== null) { + $object->setNetworkSettings($this->denormalizer->denormalize($data['NetworkSettings'], \Docker\API\Model\ContainerSummaryNetworkSettings::class, 'json', $context)); + } + elseif (\array_key_exists('NetworkSettings', $data) && $data['NetworkSettings'] === null) { + $object->setNetworkSettings(null); + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values_3 = []; + foreach ($data['Mounts'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\MountPoint::class, 'json', $context); + } + $object->setMounts($values_3); + } + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); + } + if ($object->isInitialized('names') && null !== $object->getNames()) { + $values = []; + foreach ($object->getNames() as $value) { + $values[] = $value; + } + $data['Names'] = $values; + } + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); + } + if ($object->isInitialized('imageID') && null !== $object->getImageID()) { + $data['ImageID'] = $object->getImageID(); + } + if ($object->isInitialized('command') && null !== $object->getCommand()) { + $data['Command'] = $object->getCommand(); + } + if ($object->isInitialized('created') && null !== $object->getCreated()) { + $data['Created'] = $object->getCreated(); + } + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values_1 = []; + foreach ($object->getPorts() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Ports'] = $values_1; + } + if ($object->isInitialized('sizeRw') && null !== $object->getSizeRw()) { + $data['SizeRw'] = $object->getSizeRw(); + } + if ($object->isInitialized('sizeRootFs') && null !== $object->getSizeRootFs()) { + $data['SizeRootFs'] = $object->getSizeRootFs(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_2 = []; + foreach ($object->getLabels() as $key => $value_2) { + $values_2[$key] = $value_2; + } + $data['Labels'] = $values_2; + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['Status'] = $object->getStatus(); + } + if ($object->isInitialized('hostConfig') && null !== $object->getHostConfig()) { + $data['HostConfig'] = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); + } + if ($object->isInitialized('networkSettings') && null !== $object->getNetworkSettings()) { + $data['NetworkSettings'] = $this->normalizer->normalize($object->getNetworkSettings(), 'json', $context); + } + if ($object->isInitialized('mounts') && null !== $object->getMounts()) { + $values_3 = []; + foreach ($object->getMounts() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['Mounts'] = $values_3; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerSummary::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainerTopNormalizer.php b/generated/Normalizer/ContainerTopNormalizer.php deleted file mode 100644 index 36e6e027..00000000 --- a/generated/Normalizer/ContainerTopNormalizer.php +++ /dev/null @@ -1,125 +0,0 @@ -{'Titles'}; - if (is_array($data->{'Titles'})) { - $values = []; - foreach ($data->{'Titles'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Titles'})) { - $value = $data->{'Titles'}; - } - $object->setTitles($value); - } - if (property_exists($data, 'Processes')) { - $value_2 = $data->{'Processes'}; - if (is_array($data->{'Processes'})) { - $values_1 = []; - foreach ($data->{'Processes'} as $value_3) { - $value_4 = $value_3; - if (is_array($value_3)) { - $values_2 = []; - foreach ($value_3 as $value_5) { - $values_2[] = $value_5; - } - $value_4 = $values_2; - } - if (is_null($value_3)) { - $value_4 = $value_3; - } - $values_1[] = $value_4; - } - $value_2 = $values_1; - } - if (is_null($data->{'Processes'})) { - $value_2 = $data->{'Processes'}; - } - $object->setProcesses($value_2); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - $value = $object->getTitles(); - if (is_array($object->getTitles())) { - $values = []; - foreach ($object->getTitles() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getTitles())) { - $value = $object->getTitles(); - } - $data->{'Titles'} = $value; - $value_2 = $object->getProcesses(); - if (is_array($object->getProcesses())) { - $values_1 = []; - foreach ($object->getProcesses() as $value_3) { - $value_4 = $value_3; - if (is_array($value_3)) { - $values_2 = []; - foreach ($value_3 as $value_5) { - $values_2[] = $value_5; - } - $value_4 = $values_2; - } - if (is_null($value_3)) { - $value_4 = $value_3; - } - $values_1[] = $value_4; - } - $value_2 = $values_1; - } - if (is_null($object->getProcesses())) { - $value_2 = $object->getProcesses(); - } - $data->{'Processes'} = $value_2; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerUpdateResultNormalizer.php b/generated/Normalizer/ContainerUpdateResultNormalizer.php deleted file mode 100644 index 5c93640c..00000000 --- a/generated/Normalizer/ContainerUpdateResultNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -{'Warnings'}; - if (is_array($data->{'Warnings'})) { - $values = []; - foreach ($data->{'Warnings'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Warnings'})) { - $value = $data->{'Warnings'}; - } - $object->setWarnings($value); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - $value = $object->getWarnings(); - if (is_array($object->getWarnings())) { - $values = []; - foreach ($object->getWarnings() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getWarnings())) { - $value = $object->getWarnings(); - } - $data->{'Warnings'} = $value; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerWaitExitErrorNormalizer.php b/generated/Normalizer/ContainerWaitExitErrorNormalizer.php new file mode 100644 index 00000000..cfa5c54d --- /dev/null +++ b/generated/Normalizer/ContainerWaitExitErrorNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainerWaitExitErrorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerWaitExitError::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerWaitExitError::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerWaitExitError(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Message', $data) && $data['Message'] !== null) { + $object->setMessage($data['Message']); + } + elseif (\array_key_exists('Message', $data) && $data['Message'] === null) { + $object->setMessage(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['Message'] = $object->getMessage(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerWaitExitError::class => false]; + } + } +} else { + class ContainerWaitExitErrorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerWaitExitError::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerWaitExitError::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerWaitExitError(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Message', $data) && $data['Message'] !== null) { + $object->setMessage($data['Message']); + } + elseif (\array_key_exists('Message', $data) && $data['Message'] === null) { + $object->setMessage(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['Message'] = $object->getMessage(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerWaitExitError::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainerWaitNormalizer.php b/generated/Normalizer/ContainerWaitNormalizer.php deleted file mode 100644 index c41af226..00000000 --- a/generated/Normalizer/ContainerWaitNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -setStatusCode($data->{'StatusCode'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getStatusCode()) { - $data->{'StatusCode'} = $object->getStatusCode(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ContainerWaitResponseNormalizer.php b/generated/Normalizer/ContainerWaitResponseNormalizer.php new file mode 100644 index 00000000..1e1e178d --- /dev/null +++ b/generated/Normalizer/ContainerWaitResponseNormalizer.php @@ -0,0 +1,132 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainerWaitResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerWaitResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerWaitResponse::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerWaitResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('StatusCode', $data) && $data['StatusCode'] !== null) { + $object->setStatusCode($data['StatusCode']); + } + elseif (\array_key_exists('StatusCode', $data) && $data['StatusCode'] === null) { + $object->setStatusCode(null); + } + if (\array_key_exists('Error', $data) && $data['Error'] !== null) { + $object->setError($this->denormalizer->denormalize($data['Error'], \Docker\API\Model\ContainerWaitExitError::class, 'json', $context)); + } + elseif (\array_key_exists('Error', $data) && $data['Error'] === null) { + $object->setError(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['StatusCode'] = $object->getStatusCode(); + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['Error'] = $this->normalizer->normalize($object->getError(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerWaitResponse::class => false]; + } + } +} else { + class ContainerWaitResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerWaitResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerWaitResponse::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerWaitResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('StatusCode', $data) && $data['StatusCode'] !== null) { + $object->setStatusCode($data['StatusCode']); + } + elseif (\array_key_exists('StatusCode', $data) && $data['StatusCode'] === null) { + $object->setStatusCode(null); + } + if (\array_key_exists('Error', $data) && $data['Error'] !== null) { + $object->setError($this->denormalizer->denormalize($data['Error'], \Docker\API\Model\ContainerWaitExitError::class, 'json', $context)); + } + elseif (\array_key_exists('Error', $data) && $data['Error'] === null) { + $object->setError(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['StatusCode'] = $object->getStatusCode(); + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['Error'] = $this->normalizer->normalize($object->getError(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerWaitResponse::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainerdInfoNamespacesNormalizer.php b/generated/Normalizer/ContainerdInfoNamespacesNormalizer.php new file mode 100644 index 00000000..8a4acf19 --- /dev/null +++ b/generated/Normalizer/ContainerdInfoNamespacesNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainerdInfoNamespacesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerdInfoNamespaces::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerdInfoNamespaces::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerdInfoNamespaces(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $object->setContainers($data['Containers']); + } + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); + } + if (\array_key_exists('Plugins', $data) && $data['Plugins'] !== null) { + $object->setPlugins($data['Plugins']); + } + elseif (\array_key_exists('Plugins', $data) && $data['Plugins'] === null) { + $object->setPlugins(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('containers') && null !== $object->getContainers()) { + $data['Containers'] = $object->getContainers(); + } + if ($object->isInitialized('plugins') && null !== $object->getPlugins()) { + $data['Plugins'] = $object->getPlugins(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerdInfoNamespaces::class => false]; + } + } +} else { + class ContainerdInfoNamespacesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerdInfoNamespaces::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerdInfoNamespaces::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerdInfoNamespaces(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $object->setContainers($data['Containers']); + } + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); + } + if (\array_key_exists('Plugins', $data) && $data['Plugins'] !== null) { + $object->setPlugins($data['Plugins']); + } + elseif (\array_key_exists('Plugins', $data) && $data['Plugins'] === null) { + $object->setPlugins(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('containers') && null !== $object->getContainers()) { + $data['Containers'] = $object->getContainers(); + } + if ($object->isInitialized('plugins') && null !== $object->getPlugins()) { + $data['Plugins'] = $object->getPlugins(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerdInfoNamespaces::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainerdInfoNormalizer.php b/generated/Normalizer/ContainerdInfoNormalizer.php new file mode 100644 index 00000000..d0e8ddac --- /dev/null +++ b/generated/Normalizer/ContainerdInfoNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainerdInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerdInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerdInfo::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerdInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Address', $data) && $data['Address'] !== null) { + $object->setAddress($data['Address']); + } + elseif (\array_key_exists('Address', $data) && $data['Address'] === null) { + $object->setAddress(null); + } + if (\array_key_exists('Namespaces', $data) && $data['Namespaces'] !== null) { + $object->setNamespaces($this->denormalizer->denormalize($data['Namespaces'], \Docker\API\Model\ContainerdInfoNamespaces::class, 'json', $context)); + } + elseif (\array_key_exists('Namespaces', $data) && $data['Namespaces'] === null) { + $object->setNamespaces(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('address') && null !== $object->getAddress()) { + $data['Address'] = $object->getAddress(); + } + if ($object->isInitialized('namespaces') && null !== $object->getNamespaces()) { + $data['Namespaces'] = $this->normalizer->normalize($object->getNamespaces(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerdInfo::class => false]; + } + } +} else { + class ContainerdInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainerdInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainerdInfo::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainerdInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Address', $data) && $data['Address'] !== null) { + $object->setAddress($data['Address']); + } + elseif (\array_key_exists('Address', $data) && $data['Address'] === null) { + $object->setAddress(null); + } + if (\array_key_exists('Namespaces', $data) && $data['Namespaces'] !== null) { + $object->setNamespaces($this->denormalizer->denormalize($data['Namespaces'], \Docker\API\Model\ContainerdInfoNamespaces::class, 'json', $context)); + } + elseif (\array_key_exists('Namespaces', $data) && $data['Namespaces'] === null) { + $object->setNamespaces(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('address') && null !== $object->getAddress()) { + $data['Address'] = $object->getAddress(); + } + if ($object->isInitialized('namespaces') && null !== $object->getNamespaces()) { + $data['Namespaces'] = $this->normalizer->normalize($object->getNamespaces(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerdInfo::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainersCreatePostBodyNormalizer.php b/generated/Normalizer/ContainersCreatePostBodyNormalizer.php new file mode 100644 index 00000000..3f17b90b --- /dev/null +++ b/generated/Normalizer/ContainersCreatePostBodyNormalizer.php @@ -0,0 +1,714 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainersCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersCreatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersCreatePostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Hostname', $data) && $data['Hostname'] !== null) { + $object->setHostname($data['Hostname']); + } + elseif (\array_key_exists('Hostname', $data) && $data['Hostname'] === null) { + $object->setHostname(null); + } + if (\array_key_exists('Domainname', $data) && $data['Domainname'] !== null) { + $object->setDomainname($data['Domainname']); + } + elseif (\array_key_exists('Domainname', $data) && $data['Domainname'] === null) { + $object->setDomainname(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] !== null) { + $object->setAttachStdin($data['AttachStdin']); + } + elseif (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] === null) { + $object->setAttachStdin(null); + } + if (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] !== null) { + $object->setAttachStdout($data['AttachStdout']); + } + elseif (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] === null) { + $object->setAttachStdout(null); + } + if (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] !== null) { + $object->setAttachStderr($data['AttachStderr']); + } + elseif (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] === null) { + $object->setAttachStderr(null); + } + if (\array_key_exists('ExposedPorts', $data) && $data['ExposedPorts'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['ExposedPorts'] as $key => $value) { + $values[$key] = $value; + } + $object->setExposedPorts($values); + } + elseif (\array_key_exists('ExposedPorts', $data) && $data['ExposedPorts'] === null) { + $object->setExposedPorts(null); + } + if (\array_key_exists('Tty', $data) && $data['Tty'] !== null) { + $object->setTty($data['Tty']); + } + elseif (\array_key_exists('Tty', $data) && $data['Tty'] === null) { + $object->setTty(null); + } + if (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] !== null) { + $object->setOpenStdin($data['OpenStdin']); + } + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); + } + if (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] !== null) { + $object->setStdinOnce($data['StdinOnce']); + } + elseif (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] === null) { + $object->setStdinOnce(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_1 = []; + foreach ($data['Env'] as $value_1) { + $values_1[] = $value_1; + } + $object->setEnv($values_1); + } + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Cmd', $data) && $data['Cmd'] !== null) { + $values_2 = []; + foreach ($data['Cmd'] as $value_2) { + $values_2[] = $value_2; + } + $object->setCmd($values_2); + } + elseif (\array_key_exists('Cmd', $data) && $data['Cmd'] === null) { + $object->setCmd(null); + } + if (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] !== null) { + $object->setHealthcheck($this->denormalizer->denormalize($data['Healthcheck'], \Docker\API\Model\HealthConfig::class, 'json', $context)); + } + elseif (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] === null) { + $object->setHealthcheck(null); + } + if (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] !== null) { + $object->setArgsEscaped($data['ArgsEscaped']); + } + elseif (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] === null) { + $object->setArgsEscaped(null); + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); + } + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('Volumes', $data) && $data['Volumes'] !== null) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Volumes'] as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $object->setVolumes($values_3); + } + elseif (\array_key_exists('Volumes', $data) && $data['Volumes'] === null) { + $object->setVolumes(null); + } + if (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] !== null) { + $object->setWorkingDir($data['WorkingDir']); + } + elseif (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] === null) { + $object->setWorkingDir(null); + } + if (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] !== null) { + $values_4 = []; + foreach ($data['Entrypoint'] as $value_4) { + $values_4[] = $value_4; + } + $object->setEntrypoint($values_4); + } + elseif (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] === null) { + $object->setEntrypoint(null); + } + if (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] !== null) { + $object->setNetworkDisabled($data['NetworkDisabled']); + } + elseif (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] === null) { + $object->setNetworkDisabled(null); + } + if (\array_key_exists('MacAddress', $data) && $data['MacAddress'] !== null) { + $object->setMacAddress($data['MacAddress']); + } + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); + } + if (\array_key_exists('OnBuild', $data) && $data['OnBuild'] !== null) { + $values_5 = []; + foreach ($data['OnBuild'] as $value_5) { + $values_5[] = $value_5; + } + $object->setOnBuild($values_5); + } + elseif (\array_key_exists('OnBuild', $data) && $data['OnBuild'] === null) { + $object->setOnBuild(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; + } + $object->setLabels($values_6); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('StopSignal', $data) && $data['StopSignal'] !== null) { + $object->setStopSignal($data['StopSignal']); + } + elseif (\array_key_exists('StopSignal', $data) && $data['StopSignal'] === null) { + $object->setStopSignal(null); + } + if (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] !== null) { + $object->setStopTimeout($data['StopTimeout']); + } + elseif (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] === null) { + $object->setStopTimeout(null); + } + if (\array_key_exists('Shell', $data) && $data['Shell'] !== null) { + $values_7 = []; + foreach ($data['Shell'] as $value_7) { + $values_7[] = $value_7; + } + $object->setShell($values_7); + } + elseif (\array_key_exists('Shell', $data) && $data['Shell'] === null) { + $object->setShell(null); + } + if (\array_key_exists('HostConfig', $data) && $data['HostConfig'] !== null) { + $object->setHostConfig($this->denormalizer->denormalize($data['HostConfig'], \Docker\API\Model\HostConfig::class, 'json', $context)); + } + elseif (\array_key_exists('HostConfig', $data) && $data['HostConfig'] === null) { + $object->setHostConfig(null); + } + if (\array_key_exists('NetworkingConfig', $data) && $data['NetworkingConfig'] !== null) { + $object->setNetworkingConfig($this->denormalizer->denormalize($data['NetworkingConfig'], \Docker\API\Model\NetworkingConfig::class, 'json', $context)); + } + elseif (\array_key_exists('NetworkingConfig', $data) && $data['NetworkingConfig'] === null) { + $object->setNetworkingConfig(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); + } + if ($object->isInitialized('domainname') && null !== $object->getDomainname()) { + $data['Domainname'] = $object->getDomainname(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); + } + if ($object->isInitialized('attachStdin') && null !== $object->getAttachStdin()) { + $data['AttachStdin'] = $object->getAttachStdin(); + } + if ($object->isInitialized('attachStdout') && null !== $object->getAttachStdout()) { + $data['AttachStdout'] = $object->getAttachStdout(); + } + if ($object->isInitialized('attachStderr') && null !== $object->getAttachStderr()) { + $data['AttachStderr'] = $object->getAttachStderr(); + } + if ($object->isInitialized('exposedPorts') && null !== $object->getExposedPorts()) { + $values = []; + foreach ($object->getExposedPorts() as $key => $value) { + $values[$key] = $value; + } + $data['ExposedPorts'] = $values; + } + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); + } + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); + } + if ($object->isInitialized('stdinOnce') && null !== $object->getStdinOnce()) { + $data['StdinOnce'] = $object->getStdinOnce(); + } + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_1 = []; + foreach ($object->getEnv() as $value_1) { + $values_1[] = $value_1; + } + $data['Env'] = $values_1; + } + if ($object->isInitialized('cmd') && null !== $object->getCmd()) { + $values_2 = []; + foreach ($object->getCmd() as $value_2) { + $values_2[] = $value_2; + } + $data['Cmd'] = $values_2; + } + if ($object->isInitialized('healthcheck') && null !== $object->getHealthcheck()) { + $data['Healthcheck'] = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context); + } + if ($object->isInitialized('argsEscaped') && null !== $object->getArgsEscaped()) { + $data['ArgsEscaped'] = $object->getArgsEscaped(); + } + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); + } + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values_3 = []; + foreach ($object->getVolumes() as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $data['Volumes'] = $values_3; + } + if ($object->isInitialized('workingDir') && null !== $object->getWorkingDir()) { + $data['WorkingDir'] = $object->getWorkingDir(); + } + if ($object->isInitialized('entrypoint') && null !== $object->getEntrypoint()) { + $values_4 = []; + foreach ($object->getEntrypoint() as $value_4) { + $values_4[] = $value_4; + } + $data['Entrypoint'] = $values_4; + } + if ($object->isInitialized('networkDisabled') && null !== $object->getNetworkDisabled()) { + $data['NetworkDisabled'] = $object->getNetworkDisabled(); + } + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); + } + if ($object->isInitialized('onBuild') && null !== $object->getOnBuild()) { + $values_5 = []; + foreach ($object->getOnBuild() as $value_5) { + $values_5[] = $value_5; + } + $data['OnBuild'] = $values_5; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_6 = []; + foreach ($object->getLabels() as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; + } + $data['Labels'] = $values_6; + } + if ($object->isInitialized('stopSignal') && null !== $object->getStopSignal()) { + $data['StopSignal'] = $object->getStopSignal(); + } + if ($object->isInitialized('stopTimeout') && null !== $object->getStopTimeout()) { + $data['StopTimeout'] = $object->getStopTimeout(); + } + if ($object->isInitialized('shell') && null !== $object->getShell()) { + $values_7 = []; + foreach ($object->getShell() as $value_7) { + $values_7[] = $value_7; + } + $data['Shell'] = $values_7; + } + if ($object->isInitialized('hostConfig') && null !== $object->getHostConfig()) { + $data['HostConfig'] = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); + } + if ($object->isInitialized('networkingConfig') && null !== $object->getNetworkingConfig()) { + $data['NetworkingConfig'] = $this->normalizer->normalize($object->getNetworkingConfig(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersCreatePostBody::class => false]; + } + } +} else { + class ContainersCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersCreatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersCreatePostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Hostname', $data) && $data['Hostname'] !== null) { + $object->setHostname($data['Hostname']); + } + elseif (\array_key_exists('Hostname', $data) && $data['Hostname'] === null) { + $object->setHostname(null); + } + if (\array_key_exists('Domainname', $data) && $data['Domainname'] !== null) { + $object->setDomainname($data['Domainname']); + } + elseif (\array_key_exists('Domainname', $data) && $data['Domainname'] === null) { + $object->setDomainname(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] !== null) { + $object->setAttachStdin($data['AttachStdin']); + } + elseif (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] === null) { + $object->setAttachStdin(null); + } + if (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] !== null) { + $object->setAttachStdout($data['AttachStdout']); + } + elseif (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] === null) { + $object->setAttachStdout(null); + } + if (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] !== null) { + $object->setAttachStderr($data['AttachStderr']); + } + elseif (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] === null) { + $object->setAttachStderr(null); + } + if (\array_key_exists('ExposedPorts', $data) && $data['ExposedPorts'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['ExposedPorts'] as $key => $value) { + $values[$key] = $value; + } + $object->setExposedPorts($values); + } + elseif (\array_key_exists('ExposedPorts', $data) && $data['ExposedPorts'] === null) { + $object->setExposedPorts(null); + } + if (\array_key_exists('Tty', $data) && $data['Tty'] !== null) { + $object->setTty($data['Tty']); + } + elseif (\array_key_exists('Tty', $data) && $data['Tty'] === null) { + $object->setTty(null); + } + if (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] !== null) { + $object->setOpenStdin($data['OpenStdin']); + } + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); + } + if (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] !== null) { + $object->setStdinOnce($data['StdinOnce']); + } + elseif (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] === null) { + $object->setStdinOnce(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_1 = []; + foreach ($data['Env'] as $value_1) { + $values_1[] = $value_1; + } + $object->setEnv($values_1); + } + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Cmd', $data) && $data['Cmd'] !== null) { + $values_2 = []; + foreach ($data['Cmd'] as $value_2) { + $values_2[] = $value_2; + } + $object->setCmd($values_2); + } + elseif (\array_key_exists('Cmd', $data) && $data['Cmd'] === null) { + $object->setCmd(null); + } + if (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] !== null) { + $object->setHealthcheck($this->denormalizer->denormalize($data['Healthcheck'], \Docker\API\Model\HealthConfig::class, 'json', $context)); + } + elseif (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] === null) { + $object->setHealthcheck(null); + } + if (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] !== null) { + $object->setArgsEscaped($data['ArgsEscaped']); + } + elseif (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] === null) { + $object->setArgsEscaped(null); + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); + } + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('Volumes', $data) && $data['Volumes'] !== null) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Volumes'] as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $object->setVolumes($values_3); + } + elseif (\array_key_exists('Volumes', $data) && $data['Volumes'] === null) { + $object->setVolumes(null); + } + if (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] !== null) { + $object->setWorkingDir($data['WorkingDir']); + } + elseif (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] === null) { + $object->setWorkingDir(null); + } + if (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] !== null) { + $values_4 = []; + foreach ($data['Entrypoint'] as $value_4) { + $values_4[] = $value_4; + } + $object->setEntrypoint($values_4); + } + elseif (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] === null) { + $object->setEntrypoint(null); + } + if (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] !== null) { + $object->setNetworkDisabled($data['NetworkDisabled']); + } + elseif (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] === null) { + $object->setNetworkDisabled(null); + } + if (\array_key_exists('MacAddress', $data) && $data['MacAddress'] !== null) { + $object->setMacAddress($data['MacAddress']); + } + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); + } + if (\array_key_exists('OnBuild', $data) && $data['OnBuild'] !== null) { + $values_5 = []; + foreach ($data['OnBuild'] as $value_5) { + $values_5[] = $value_5; + } + $object->setOnBuild($values_5); + } + elseif (\array_key_exists('OnBuild', $data) && $data['OnBuild'] === null) { + $object->setOnBuild(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; + } + $object->setLabels($values_6); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('StopSignal', $data) && $data['StopSignal'] !== null) { + $object->setStopSignal($data['StopSignal']); + } + elseif (\array_key_exists('StopSignal', $data) && $data['StopSignal'] === null) { + $object->setStopSignal(null); + } + if (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] !== null) { + $object->setStopTimeout($data['StopTimeout']); + } + elseif (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] === null) { + $object->setStopTimeout(null); + } + if (\array_key_exists('Shell', $data) && $data['Shell'] !== null) { + $values_7 = []; + foreach ($data['Shell'] as $value_7) { + $values_7[] = $value_7; + } + $object->setShell($values_7); + } + elseif (\array_key_exists('Shell', $data) && $data['Shell'] === null) { + $object->setShell(null); + } + if (\array_key_exists('HostConfig', $data) && $data['HostConfig'] !== null) { + $object->setHostConfig($this->denormalizer->denormalize($data['HostConfig'], \Docker\API\Model\HostConfig::class, 'json', $context)); + } + elseif (\array_key_exists('HostConfig', $data) && $data['HostConfig'] === null) { + $object->setHostConfig(null); + } + if (\array_key_exists('NetworkingConfig', $data) && $data['NetworkingConfig'] !== null) { + $object->setNetworkingConfig($this->denormalizer->denormalize($data['NetworkingConfig'], \Docker\API\Model\NetworkingConfig::class, 'json', $context)); + } + elseif (\array_key_exists('NetworkingConfig', $data) && $data['NetworkingConfig'] === null) { + $object->setNetworkingConfig(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); + } + if ($object->isInitialized('domainname') && null !== $object->getDomainname()) { + $data['Domainname'] = $object->getDomainname(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); + } + if ($object->isInitialized('attachStdin') && null !== $object->getAttachStdin()) { + $data['AttachStdin'] = $object->getAttachStdin(); + } + if ($object->isInitialized('attachStdout') && null !== $object->getAttachStdout()) { + $data['AttachStdout'] = $object->getAttachStdout(); + } + if ($object->isInitialized('attachStderr') && null !== $object->getAttachStderr()) { + $data['AttachStderr'] = $object->getAttachStderr(); + } + if ($object->isInitialized('exposedPorts') && null !== $object->getExposedPorts()) { + $values = []; + foreach ($object->getExposedPorts() as $key => $value) { + $values[$key] = $value; + } + $data['ExposedPorts'] = $values; + } + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); + } + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); + } + if ($object->isInitialized('stdinOnce') && null !== $object->getStdinOnce()) { + $data['StdinOnce'] = $object->getStdinOnce(); + } + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_1 = []; + foreach ($object->getEnv() as $value_1) { + $values_1[] = $value_1; + } + $data['Env'] = $values_1; + } + if ($object->isInitialized('cmd') && null !== $object->getCmd()) { + $values_2 = []; + foreach ($object->getCmd() as $value_2) { + $values_2[] = $value_2; + } + $data['Cmd'] = $values_2; + } + if ($object->isInitialized('healthcheck') && null !== $object->getHealthcheck()) { + $data['Healthcheck'] = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context); + } + if ($object->isInitialized('argsEscaped') && null !== $object->getArgsEscaped()) { + $data['ArgsEscaped'] = $object->getArgsEscaped(); + } + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); + } + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values_3 = []; + foreach ($object->getVolumes() as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $data['Volumes'] = $values_3; + } + if ($object->isInitialized('workingDir') && null !== $object->getWorkingDir()) { + $data['WorkingDir'] = $object->getWorkingDir(); + } + if ($object->isInitialized('entrypoint') && null !== $object->getEntrypoint()) { + $values_4 = []; + foreach ($object->getEntrypoint() as $value_4) { + $values_4[] = $value_4; + } + $data['Entrypoint'] = $values_4; + } + if ($object->isInitialized('networkDisabled') && null !== $object->getNetworkDisabled()) { + $data['NetworkDisabled'] = $object->getNetworkDisabled(); + } + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); + } + if ($object->isInitialized('onBuild') && null !== $object->getOnBuild()) { + $values_5 = []; + foreach ($object->getOnBuild() as $value_5) { + $values_5[] = $value_5; + } + $data['OnBuild'] = $values_5; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_6 = []; + foreach ($object->getLabels() as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; + } + $data['Labels'] = $values_6; + } + if ($object->isInitialized('stopSignal') && null !== $object->getStopSignal()) { + $data['StopSignal'] = $object->getStopSignal(); + } + if ($object->isInitialized('stopTimeout') && null !== $object->getStopTimeout()) { + $data['StopTimeout'] = $object->getStopTimeout(); + } + if ($object->isInitialized('shell') && null !== $object->getShell()) { + $values_7 = []; + foreach ($object->getShell() as $value_7) { + $values_7[] = $value_7; + } + $data['Shell'] = $values_7; + } + if ($object->isInitialized('hostConfig') && null !== $object->getHostConfig()) { + $data['HostConfig'] = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); + } + if ($object->isInitialized('networkingConfig') && null !== $object->getNetworkingConfig()) { + $data['NetworkingConfig'] = $this->normalizer->normalize($object->getNetworkingConfig(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersCreatePostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainersIdExecPostBodyNormalizer.php b/generated/Normalizer/ContainersIdExecPostBodyNormalizer.php new file mode 100644 index 00000000..01bd8750 --- /dev/null +++ b/generated/Normalizer/ContainersIdExecPostBodyNormalizer.php @@ -0,0 +1,346 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainersIdExecPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersIdExecPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersIdExecPostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersIdExecPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] !== null) { + $object->setAttachStdin($data['AttachStdin']); + } + elseif (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] === null) { + $object->setAttachStdin(null); + } + if (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] !== null) { + $object->setAttachStdout($data['AttachStdout']); + } + elseif (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] === null) { + $object->setAttachStdout(null); + } + if (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] !== null) { + $object->setAttachStderr($data['AttachStderr']); + } + elseif (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] === null) { + $object->setAttachStderr(null); + } + if (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] !== null) { + $values = []; + foreach ($data['ConsoleSize'] as $value) { + $values[] = $value; + } + $object->setConsoleSize($values); + } + elseif (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] === null) { + $object->setConsoleSize(null); + } + if (\array_key_exists('DetachKeys', $data) && $data['DetachKeys'] !== null) { + $object->setDetachKeys($data['DetachKeys']); + } + elseif (\array_key_exists('DetachKeys', $data) && $data['DetachKeys'] === null) { + $object->setDetachKeys(null); + } + if (\array_key_exists('Tty', $data) && $data['Tty'] !== null) { + $object->setTty($data['Tty']); + } + elseif (\array_key_exists('Tty', $data) && $data['Tty'] === null) { + $object->setTty(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_1 = []; + foreach ($data['Env'] as $value_1) { + $values_1[] = $value_1; + } + $object->setEnv($values_1); + } + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Cmd', $data) && $data['Cmd'] !== null) { + $values_2 = []; + foreach ($data['Cmd'] as $value_2) { + $values_2[] = $value_2; + } + $object->setCmd($values_2); + } + elseif (\array_key_exists('Cmd', $data) && $data['Cmd'] === null) { + $object->setCmd(null); + } + if (\array_key_exists('Privileged', $data) && $data['Privileged'] !== null) { + $object->setPrivileged($data['Privileged']); + } + elseif (\array_key_exists('Privileged', $data) && $data['Privileged'] === null) { + $object->setPrivileged(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] !== null) { + $object->setWorkingDir($data['WorkingDir']); + } + elseif (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] === null) { + $object->setWorkingDir(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('attachStdin') && null !== $object->getAttachStdin()) { + $data['AttachStdin'] = $object->getAttachStdin(); + } + if ($object->isInitialized('attachStdout') && null !== $object->getAttachStdout()) { + $data['AttachStdout'] = $object->getAttachStdout(); + } + if ($object->isInitialized('attachStderr') && null !== $object->getAttachStderr()) { + $data['AttachStderr'] = $object->getAttachStderr(); + } + if ($object->isInitialized('consoleSize') && null !== $object->getConsoleSize()) { + $values = []; + foreach ($object->getConsoleSize() as $value) { + $values[] = $value; + } + $data['ConsoleSize'] = $values; + } + if ($object->isInitialized('detachKeys') && null !== $object->getDetachKeys()) { + $data['DetachKeys'] = $object->getDetachKeys(); + } + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); + } + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_1 = []; + foreach ($object->getEnv() as $value_1) { + $values_1[] = $value_1; + } + $data['Env'] = $values_1; + } + if ($object->isInitialized('cmd') && null !== $object->getCmd()) { + $values_2 = []; + foreach ($object->getCmd() as $value_2) { + $values_2[] = $value_2; + } + $data['Cmd'] = $values_2; + } + if ($object->isInitialized('privileged') && null !== $object->getPrivileged()) { + $data['Privileged'] = $object->getPrivileged(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); + } + if ($object->isInitialized('workingDir') && null !== $object->getWorkingDir()) { + $data['WorkingDir'] = $object->getWorkingDir(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdExecPostBody::class => false]; + } + } +} else { + class ContainersIdExecPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersIdExecPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersIdExecPostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersIdExecPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] !== null) { + $object->setAttachStdin($data['AttachStdin']); + } + elseif (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] === null) { + $object->setAttachStdin(null); + } + if (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] !== null) { + $object->setAttachStdout($data['AttachStdout']); + } + elseif (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] === null) { + $object->setAttachStdout(null); + } + if (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] !== null) { + $object->setAttachStderr($data['AttachStderr']); + } + elseif (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] === null) { + $object->setAttachStderr(null); + } + if (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] !== null) { + $values = []; + foreach ($data['ConsoleSize'] as $value) { + $values[] = $value; + } + $object->setConsoleSize($values); + } + elseif (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] === null) { + $object->setConsoleSize(null); + } + if (\array_key_exists('DetachKeys', $data) && $data['DetachKeys'] !== null) { + $object->setDetachKeys($data['DetachKeys']); + } + elseif (\array_key_exists('DetachKeys', $data) && $data['DetachKeys'] === null) { + $object->setDetachKeys(null); + } + if (\array_key_exists('Tty', $data) && $data['Tty'] !== null) { + $object->setTty($data['Tty']); + } + elseif (\array_key_exists('Tty', $data) && $data['Tty'] === null) { + $object->setTty(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_1 = []; + foreach ($data['Env'] as $value_1) { + $values_1[] = $value_1; + } + $object->setEnv($values_1); + } + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Cmd', $data) && $data['Cmd'] !== null) { + $values_2 = []; + foreach ($data['Cmd'] as $value_2) { + $values_2[] = $value_2; + } + $object->setCmd($values_2); + } + elseif (\array_key_exists('Cmd', $data) && $data['Cmd'] === null) { + $object->setCmd(null); + } + if (\array_key_exists('Privileged', $data) && $data['Privileged'] !== null) { + $object->setPrivileged($data['Privileged']); + } + elseif (\array_key_exists('Privileged', $data) && $data['Privileged'] === null) { + $object->setPrivileged(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] !== null) { + $object->setWorkingDir($data['WorkingDir']); + } + elseif (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] === null) { + $object->setWorkingDir(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('attachStdin') && null !== $object->getAttachStdin()) { + $data['AttachStdin'] = $object->getAttachStdin(); + } + if ($object->isInitialized('attachStdout') && null !== $object->getAttachStdout()) { + $data['AttachStdout'] = $object->getAttachStdout(); + } + if ($object->isInitialized('attachStderr') && null !== $object->getAttachStderr()) { + $data['AttachStderr'] = $object->getAttachStderr(); + } + if ($object->isInitialized('consoleSize') && null !== $object->getConsoleSize()) { + $values = []; + foreach ($object->getConsoleSize() as $value) { + $values[] = $value; + } + $data['ConsoleSize'] = $values; + } + if ($object->isInitialized('detachKeys') && null !== $object->getDetachKeys()) { + $data['DetachKeys'] = $object->getDetachKeys(); + } + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); + } + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_1 = []; + foreach ($object->getEnv() as $value_1) { + $values_1[] = $value_1; + } + $data['Env'] = $values_1; + } + if ($object->isInitialized('cmd') && null !== $object->getCmd()) { + $values_2 = []; + foreach ($object->getCmd() as $value_2) { + $values_2[] = $value_2; + } + $data['Cmd'] = $values_2; + } + if ($object->isInitialized('privileged') && null !== $object->getPrivileged()) { + $data['Privileged'] = $object->getPrivileged(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); + } + if ($object->isInitialized('workingDir') && null !== $object->getWorkingDir()) { + $data['WorkingDir'] = $object->getWorkingDir(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdExecPostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainersIdJsonGetResponse200Normalizer.php b/generated/Normalizer/ContainersIdJsonGetResponse200Normalizer.php new file mode 100644 index 00000000..22dfd707 --- /dev/null +++ b/generated/Normalizer/ContainersIdJsonGetResponse200Normalizer.php @@ -0,0 +1,598 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainersIdJsonGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersIdJsonGetResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersIdJsonGetResponse200::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersIdJsonGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); + } + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); + } + if (\array_key_exists('Path', $data) && $data['Path'] !== null) { + $object->setPath($data['Path']); + } + elseif (\array_key_exists('Path', $data) && $data['Path'] === null) { + $object->setPath(null); + } + if (\array_key_exists('Args', $data) && $data['Args'] !== null) { + $values = []; + foreach ($data['Args'] as $value) { + $values[] = $value; + } + $object->setArgs($values); + } + elseif (\array_key_exists('Args', $data) && $data['Args'] === null) { + $object->setArgs(null); + } + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($this->denormalizer->denormalize($data['State'], \Docker\API\Model\ContainerState::class, 'json', $context)); + } + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); + } + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('ResolvConfPath', $data) && $data['ResolvConfPath'] !== null) { + $object->setResolvConfPath($data['ResolvConfPath']); + } + elseif (\array_key_exists('ResolvConfPath', $data) && $data['ResolvConfPath'] === null) { + $object->setResolvConfPath(null); + } + if (\array_key_exists('HostnamePath', $data) && $data['HostnamePath'] !== null) { + $object->setHostnamePath($data['HostnamePath']); + } + elseif (\array_key_exists('HostnamePath', $data) && $data['HostnamePath'] === null) { + $object->setHostnamePath(null); + } + if (\array_key_exists('HostsPath', $data) && $data['HostsPath'] !== null) { + $object->setHostsPath($data['HostsPath']); + } + elseif (\array_key_exists('HostsPath', $data) && $data['HostsPath'] === null) { + $object->setHostsPath(null); + } + if (\array_key_exists('LogPath', $data) && $data['LogPath'] !== null) { + $object->setLogPath($data['LogPath']); + } + elseif (\array_key_exists('LogPath', $data) && $data['LogPath'] === null) { + $object->setLogPath(null); + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('RestartCount', $data) && $data['RestartCount'] !== null) { + $object->setRestartCount($data['RestartCount']); + } + elseif (\array_key_exists('RestartCount', $data) && $data['RestartCount'] === null) { + $object->setRestartCount(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Platform', $data) && $data['Platform'] !== null) { + $object->setPlatform($data['Platform']); + } + elseif (\array_key_exists('Platform', $data) && $data['Platform'] === null) { + $object->setPlatform(null); + } + if (\array_key_exists('MountLabel', $data) && $data['MountLabel'] !== null) { + $object->setMountLabel($data['MountLabel']); + } + elseif (\array_key_exists('MountLabel', $data) && $data['MountLabel'] === null) { + $object->setMountLabel(null); + } + if (\array_key_exists('ProcessLabel', $data) && $data['ProcessLabel'] !== null) { + $object->setProcessLabel($data['ProcessLabel']); + } + elseif (\array_key_exists('ProcessLabel', $data) && $data['ProcessLabel'] === null) { + $object->setProcessLabel(null); + } + if (\array_key_exists('AppArmorProfile', $data) && $data['AppArmorProfile'] !== null) { + $object->setAppArmorProfile($data['AppArmorProfile']); + } + elseif (\array_key_exists('AppArmorProfile', $data) && $data['AppArmorProfile'] === null) { + $object->setAppArmorProfile(null); + } + if (\array_key_exists('ExecIDs', $data) && $data['ExecIDs'] !== null) { + $values_1 = []; + foreach ($data['ExecIDs'] as $value_1) { + $values_1[] = $value_1; + } + $object->setExecIDs($values_1); + } + elseif (\array_key_exists('ExecIDs', $data) && $data['ExecIDs'] === null) { + $object->setExecIDs(null); + } + if (\array_key_exists('HostConfig', $data) && $data['HostConfig'] !== null) { + $object->setHostConfig($this->denormalizer->denormalize($data['HostConfig'], \Docker\API\Model\HostConfig::class, 'json', $context)); + } + elseif (\array_key_exists('HostConfig', $data) && $data['HostConfig'] === null) { + $object->setHostConfig(null); + } + if (\array_key_exists('GraphDriver', $data) && $data['GraphDriver'] !== null) { + $object->setGraphDriver($this->denormalizer->denormalize($data['GraphDriver'], \Docker\API\Model\DriverData::class, 'json', $context)); + } + elseif (\array_key_exists('GraphDriver', $data) && $data['GraphDriver'] === null) { + $object->setGraphDriver(null); + } + if (\array_key_exists('SizeRw', $data) && $data['SizeRw'] !== null) { + $object->setSizeRw($data['SizeRw']); + } + elseif (\array_key_exists('SizeRw', $data) && $data['SizeRw'] === null) { + $object->setSizeRw(null); + } + if (\array_key_exists('SizeRootFs', $data) && $data['SizeRootFs'] !== null) { + $object->setSizeRootFs($data['SizeRootFs']); + } + elseif (\array_key_exists('SizeRootFs', $data) && $data['SizeRootFs'] === null) { + $object->setSizeRootFs(null); + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values_2 = []; + foreach ($data['Mounts'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\MountPoint::class, 'json', $context); + } + $object->setMounts($values_2); + } + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $object->setConfig($this->denormalizer->denormalize($data['Config'], \Docker\API\Model\ContainerConfig::class, 'json', $context)); + } + elseif (\array_key_exists('Config', $data) && $data['Config'] === null) { + $object->setConfig(null); + } + if (\array_key_exists('NetworkSettings', $data) && $data['NetworkSettings'] !== null) { + $object->setNetworkSettings($this->denormalizer->denormalize($data['NetworkSettings'], \Docker\API\Model\NetworkSettings::class, 'json', $context)); + } + elseif (\array_key_exists('NetworkSettings', $data) && $data['NetworkSettings'] === null) { + $object->setNetworkSettings(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); + } + if ($object->isInitialized('created') && null !== $object->getCreated()) { + $data['Created'] = $object->getCreated(); + } + if ($object->isInitialized('path') && null !== $object->getPath()) { + $data['Path'] = $object->getPath(); + } + if ($object->isInitialized('args') && null !== $object->getArgs()) { + $values = []; + foreach ($object->getArgs() as $value) { + $values[] = $value; + } + $data['Args'] = $values; + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $this->normalizer->normalize($object->getState(), 'json', $context); + } + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); + } + if ($object->isInitialized('resolvConfPath') && null !== $object->getResolvConfPath()) { + $data['ResolvConfPath'] = $object->getResolvConfPath(); + } + if ($object->isInitialized('hostnamePath') && null !== $object->getHostnamePath()) { + $data['HostnamePath'] = $object->getHostnamePath(); + } + if ($object->isInitialized('hostsPath') && null !== $object->getHostsPath()) { + $data['HostsPath'] = $object->getHostsPath(); + } + if ($object->isInitialized('logPath') && null !== $object->getLogPath()) { + $data['LogPath'] = $object->getLogPath(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('restartCount') && null !== $object->getRestartCount()) { + $data['RestartCount'] = $object->getRestartCount(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('platform') && null !== $object->getPlatform()) { + $data['Platform'] = $object->getPlatform(); + } + if ($object->isInitialized('mountLabel') && null !== $object->getMountLabel()) { + $data['MountLabel'] = $object->getMountLabel(); + } + if ($object->isInitialized('processLabel') && null !== $object->getProcessLabel()) { + $data['ProcessLabel'] = $object->getProcessLabel(); + } + if ($object->isInitialized('appArmorProfile') && null !== $object->getAppArmorProfile()) { + $data['AppArmorProfile'] = $object->getAppArmorProfile(); + } + if ($object->isInitialized('execIDs') && null !== $object->getExecIDs()) { + $values_1 = []; + foreach ($object->getExecIDs() as $value_1) { + $values_1[] = $value_1; + } + $data['ExecIDs'] = $values_1; + } + if ($object->isInitialized('hostConfig') && null !== $object->getHostConfig()) { + $data['HostConfig'] = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); + } + if ($object->isInitialized('graphDriver') && null !== $object->getGraphDriver()) { + $data['GraphDriver'] = $this->normalizer->normalize($object->getGraphDriver(), 'json', $context); + } + if ($object->isInitialized('sizeRw') && null !== $object->getSizeRw()) { + $data['SizeRw'] = $object->getSizeRw(); + } + if ($object->isInitialized('sizeRootFs') && null !== $object->getSizeRootFs()) { + $data['SizeRootFs'] = $object->getSizeRootFs(); + } + if ($object->isInitialized('mounts') && null !== $object->getMounts()) { + $values_2 = []; + foreach ($object->getMounts() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['Mounts'] = $values_2; + } + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $data['Config'] = $this->normalizer->normalize($object->getConfig(), 'json', $context); + } + if ($object->isInitialized('networkSettings') && null !== $object->getNetworkSettings()) { + $data['NetworkSettings'] = $this->normalizer->normalize($object->getNetworkSettings(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdJsonGetResponse200::class => false]; + } + } +} else { + class ContainersIdJsonGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersIdJsonGetResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersIdJsonGetResponse200::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersIdJsonGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); + } + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); + } + if (\array_key_exists('Path', $data) && $data['Path'] !== null) { + $object->setPath($data['Path']); + } + elseif (\array_key_exists('Path', $data) && $data['Path'] === null) { + $object->setPath(null); + } + if (\array_key_exists('Args', $data) && $data['Args'] !== null) { + $values = []; + foreach ($data['Args'] as $value) { + $values[] = $value; + } + $object->setArgs($values); + } + elseif (\array_key_exists('Args', $data) && $data['Args'] === null) { + $object->setArgs(null); + } + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($this->denormalizer->denormalize($data['State'], \Docker\API\Model\ContainerState::class, 'json', $context)); + } + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); + } + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('ResolvConfPath', $data) && $data['ResolvConfPath'] !== null) { + $object->setResolvConfPath($data['ResolvConfPath']); + } + elseif (\array_key_exists('ResolvConfPath', $data) && $data['ResolvConfPath'] === null) { + $object->setResolvConfPath(null); + } + if (\array_key_exists('HostnamePath', $data) && $data['HostnamePath'] !== null) { + $object->setHostnamePath($data['HostnamePath']); + } + elseif (\array_key_exists('HostnamePath', $data) && $data['HostnamePath'] === null) { + $object->setHostnamePath(null); + } + if (\array_key_exists('HostsPath', $data) && $data['HostsPath'] !== null) { + $object->setHostsPath($data['HostsPath']); + } + elseif (\array_key_exists('HostsPath', $data) && $data['HostsPath'] === null) { + $object->setHostsPath(null); + } + if (\array_key_exists('LogPath', $data) && $data['LogPath'] !== null) { + $object->setLogPath($data['LogPath']); + } + elseif (\array_key_exists('LogPath', $data) && $data['LogPath'] === null) { + $object->setLogPath(null); + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('RestartCount', $data) && $data['RestartCount'] !== null) { + $object->setRestartCount($data['RestartCount']); + } + elseif (\array_key_exists('RestartCount', $data) && $data['RestartCount'] === null) { + $object->setRestartCount(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Platform', $data) && $data['Platform'] !== null) { + $object->setPlatform($data['Platform']); + } + elseif (\array_key_exists('Platform', $data) && $data['Platform'] === null) { + $object->setPlatform(null); + } + if (\array_key_exists('MountLabel', $data) && $data['MountLabel'] !== null) { + $object->setMountLabel($data['MountLabel']); + } + elseif (\array_key_exists('MountLabel', $data) && $data['MountLabel'] === null) { + $object->setMountLabel(null); + } + if (\array_key_exists('ProcessLabel', $data) && $data['ProcessLabel'] !== null) { + $object->setProcessLabel($data['ProcessLabel']); + } + elseif (\array_key_exists('ProcessLabel', $data) && $data['ProcessLabel'] === null) { + $object->setProcessLabel(null); + } + if (\array_key_exists('AppArmorProfile', $data) && $data['AppArmorProfile'] !== null) { + $object->setAppArmorProfile($data['AppArmorProfile']); + } + elseif (\array_key_exists('AppArmorProfile', $data) && $data['AppArmorProfile'] === null) { + $object->setAppArmorProfile(null); + } + if (\array_key_exists('ExecIDs', $data) && $data['ExecIDs'] !== null) { + $values_1 = []; + foreach ($data['ExecIDs'] as $value_1) { + $values_1[] = $value_1; + } + $object->setExecIDs($values_1); + } + elseif (\array_key_exists('ExecIDs', $data) && $data['ExecIDs'] === null) { + $object->setExecIDs(null); + } + if (\array_key_exists('HostConfig', $data) && $data['HostConfig'] !== null) { + $object->setHostConfig($this->denormalizer->denormalize($data['HostConfig'], \Docker\API\Model\HostConfig::class, 'json', $context)); + } + elseif (\array_key_exists('HostConfig', $data) && $data['HostConfig'] === null) { + $object->setHostConfig(null); + } + if (\array_key_exists('GraphDriver', $data) && $data['GraphDriver'] !== null) { + $object->setGraphDriver($this->denormalizer->denormalize($data['GraphDriver'], \Docker\API\Model\DriverData::class, 'json', $context)); + } + elseif (\array_key_exists('GraphDriver', $data) && $data['GraphDriver'] === null) { + $object->setGraphDriver(null); + } + if (\array_key_exists('SizeRw', $data) && $data['SizeRw'] !== null) { + $object->setSizeRw($data['SizeRw']); + } + elseif (\array_key_exists('SizeRw', $data) && $data['SizeRw'] === null) { + $object->setSizeRw(null); + } + if (\array_key_exists('SizeRootFs', $data) && $data['SizeRootFs'] !== null) { + $object->setSizeRootFs($data['SizeRootFs']); + } + elseif (\array_key_exists('SizeRootFs', $data) && $data['SizeRootFs'] === null) { + $object->setSizeRootFs(null); + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values_2 = []; + foreach ($data['Mounts'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\MountPoint::class, 'json', $context); + } + $object->setMounts($values_2); + } + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $object->setConfig($this->denormalizer->denormalize($data['Config'], \Docker\API\Model\ContainerConfig::class, 'json', $context)); + } + elseif (\array_key_exists('Config', $data) && $data['Config'] === null) { + $object->setConfig(null); + } + if (\array_key_exists('NetworkSettings', $data) && $data['NetworkSettings'] !== null) { + $object->setNetworkSettings($this->denormalizer->denormalize($data['NetworkSettings'], \Docker\API\Model\NetworkSettings::class, 'json', $context)); + } + elseif (\array_key_exists('NetworkSettings', $data) && $data['NetworkSettings'] === null) { + $object->setNetworkSettings(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); + } + if ($object->isInitialized('created') && null !== $object->getCreated()) { + $data['Created'] = $object->getCreated(); + } + if ($object->isInitialized('path') && null !== $object->getPath()) { + $data['Path'] = $object->getPath(); + } + if ($object->isInitialized('args') && null !== $object->getArgs()) { + $values = []; + foreach ($object->getArgs() as $value) { + $values[] = $value; + } + $data['Args'] = $values; + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $this->normalizer->normalize($object->getState(), 'json', $context); + } + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); + } + if ($object->isInitialized('resolvConfPath') && null !== $object->getResolvConfPath()) { + $data['ResolvConfPath'] = $object->getResolvConfPath(); + } + if ($object->isInitialized('hostnamePath') && null !== $object->getHostnamePath()) { + $data['HostnamePath'] = $object->getHostnamePath(); + } + if ($object->isInitialized('hostsPath') && null !== $object->getHostsPath()) { + $data['HostsPath'] = $object->getHostsPath(); + } + if ($object->isInitialized('logPath') && null !== $object->getLogPath()) { + $data['LogPath'] = $object->getLogPath(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('restartCount') && null !== $object->getRestartCount()) { + $data['RestartCount'] = $object->getRestartCount(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('platform') && null !== $object->getPlatform()) { + $data['Platform'] = $object->getPlatform(); + } + if ($object->isInitialized('mountLabel') && null !== $object->getMountLabel()) { + $data['MountLabel'] = $object->getMountLabel(); + } + if ($object->isInitialized('processLabel') && null !== $object->getProcessLabel()) { + $data['ProcessLabel'] = $object->getProcessLabel(); + } + if ($object->isInitialized('appArmorProfile') && null !== $object->getAppArmorProfile()) { + $data['AppArmorProfile'] = $object->getAppArmorProfile(); + } + if ($object->isInitialized('execIDs') && null !== $object->getExecIDs()) { + $values_1 = []; + foreach ($object->getExecIDs() as $value_1) { + $values_1[] = $value_1; + } + $data['ExecIDs'] = $values_1; + } + if ($object->isInitialized('hostConfig') && null !== $object->getHostConfig()) { + $data['HostConfig'] = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); + } + if ($object->isInitialized('graphDriver') && null !== $object->getGraphDriver()) { + $data['GraphDriver'] = $this->normalizer->normalize($object->getGraphDriver(), 'json', $context); + } + if ($object->isInitialized('sizeRw') && null !== $object->getSizeRw()) { + $data['SizeRw'] = $object->getSizeRw(); + } + if ($object->isInitialized('sizeRootFs') && null !== $object->getSizeRootFs()) { + $data['SizeRootFs'] = $object->getSizeRootFs(); + } + if ($object->isInitialized('mounts') && null !== $object->getMounts()) { + $values_2 = []; + foreach ($object->getMounts() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['Mounts'] = $values_2; + } + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $data['Config'] = $this->normalizer->normalize($object->getConfig(), 'json', $context); + } + if ($object->isInitialized('networkSettings') && null !== $object->getNetworkSettings()) { + $data['NetworkSettings'] = $this->normalizer->normalize($object->getNetworkSettings(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdJsonGetResponse200::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainersIdTopGetResponse200Normalizer.php b/generated/Normalizer/ContainersIdTopGetResponse200Normalizer.php new file mode 100644 index 00000000..888d5d60 --- /dev/null +++ b/generated/Normalizer/ContainersIdTopGetResponse200Normalizer.php @@ -0,0 +1,184 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainersIdTopGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersIdTopGetResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersIdTopGetResponse200::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersIdTopGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Titles', $data) && $data['Titles'] !== null) { + $values = []; + foreach ($data['Titles'] as $value) { + $values[] = $value; + } + $object->setTitles($values); + } + elseif (\array_key_exists('Titles', $data) && $data['Titles'] === null) { + $object->setTitles(null); + } + if (\array_key_exists('Processes', $data) && $data['Processes'] !== null) { + $values_1 = []; + foreach ($data['Processes'] as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $object->setProcesses($values_1); + } + elseif (\array_key_exists('Processes', $data) && $data['Processes'] === null) { + $object->setProcesses(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('titles') && null !== $object->getTitles()) { + $values = []; + foreach ($object->getTitles() as $value) { + $values[] = $value; + } + $data['Titles'] = $values; + } + if ($object->isInitialized('processes') && null !== $object->getProcesses()) { + $values_1 = []; + foreach ($object->getProcesses() as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $data['Processes'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdTopGetResponse200::class => false]; + } + } +} else { + class ContainersIdTopGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersIdTopGetResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersIdTopGetResponse200::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersIdTopGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Titles', $data) && $data['Titles'] !== null) { + $values = []; + foreach ($data['Titles'] as $value) { + $values[] = $value; + } + $object->setTitles($values); + } + elseif (\array_key_exists('Titles', $data) && $data['Titles'] === null) { + $object->setTitles(null); + } + if (\array_key_exists('Processes', $data) && $data['Processes'] !== null) { + $values_1 = []; + foreach ($data['Processes'] as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $object->setProcesses($values_1); + } + elseif (\array_key_exists('Processes', $data) && $data['Processes'] === null) { + $object->setProcesses(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('titles') && null !== $object->getTitles()) { + $values = []; + foreach ($object->getTitles() as $value) { + $values[] = $value; + } + $data['Titles'] = $values; + } + if ($object->isInitialized('processes') && null !== $object->getProcesses()) { + $values_1 = []; + foreach ($object->getProcesses() as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $data['Processes'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdTopGetResponse200::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainersIdUpdatePostBodyNormalizer.php b/generated/Normalizer/ContainersIdUpdatePostBodyNormalizer.php new file mode 100644 index 00000000..e1ac073b --- /dev/null +++ b/generated/Normalizer/ContainersIdUpdatePostBodyNormalizer.php @@ -0,0 +1,820 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainersIdUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersIdUpdatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersIdUpdatePostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersIdUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CpuShares', $data) && $data['CpuShares'] !== null) { + $object->setCpuShares($data['CpuShares']); + } + elseif (\array_key_exists('CpuShares', $data) && $data['CpuShares'] === null) { + $object->setCpuShares(null); + } + if (\array_key_exists('Memory', $data) && $data['Memory'] !== null) { + $object->setMemory($data['Memory']); + } + elseif (\array_key_exists('Memory', $data) && $data['Memory'] === null) { + $object->setMemory(null); + } + if (\array_key_exists('CgroupParent', $data) && $data['CgroupParent'] !== null) { + $object->setCgroupParent($data['CgroupParent']); + } + elseif (\array_key_exists('CgroupParent', $data) && $data['CgroupParent'] === null) { + $object->setCgroupParent(null); + } + if (\array_key_exists('BlkioWeight', $data) && $data['BlkioWeight'] !== null) { + $object->setBlkioWeight($data['BlkioWeight']); + } + elseif (\array_key_exists('BlkioWeight', $data) && $data['BlkioWeight'] === null) { + $object->setBlkioWeight(null); + } + if (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] !== null) { + $values = []; + foreach ($data['BlkioWeightDevice'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class, 'json', $context); + } + $object->setBlkioWeightDevice($values); + } + elseif (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] === null) { + $object->setBlkioWeightDevice(null); + } + if (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] !== null) { + $values_1 = []; + foreach ($data['BlkioDeviceReadBps'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceReadBps($values_1); + } + elseif (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] === null) { + $object->setBlkioDeviceReadBps(null); + } + if (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] !== null) { + $values_2 = []; + foreach ($data['BlkioDeviceWriteBps'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceWriteBps($values_2); + } + elseif (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] === null) { + $object->setBlkioDeviceWriteBps(null); + } + if (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] !== null) { + $values_3 = []; + foreach ($data['BlkioDeviceReadIOps'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceReadIOps($values_3); + } + elseif (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] === null) { + $object->setBlkioDeviceReadIOps(null); + } + if (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] !== null) { + $values_4 = []; + foreach ($data['BlkioDeviceWriteIOps'] as $value_4) { + $values_4[] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceWriteIOps($values_4); + } + elseif (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] === null) { + $object->setBlkioDeviceWriteIOps(null); + } + if (\array_key_exists('CpuPeriod', $data) && $data['CpuPeriod'] !== null) { + $object->setCpuPeriod($data['CpuPeriod']); + } + elseif (\array_key_exists('CpuPeriod', $data) && $data['CpuPeriod'] === null) { + $object->setCpuPeriod(null); + } + if (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] !== null) { + $object->setCpuQuota($data['CpuQuota']); + } + elseif (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] === null) { + $object->setCpuQuota(null); + } + if (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] !== null) { + $object->setCpuRealtimePeriod($data['CpuRealtimePeriod']); + } + elseif (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] === null) { + $object->setCpuRealtimePeriod(null); + } + if (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] !== null) { + $object->setCpuRealtimeRuntime($data['CpuRealtimeRuntime']); + } + elseif (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] === null) { + $object->setCpuRealtimeRuntime(null); + } + if (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] !== null) { + $object->setCpusetCpus($data['CpusetCpus']); + } + elseif (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] === null) { + $object->setCpusetCpus(null); + } + if (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] !== null) { + $object->setCpusetMems($data['CpusetMems']); + } + elseif (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] === null) { + $object->setCpusetMems(null); + } + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { + $values_5 = []; + foreach ($data['Devices'] as $value_5) { + $values_5[] = $this->denormalizer->denormalize($value_5, \Docker\API\Model\DeviceMapping::class, 'json', $context); + } + $object->setDevices($values_5); + } + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } + if (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] !== null) { + $values_6 = []; + foreach ($data['DeviceCgroupRules'] as $value_6) { + $values_6[] = $value_6; + } + $object->setDeviceCgroupRules($values_6); + } + elseif (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] === null) { + $object->setDeviceCgroupRules(null); + } + if (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] !== null) { + $values_7 = []; + foreach ($data['DeviceRequests'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, \Docker\API\Model\DeviceRequest::class, 'json', $context); + } + $object->setDeviceRequests($values_7); + } + elseif (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] === null) { + $object->setDeviceRequests(null); + } + if (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] !== null) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); + } + elseif (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] === null) { + $object->setKernelMemoryTCP(null); + } + if (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] !== null) { + $object->setMemoryReservation($data['MemoryReservation']); + } + elseif (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] === null) { + $object->setMemoryReservation(null); + } + if (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] !== null) { + $object->setMemorySwap($data['MemorySwap']); + } + elseif (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] === null) { + $object->setMemorySwap(null); + } + if (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] !== null) { + $object->setMemorySwappiness($data['MemorySwappiness']); + } + elseif (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] === null) { + $object->setMemorySwappiness(null); + } + if (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] !== null) { + $object->setNanoCpus($data['NanoCpus']); + } + elseif (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] === null) { + $object->setNanoCpus(null); + } + if (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] !== null) { + $object->setOomKillDisable($data['OomKillDisable']); + } + elseif (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] === null) { + $object->setOomKillDisable(null); + } + if (\array_key_exists('Init', $data) && $data['Init'] !== null) { + $object->setInit($data['Init']); + } + elseif (\array_key_exists('Init', $data) && $data['Init'] === null) { + $object->setInit(null); + } + if (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] !== null) { + $object->setPidsLimit($data['PidsLimit']); + } + elseif (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] === null) { + $object->setPidsLimit(null); + } + if (\array_key_exists('Ulimits', $data) && $data['Ulimits'] !== null) { + $values_8 = []; + foreach ($data['Ulimits'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, \Docker\API\Model\ResourcesUlimitsItem::class, 'json', $context); + } + $object->setUlimits($values_8); + } + elseif (\array_key_exists('Ulimits', $data) && $data['Ulimits'] === null) { + $object->setUlimits(null); + } + if (\array_key_exists('CpuCount', $data) && $data['CpuCount'] !== null) { + $object->setCpuCount($data['CpuCount']); + } + elseif (\array_key_exists('CpuCount', $data) && $data['CpuCount'] === null) { + $object->setCpuCount(null); + } + if (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] !== null) { + $object->setCpuPercent($data['CpuPercent']); + } + elseif (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] === null) { + $object->setCpuPercent(null); + } + if (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] !== null) { + $object->setIOMaximumIOps($data['IOMaximumIOps']); + } + elseif (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] === null) { + $object->setIOMaximumIOps(null); + } + if (\array_key_exists('IOMaximumBandwidth', $data) && $data['IOMaximumBandwidth'] !== null) { + $object->setIOMaximumBandwidth($data['IOMaximumBandwidth']); + } + elseif (\array_key_exists('IOMaximumBandwidth', $data) && $data['IOMaximumBandwidth'] === null) { + $object->setIOMaximumBandwidth(null); + } + if (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] !== null) { + $object->setRestartPolicy($this->denormalizer->denormalize($data['RestartPolicy'], \Docker\API\Model\RestartPolicy::class, 'json', $context)); + } + elseif (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] === null) { + $object->setRestartPolicy(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('cpuShares') && null !== $object->getCpuShares()) { + $data['CpuShares'] = $object->getCpuShares(); + } + if ($object->isInitialized('memory') && null !== $object->getMemory()) { + $data['Memory'] = $object->getMemory(); + } + if ($object->isInitialized('cgroupParent') && null !== $object->getCgroupParent()) { + $data['CgroupParent'] = $object->getCgroupParent(); + } + if ($object->isInitialized('blkioWeight') && null !== $object->getBlkioWeight()) { + $data['BlkioWeight'] = $object->getBlkioWeight(); + } + if ($object->isInitialized('blkioWeightDevice') && null !== $object->getBlkioWeightDevice()) { + $values = []; + foreach ($object->getBlkioWeightDevice() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['BlkioWeightDevice'] = $values; + } + if ($object->isInitialized('blkioDeviceReadBps') && null !== $object->getBlkioDeviceReadBps()) { + $values_1 = []; + foreach ($object->getBlkioDeviceReadBps() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['BlkioDeviceReadBps'] = $values_1; + } + if ($object->isInitialized('blkioDeviceWriteBps') && null !== $object->getBlkioDeviceWriteBps()) { + $values_2 = []; + foreach ($object->getBlkioDeviceWriteBps() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['BlkioDeviceWriteBps'] = $values_2; + } + if ($object->isInitialized('blkioDeviceReadIOps') && null !== $object->getBlkioDeviceReadIOps()) { + $values_3 = []; + foreach ($object->getBlkioDeviceReadIOps() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['BlkioDeviceReadIOps'] = $values_3; + } + if ($object->isInitialized('blkioDeviceWriteIOps') && null !== $object->getBlkioDeviceWriteIOps()) { + $values_4 = []; + foreach ($object->getBlkioDeviceWriteIOps() as $value_4) { + $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); + } + $data['BlkioDeviceWriteIOps'] = $values_4; + } + if ($object->isInitialized('cpuPeriod') && null !== $object->getCpuPeriod()) { + $data['CpuPeriod'] = $object->getCpuPeriod(); + } + if ($object->isInitialized('cpuQuota') && null !== $object->getCpuQuota()) { + $data['CpuQuota'] = $object->getCpuQuota(); + } + if ($object->isInitialized('cpuRealtimePeriod') && null !== $object->getCpuRealtimePeriod()) { + $data['CpuRealtimePeriod'] = $object->getCpuRealtimePeriod(); + } + if ($object->isInitialized('cpuRealtimeRuntime') && null !== $object->getCpuRealtimeRuntime()) { + $data['CpuRealtimeRuntime'] = $object->getCpuRealtimeRuntime(); + } + if ($object->isInitialized('cpusetCpus') && null !== $object->getCpusetCpus()) { + $data['CpusetCpus'] = $object->getCpusetCpus(); + } + if ($object->isInitialized('cpusetMems') && null !== $object->getCpusetMems()) { + $data['CpusetMems'] = $object->getCpusetMems(); + } + if ($object->isInitialized('devices') && null !== $object->getDevices()) { + $values_5 = []; + foreach ($object->getDevices() as $value_5) { + $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); + } + $data['Devices'] = $values_5; + } + if ($object->isInitialized('deviceCgroupRules') && null !== $object->getDeviceCgroupRules()) { + $values_6 = []; + foreach ($object->getDeviceCgroupRules() as $value_6) { + $values_6[] = $value_6; + } + $data['DeviceCgroupRules'] = $values_6; + } + if ($object->isInitialized('deviceRequests') && null !== $object->getDeviceRequests()) { + $values_7 = []; + foreach ($object->getDeviceRequests() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $data['DeviceRequests'] = $values_7; + } + if ($object->isInitialized('kernelMemoryTCP') && null !== $object->getKernelMemoryTCP()) { + $data['KernelMemoryTCP'] = $object->getKernelMemoryTCP(); + } + if ($object->isInitialized('memoryReservation') && null !== $object->getMemoryReservation()) { + $data['MemoryReservation'] = $object->getMemoryReservation(); + } + if ($object->isInitialized('memorySwap') && null !== $object->getMemorySwap()) { + $data['MemorySwap'] = $object->getMemorySwap(); + } + if ($object->isInitialized('memorySwappiness') && null !== $object->getMemorySwappiness()) { + $data['MemorySwappiness'] = $object->getMemorySwappiness(); + } + if ($object->isInitialized('nanoCpus') && null !== $object->getNanoCpus()) { + $data['NanoCpus'] = $object->getNanoCpus(); + } + if ($object->isInitialized('oomKillDisable') && null !== $object->getOomKillDisable()) { + $data['OomKillDisable'] = $object->getOomKillDisable(); + } + if ($object->isInitialized('init') && null !== $object->getInit()) { + $data['Init'] = $object->getInit(); + } + if ($object->isInitialized('pidsLimit') && null !== $object->getPidsLimit()) { + $data['PidsLimit'] = $object->getPidsLimit(); + } + if ($object->isInitialized('ulimits') && null !== $object->getUlimits()) { + $values_8 = []; + foreach ($object->getUlimits() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); + } + $data['Ulimits'] = $values_8; + } + if ($object->isInitialized('cpuCount') && null !== $object->getCpuCount()) { + $data['CpuCount'] = $object->getCpuCount(); + } + if ($object->isInitialized('cpuPercent') && null !== $object->getCpuPercent()) { + $data['CpuPercent'] = $object->getCpuPercent(); + } + if ($object->isInitialized('iOMaximumIOps') && null !== $object->getIOMaximumIOps()) { + $data['IOMaximumIOps'] = $object->getIOMaximumIOps(); + } + if ($object->isInitialized('iOMaximumBandwidth') && null !== $object->getIOMaximumBandwidth()) { + $data['IOMaximumBandwidth'] = $object->getIOMaximumBandwidth(); + } + if ($object->isInitialized('restartPolicy') && null !== $object->getRestartPolicy()) { + $data['RestartPolicy'] = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdUpdatePostBody::class => false]; + } + } +} else { + class ContainersIdUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersIdUpdatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersIdUpdatePostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersIdUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CpuShares', $data) && $data['CpuShares'] !== null) { + $object->setCpuShares($data['CpuShares']); + } + elseif (\array_key_exists('CpuShares', $data) && $data['CpuShares'] === null) { + $object->setCpuShares(null); + } + if (\array_key_exists('Memory', $data) && $data['Memory'] !== null) { + $object->setMemory($data['Memory']); + } + elseif (\array_key_exists('Memory', $data) && $data['Memory'] === null) { + $object->setMemory(null); + } + if (\array_key_exists('CgroupParent', $data) && $data['CgroupParent'] !== null) { + $object->setCgroupParent($data['CgroupParent']); + } + elseif (\array_key_exists('CgroupParent', $data) && $data['CgroupParent'] === null) { + $object->setCgroupParent(null); + } + if (\array_key_exists('BlkioWeight', $data) && $data['BlkioWeight'] !== null) { + $object->setBlkioWeight($data['BlkioWeight']); + } + elseif (\array_key_exists('BlkioWeight', $data) && $data['BlkioWeight'] === null) { + $object->setBlkioWeight(null); + } + if (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] !== null) { + $values = []; + foreach ($data['BlkioWeightDevice'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class, 'json', $context); + } + $object->setBlkioWeightDevice($values); + } + elseif (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] === null) { + $object->setBlkioWeightDevice(null); + } + if (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] !== null) { + $values_1 = []; + foreach ($data['BlkioDeviceReadBps'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceReadBps($values_1); + } + elseif (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] === null) { + $object->setBlkioDeviceReadBps(null); + } + if (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] !== null) { + $values_2 = []; + foreach ($data['BlkioDeviceWriteBps'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceWriteBps($values_2); + } + elseif (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] === null) { + $object->setBlkioDeviceWriteBps(null); + } + if (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] !== null) { + $values_3 = []; + foreach ($data['BlkioDeviceReadIOps'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceReadIOps($values_3); + } + elseif (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] === null) { + $object->setBlkioDeviceReadIOps(null); + } + if (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] !== null) { + $values_4 = []; + foreach ($data['BlkioDeviceWriteIOps'] as $value_4) { + $values_4[] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceWriteIOps($values_4); + } + elseif (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] === null) { + $object->setBlkioDeviceWriteIOps(null); + } + if (\array_key_exists('CpuPeriod', $data) && $data['CpuPeriod'] !== null) { + $object->setCpuPeriod($data['CpuPeriod']); + } + elseif (\array_key_exists('CpuPeriod', $data) && $data['CpuPeriod'] === null) { + $object->setCpuPeriod(null); + } + if (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] !== null) { + $object->setCpuQuota($data['CpuQuota']); + } + elseif (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] === null) { + $object->setCpuQuota(null); + } + if (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] !== null) { + $object->setCpuRealtimePeriod($data['CpuRealtimePeriod']); + } + elseif (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] === null) { + $object->setCpuRealtimePeriod(null); + } + if (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] !== null) { + $object->setCpuRealtimeRuntime($data['CpuRealtimeRuntime']); + } + elseif (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] === null) { + $object->setCpuRealtimeRuntime(null); + } + if (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] !== null) { + $object->setCpusetCpus($data['CpusetCpus']); + } + elseif (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] === null) { + $object->setCpusetCpus(null); + } + if (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] !== null) { + $object->setCpusetMems($data['CpusetMems']); + } + elseif (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] === null) { + $object->setCpusetMems(null); + } + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { + $values_5 = []; + foreach ($data['Devices'] as $value_5) { + $values_5[] = $this->denormalizer->denormalize($value_5, \Docker\API\Model\DeviceMapping::class, 'json', $context); + } + $object->setDevices($values_5); + } + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } + if (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] !== null) { + $values_6 = []; + foreach ($data['DeviceCgroupRules'] as $value_6) { + $values_6[] = $value_6; + } + $object->setDeviceCgroupRules($values_6); + } + elseif (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] === null) { + $object->setDeviceCgroupRules(null); + } + if (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] !== null) { + $values_7 = []; + foreach ($data['DeviceRequests'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, \Docker\API\Model\DeviceRequest::class, 'json', $context); + } + $object->setDeviceRequests($values_7); + } + elseif (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] === null) { + $object->setDeviceRequests(null); + } + if (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] !== null) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); + } + elseif (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] === null) { + $object->setKernelMemoryTCP(null); + } + if (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] !== null) { + $object->setMemoryReservation($data['MemoryReservation']); + } + elseif (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] === null) { + $object->setMemoryReservation(null); + } + if (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] !== null) { + $object->setMemorySwap($data['MemorySwap']); + } + elseif (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] === null) { + $object->setMemorySwap(null); + } + if (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] !== null) { + $object->setMemorySwappiness($data['MemorySwappiness']); + } + elseif (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] === null) { + $object->setMemorySwappiness(null); + } + if (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] !== null) { + $object->setNanoCpus($data['NanoCpus']); + } + elseif (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] === null) { + $object->setNanoCpus(null); + } + if (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] !== null) { + $object->setOomKillDisable($data['OomKillDisable']); + } + elseif (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] === null) { + $object->setOomKillDisable(null); + } + if (\array_key_exists('Init', $data) && $data['Init'] !== null) { + $object->setInit($data['Init']); + } + elseif (\array_key_exists('Init', $data) && $data['Init'] === null) { + $object->setInit(null); + } + if (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] !== null) { + $object->setPidsLimit($data['PidsLimit']); + } + elseif (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] === null) { + $object->setPidsLimit(null); + } + if (\array_key_exists('Ulimits', $data) && $data['Ulimits'] !== null) { + $values_8 = []; + foreach ($data['Ulimits'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, \Docker\API\Model\ResourcesUlimitsItem::class, 'json', $context); + } + $object->setUlimits($values_8); + } + elseif (\array_key_exists('Ulimits', $data) && $data['Ulimits'] === null) { + $object->setUlimits(null); + } + if (\array_key_exists('CpuCount', $data) && $data['CpuCount'] !== null) { + $object->setCpuCount($data['CpuCount']); + } + elseif (\array_key_exists('CpuCount', $data) && $data['CpuCount'] === null) { + $object->setCpuCount(null); + } + if (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] !== null) { + $object->setCpuPercent($data['CpuPercent']); + } + elseif (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] === null) { + $object->setCpuPercent(null); + } + if (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] !== null) { + $object->setIOMaximumIOps($data['IOMaximumIOps']); + } + elseif (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] === null) { + $object->setIOMaximumIOps(null); + } + if (\array_key_exists('IOMaximumBandwidth', $data) && $data['IOMaximumBandwidth'] !== null) { + $object->setIOMaximumBandwidth($data['IOMaximumBandwidth']); + } + elseif (\array_key_exists('IOMaximumBandwidth', $data) && $data['IOMaximumBandwidth'] === null) { + $object->setIOMaximumBandwidth(null); + } + if (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] !== null) { + $object->setRestartPolicy($this->denormalizer->denormalize($data['RestartPolicy'], \Docker\API\Model\RestartPolicy::class, 'json', $context)); + } + elseif (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] === null) { + $object->setRestartPolicy(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('cpuShares') && null !== $object->getCpuShares()) { + $data['CpuShares'] = $object->getCpuShares(); + } + if ($object->isInitialized('memory') && null !== $object->getMemory()) { + $data['Memory'] = $object->getMemory(); + } + if ($object->isInitialized('cgroupParent') && null !== $object->getCgroupParent()) { + $data['CgroupParent'] = $object->getCgroupParent(); + } + if ($object->isInitialized('blkioWeight') && null !== $object->getBlkioWeight()) { + $data['BlkioWeight'] = $object->getBlkioWeight(); + } + if ($object->isInitialized('blkioWeightDevice') && null !== $object->getBlkioWeightDevice()) { + $values = []; + foreach ($object->getBlkioWeightDevice() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['BlkioWeightDevice'] = $values; + } + if ($object->isInitialized('blkioDeviceReadBps') && null !== $object->getBlkioDeviceReadBps()) { + $values_1 = []; + foreach ($object->getBlkioDeviceReadBps() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['BlkioDeviceReadBps'] = $values_1; + } + if ($object->isInitialized('blkioDeviceWriteBps') && null !== $object->getBlkioDeviceWriteBps()) { + $values_2 = []; + foreach ($object->getBlkioDeviceWriteBps() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['BlkioDeviceWriteBps'] = $values_2; + } + if ($object->isInitialized('blkioDeviceReadIOps') && null !== $object->getBlkioDeviceReadIOps()) { + $values_3 = []; + foreach ($object->getBlkioDeviceReadIOps() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['BlkioDeviceReadIOps'] = $values_3; + } + if ($object->isInitialized('blkioDeviceWriteIOps') && null !== $object->getBlkioDeviceWriteIOps()) { + $values_4 = []; + foreach ($object->getBlkioDeviceWriteIOps() as $value_4) { + $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); + } + $data['BlkioDeviceWriteIOps'] = $values_4; + } + if ($object->isInitialized('cpuPeriod') && null !== $object->getCpuPeriod()) { + $data['CpuPeriod'] = $object->getCpuPeriod(); + } + if ($object->isInitialized('cpuQuota') && null !== $object->getCpuQuota()) { + $data['CpuQuota'] = $object->getCpuQuota(); + } + if ($object->isInitialized('cpuRealtimePeriod') && null !== $object->getCpuRealtimePeriod()) { + $data['CpuRealtimePeriod'] = $object->getCpuRealtimePeriod(); + } + if ($object->isInitialized('cpuRealtimeRuntime') && null !== $object->getCpuRealtimeRuntime()) { + $data['CpuRealtimeRuntime'] = $object->getCpuRealtimeRuntime(); + } + if ($object->isInitialized('cpusetCpus') && null !== $object->getCpusetCpus()) { + $data['CpusetCpus'] = $object->getCpusetCpus(); + } + if ($object->isInitialized('cpusetMems') && null !== $object->getCpusetMems()) { + $data['CpusetMems'] = $object->getCpusetMems(); + } + if ($object->isInitialized('devices') && null !== $object->getDevices()) { + $values_5 = []; + foreach ($object->getDevices() as $value_5) { + $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); + } + $data['Devices'] = $values_5; + } + if ($object->isInitialized('deviceCgroupRules') && null !== $object->getDeviceCgroupRules()) { + $values_6 = []; + foreach ($object->getDeviceCgroupRules() as $value_6) { + $values_6[] = $value_6; + } + $data['DeviceCgroupRules'] = $values_6; + } + if ($object->isInitialized('deviceRequests') && null !== $object->getDeviceRequests()) { + $values_7 = []; + foreach ($object->getDeviceRequests() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $data['DeviceRequests'] = $values_7; + } + if ($object->isInitialized('kernelMemoryTCP') && null !== $object->getKernelMemoryTCP()) { + $data['KernelMemoryTCP'] = $object->getKernelMemoryTCP(); + } + if ($object->isInitialized('memoryReservation') && null !== $object->getMemoryReservation()) { + $data['MemoryReservation'] = $object->getMemoryReservation(); + } + if ($object->isInitialized('memorySwap') && null !== $object->getMemorySwap()) { + $data['MemorySwap'] = $object->getMemorySwap(); + } + if ($object->isInitialized('memorySwappiness') && null !== $object->getMemorySwappiness()) { + $data['MemorySwappiness'] = $object->getMemorySwappiness(); + } + if ($object->isInitialized('nanoCpus') && null !== $object->getNanoCpus()) { + $data['NanoCpus'] = $object->getNanoCpus(); + } + if ($object->isInitialized('oomKillDisable') && null !== $object->getOomKillDisable()) { + $data['OomKillDisable'] = $object->getOomKillDisable(); + } + if ($object->isInitialized('init') && null !== $object->getInit()) { + $data['Init'] = $object->getInit(); + } + if ($object->isInitialized('pidsLimit') && null !== $object->getPidsLimit()) { + $data['PidsLimit'] = $object->getPidsLimit(); + } + if ($object->isInitialized('ulimits') && null !== $object->getUlimits()) { + $values_8 = []; + foreach ($object->getUlimits() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); + } + $data['Ulimits'] = $values_8; + } + if ($object->isInitialized('cpuCount') && null !== $object->getCpuCount()) { + $data['CpuCount'] = $object->getCpuCount(); + } + if ($object->isInitialized('cpuPercent') && null !== $object->getCpuPercent()) { + $data['CpuPercent'] = $object->getCpuPercent(); + } + if ($object->isInitialized('iOMaximumIOps') && null !== $object->getIOMaximumIOps()) { + $data['IOMaximumIOps'] = $object->getIOMaximumIOps(); + } + if ($object->isInitialized('iOMaximumBandwidth') && null !== $object->getIOMaximumBandwidth()) { + $data['IOMaximumBandwidth'] = $object->getIOMaximumBandwidth(); + } + if ($object->isInitialized('restartPolicy') && null !== $object->getRestartPolicy()) { + $data['RestartPolicy'] = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdUpdatePostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainersIdUpdatePostResponse200Normalizer.php b/generated/Normalizer/ContainersIdUpdatePostResponse200Normalizer.php new file mode 100644 index 00000000..30d5afe8 --- /dev/null +++ b/generated/Normalizer/ContainersIdUpdatePostResponse200Normalizer.php @@ -0,0 +1,134 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainersIdUpdatePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersIdUpdatePostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersIdUpdatePostResponse200::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersIdUpdatePostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values = []; + foreach ($data['Warnings'] as $value) { + $values[] = $value; + } + $object->setWarnings($values); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values = []; + foreach ($object->getWarnings() as $value) { + $values[] = $value; + } + $data['Warnings'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdUpdatePostResponse200::class => false]; + } + } +} else { + class ContainersIdUpdatePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersIdUpdatePostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersIdUpdatePostResponse200::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersIdUpdatePostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values = []; + foreach ($data['Warnings'] as $value) { + $values[] = $value; + } + $object->setWarnings($values); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values = []; + foreach ($object->getWarnings() as $value) { + $values[] = $value; + } + $data['Warnings'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdUpdatePostResponse200::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ContainersPrunePostResponse200Normalizer.php b/generated/Normalizer/ContainersPrunePostResponse200Normalizer.php new file mode 100644 index 00000000..8eb1abd0 --- /dev/null +++ b/generated/Normalizer/ContainersPrunePostResponse200Normalizer.php @@ -0,0 +1,152 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContainersPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersPrunePostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersPrunePostResponse200::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersPrunePostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ContainersDeleted', $data) && $data['ContainersDeleted'] !== null) { + $values = []; + foreach ($data['ContainersDeleted'] as $value) { + $values[] = $value; + } + $object->setContainersDeleted($values); + } + elseif (\array_key_exists('ContainersDeleted', $data) && $data['ContainersDeleted'] === null) { + $object->setContainersDeleted(null); + } + if (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] !== null) { + $object->setSpaceReclaimed($data['SpaceReclaimed']); + } + elseif (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] === null) { + $object->setSpaceReclaimed(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('containersDeleted') && null !== $object->getContainersDeleted()) { + $values = []; + foreach ($object->getContainersDeleted() as $value) { + $values[] = $value; + } + $data['ContainersDeleted'] = $values; + } + if ($object->isInitialized('spaceReclaimed') && null !== $object->getSpaceReclaimed()) { + $data['SpaceReclaimed'] = $object->getSpaceReclaimed(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersPrunePostResponse200::class => false]; + } + } +} else { + class ContainersPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ContainersPrunePostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ContainersPrunePostResponse200::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ContainersPrunePostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ContainersDeleted', $data) && $data['ContainersDeleted'] !== null) { + $values = []; + foreach ($data['ContainersDeleted'] as $value) { + $values[] = $value; + } + $object->setContainersDeleted($values); + } + elseif (\array_key_exists('ContainersDeleted', $data) && $data['ContainersDeleted'] === null) { + $object->setContainersDeleted(null); + } + if (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] !== null) { + $object->setSpaceReclaimed($data['SpaceReclaimed']); + } + elseif (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] === null) { + $object->setSpaceReclaimed(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('containersDeleted') && null !== $object->getContainersDeleted()) { + $values = []; + foreach ($object->getContainersDeleted() as $value) { + $values[] = $value; + } + $data['ContainersDeleted'] = $values; + } + if ($object->isInitialized('spaceReclaimed') && null !== $object->getSpaceReclaimed()) { + $data['SpaceReclaimed'] = $object->getSpaceReclaimed(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersPrunePostResponse200::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/CreateImageInfoNormalizer.php b/generated/Normalizer/CreateImageInfoNormalizer.php index 23db4def..02243a57 100644 --- a/generated/Normalizer/CreateImageInfoNormalizer.php +++ b/generated/Normalizer/CreateImageInfoNormalizer.php @@ -2,80 +2,207 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class CreateImageInfoNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\CreateImageInfo') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\CreateImageInfo) { - return true; - } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CreateImageInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\CreateImageInfo(); - if (property_exists($data, 'id')) { - $object->setId($data->{'id'}); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\CreateImageInfo::class; } - if (property_exists($data, 'error')) { - $object->setError($data->{'error'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\CreateImageInfo::class; } - if (property_exists($data, 'status')) { - $object->setStatus($data->{'status'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\CreateImageInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && $data['id'] !== null) { + $object->setId($data['id']); + } + elseif (\array_key_exists('id', $data) && $data['id'] === null) { + $object->setId(null); + } + if (\array_key_exists('error', $data) && $data['error'] !== null) { + $object->setError($data['error']); + } + elseif (\array_key_exists('error', $data) && $data['error'] === null) { + $object->setError(null); + } + if (\array_key_exists('errorDetail', $data) && $data['errorDetail'] !== null) { + $object->setErrorDetail($this->denormalizer->denormalize($data['errorDetail'], \Docker\API\Model\ErrorDetail::class, 'json', $context)); + } + elseif (\array_key_exists('errorDetail', $data) && $data['errorDetail'] === null) { + $object->setErrorDetail(null); + } + if (\array_key_exists('status', $data) && $data['status'] !== null) { + $object->setStatus($data['status']); + } + elseif (\array_key_exists('status', $data) && $data['status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('progress', $data) && $data['progress'] !== null) { + $object->setProgress($data['progress']); + } + elseif (\array_key_exists('progress', $data) && $data['progress'] === null) { + $object->setProgress(null); + } + if (\array_key_exists('progressDetail', $data) && $data['progressDetail'] !== null) { + $object->setProgressDetail($this->denormalizer->denormalize($data['progressDetail'], \Docker\API\Model\ProgressDetail::class, 'json', $context)); + } + elseif (\array_key_exists('progressDetail', $data) && $data['progressDetail'] === null) { + $object->setProgressDetail(null); + } + return $object; } - if (property_exists($data, 'progress')) { - $object->setProgress($data->{'progress'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['error'] = $object->getError(); + } + if ($object->isInitialized('errorDetail') && null !== $object->getErrorDetail()) { + $data['errorDetail'] = $this->normalizer->normalize($object->getErrorDetail(), 'json', $context); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['status'] = $object->getStatus(); + } + if ($object->isInitialized('progress') && null !== $object->getProgress()) { + $data['progress'] = $object->getProgress(); + } + if ($object->isInitialized('progressDetail') && null !== $object->getProgressDetail()) { + $data['progressDetail'] = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); + } + return $data; } - if (property_exists($data, 'progressDetail')) { - $object->setProgressDetail($this->serializer->denormalize($data->{'progressDetail'}, 'Docker\\API\\Model\\ProgressDetail', 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\CreateImageInfo::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class CreateImageInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'id'} = $object->getId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\CreateImageInfo::class; } - if (null !== $object->getError()) { - $data->{'error'} = $object->getError(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\CreateImageInfo::class; } - if (null !== $object->getStatus()) { - $data->{'status'} = $object->getStatus(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\CreateImageInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && $data['id'] !== null) { + $object->setId($data['id']); + } + elseif (\array_key_exists('id', $data) && $data['id'] === null) { + $object->setId(null); + } + if (\array_key_exists('error', $data) && $data['error'] !== null) { + $object->setError($data['error']); + } + elseif (\array_key_exists('error', $data) && $data['error'] === null) { + $object->setError(null); + } + if (\array_key_exists('errorDetail', $data) && $data['errorDetail'] !== null) { + $object->setErrorDetail($this->denormalizer->denormalize($data['errorDetail'], \Docker\API\Model\ErrorDetail::class, 'json', $context)); + } + elseif (\array_key_exists('errorDetail', $data) && $data['errorDetail'] === null) { + $object->setErrorDetail(null); + } + if (\array_key_exists('status', $data) && $data['status'] !== null) { + $object->setStatus($data['status']); + } + elseif (\array_key_exists('status', $data) && $data['status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('progress', $data) && $data['progress'] !== null) { + $object->setProgress($data['progress']); + } + elseif (\array_key_exists('progress', $data) && $data['progress'] === null) { + $object->setProgress(null); + } + if (\array_key_exists('progressDetail', $data) && $data['progressDetail'] !== null) { + $object->setProgressDetail($this->denormalizer->denormalize($data['progressDetail'], \Docker\API\Model\ProgressDetail::class, 'json', $context)); + } + elseif (\array_key_exists('progressDetail', $data) && $data['progressDetail'] === null) { + $object->setProgressDetail(null); + } + return $object; } - if (null !== $object->getProgress()) { - $data->{'progress'} = $object->getProgress(); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['error'] = $object->getError(); + } + if ($object->isInitialized('errorDetail') && null !== $object->getErrorDetail()) { + $data['errorDetail'] = $this->normalizer->normalize($object->getErrorDetail(), 'json', $context); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['status'] = $object->getStatus(); + } + if ($object->isInitialized('progress') && null !== $object->getProgress()) { + $data['progress'] = $object->getProgress(); + } + if ($object->isInitialized('progressDetail') && null !== $object->getProgressDetail()) { + $data['progressDetail'] = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); + } + return $data; } - if (null !== $object->getProgressDetail()) { - $data->{'progressDetail'} = json_decode($this->serializer->normalize($object->getProgressDetail(), 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\CreateImageInfo::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/DeviceMappingNormalizer.php b/generated/Normalizer/DeviceMappingNormalizer.php new file mode 100644 index 00000000..ddd4ec9c --- /dev/null +++ b/generated/Normalizer/DeviceMappingNormalizer.php @@ -0,0 +1,154 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class DeviceMappingNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\DeviceMapping::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\DeviceMapping::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\DeviceMapping(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('PathOnHost', $data) && $data['PathOnHost'] !== null) { + $object->setPathOnHost($data['PathOnHost']); + } + elseif (\array_key_exists('PathOnHost', $data) && $data['PathOnHost'] === null) { + $object->setPathOnHost(null); + } + if (\array_key_exists('PathInContainer', $data) && $data['PathInContainer'] !== null) { + $object->setPathInContainer($data['PathInContainer']); + } + elseif (\array_key_exists('PathInContainer', $data) && $data['PathInContainer'] === null) { + $object->setPathInContainer(null); + } + if (\array_key_exists('CgroupPermissions', $data) && $data['CgroupPermissions'] !== null) { + $object->setCgroupPermissions($data['CgroupPermissions']); + } + elseif (\array_key_exists('CgroupPermissions', $data) && $data['CgroupPermissions'] === null) { + $object->setCgroupPermissions(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('pathOnHost') && null !== $object->getPathOnHost()) { + $data['PathOnHost'] = $object->getPathOnHost(); + } + if ($object->isInitialized('pathInContainer') && null !== $object->getPathInContainer()) { + $data['PathInContainer'] = $object->getPathInContainer(); + } + if ($object->isInitialized('cgroupPermissions') && null !== $object->getCgroupPermissions()) { + $data['CgroupPermissions'] = $object->getCgroupPermissions(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\DeviceMapping::class => false]; + } + } +} else { + class DeviceMappingNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\DeviceMapping::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\DeviceMapping::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\DeviceMapping(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('PathOnHost', $data) && $data['PathOnHost'] !== null) { + $object->setPathOnHost($data['PathOnHost']); + } + elseif (\array_key_exists('PathOnHost', $data) && $data['PathOnHost'] === null) { + $object->setPathOnHost(null); + } + if (\array_key_exists('PathInContainer', $data) && $data['PathInContainer'] !== null) { + $object->setPathInContainer($data['PathInContainer']); + } + elseif (\array_key_exists('PathInContainer', $data) && $data['PathInContainer'] === null) { + $object->setPathInContainer(null); + } + if (\array_key_exists('CgroupPermissions', $data) && $data['CgroupPermissions'] !== null) { + $object->setCgroupPermissions($data['CgroupPermissions']); + } + elseif (\array_key_exists('CgroupPermissions', $data) && $data['CgroupPermissions'] === null) { + $object->setCgroupPermissions(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('pathOnHost') && null !== $object->getPathOnHost()) { + $data['PathOnHost'] = $object->getPathOnHost(); + } + if ($object->isInitialized('pathInContainer') && null !== $object->getPathInContainer()) { + $data['PathInContainer'] = $object->getPathInContainer(); + } + if ($object->isInitialized('cgroupPermissions') && null !== $object->getCgroupPermissions()) { + $data['CgroupPermissions'] = $object->getCgroupPermissions(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\DeviceMapping::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/DeviceNormalizer.php b/generated/Normalizer/DeviceNormalizer.php deleted file mode 100644 index 9443be2e..00000000 --- a/generated/Normalizer/DeviceNormalizer.php +++ /dev/null @@ -1,69 +0,0 @@ -setPathOnHost($data->{'PathOnHost'}); - } - if (property_exists($data, 'PathInContainer')) { - $object->setPathInContainer($data->{'PathInContainer'}); - } - if (property_exists($data, 'CgroupPermissions')) { - $object->setCgroupPermissions($data->{'CgroupPermissions'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getPathOnHost()) { - $data->{'PathOnHost'} = $object->getPathOnHost(); - } - if (null !== $object->getPathInContainer()) { - $data->{'PathInContainer'} = $object->getPathInContainer(); - } - if (null !== $object->getCgroupPermissions()) { - $data->{'CgroupPermissions'} = $object->getCgroupPermissions(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/DeviceRateNormalizer.php b/generated/Normalizer/DeviceRateNormalizer.php deleted file mode 100644 index ae9ef760..00000000 --- a/generated/Normalizer/DeviceRateNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -setPath($data->{'Path'}); - } - if (property_exists($data, 'Rate')) { - $value = $data->{'Rate'}; - if (is_int($data->{'Rate'})) { - $value = $data->{'Rate'}; - } - if (is_string($data->{'Rate'})) { - $value = $data->{'Rate'}; - } - $object->setRate($value); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); - } - if (null !== $object->getRate()) { - $value = $object->getRate(); - if (is_int($object->getRate())) { - $value = $object->getRate(); - } - if (is_string($object->getRate())) { - $value = $object->getRate(); - } - $data->{'Rate'} = $value; - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/DeviceRequestNormalizer.php b/generated/Normalizer/DeviceRequestNormalizer.php new file mode 100644 index 00000000..58362d9f --- /dev/null +++ b/generated/Normalizer/DeviceRequestNormalizer.php @@ -0,0 +1,254 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class DeviceRequestNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\DeviceRequest::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\DeviceRequest::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\DeviceRequest(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Count', $data) && $data['Count'] !== null) { + $object->setCount($data['Count']); + } + elseif (\array_key_exists('Count', $data) && $data['Count'] === null) { + $object->setCount(null); + } + if (\array_key_exists('DeviceIDs', $data) && $data['DeviceIDs'] !== null) { + $values = []; + foreach ($data['DeviceIDs'] as $value) { + $values[] = $value; + } + $object->setDeviceIDs($values); + } + elseif (\array_key_exists('DeviceIDs', $data) && $data['DeviceIDs'] === null) { + $object->setDeviceIDs(null); + } + if (\array_key_exists('Capabilities', $data) && $data['Capabilities'] !== null) { + $values_1 = []; + foreach ($data['Capabilities'] as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $object->setCapabilities($values_1); + } + elseif (\array_key_exists('Capabilities', $data) && $data['Capabilities'] === null) { + $object->setCapabilities(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value_3) { + $values_3[$key] = $value_3; + } + $object->setOptions($values_3); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('count') && null !== $object->getCount()) { + $data['Count'] = $object->getCount(); + } + if ($object->isInitialized('deviceIDs') && null !== $object->getDeviceIDs()) { + $values = []; + foreach ($object->getDeviceIDs() as $value) { + $values[] = $value; + } + $data['DeviceIDs'] = $values; + } + if ($object->isInitialized('capabilities') && null !== $object->getCapabilities()) { + $values_1 = []; + foreach ($object->getCapabilities() as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $data['Capabilities'] = $values_1; + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values_3 = []; + foreach ($object->getOptions() as $key => $value_3) { + $values_3[$key] = $value_3; + } + $data['Options'] = $values_3; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\DeviceRequest::class => false]; + } + } +} else { + class DeviceRequestNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\DeviceRequest::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\DeviceRequest::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\DeviceRequest(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Count', $data) && $data['Count'] !== null) { + $object->setCount($data['Count']); + } + elseif (\array_key_exists('Count', $data) && $data['Count'] === null) { + $object->setCount(null); + } + if (\array_key_exists('DeviceIDs', $data) && $data['DeviceIDs'] !== null) { + $values = []; + foreach ($data['DeviceIDs'] as $value) { + $values[] = $value; + } + $object->setDeviceIDs($values); + } + elseif (\array_key_exists('DeviceIDs', $data) && $data['DeviceIDs'] === null) { + $object->setDeviceIDs(null); + } + if (\array_key_exists('Capabilities', $data) && $data['Capabilities'] !== null) { + $values_1 = []; + foreach ($data['Capabilities'] as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $object->setCapabilities($values_1); + } + elseif (\array_key_exists('Capabilities', $data) && $data['Capabilities'] === null) { + $object->setCapabilities(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value_3) { + $values_3[$key] = $value_3; + } + $object->setOptions($values_3); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('count') && null !== $object->getCount()) { + $data['Count'] = $object->getCount(); + } + if ($object->isInitialized('deviceIDs') && null !== $object->getDeviceIDs()) { + $values = []; + foreach ($object->getDeviceIDs() as $value) { + $values[] = $value; + } + $data['DeviceIDs'] = $values; + } + if ($object->isInitialized('capabilities') && null !== $object->getCapabilities()) { + $values_1 = []; + foreach ($object->getCapabilities() as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $data['Capabilities'] = $values_1; + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values_3 = []; + foreach ($object->getOptions() as $key => $value_3) { + $values_3[$key] = $value_3; + } + $data['Options'] = $values_3; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\DeviceRequest::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/DeviceWeightNormalizer.php b/generated/Normalizer/DeviceWeightNormalizer.php deleted file mode 100644 index 4e874a77..00000000 --- a/generated/Normalizer/DeviceWeightNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setPath($data->{'Path'}); - } - if (property_exists($data, 'Weight')) { - $object->setWeight($data->{'Weight'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); - } - if (null !== $object->getWeight()) { - $data->{'Weight'} = $object->getWeight(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/DistributionInspectNormalizer.php b/generated/Normalizer/DistributionInspectNormalizer.php new file mode 100644 index 00000000..a61f15d5 --- /dev/null +++ b/generated/Normalizer/DistributionInspectNormalizer.php @@ -0,0 +1,144 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class DistributionInspectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\DistributionInspect::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\DistributionInspect::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\DistributionInspect(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Descriptor', $data) && $data['Descriptor'] !== null) { + $object->setDescriptor($this->denormalizer->denormalize($data['Descriptor'], \Docker\API\Model\OCIDescriptor::class, 'json', $context)); + } + elseif (\array_key_exists('Descriptor', $data) && $data['Descriptor'] === null) { + $object->setDescriptor(null); + } + if (\array_key_exists('Platforms', $data) && $data['Platforms'] !== null) { + $values = []; + foreach ($data['Platforms'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\OCIPlatform::class, 'json', $context); + } + $object->setPlatforms($values); + } + elseif (\array_key_exists('Platforms', $data) && $data['Platforms'] === null) { + $object->setPlatforms(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Descriptor'] = $this->normalizer->normalize($object->getDescriptor(), 'json', $context); + $values = []; + foreach ($object->getPlatforms() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Platforms'] = $values; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\DistributionInspect::class => false]; + } + } +} else { + class DistributionInspectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\DistributionInspect::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\DistributionInspect::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\DistributionInspect(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Descriptor', $data) && $data['Descriptor'] !== null) { + $object->setDescriptor($this->denormalizer->denormalize($data['Descriptor'], \Docker\API\Model\OCIDescriptor::class, 'json', $context)); + } + elseif (\array_key_exists('Descriptor', $data) && $data['Descriptor'] === null) { + $object->setDescriptor(null); + } + if (\array_key_exists('Platforms', $data) && $data['Platforms'] !== null) { + $values = []; + foreach ($data['Platforms'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\OCIPlatform::class, 'json', $context); + } + $object->setPlatforms($values); + } + elseif (\array_key_exists('Platforms', $data) && $data['Platforms'] === null) { + $object->setPlatforms(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Descriptor'] = $this->normalizer->normalize($object->getDescriptor(), 'json', $context); + $values = []; + foreach ($object->getPlatforms() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Platforms'] = $values; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\DistributionInspect::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/DriverDataNormalizer.php b/generated/Normalizer/DriverDataNormalizer.php new file mode 100644 index 00000000..52e14398 --- /dev/null +++ b/generated/Normalizer/DriverDataNormalizer.php @@ -0,0 +1,144 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class DriverDataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\DriverData::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\DriverData::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\DriverData(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Data', $data) && $data['Data'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Data'] as $key => $value) { + $values[$key] = $value; + } + $object->setData($values); + } + elseif (\array_key_exists('Data', $data) && $data['Data'] === null) { + $object->setData(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Name'] = $object->getName(); + $values = []; + foreach ($object->getData() as $key => $value) { + $values[$key] = $value; + } + $data['Data'] = $values; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\DriverData::class => false]; + } + } +} else { + class DriverDataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\DriverData::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\DriverData::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\DriverData(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Data', $data) && $data['Data'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Data'] as $key => $value) { + $values[$key] = $value; + } + $object->setData($values); + } + elseif (\array_key_exists('Data', $data) && $data['Data'] === null) { + $object->setData(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Name'] = $object->getName(); + $values = []; + foreach ($object->getData() as $key => $value) { + $values[$key] = $value; + } + $data['Data'] = $values; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\DriverData::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/DriverNormalizer.php b/generated/Normalizer/DriverNormalizer.php index e3e6da15..e5381c46 100644 --- a/generated/Normalizer/DriverNormalizer.php +++ b/generated/Normalizer/DriverNormalizer.php @@ -2,82 +2,147 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class DriverNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\Driver') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class DriverNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\Driver) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Driver::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\Driver(); - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Driver::class; } - if (property_exists($data, 'Options')) { - $value = $data->{'Options'}; - if (is_object($data->{'Options'})) { + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Driver(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value_1) { - $values[$key] = $value_1; + foreach ($data['Options'] as $key => $value) { + $values[$key] = $value; } - $value = $values; + $object->setOptions($values); } - if (is_null($data->{'Options'})) { - $value = $data->{'Options'}; + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); } - $object->setOptions($value); + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Name'] = $object->getName(); + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $key => $value) { + $values[$key] = $value; + } + $data['Options'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Driver::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class DriverNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Driver::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Driver::class; } - $value = $object->getOptions(); - if (is_object($object->getOptions())) { - $values = new \stdClass(); - foreach ($object->getOptions() as $key => $value_1) { - $values->{$key} = $value_1; + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Driver(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - $value = $values; + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { + $values[$key] = $value; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; } - if (is_null($object->getOptions())) { - $value = $object->getOptions(); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Name'] = $object->getName(); + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $key => $value) { + $values[$key] = $value; + } + $data['Options'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Driver::class => false]; } - $data->{'Options'} = $value; - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/EndpointConfigNormalizer.php b/generated/Normalizer/EndpointConfigNormalizer.php deleted file mode 100644 index 6026f2dc..00000000 --- a/generated/Normalizer/EndpointConfigNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setIPv4Address($data->{'IPv4Address'}); - } - if (property_exists($data, 'IPv6Address')) { - $object->setIPv6Address($data->{'IPv6Address'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getIPv4Address()) { - $data->{'IPv4Address'} = $object->getIPv4Address(); - } - if (null !== $object->getIPv6Address()) { - $data->{'IPv6Address'} = $object->getIPv6Address(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/EndpointIPAMConfigNormalizer.php b/generated/Normalizer/EndpointIPAMConfigNormalizer.php index bee62c1a..6dcb724f 100644 --- a/generated/Normalizer/EndpointIPAMConfigNormalizer.php +++ b/generated/Normalizer/EndpointIPAMConfigNormalizer.php @@ -2,76 +2,169 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class EndpointIPAMConfigNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\EndpointIPAMConfig') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EndpointIPAMConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\EndpointIPAMConfig) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EndpointIPAMConfig::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\EndpointIPAMConfig(); - if (property_exists($data, 'IPv4Address')) { - $object->setIPv4Address($data->{'IPv4Address'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EndpointIPAMConfig::class; } - if (property_exists($data, 'IPv6Address')) { - $object->setIPv6Address($data->{'IPv6Address'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EndpointIPAMConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('IPv4Address', $data) && $data['IPv4Address'] !== null) { + $object->setIPv4Address($data['IPv4Address']); + } + elseif (\array_key_exists('IPv4Address', $data) && $data['IPv4Address'] === null) { + $object->setIPv4Address(null); + } + if (\array_key_exists('IPv6Address', $data) && $data['IPv6Address'] !== null) { + $object->setIPv6Address($data['IPv6Address']); + } + elseif (\array_key_exists('IPv6Address', $data) && $data['IPv6Address'] === null) { + $object->setIPv6Address(null); + } + if (\array_key_exists('LinkLocalIPs', $data) && $data['LinkLocalIPs'] !== null) { + $values = []; + foreach ($data['LinkLocalIPs'] as $value) { + $values[] = $value; + } + $object->setLinkLocalIPs($values); + } + elseif (\array_key_exists('LinkLocalIPs', $data) && $data['LinkLocalIPs'] === null) { + $object->setLinkLocalIPs(null); + } + return $object; } - if (property_exists($data, 'LinkLocalIPs')) { - $values = []; - foreach ($data->{'LinkLocalIPs'} as $value) { - $values[] = $value; + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iPv4Address') && null !== $object->getIPv4Address()) { + $data['IPv4Address'] = $object->getIPv4Address(); + } + if ($object->isInitialized('iPv6Address') && null !== $object->getIPv6Address()) { + $data['IPv6Address'] = $object->getIPv6Address(); } - $object->setLinkLocalIPs($values); + if ($object->isInitialized('linkLocalIPs') && null !== $object->getLinkLocalIPs()) { + $values = []; + foreach ($object->getLinkLocalIPs() as $value) { + $values[] = $value; + } + $data['LinkLocalIPs'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EndpointIPAMConfig::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class EndpointIPAMConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getIPv4Address()) { - $data->{'IPv4Address'} = $object->getIPv4Address(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EndpointIPAMConfig::class; } - if (null !== $object->getIPv6Address()) { - $data->{'IPv6Address'} = $object->getIPv6Address(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EndpointIPAMConfig::class; } - if (null !== $object->getLinkLocalIPs()) { - $values = []; - foreach ($object->getLinkLocalIPs() as $value) { - $values[] = $value; + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EndpointIPAMConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('IPv4Address', $data) && $data['IPv4Address'] !== null) { + $object->setIPv4Address($data['IPv4Address']); + } + elseif (\array_key_exists('IPv4Address', $data) && $data['IPv4Address'] === null) { + $object->setIPv4Address(null); } - $data->{'LinkLocalIPs'} = $values; + if (\array_key_exists('IPv6Address', $data) && $data['IPv6Address'] !== null) { + $object->setIPv6Address($data['IPv6Address']); + } + elseif (\array_key_exists('IPv6Address', $data) && $data['IPv6Address'] === null) { + $object->setIPv6Address(null); + } + if (\array_key_exists('LinkLocalIPs', $data) && $data['LinkLocalIPs'] !== null) { + $values = []; + foreach ($data['LinkLocalIPs'] as $value) { + $values[] = $value; + } + $object->setLinkLocalIPs($values); + } + elseif (\array_key_exists('LinkLocalIPs', $data) && $data['LinkLocalIPs'] === null) { + $object->setLinkLocalIPs(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iPv4Address') && null !== $object->getIPv4Address()) { + $data['IPv4Address'] = $object->getIPv4Address(); + } + if ($object->isInitialized('iPv6Address') && null !== $object->getIPv6Address()) { + $data['IPv6Address'] = $object->getIPv6Address(); + } + if ($object->isInitialized('linkLocalIPs') && null !== $object->getLinkLocalIPs()) { + $values = []; + foreach ($object->getLinkLocalIPs() as $value) { + $values[] = $value; + } + $data['LinkLocalIPs'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EndpointIPAMConfig::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/EndpointNormalizer.php b/generated/Normalizer/EndpointNormalizer.php deleted file mode 100644 index 9e9a3d74..00000000 --- a/generated/Normalizer/EndpointNormalizer.php +++ /dev/null @@ -1,109 +0,0 @@ -setSpec($this->serializer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\EndpointSpec', 'raw', $context)); - } - if (property_exists($data, 'ExposedPorts')) { - $value = $data->{'ExposedPorts'}; - if (is_array($data->{'ExposedPorts'})) { - $values = []; - foreach ($data->{'ExposedPorts'} as $value_1) { - $values[] = $this->serializer->denormalize($value_1, 'Docker\\API\\Model\\PortConfig', 'raw', $context); - } - $value = $values; - } - if (is_null($data->{'ExposedPorts'})) { - $value = $data->{'ExposedPorts'}; - } - $object->setExposedPorts($value); - } - if (property_exists($data, 'VirtualIPs')) { - $value_2 = $data->{'VirtualIPs'}; - if (is_array($data->{'VirtualIPs'})) { - $values_1 = []; - foreach ($data->{'VirtualIPs'} as $value_3) { - $values_1[] = $this->serializer->denormalize($value_3, 'Docker\\API\\Model\\EndpointVirtualIP', 'raw', $context); - } - $value_2 = $values_1; - } - if (is_null($data->{'VirtualIPs'})) { - $value_2 = $data->{'VirtualIPs'}; - } - $object->setVirtualIPs($value_2); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getSpec()) { - $data->{'Spec'} = json_decode($this->serializer->normalize($object->getSpec(), 'raw', $context)); - } - $value = $object->getExposedPorts(); - if (is_array($object->getExposedPorts())) { - $values = []; - foreach ($object->getExposedPorts() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getExposedPorts())) { - $value = $object->getExposedPorts(); - } - $data->{'ExposedPorts'} = $value; - $value_2 = $object->getVirtualIPs(); - if (is_array($object->getVirtualIPs())) { - $values_1 = []; - foreach ($object->getVirtualIPs() as $value_3) { - $values_1[] = $value_3; - } - $value_2 = $values_1; - } - if (is_null($object->getVirtualIPs())) { - $value_2 = $object->getVirtualIPs(); - } - $data->{'VirtualIPs'} = $value_2; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/EndpointPortConfigNormalizer.php b/generated/Normalizer/EndpointPortConfigNormalizer.php new file mode 100644 index 00000000..af612f71 --- /dev/null +++ b/generated/Normalizer/EndpointPortConfigNormalizer.php @@ -0,0 +1,190 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EndpointPortConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EndpointPortConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EndpointPortConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EndpointPortConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Protocol', $data) && $data['Protocol'] !== null) { + $object->setProtocol($data['Protocol']); + } + elseif (\array_key_exists('Protocol', $data) && $data['Protocol'] === null) { + $object->setProtocol(null); + } + if (\array_key_exists('TargetPort', $data) && $data['TargetPort'] !== null) { + $object->setTargetPort($data['TargetPort']); + } + elseif (\array_key_exists('TargetPort', $data) && $data['TargetPort'] === null) { + $object->setTargetPort(null); + } + if (\array_key_exists('PublishedPort', $data) && $data['PublishedPort'] !== null) { + $object->setPublishedPort($data['PublishedPort']); + } + elseif (\array_key_exists('PublishedPort', $data) && $data['PublishedPort'] === null) { + $object->setPublishedPort(null); + } + if (\array_key_exists('PublishMode', $data) && $data['PublishMode'] !== null) { + $object->setPublishMode($data['PublishMode']); + } + elseif (\array_key_exists('PublishMode', $data) && $data['PublishMode'] === null) { + $object->setPublishMode(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('protocol') && null !== $object->getProtocol()) { + $data['Protocol'] = $object->getProtocol(); + } + if ($object->isInitialized('targetPort') && null !== $object->getTargetPort()) { + $data['TargetPort'] = $object->getTargetPort(); + } + if ($object->isInitialized('publishedPort') && null !== $object->getPublishedPort()) { + $data['PublishedPort'] = $object->getPublishedPort(); + } + if ($object->isInitialized('publishMode') && null !== $object->getPublishMode()) { + $data['PublishMode'] = $object->getPublishMode(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EndpointPortConfig::class => false]; + } + } +} else { + class EndpointPortConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EndpointPortConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EndpointPortConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EndpointPortConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Protocol', $data) && $data['Protocol'] !== null) { + $object->setProtocol($data['Protocol']); + } + elseif (\array_key_exists('Protocol', $data) && $data['Protocol'] === null) { + $object->setProtocol(null); + } + if (\array_key_exists('TargetPort', $data) && $data['TargetPort'] !== null) { + $object->setTargetPort($data['TargetPort']); + } + elseif (\array_key_exists('TargetPort', $data) && $data['TargetPort'] === null) { + $object->setTargetPort(null); + } + if (\array_key_exists('PublishedPort', $data) && $data['PublishedPort'] !== null) { + $object->setPublishedPort($data['PublishedPort']); + } + elseif (\array_key_exists('PublishedPort', $data) && $data['PublishedPort'] === null) { + $object->setPublishedPort(null); + } + if (\array_key_exists('PublishMode', $data) && $data['PublishMode'] !== null) { + $object->setPublishMode($data['PublishMode']); + } + elseif (\array_key_exists('PublishMode', $data) && $data['PublishMode'] === null) { + $object->setPublishMode(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('protocol') && null !== $object->getProtocol()) { + $data['Protocol'] = $object->getProtocol(); + } + if ($object->isInitialized('targetPort') && null !== $object->getTargetPort()) { + $data['TargetPort'] = $object->getTargetPort(); + } + if ($object->isInitialized('publishedPort') && null !== $object->getPublishedPort()) { + $data['PublishedPort'] = $object->getPublishedPort(); + } + if ($object->isInitialized('publishMode') && null !== $object->getPublishMode()) { + $data['PublishMode'] = $object->getPublishMode(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EndpointPortConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/EndpointSettingsNormalizer.php b/generated/Normalizer/EndpointSettingsNormalizer.php index 463f151f..4c4ae3b9 100644 --- a/generated/Normalizer/EndpointSettingsNormalizer.php +++ b/generated/Normalizer/EndpointSettingsNormalizer.php @@ -2,138 +2,415 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class EndpointSettingsNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\EndpointSettings') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EndpointSettingsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\EndpointSettings) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EndpointSettings::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\EndpointSettings(); - if (property_exists($data, 'IPAMConfig')) { - $object->setIPAMConfig($this->serializer->denormalize($data->{'IPAMConfig'}, 'Docker\\API\\Model\\EndpointIPAMConfig', 'raw', $context)); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EndpointSettings::class; } - if (property_exists($data, 'Links')) { - $values = []; - foreach ($data->{'Links'} as $value) { - $values[] = $value; + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $object->setLinks($values); - } - if (property_exists($data, 'Aliases')) { - $values_1 = []; - foreach ($data->{'Aliases'} as $value_1) { - $values_1[] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - $object->setAliases($values_1); - } - if (property_exists($data, 'NetworkID')) { - $object->setNetworkID($data->{'NetworkID'}); - } - if (property_exists($data, 'EndpointID')) { - $object->setEndpointID($data->{'EndpointID'}); - } - if (property_exists($data, 'Gateway')) { - $object->setGateway($data->{'Gateway'}); - } - if (property_exists($data, 'IPAddress')) { - $object->setIPAddress($data->{'IPAddress'}); - } - if (property_exists($data, 'IPPrefixLen')) { - $object->setIPPrefixLen($data->{'IPPrefixLen'}); - } - if (property_exists($data, 'IPv6Gateway')) { - $object->setIPv6Gateway($data->{'IPv6Gateway'}); - } - if (property_exists($data, 'GlobalIPv6Address')) { - $object->setGlobalIPv6Address($data->{'GlobalIPv6Address'}); + $object = new \Docker\API\Model\EndpointSettings(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('IPAMConfig', $data) && $data['IPAMConfig'] !== null) { + $object->setIPAMConfig($this->denormalizer->denormalize($data['IPAMConfig'], \Docker\API\Model\EndpointIPAMConfig::class, 'json', $context)); + } + elseif (\array_key_exists('IPAMConfig', $data) && $data['IPAMConfig'] === null) { + $object->setIPAMConfig(null); + } + if (\array_key_exists('Links', $data) && $data['Links'] !== null) { + $values = []; + foreach ($data['Links'] as $value) { + $values[] = $value; + } + $object->setLinks($values); + } + elseif (\array_key_exists('Links', $data) && $data['Links'] === null) { + $object->setLinks(null); + } + if (\array_key_exists('MacAddress', $data) && $data['MacAddress'] !== null) { + $object->setMacAddress($data['MacAddress']); + } + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); + } + if (\array_key_exists('Aliases', $data) && $data['Aliases'] !== null) { + $values_1 = []; + foreach ($data['Aliases'] as $value_1) { + $values_1[] = $value_1; + } + $object->setAliases($values_1); + } + elseif (\array_key_exists('Aliases', $data) && $data['Aliases'] === null) { + $object->setAliases(null); + } + if (\array_key_exists('DriverOpts', $data) && $data['DriverOpts'] !== null) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['DriverOpts'] as $key => $value_2) { + $values_2[$key] = $value_2; + } + $object->setDriverOpts($values_2); + } + elseif (\array_key_exists('DriverOpts', $data) && $data['DriverOpts'] === null) { + $object->setDriverOpts(null); + } + if (\array_key_exists('NetworkID', $data) && $data['NetworkID'] !== null) { + $object->setNetworkID($data['NetworkID']); + } + elseif (\array_key_exists('NetworkID', $data) && $data['NetworkID'] === null) { + $object->setNetworkID(null); + } + if (\array_key_exists('EndpointID', $data) && $data['EndpointID'] !== null) { + $object->setEndpointID($data['EndpointID']); + } + elseif (\array_key_exists('EndpointID', $data) && $data['EndpointID'] === null) { + $object->setEndpointID(null); + } + if (\array_key_exists('Gateway', $data) && $data['Gateway'] !== null) { + $object->setGateway($data['Gateway']); + } + elseif (\array_key_exists('Gateway', $data) && $data['Gateway'] === null) { + $object->setGateway(null); + } + if (\array_key_exists('IPAddress', $data) && $data['IPAddress'] !== null) { + $object->setIPAddress($data['IPAddress']); + } + elseif (\array_key_exists('IPAddress', $data) && $data['IPAddress'] === null) { + $object->setIPAddress(null); + } + if (\array_key_exists('IPPrefixLen', $data) && $data['IPPrefixLen'] !== null) { + $object->setIPPrefixLen($data['IPPrefixLen']); + } + elseif (\array_key_exists('IPPrefixLen', $data) && $data['IPPrefixLen'] === null) { + $object->setIPPrefixLen(null); + } + if (\array_key_exists('IPv6Gateway', $data) && $data['IPv6Gateway'] !== null) { + $object->setIPv6Gateway($data['IPv6Gateway']); + } + elseif (\array_key_exists('IPv6Gateway', $data) && $data['IPv6Gateway'] === null) { + $object->setIPv6Gateway(null); + } + if (\array_key_exists('GlobalIPv6Address', $data) && $data['GlobalIPv6Address'] !== null) { + $object->setGlobalIPv6Address($data['GlobalIPv6Address']); + } + elseif (\array_key_exists('GlobalIPv6Address', $data) && $data['GlobalIPv6Address'] === null) { + $object->setGlobalIPv6Address(null); + } + if (\array_key_exists('GlobalIPv6PrefixLen', $data) && $data['GlobalIPv6PrefixLen'] !== null) { + $object->setGlobalIPv6PrefixLen($data['GlobalIPv6PrefixLen']); + } + elseif (\array_key_exists('GlobalIPv6PrefixLen', $data) && $data['GlobalIPv6PrefixLen'] === null) { + $object->setGlobalIPv6PrefixLen(null); + } + if (\array_key_exists('DNSNames', $data) && $data['DNSNames'] !== null) { + $values_3 = []; + foreach ($data['DNSNames'] as $value_3) { + $values_3[] = $value_3; + } + $object->setDNSNames($values_3); + } + elseif (\array_key_exists('DNSNames', $data) && $data['DNSNames'] === null) { + $object->setDNSNames(null); + } + return $object; } - if (property_exists($data, 'GlobalIPv6PrefixLen')) { - $object->setGlobalIPv6PrefixLen($data->{'GlobalIPv6PrefixLen'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iPAMConfig') && null !== $object->getIPAMConfig()) { + $data['IPAMConfig'] = $this->normalizer->normalize($object->getIPAMConfig(), 'json', $context); + } + if ($object->isInitialized('links') && null !== $object->getLinks()) { + $values = []; + foreach ($object->getLinks() as $value) { + $values[] = $value; + } + $data['Links'] = $values; + } + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); + } + if ($object->isInitialized('aliases') && null !== $object->getAliases()) { + $values_1 = []; + foreach ($object->getAliases() as $value_1) { + $values_1[] = $value_1; + } + $data['Aliases'] = $values_1; + } + if ($object->isInitialized('driverOpts') && null !== $object->getDriverOpts()) { + $values_2 = []; + foreach ($object->getDriverOpts() as $key => $value_2) { + $values_2[$key] = $value_2; + } + $data['DriverOpts'] = $values_2; + } + if ($object->isInitialized('networkID') && null !== $object->getNetworkID()) { + $data['NetworkID'] = $object->getNetworkID(); + } + if ($object->isInitialized('endpointID') && null !== $object->getEndpointID()) { + $data['EndpointID'] = $object->getEndpointID(); + } + if ($object->isInitialized('gateway') && null !== $object->getGateway()) { + $data['Gateway'] = $object->getGateway(); + } + if ($object->isInitialized('iPAddress') && null !== $object->getIPAddress()) { + $data['IPAddress'] = $object->getIPAddress(); + } + if ($object->isInitialized('iPPrefixLen') && null !== $object->getIPPrefixLen()) { + $data['IPPrefixLen'] = $object->getIPPrefixLen(); + } + if ($object->isInitialized('iPv6Gateway') && null !== $object->getIPv6Gateway()) { + $data['IPv6Gateway'] = $object->getIPv6Gateway(); + } + if ($object->isInitialized('globalIPv6Address') && null !== $object->getGlobalIPv6Address()) { + $data['GlobalIPv6Address'] = $object->getGlobalIPv6Address(); + } + if ($object->isInitialized('globalIPv6PrefixLen') && null !== $object->getGlobalIPv6PrefixLen()) { + $data['GlobalIPv6PrefixLen'] = $object->getGlobalIPv6PrefixLen(); + } + if ($object->isInitialized('dNSNames') && null !== $object->getDNSNames()) { + $values_3 = []; + foreach ($object->getDNSNames() as $value_3) { + $values_3[] = $value_3; + } + $data['DNSNames'] = $values_3; + } + return $data; } - if (property_exists($data, 'MacAddress')) { - $object->setMacAddress($data->{'MacAddress'}); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EndpointSettings::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class EndpointSettingsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getIPAMConfig()) { - $data->{'IPAMConfig'} = json_decode($this->serializer->normalize($object->getIPAMConfig(), 'raw', $context)); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EndpointSettings::class; } - if (null !== $object->getLinks()) { - $values = []; - foreach ($object->getLinks() as $value) { - $values[] = $value; - } - $data->{'Links'} = $values; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EndpointSettings::class; } - if (null !== $object->getAliases()) { - $values_1 = []; - foreach ($object->getAliases() as $value_1) { - $values_1[] = $value_1; + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data->{'Aliases'} = $values_1; - } - if (null !== $object->getNetworkID()) { - $data->{'NetworkID'} = $object->getNetworkID(); - } - if (null !== $object->getEndpointID()) { - $data->{'EndpointID'} = $object->getEndpointID(); - } - if (null !== $object->getGateway()) { - $data->{'Gateway'} = $object->getGateway(); - } - if (null !== $object->getIPAddress()) { - $data->{'IPAddress'} = $object->getIPAddress(); - } - if (null !== $object->getIPPrefixLen()) { - $data->{'IPPrefixLen'} = $object->getIPPrefixLen(); - } - if (null !== $object->getIPv6Gateway()) { - $data->{'IPv6Gateway'} = $object->getIPv6Gateway(); - } - if (null !== $object->getGlobalIPv6Address()) { - $data->{'GlobalIPv6Address'} = $object->getGlobalIPv6Address(); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EndpointSettings(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('IPAMConfig', $data) && $data['IPAMConfig'] !== null) { + $object->setIPAMConfig($this->denormalizer->denormalize($data['IPAMConfig'], \Docker\API\Model\EndpointIPAMConfig::class, 'json', $context)); + } + elseif (\array_key_exists('IPAMConfig', $data) && $data['IPAMConfig'] === null) { + $object->setIPAMConfig(null); + } + if (\array_key_exists('Links', $data) && $data['Links'] !== null) { + $values = []; + foreach ($data['Links'] as $value) { + $values[] = $value; + } + $object->setLinks($values); + } + elseif (\array_key_exists('Links', $data) && $data['Links'] === null) { + $object->setLinks(null); + } + if (\array_key_exists('MacAddress', $data) && $data['MacAddress'] !== null) { + $object->setMacAddress($data['MacAddress']); + } + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); + } + if (\array_key_exists('Aliases', $data) && $data['Aliases'] !== null) { + $values_1 = []; + foreach ($data['Aliases'] as $value_1) { + $values_1[] = $value_1; + } + $object->setAliases($values_1); + } + elseif (\array_key_exists('Aliases', $data) && $data['Aliases'] === null) { + $object->setAliases(null); + } + if (\array_key_exists('DriverOpts', $data) && $data['DriverOpts'] !== null) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['DriverOpts'] as $key => $value_2) { + $values_2[$key] = $value_2; + } + $object->setDriverOpts($values_2); + } + elseif (\array_key_exists('DriverOpts', $data) && $data['DriverOpts'] === null) { + $object->setDriverOpts(null); + } + if (\array_key_exists('NetworkID', $data) && $data['NetworkID'] !== null) { + $object->setNetworkID($data['NetworkID']); + } + elseif (\array_key_exists('NetworkID', $data) && $data['NetworkID'] === null) { + $object->setNetworkID(null); + } + if (\array_key_exists('EndpointID', $data) && $data['EndpointID'] !== null) { + $object->setEndpointID($data['EndpointID']); + } + elseif (\array_key_exists('EndpointID', $data) && $data['EndpointID'] === null) { + $object->setEndpointID(null); + } + if (\array_key_exists('Gateway', $data) && $data['Gateway'] !== null) { + $object->setGateway($data['Gateway']); + } + elseif (\array_key_exists('Gateway', $data) && $data['Gateway'] === null) { + $object->setGateway(null); + } + if (\array_key_exists('IPAddress', $data) && $data['IPAddress'] !== null) { + $object->setIPAddress($data['IPAddress']); + } + elseif (\array_key_exists('IPAddress', $data) && $data['IPAddress'] === null) { + $object->setIPAddress(null); + } + if (\array_key_exists('IPPrefixLen', $data) && $data['IPPrefixLen'] !== null) { + $object->setIPPrefixLen($data['IPPrefixLen']); + } + elseif (\array_key_exists('IPPrefixLen', $data) && $data['IPPrefixLen'] === null) { + $object->setIPPrefixLen(null); + } + if (\array_key_exists('IPv6Gateway', $data) && $data['IPv6Gateway'] !== null) { + $object->setIPv6Gateway($data['IPv6Gateway']); + } + elseif (\array_key_exists('IPv6Gateway', $data) && $data['IPv6Gateway'] === null) { + $object->setIPv6Gateway(null); + } + if (\array_key_exists('GlobalIPv6Address', $data) && $data['GlobalIPv6Address'] !== null) { + $object->setGlobalIPv6Address($data['GlobalIPv6Address']); + } + elseif (\array_key_exists('GlobalIPv6Address', $data) && $data['GlobalIPv6Address'] === null) { + $object->setGlobalIPv6Address(null); + } + if (\array_key_exists('GlobalIPv6PrefixLen', $data) && $data['GlobalIPv6PrefixLen'] !== null) { + $object->setGlobalIPv6PrefixLen($data['GlobalIPv6PrefixLen']); + } + elseif (\array_key_exists('GlobalIPv6PrefixLen', $data) && $data['GlobalIPv6PrefixLen'] === null) { + $object->setGlobalIPv6PrefixLen(null); + } + if (\array_key_exists('DNSNames', $data) && $data['DNSNames'] !== null) { + $values_3 = []; + foreach ($data['DNSNames'] as $value_3) { + $values_3[] = $value_3; + } + $object->setDNSNames($values_3); + } + elseif (\array_key_exists('DNSNames', $data) && $data['DNSNames'] === null) { + $object->setDNSNames(null); + } + return $object; } - if (null !== $object->getGlobalIPv6PrefixLen()) { - $data->{'GlobalIPv6PrefixLen'} = $object->getGlobalIPv6PrefixLen(); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iPAMConfig') && null !== $object->getIPAMConfig()) { + $data['IPAMConfig'] = $this->normalizer->normalize($object->getIPAMConfig(), 'json', $context); + } + if ($object->isInitialized('links') && null !== $object->getLinks()) { + $values = []; + foreach ($object->getLinks() as $value) { + $values[] = $value; + } + $data['Links'] = $values; + } + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); + } + if ($object->isInitialized('aliases') && null !== $object->getAliases()) { + $values_1 = []; + foreach ($object->getAliases() as $value_1) { + $values_1[] = $value_1; + } + $data['Aliases'] = $values_1; + } + if ($object->isInitialized('driverOpts') && null !== $object->getDriverOpts()) { + $values_2 = []; + foreach ($object->getDriverOpts() as $key => $value_2) { + $values_2[$key] = $value_2; + } + $data['DriverOpts'] = $values_2; + } + if ($object->isInitialized('networkID') && null !== $object->getNetworkID()) { + $data['NetworkID'] = $object->getNetworkID(); + } + if ($object->isInitialized('endpointID') && null !== $object->getEndpointID()) { + $data['EndpointID'] = $object->getEndpointID(); + } + if ($object->isInitialized('gateway') && null !== $object->getGateway()) { + $data['Gateway'] = $object->getGateway(); + } + if ($object->isInitialized('iPAddress') && null !== $object->getIPAddress()) { + $data['IPAddress'] = $object->getIPAddress(); + } + if ($object->isInitialized('iPPrefixLen') && null !== $object->getIPPrefixLen()) { + $data['IPPrefixLen'] = $object->getIPPrefixLen(); + } + if ($object->isInitialized('iPv6Gateway') && null !== $object->getIPv6Gateway()) { + $data['IPv6Gateway'] = $object->getIPv6Gateway(); + } + if ($object->isInitialized('globalIPv6Address') && null !== $object->getGlobalIPv6Address()) { + $data['GlobalIPv6Address'] = $object->getGlobalIPv6Address(); + } + if ($object->isInitialized('globalIPv6PrefixLen') && null !== $object->getGlobalIPv6PrefixLen()) { + $data['GlobalIPv6PrefixLen'] = $object->getGlobalIPv6PrefixLen(); + } + if ($object->isInitialized('dNSNames') && null !== $object->getDNSNames()) { + $values_3 = []; + foreach ($object->getDNSNames() as $value_3) { + $values_3[] = $value_3; + } + $data['DNSNames'] = $values_3; + } + return $data; } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EndpointSettings::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/EndpointSpecNormalizer.php b/generated/Normalizer/EndpointSpecNormalizer.php index 502c2f42..39e89190 100644 --- a/generated/Normalizer/EndpointSpecNormalizer.php +++ b/generated/Normalizer/EndpointSpecNormalizer.php @@ -2,82 +2,151 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class EndpointSpecNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\EndpointSpec') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EndpointSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\EndpointSpec) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EndpointSpec::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\EndpointSpec(); - if (property_exists($data, 'Mode')) { - $object->setMode($data->{'Mode'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EndpointSpec::class; } - if (property_exists($data, 'Ports')) { - $value = $data->{'Ports'}; - if (is_array($data->{'Ports'})) { + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EndpointSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { $values = []; - foreach ($data->{'Ports'} as $value_1) { - $values[] = $this->serializer->denormalize($value_1, 'Docker\\API\\Model\\PortConfig', 'raw', $context); + foreach ($data['Ports'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointPortConfig::class, 'json', $context); } - $value = $values; + $object->setPorts($values); } - if (is_null($data->{'Ports'})) { - $value = $data->{'Ports'}; + elseif (\array_key_exists('Ports', $data) && $data['Ports'] === null) { + $object->setPorts(null); } - $object->setPorts($value); + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values = []; + foreach ($object->getPorts() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Ports'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EndpointSpec::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class EndpointSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getMode()) { - $data->{'Mode'} = $object->getMode(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EndpointSpec::class; } - $value = $object->getPorts(); - if (is_array($object->getPorts())) { - $values = []; - foreach ($object->getPorts() as $value_1) { - $values[] = $value_1; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EndpointSpec::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EndpointSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); } - $value = $values; + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { + $values = []; + foreach ($data['Ports'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointPortConfig::class, 'json', $context); + } + $object->setPorts($values); + } + elseif (\array_key_exists('Ports', $data) && $data['Ports'] === null) { + $object->setPorts(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values = []; + foreach ($object->getPorts() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Ports'] = $values; + } + return $data; } - if (is_null($object->getPorts())) { - $value = $object->getPorts(); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EndpointSpec::class => false]; } - $data->{'Ports'} = $value; - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/EndpointVirtualIPNormalizer.php b/generated/Normalizer/EndpointVirtualIPNormalizer.php deleted file mode 100644 index a31932f2..00000000 --- a/generated/Normalizer/EndpointVirtualIPNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setNetworkID($data->{'NetworkID'}); - } - if (property_exists($data, 'Addr')) { - $object->setAddr($data->{'Addr'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getNetworkID()) { - $data->{'NetworkID'} = $object->getNetworkID(); - } - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/EngineDescriptionNormalizer.php b/generated/Normalizer/EngineDescriptionNormalizer.php new file mode 100644 index 00000000..ef1a90d8 --- /dev/null +++ b/generated/Normalizer/EngineDescriptionNormalizer.php @@ -0,0 +1,186 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EngineDescriptionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EngineDescription::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EngineDescription::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EngineDescription(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('EngineVersion', $data) && $data['EngineVersion'] !== null) { + $object->setEngineVersion($data['EngineVersion']); + } + elseif (\array_key_exists('EngineVersion', $data) && $data['EngineVersion'] === null) { + $object->setEngineVersion(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Plugins', $data) && $data['Plugins'] !== null) { + $values_1 = []; + foreach ($data['Plugins'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\EngineDescriptionPluginsItem::class, 'json', $context); + } + $object->setPlugins($values_1); + } + elseif (\array_key_exists('Plugins', $data) && $data['Plugins'] === null) { + $object->setPlugins(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('engineVersion') && null !== $object->getEngineVersion()) { + $data['EngineVersion'] = $object->getEngineVersion(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('plugins') && null !== $object->getPlugins()) { + $values_1 = []; + foreach ($object->getPlugins() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Plugins'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EngineDescription::class => false]; + } + } +} else { + class EngineDescriptionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EngineDescription::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EngineDescription::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EngineDescription(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('EngineVersion', $data) && $data['EngineVersion'] !== null) { + $object->setEngineVersion($data['EngineVersion']); + } + elseif (\array_key_exists('EngineVersion', $data) && $data['EngineVersion'] === null) { + $object->setEngineVersion(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Plugins', $data) && $data['Plugins'] !== null) { + $values_1 = []; + foreach ($data['Plugins'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\EngineDescriptionPluginsItem::class, 'json', $context); + } + $object->setPlugins($values_1); + } + elseif (\array_key_exists('Plugins', $data) && $data['Plugins'] === null) { + $object->setPlugins(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('engineVersion') && null !== $object->getEngineVersion()) { + $data['EngineVersion'] = $object->getEngineVersion(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('plugins') && null !== $object->getPlugins()) { + $values_1 = []; + foreach ($object->getPlugins() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Plugins'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EngineDescription::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/EngineDescriptionPluginsItemNormalizer.php b/generated/Normalizer/EngineDescriptionPluginsItemNormalizer.php new file mode 100644 index 00000000..182a6ee1 --- /dev/null +++ b/generated/Normalizer/EngineDescriptionPluginsItemNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EngineDescriptionPluginsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EngineDescriptionPluginsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EngineDescriptionPluginsItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EngineDescriptionPluginsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EngineDescriptionPluginsItem::class => false]; + } + } +} else { + class EngineDescriptionPluginsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EngineDescriptionPluginsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EngineDescriptionPluginsItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EngineDescriptionPluginsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EngineDescriptionPluginsItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ErrorDetailNormalizer.php b/generated/Normalizer/ErrorDetailNormalizer.php index 5e120407..6ef462f0 100644 --- a/generated/Normalizer/ErrorDetailNormalizer.php +++ b/generated/Normalizer/ErrorDetailNormalizer.php @@ -2,62 +2,135 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class ErrorDetailNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ErrorDetailNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\ErrorDetail') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ErrorDetail::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\ErrorDetail) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ErrorDetail::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\ErrorDetail(); - if (property_exists($data, 'code')) { - $object->setCode($data->{'code'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ErrorDetail(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('code', $data) && $data['code'] !== null) { + $object->setCode($data['code']); + } + elseif (\array_key_exists('code', $data) && $data['code'] === null) { + $object->setCode(null); + } + if (\array_key_exists('message', $data) && $data['message'] !== null) { + $object->setMessage($data['message']); + } + elseif (\array_key_exists('message', $data) && $data['message'] === null) { + $object->setMessage(null); + } + return $object; } - if (property_exists($data, 'message')) { - $object->setMessage($data->{'message'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('code') && null !== $object->getCode()) { + $data['code'] = $object->getCode(); + } + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['message'] = $object->getMessage(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ErrorDetail::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class ErrorDetailNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getCode()) { - $data->{'code'} = $object->getCode(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ErrorDetail::class; } - if (null !== $object->getMessage()) { - $data->{'message'} = $object->getMessage(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ErrorDetail::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ErrorDetail(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('code', $data) && $data['code'] !== null) { + $object->setCode($data['code']); + } + elseif (\array_key_exists('code', $data) && $data['code'] === null) { + $object->setCode(null); + } + if (\array_key_exists('message', $data) && $data['message'] !== null) { + $object->setMessage($data['message']); + } + elseif (\array_key_exists('message', $data) && $data['message'] === null) { + $object->setMessage(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('code') && null !== $object->getCode()) { + $data['code'] = $object->getCode(); + } + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['message'] = $object->getMessage(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ErrorDetail::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/ErrorResponseNormalizer.php b/generated/Normalizer/ErrorResponseNormalizer.php new file mode 100644 index 00000000..df1e78ff --- /dev/null +++ b/generated/Normalizer/ErrorResponseNormalizer.php @@ -0,0 +1,114 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ErrorResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ErrorResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ErrorResponse::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ErrorResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('message', $data) && $data['message'] !== null) { + $object->setMessage($data['message']); + } + elseif (\array_key_exists('message', $data) && $data['message'] === null) { + $object->setMessage(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['message'] = $object->getMessage(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ErrorResponse::class => false]; + } + } +} else { + class ErrorResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ErrorResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ErrorResponse::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ErrorResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('message', $data) && $data['message'] !== null) { + $object->setMessage($data['message']); + } + elseif (\array_key_exists('message', $data) && $data['message'] === null) { + $object->setMessage(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['message'] = $object->getMessage(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ErrorResponse::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/EventActorNormalizer.php b/generated/Normalizer/EventActorNormalizer.php new file mode 100644 index 00000000..5bc6380d --- /dev/null +++ b/generated/Normalizer/EventActorNormalizer.php @@ -0,0 +1,152 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EventActorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EventActor::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EventActor::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EventActor(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Attributes', $data) && $data['Attributes'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Attributes'] as $key => $value) { + $values[$key] = $value; + } + $object->setAttributes($values); + } + elseif (\array_key_exists('Attributes', $data) && $data['Attributes'] === null) { + $object->setAttributes(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { + $values = []; + foreach ($object->getAttributes() as $key => $value) { + $values[$key] = $value; + } + $data['Attributes'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EventActor::class => false]; + } + } +} else { + class EventActorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EventActor::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EventActor::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EventActor(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Attributes', $data) && $data['Attributes'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Attributes'] as $key => $value) { + $values[$key] = $value; + } + $object->setAttributes($values); + } + elseif (\array_key_exists('Attributes', $data) && $data['Attributes'] === null) { + $object->setAttributes(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { + $values = []; + foreach ($object->getAttributes() as $key => $value) { + $values[$key] = $value; + } + $data['Attributes'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EventActor::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/EventMessageNormalizer.php b/generated/Normalizer/EventMessageNormalizer.php new file mode 100644 index 00000000..ed66f826 --- /dev/null +++ b/generated/Normalizer/EventMessageNormalizer.php @@ -0,0 +1,208 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EventMessageNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EventMessage::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EventMessage::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EventMessage(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Action', $data) && $data['Action'] !== null) { + $object->setAction($data['Action']); + } + elseif (\array_key_exists('Action', $data) && $data['Action'] === null) { + $object->setAction(null); + } + if (\array_key_exists('Actor', $data) && $data['Actor'] !== null) { + $object->setActor($this->denormalizer->denormalize($data['Actor'], \Docker\API\Model\EventActor::class, 'json', $context)); + } + elseif (\array_key_exists('Actor', $data) && $data['Actor'] === null) { + $object->setActor(null); + } + if (\array_key_exists('scope', $data) && $data['scope'] !== null) { + $object->setScope($data['scope']); + } + elseif (\array_key_exists('scope', $data) && $data['scope'] === null) { + $object->setScope(null); + } + if (\array_key_exists('time', $data) && $data['time'] !== null) { + $object->setTime($data['time']); + } + elseif (\array_key_exists('time', $data) && $data['time'] === null) { + $object->setTime(null); + } + if (\array_key_exists('timeNano', $data) && $data['timeNano'] !== null) { + $object->setTimeNano($data['timeNano']); + } + elseif (\array_key_exists('timeNano', $data) && $data['timeNano'] === null) { + $object->setTimeNano(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('action') && null !== $object->getAction()) { + $data['Action'] = $object->getAction(); + } + if ($object->isInitialized('actor') && null !== $object->getActor()) { + $data['Actor'] = $this->normalizer->normalize($object->getActor(), 'json', $context); + } + if ($object->isInitialized('scope') && null !== $object->getScope()) { + $data['scope'] = $object->getScope(); + } + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime(); + } + if ($object->isInitialized('timeNano') && null !== $object->getTimeNano()) { + $data['timeNano'] = $object->getTimeNano(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EventMessage::class => false]; + } + } +} else { + class EventMessageNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\EventMessage::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\EventMessage::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\EventMessage(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Action', $data) && $data['Action'] !== null) { + $object->setAction($data['Action']); + } + elseif (\array_key_exists('Action', $data) && $data['Action'] === null) { + $object->setAction(null); + } + if (\array_key_exists('Actor', $data) && $data['Actor'] !== null) { + $object->setActor($this->denormalizer->denormalize($data['Actor'], \Docker\API\Model\EventActor::class, 'json', $context)); + } + elseif (\array_key_exists('Actor', $data) && $data['Actor'] === null) { + $object->setActor(null); + } + if (\array_key_exists('scope', $data) && $data['scope'] !== null) { + $object->setScope($data['scope']); + } + elseif (\array_key_exists('scope', $data) && $data['scope'] === null) { + $object->setScope(null); + } + if (\array_key_exists('time', $data) && $data['time'] !== null) { + $object->setTime($data['time']); + } + elseif (\array_key_exists('time', $data) && $data['time'] === null) { + $object->setTime(null); + } + if (\array_key_exists('timeNano', $data) && $data['timeNano'] !== null) { + $object->setTimeNano($data['timeNano']); + } + elseif (\array_key_exists('timeNano', $data) && $data['timeNano'] === null) { + $object->setTimeNano(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('action') && null !== $object->getAction()) { + $data['Action'] = $object->getAction(); + } + if ($object->isInitialized('actor') && null !== $object->getActor()) { + $data['Actor'] = $this->normalizer->normalize($object->getActor(), 'json', $context); + } + if ($object->isInitialized('scope') && null !== $object->getScope()) { + $data['scope'] = $object->getScope(); + } + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime(); + } + if ($object->isInitialized('timeNano') && null !== $object->getTimeNano()) { + $data['timeNano'] = $object->getTimeNano(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EventMessage::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/EventNormalizer.php b/generated/Normalizer/EventNormalizer.php deleted file mode 100644 index 79c8f653..00000000 --- a/generated/Normalizer/EventNormalizer.php +++ /dev/null @@ -1,81 +0,0 @@ -setStatus($data->{'status'}); - } - if (property_exists($data, 'id')) { - $object->setId($data->{'id'}); - } - if (property_exists($data, 'from')) { - $object->setFrom($data->{'from'}); - } - if (property_exists($data, 'time')) { - $object->setTime($data->{'time'}); - } - if (property_exists($data, 'timeNano')) { - $object->setTimeNano($data->{'timeNano'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getStatus()) { - $data->{'status'} = $object->getStatus(); - } - if (null !== $object->getId()) { - $data->{'id'} = $object->getId(); - } - if (null !== $object->getFrom()) { - $data->{'from'} = $object->getFrom(); - } - if (null !== $object->getTime()) { - $data->{'time'} = $object->getTime(); - } - if (null !== $object->getTimeNano()) { - $data->{'timeNano'} = $object->getTimeNano(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ExecCommandNormalizer.php b/generated/Normalizer/ExecCommandNormalizer.php deleted file mode 100644 index 2b9c35b9..00000000 --- a/generated/Normalizer/ExecCommandNormalizer.php +++ /dev/null @@ -1,105 +0,0 @@ -setID($data->{'ID'}); - } - if (property_exists($data, 'Running')) { - $object->setRunning($data->{'Running'}); - } - if (property_exists($data, 'ExitCode')) { - $object->setExitCode($data->{'ExitCode'}); - } - if (property_exists($data, 'ProcessConfig')) { - $object->setProcessConfig($this->serializer->denormalize($data->{'ProcessConfig'}, 'Docker\\API\\Model\\ProcessConfig', 'raw', $context)); - } - if (property_exists($data, 'OpenStdin')) { - $object->setOpenStdin($data->{'OpenStdin'}); - } - if (property_exists($data, 'OpenStderr')) { - $object->setOpenStderr($data->{'OpenStderr'}); - } - if (property_exists($data, 'OpenStdout')) { - $object->setOpenStdout($data->{'OpenStdout'}); - } - if (property_exists($data, 'Container')) { - $object->setContainer($this->serializer->denormalize($data->{'Container'}, 'Docker\\API\\Model\\Container', 'raw', $context)); - } - if (property_exists($data, 'DetachKeys')) { - $object->setDetachKeys($data->{'DetachKeys'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); - } - if (null !== $object->getRunning()) { - $data->{'Running'} = $object->getRunning(); - } - if (null !== $object->getExitCode()) { - $data->{'ExitCode'} = $object->getExitCode(); - } - if (null !== $object->getProcessConfig()) { - $data->{'ProcessConfig'} = json_decode($this->serializer->normalize($object->getProcessConfig(), 'raw', $context)); - } - if (null !== $object->getOpenStdin()) { - $data->{'OpenStdin'} = $object->getOpenStdin(); - } - if (null !== $object->getOpenStderr()) { - $data->{'OpenStderr'} = $object->getOpenStderr(); - } - if (null !== $object->getOpenStdout()) { - $data->{'OpenStdout'} = $object->getOpenStdout(); - } - if (null !== $object->getContainer()) { - $data->{'Container'} = json_decode($this->serializer->normalize($object->getContainer(), 'raw', $context)); - } - if (null !== $object->getDetachKeys()) { - $data->{'DetachKeys'} = $object->getDetachKeys(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ExecConfigNormalizer.php b/generated/Normalizer/ExecConfigNormalizer.php deleted file mode 100644 index 93f74abc..00000000 --- a/generated/Normalizer/ExecConfigNormalizer.php +++ /dev/null @@ -1,107 +0,0 @@ -setAttachStdin($data->{'AttachStdin'}); - } - if (property_exists($data, 'AttachStdout')) { - $object->setAttachStdout($data->{'AttachStdout'}); - } - if (property_exists($data, 'AttachStderr')) { - $object->setAttachStderr($data->{'AttachStderr'}); - } - if (property_exists($data, 'Tty')) { - $object->setTty($data->{'Tty'}); - } - if (property_exists($data, 'Cmd')) { - $value = $data->{'Cmd'}; - if (is_array($data->{'Cmd'})) { - $values = []; - foreach ($data->{'Cmd'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Cmd'})) { - $value = $data->{'Cmd'}; - } - $object->setCmd($value); - } - if (property_exists($data, 'DetachKeys')) { - $object->setDetachKeys($data->{'DetachKeys'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getAttachStdin()) { - $data->{'AttachStdin'} = $object->getAttachStdin(); - } - if (null !== $object->getAttachStdout()) { - $data->{'AttachStdout'} = $object->getAttachStdout(); - } - if (null !== $object->getAttachStderr()) { - $data->{'AttachStderr'} = $object->getAttachStderr(); - } - if (null !== $object->getTty()) { - $data->{'Tty'} = $object->getTty(); - } - $value = $object->getCmd(); - if (is_array($object->getCmd())) { - $values = []; - foreach ($object->getCmd() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getCmd())) { - $value = $object->getCmd(); - } - $data->{'Cmd'} = $value; - if (null !== $object->getDetachKeys()) { - $data->{'DetachKeys'} = $object->getDetachKeys(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ExecCreateResultNormalizer.php b/generated/Normalizer/ExecCreateResultNormalizer.php deleted file mode 100644 index c58b63c5..00000000 --- a/generated/Normalizer/ExecCreateResultNormalizer.php +++ /dev/null @@ -1,83 +0,0 @@ -setId($data->{'Id'}); - } - if (property_exists($data, 'Warnings')) { - $value = $data->{'Warnings'}; - if (is_array($data->{'Warnings'})) { - $values = []; - foreach ($data->{'Warnings'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Warnings'})) { - $value = $data->{'Warnings'}; - } - $object->setWarnings($value); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - $value = $object->getWarnings(); - if (is_array($object->getWarnings())) { - $values = []; - foreach ($object->getWarnings() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getWarnings())) { - $value = $object->getWarnings(); - } - $data->{'Warnings'} = $value; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ExecIdJsonGetResponse200Normalizer.php b/generated/Normalizer/ExecIdJsonGetResponse200Normalizer.php new file mode 100644 index 00000000..95d97a0f --- /dev/null +++ b/generated/Normalizer/ExecIdJsonGetResponse200Normalizer.php @@ -0,0 +1,298 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ExecIdJsonGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ExecIdJsonGetResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ExecIdJsonGetResponse200::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ExecIdJsonGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CanRemove', $data) && $data['CanRemove'] !== null) { + $object->setCanRemove($data['CanRemove']); + } + elseif (\array_key_exists('CanRemove', $data) && $data['CanRemove'] === null) { + $object->setCanRemove(null); + } + if (\array_key_exists('DetachKeys', $data) && $data['DetachKeys'] !== null) { + $object->setDetachKeys($data['DetachKeys']); + } + elseif (\array_key_exists('DetachKeys', $data) && $data['DetachKeys'] === null) { + $object->setDetachKeys(null); + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Running', $data) && $data['Running'] !== null) { + $object->setRunning($data['Running']); + } + elseif (\array_key_exists('Running', $data) && $data['Running'] === null) { + $object->setRunning(null); + } + if (\array_key_exists('ExitCode', $data) && $data['ExitCode'] !== null) { + $object->setExitCode($data['ExitCode']); + } + elseif (\array_key_exists('ExitCode', $data) && $data['ExitCode'] === null) { + $object->setExitCode(null); + } + if (\array_key_exists('ProcessConfig', $data) && $data['ProcessConfig'] !== null) { + $object->setProcessConfig($this->denormalizer->denormalize($data['ProcessConfig'], \Docker\API\Model\ProcessConfig::class, 'json', $context)); + } + elseif (\array_key_exists('ProcessConfig', $data) && $data['ProcessConfig'] === null) { + $object->setProcessConfig(null); + } + if (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] !== null) { + $object->setOpenStdin($data['OpenStdin']); + } + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); + } + if (\array_key_exists('OpenStderr', $data) && $data['OpenStderr'] !== null) { + $object->setOpenStderr($data['OpenStderr']); + } + elseif (\array_key_exists('OpenStderr', $data) && $data['OpenStderr'] === null) { + $object->setOpenStderr(null); + } + if (\array_key_exists('OpenStdout', $data) && $data['OpenStdout'] !== null) { + $object->setOpenStdout($data['OpenStdout']); + } + elseif (\array_key_exists('OpenStdout', $data) && $data['OpenStdout'] === null) { + $object->setOpenStdout(null); + } + if (\array_key_exists('ContainerID', $data) && $data['ContainerID'] !== null) { + $object->setContainerID($data['ContainerID']); + } + elseif (\array_key_exists('ContainerID', $data) && $data['ContainerID'] === null) { + $object->setContainerID(null); + } + if (\array_key_exists('Pid', $data) && $data['Pid'] !== null) { + $object->setPid($data['Pid']); + } + elseif (\array_key_exists('Pid', $data) && $data['Pid'] === null) { + $object->setPid(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('canRemove') && null !== $object->getCanRemove()) { + $data['CanRemove'] = $object->getCanRemove(); + } + if ($object->isInitialized('detachKeys') && null !== $object->getDetachKeys()) { + $data['DetachKeys'] = $object->getDetachKeys(); + } + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('running') && null !== $object->getRunning()) { + $data['Running'] = $object->getRunning(); + } + if ($object->isInitialized('exitCode') && null !== $object->getExitCode()) { + $data['ExitCode'] = $object->getExitCode(); + } + if ($object->isInitialized('processConfig') && null !== $object->getProcessConfig()) { + $data['ProcessConfig'] = $this->normalizer->normalize($object->getProcessConfig(), 'json', $context); + } + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); + } + if ($object->isInitialized('openStderr') && null !== $object->getOpenStderr()) { + $data['OpenStderr'] = $object->getOpenStderr(); + } + if ($object->isInitialized('openStdout') && null !== $object->getOpenStdout()) { + $data['OpenStdout'] = $object->getOpenStdout(); + } + if ($object->isInitialized('containerID') && null !== $object->getContainerID()) { + $data['ContainerID'] = $object->getContainerID(); + } + if ($object->isInitialized('pid') && null !== $object->getPid()) { + $data['Pid'] = $object->getPid(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ExecIdJsonGetResponse200::class => false]; + } + } +} else { + class ExecIdJsonGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ExecIdJsonGetResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ExecIdJsonGetResponse200::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ExecIdJsonGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CanRemove', $data) && $data['CanRemove'] !== null) { + $object->setCanRemove($data['CanRemove']); + } + elseif (\array_key_exists('CanRemove', $data) && $data['CanRemove'] === null) { + $object->setCanRemove(null); + } + if (\array_key_exists('DetachKeys', $data) && $data['DetachKeys'] !== null) { + $object->setDetachKeys($data['DetachKeys']); + } + elseif (\array_key_exists('DetachKeys', $data) && $data['DetachKeys'] === null) { + $object->setDetachKeys(null); + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Running', $data) && $data['Running'] !== null) { + $object->setRunning($data['Running']); + } + elseif (\array_key_exists('Running', $data) && $data['Running'] === null) { + $object->setRunning(null); + } + if (\array_key_exists('ExitCode', $data) && $data['ExitCode'] !== null) { + $object->setExitCode($data['ExitCode']); + } + elseif (\array_key_exists('ExitCode', $data) && $data['ExitCode'] === null) { + $object->setExitCode(null); + } + if (\array_key_exists('ProcessConfig', $data) && $data['ProcessConfig'] !== null) { + $object->setProcessConfig($this->denormalizer->denormalize($data['ProcessConfig'], \Docker\API\Model\ProcessConfig::class, 'json', $context)); + } + elseif (\array_key_exists('ProcessConfig', $data) && $data['ProcessConfig'] === null) { + $object->setProcessConfig(null); + } + if (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] !== null) { + $object->setOpenStdin($data['OpenStdin']); + } + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); + } + if (\array_key_exists('OpenStderr', $data) && $data['OpenStderr'] !== null) { + $object->setOpenStderr($data['OpenStderr']); + } + elseif (\array_key_exists('OpenStderr', $data) && $data['OpenStderr'] === null) { + $object->setOpenStderr(null); + } + if (\array_key_exists('OpenStdout', $data) && $data['OpenStdout'] !== null) { + $object->setOpenStdout($data['OpenStdout']); + } + elseif (\array_key_exists('OpenStdout', $data) && $data['OpenStdout'] === null) { + $object->setOpenStdout(null); + } + if (\array_key_exists('ContainerID', $data) && $data['ContainerID'] !== null) { + $object->setContainerID($data['ContainerID']); + } + elseif (\array_key_exists('ContainerID', $data) && $data['ContainerID'] === null) { + $object->setContainerID(null); + } + if (\array_key_exists('Pid', $data) && $data['Pid'] !== null) { + $object->setPid($data['Pid']); + } + elseif (\array_key_exists('Pid', $data) && $data['Pid'] === null) { + $object->setPid(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('canRemove') && null !== $object->getCanRemove()) { + $data['CanRemove'] = $object->getCanRemove(); + } + if ($object->isInitialized('detachKeys') && null !== $object->getDetachKeys()) { + $data['DetachKeys'] = $object->getDetachKeys(); + } + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('running') && null !== $object->getRunning()) { + $data['Running'] = $object->getRunning(); + } + if ($object->isInitialized('exitCode') && null !== $object->getExitCode()) { + $data['ExitCode'] = $object->getExitCode(); + } + if ($object->isInitialized('processConfig') && null !== $object->getProcessConfig()) { + $data['ProcessConfig'] = $this->normalizer->normalize($object->getProcessConfig(), 'json', $context); + } + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); + } + if ($object->isInitialized('openStderr') && null !== $object->getOpenStderr()) { + $data['OpenStderr'] = $object->getOpenStderr(); + } + if ($object->isInitialized('openStdout') && null !== $object->getOpenStdout()) { + $data['OpenStdout'] = $object->getOpenStdout(); + } + if ($object->isInitialized('containerID') && null !== $object->getContainerID()) { + $data['ContainerID'] = $object->getContainerID(); + } + if ($object->isInitialized('pid') && null !== $object->getPid()) { + $data['Pid'] = $object->getPid(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ExecIdJsonGetResponse200::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ExecIdStartPostBodyNormalizer.php b/generated/Normalizer/ExecIdStartPostBodyNormalizer.php new file mode 100644 index 00000000..8c330da8 --- /dev/null +++ b/generated/Normalizer/ExecIdStartPostBodyNormalizer.php @@ -0,0 +1,170 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ExecIdStartPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ExecIdStartPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ExecIdStartPostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ExecIdStartPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Detach', $data) && $data['Detach'] !== null) { + $object->setDetach($data['Detach']); + } + elseif (\array_key_exists('Detach', $data) && $data['Detach'] === null) { + $object->setDetach(null); + } + if (\array_key_exists('Tty', $data) && $data['Tty'] !== null) { + $object->setTty($data['Tty']); + } + elseif (\array_key_exists('Tty', $data) && $data['Tty'] === null) { + $object->setTty(null); + } + if (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] !== null) { + $values = []; + foreach ($data['ConsoleSize'] as $value) { + $values[] = $value; + } + $object->setConsoleSize($values); + } + elseif (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] === null) { + $object->setConsoleSize(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('detach') && null !== $object->getDetach()) { + $data['Detach'] = $object->getDetach(); + } + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); + } + if ($object->isInitialized('consoleSize') && null !== $object->getConsoleSize()) { + $values = []; + foreach ($object->getConsoleSize() as $value) { + $values[] = $value; + } + $data['ConsoleSize'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ExecIdStartPostBody::class => false]; + } + } +} else { + class ExecIdStartPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ExecIdStartPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ExecIdStartPostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ExecIdStartPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Detach', $data) && $data['Detach'] !== null) { + $object->setDetach($data['Detach']); + } + elseif (\array_key_exists('Detach', $data) && $data['Detach'] === null) { + $object->setDetach(null); + } + if (\array_key_exists('Tty', $data) && $data['Tty'] !== null) { + $object->setTty($data['Tty']); + } + elseif (\array_key_exists('Tty', $data) && $data['Tty'] === null) { + $object->setTty(null); + } + if (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] !== null) { + $values = []; + foreach ($data['ConsoleSize'] as $value) { + $values[] = $value; + } + $object->setConsoleSize($values); + } + elseif (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] === null) { + $object->setConsoleSize(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('detach') && null !== $object->getDetach()) { + $data['Detach'] = $object->getDetach(); + } + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); + } + if ($object->isInitialized('consoleSize') && null !== $object->getConsoleSize()) { + $values = []; + foreach ($object->getConsoleSize() as $value) { + $values[] = $value; + } + $data['ConsoleSize'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ExecIdStartPostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ExecStartConfigNormalizer.php b/generated/Normalizer/ExecStartConfigNormalizer.php deleted file mode 100644 index 39ae094b..00000000 --- a/generated/Normalizer/ExecStartConfigNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setDetach($data->{'Detach'}); - } - if (property_exists($data, 'Tty')) { - $object->setTty($data->{'Tty'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getDetach()) { - $data->{'Detach'} = $object->getDetach(); - } - if (null !== $object->getTty()) { - $data->{'Tty'} = $object->getTty(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/FilesystemChangeNormalizer.php b/generated/Normalizer/FilesystemChangeNormalizer.php new file mode 100644 index 00000000..cc092399 --- /dev/null +++ b/generated/Normalizer/FilesystemChangeNormalizer.php @@ -0,0 +1,128 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class FilesystemChangeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\FilesystemChange::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\FilesystemChange::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\FilesystemChange(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Path', $data) && $data['Path'] !== null) { + $object->setPath($data['Path']); + } + elseif (\array_key_exists('Path', $data) && $data['Path'] === null) { + $object->setPath(null); + } + if (\array_key_exists('Kind', $data) && $data['Kind'] !== null) { + $object->setKind($data['Kind']); + } + elseif (\array_key_exists('Kind', $data) && $data['Kind'] === null) { + $object->setKind(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Path'] = $object->getPath(); + $data['Kind'] = $object->getKind(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\FilesystemChange::class => false]; + } + } +} else { + class FilesystemChangeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\FilesystemChange::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\FilesystemChange::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\FilesystemChange(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Path', $data) && $data['Path'] !== null) { + $object->setPath($data['Path']); + } + elseif (\array_key_exists('Path', $data) && $data['Path'] === null) { + $object->setPath(null); + } + if (\array_key_exists('Kind', $data) && $data['Kind'] !== null) { + $object->setKind($data['Kind']); + } + elseif (\array_key_exists('Kind', $data) && $data['Kind'] === null) { + $object->setKind(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Path'] = $object->getPath(); + $data['Kind'] = $object->getKind(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\FilesystemChange::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/GenericResourcesItemDiscreteResourceSpecNormalizer.php b/generated/Normalizer/GenericResourcesItemDiscreteResourceSpecNormalizer.php new file mode 100644 index 00000000..79245b61 --- /dev/null +++ b/generated/Normalizer/GenericResourcesItemDiscreteResourceSpecNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class GenericResourcesItemDiscreteResourceSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Kind', $data) && $data['Kind'] !== null) { + $object->setKind($data['Kind']); + } + elseif (\array_key_exists('Kind', $data) && $data['Kind'] === null) { + $object->setKind(null); + } + if (\array_key_exists('Value', $data) && $data['Value'] !== null) { + $object->setValue($data['Value']); + } + elseif (\array_key_exists('Value', $data) && $data['Value'] === null) { + $object->setValue(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('kind') && null !== $object->getKind()) { + $data['Kind'] = $object->getKind(); + } + if ($object->isInitialized('value') && null !== $object->getValue()) { + $data['Value'] = $object->getValue(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class => false]; + } + } +} else { + class GenericResourcesItemDiscreteResourceSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Kind', $data) && $data['Kind'] !== null) { + $object->setKind($data['Kind']); + } + elseif (\array_key_exists('Kind', $data) && $data['Kind'] === null) { + $object->setKind(null); + } + if (\array_key_exists('Value', $data) && $data['Value'] !== null) { + $object->setValue($data['Value']); + } + elseif (\array_key_exists('Value', $data) && $data['Value'] === null) { + $object->setValue(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('kind') && null !== $object->getKind()) { + $data['Kind'] = $object->getKind(); + } + if ($object->isInitialized('value') && null !== $object->getValue()) { + $data['Value'] = $object->getValue(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/GenericResourcesItemNamedResourceSpecNormalizer.php b/generated/Normalizer/GenericResourcesItemNamedResourceSpecNormalizer.php new file mode 100644 index 00000000..4315bfc5 --- /dev/null +++ b/generated/Normalizer/GenericResourcesItemNamedResourceSpecNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class GenericResourcesItemNamedResourceSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\GenericResourcesItemNamedResourceSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Kind', $data) && $data['Kind'] !== null) { + $object->setKind($data['Kind']); + } + elseif (\array_key_exists('Kind', $data) && $data['Kind'] === null) { + $object->setKind(null); + } + if (\array_key_exists('Value', $data) && $data['Value'] !== null) { + $object->setValue($data['Value']); + } + elseif (\array_key_exists('Value', $data) && $data['Value'] === null) { + $object->setValue(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('kind') && null !== $object->getKind()) { + $data['Kind'] = $object->getKind(); + } + if ($object->isInitialized('value') && null !== $object->getValue()) { + $data['Value'] = $object->getValue(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\GenericResourcesItemNamedResourceSpec::class => false]; + } + } +} else { + class GenericResourcesItemNamedResourceSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\GenericResourcesItemNamedResourceSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Kind', $data) && $data['Kind'] !== null) { + $object->setKind($data['Kind']); + } + elseif (\array_key_exists('Kind', $data) && $data['Kind'] === null) { + $object->setKind(null); + } + if (\array_key_exists('Value', $data) && $data['Value'] !== null) { + $object->setValue($data['Value']); + } + elseif (\array_key_exists('Value', $data) && $data['Value'] === null) { + $object->setValue(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('kind') && null !== $object->getKind()) { + $data['Kind'] = $object->getKind(); + } + if ($object->isInitialized('value') && null !== $object->getValue()) { + $data['Value'] = $object->getValue(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\GenericResourcesItemNamedResourceSpec::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/GenericResourcesItemNormalizer.php b/generated/Normalizer/GenericResourcesItemNormalizer.php new file mode 100644 index 00000000..2fbac34a --- /dev/null +++ b/generated/Normalizer/GenericResourcesItemNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class GenericResourcesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\GenericResourcesItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\GenericResourcesItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\GenericResourcesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NamedResourceSpec', $data) && $data['NamedResourceSpec'] !== null) { + $object->setNamedResourceSpec($this->denormalizer->denormalize($data['NamedResourceSpec'], \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class, 'json', $context)); + } + elseif (\array_key_exists('NamedResourceSpec', $data) && $data['NamedResourceSpec'] === null) { + $object->setNamedResourceSpec(null); + } + if (\array_key_exists('DiscreteResourceSpec', $data) && $data['DiscreteResourceSpec'] !== null) { + $object->setDiscreteResourceSpec($this->denormalizer->denormalize($data['DiscreteResourceSpec'], \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class, 'json', $context)); + } + elseif (\array_key_exists('DiscreteResourceSpec', $data) && $data['DiscreteResourceSpec'] === null) { + $object->setDiscreteResourceSpec(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('namedResourceSpec') && null !== $object->getNamedResourceSpec()) { + $data['NamedResourceSpec'] = $this->normalizer->normalize($object->getNamedResourceSpec(), 'json', $context); + } + if ($object->isInitialized('discreteResourceSpec') && null !== $object->getDiscreteResourceSpec()) { + $data['DiscreteResourceSpec'] = $this->normalizer->normalize($object->getDiscreteResourceSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\GenericResourcesItem::class => false]; + } + } +} else { + class GenericResourcesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\GenericResourcesItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\GenericResourcesItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\GenericResourcesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NamedResourceSpec', $data) && $data['NamedResourceSpec'] !== null) { + $object->setNamedResourceSpec($this->denormalizer->denormalize($data['NamedResourceSpec'], \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class, 'json', $context)); + } + elseif (\array_key_exists('NamedResourceSpec', $data) && $data['NamedResourceSpec'] === null) { + $object->setNamedResourceSpec(null); + } + if (\array_key_exists('DiscreteResourceSpec', $data) && $data['DiscreteResourceSpec'] !== null) { + $object->setDiscreteResourceSpec($this->denormalizer->denormalize($data['DiscreteResourceSpec'], \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class, 'json', $context)); + } + elseif (\array_key_exists('DiscreteResourceSpec', $data) && $data['DiscreteResourceSpec'] === null) { + $object->setDiscreteResourceSpec(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('namedResourceSpec') && null !== $object->getNamedResourceSpec()) { + $data['NamedResourceSpec'] = $this->normalizer->normalize($object->getNamedResourceSpec(), 'json', $context); + } + if ($object->isInitialized('discreteResourceSpec') && null !== $object->getDiscreteResourceSpec()) { + $data['DiscreteResourceSpec'] = $this->normalizer->normalize($object->getDiscreteResourceSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\GenericResourcesItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/GlobalServiceNormalizer.php b/generated/Normalizer/GlobalServiceNormalizer.php deleted file mode 100644 index 9892f17f..00000000 --- a/generated/Normalizer/GlobalServiceNormalizer.php +++ /dev/null @@ -1,51 +0,0 @@ -setName($data->{'Name'}); - } - if (property_exists($data, 'Data')) { - $object->setData($data->{'Data'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getData()) { - $data->{'Data'} = $object->getData(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/HealthConfigNormalizer.php b/generated/Normalizer/HealthConfigNormalizer.php new file mode 100644 index 00000000..97a02b90 --- /dev/null +++ b/generated/Normalizer/HealthConfigNormalizer.php @@ -0,0 +1,224 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class HealthConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\HealthConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\HealthConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\HealthConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Test', $data) && $data['Test'] !== null) { + $values = []; + foreach ($data['Test'] as $value) { + $values[] = $value; + } + $object->setTest($values); + } + elseif (\array_key_exists('Test', $data) && $data['Test'] === null) { + $object->setTest(null); + } + if (\array_key_exists('Interval', $data) && $data['Interval'] !== null) { + $object->setInterval($data['Interval']); + } + elseif (\array_key_exists('Interval', $data) && $data['Interval'] === null) { + $object->setInterval(null); + } + if (\array_key_exists('Timeout', $data) && $data['Timeout'] !== null) { + $object->setTimeout($data['Timeout']); + } + elseif (\array_key_exists('Timeout', $data) && $data['Timeout'] === null) { + $object->setTimeout(null); + } + if (\array_key_exists('Retries', $data) && $data['Retries'] !== null) { + $object->setRetries($data['Retries']); + } + elseif (\array_key_exists('Retries', $data) && $data['Retries'] === null) { + $object->setRetries(null); + } + if (\array_key_exists('StartPeriod', $data) && $data['StartPeriod'] !== null) { + $object->setStartPeriod($data['StartPeriod']); + } + elseif (\array_key_exists('StartPeriod', $data) && $data['StartPeriod'] === null) { + $object->setStartPeriod(null); + } + if (\array_key_exists('StartInterval', $data) && $data['StartInterval'] !== null) { + $object->setStartInterval($data['StartInterval']); + } + elseif (\array_key_exists('StartInterval', $data) && $data['StartInterval'] === null) { + $object->setStartInterval(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('test') && null !== $object->getTest()) { + $values = []; + foreach ($object->getTest() as $value) { + $values[] = $value; + } + $data['Test'] = $values; + } + if ($object->isInitialized('interval') && null !== $object->getInterval()) { + $data['Interval'] = $object->getInterval(); + } + if ($object->isInitialized('timeout') && null !== $object->getTimeout()) { + $data['Timeout'] = $object->getTimeout(); + } + if ($object->isInitialized('retries') && null !== $object->getRetries()) { + $data['Retries'] = $object->getRetries(); + } + if ($object->isInitialized('startPeriod') && null !== $object->getStartPeriod()) { + $data['StartPeriod'] = $object->getStartPeriod(); + } + if ($object->isInitialized('startInterval') && null !== $object->getStartInterval()) { + $data['StartInterval'] = $object->getStartInterval(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\HealthConfig::class => false]; + } + } +} else { + class HealthConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\HealthConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\HealthConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\HealthConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Test', $data) && $data['Test'] !== null) { + $values = []; + foreach ($data['Test'] as $value) { + $values[] = $value; + } + $object->setTest($values); + } + elseif (\array_key_exists('Test', $data) && $data['Test'] === null) { + $object->setTest(null); + } + if (\array_key_exists('Interval', $data) && $data['Interval'] !== null) { + $object->setInterval($data['Interval']); + } + elseif (\array_key_exists('Interval', $data) && $data['Interval'] === null) { + $object->setInterval(null); + } + if (\array_key_exists('Timeout', $data) && $data['Timeout'] !== null) { + $object->setTimeout($data['Timeout']); + } + elseif (\array_key_exists('Timeout', $data) && $data['Timeout'] === null) { + $object->setTimeout(null); + } + if (\array_key_exists('Retries', $data) && $data['Retries'] !== null) { + $object->setRetries($data['Retries']); + } + elseif (\array_key_exists('Retries', $data) && $data['Retries'] === null) { + $object->setRetries(null); + } + if (\array_key_exists('StartPeriod', $data) && $data['StartPeriod'] !== null) { + $object->setStartPeriod($data['StartPeriod']); + } + elseif (\array_key_exists('StartPeriod', $data) && $data['StartPeriod'] === null) { + $object->setStartPeriod(null); + } + if (\array_key_exists('StartInterval', $data) && $data['StartInterval'] !== null) { + $object->setStartInterval($data['StartInterval']); + } + elseif (\array_key_exists('StartInterval', $data) && $data['StartInterval'] === null) { + $object->setStartInterval(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('test') && null !== $object->getTest()) { + $values = []; + foreach ($object->getTest() as $value) { + $values[] = $value; + } + $data['Test'] = $values; + } + if ($object->isInitialized('interval') && null !== $object->getInterval()) { + $data['Interval'] = $object->getInterval(); + } + if ($object->isInitialized('timeout') && null !== $object->getTimeout()) { + $data['Timeout'] = $object->getTimeout(); + } + if ($object->isInitialized('retries') && null !== $object->getRetries()) { + $data['Retries'] = $object->getRetries(); + } + if ($object->isInitialized('startPeriod') && null !== $object->getStartPeriod()) { + $data['StartPeriod'] = $object->getStartPeriod(); + } + if ($object->isInitialized('startInterval') && null !== $object->getStartInterval()) { + $data['StartInterval'] = $object->getStartInterval(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\HealthConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/HealthNormalizer.php b/generated/Normalizer/HealthNormalizer.php new file mode 100644 index 00000000..bba4cdad --- /dev/null +++ b/generated/Normalizer/HealthNormalizer.php @@ -0,0 +1,170 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class HealthNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Health::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Health::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Health(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($data['Status']); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('FailingStreak', $data) && $data['FailingStreak'] !== null) { + $object->setFailingStreak($data['FailingStreak']); + } + elseif (\array_key_exists('FailingStreak', $data) && $data['FailingStreak'] === null) { + $object->setFailingStreak(null); + } + if (\array_key_exists('Log', $data) && $data['Log'] !== null) { + $values = []; + foreach ($data['Log'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\HealthcheckResult::class, 'json', $context); + } + $object->setLog($values); + } + elseif (\array_key_exists('Log', $data) && $data['Log'] === null) { + $object->setLog(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['Status'] = $object->getStatus(); + } + if ($object->isInitialized('failingStreak') && null !== $object->getFailingStreak()) { + $data['FailingStreak'] = $object->getFailingStreak(); + } + if ($object->isInitialized('log') && null !== $object->getLog()) { + $values = []; + foreach ($object->getLog() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Log'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Health::class => false]; + } + } +} else { + class HealthNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Health::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Health::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Health(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($data['Status']); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('FailingStreak', $data) && $data['FailingStreak'] !== null) { + $object->setFailingStreak($data['FailingStreak']); + } + elseif (\array_key_exists('FailingStreak', $data) && $data['FailingStreak'] === null) { + $object->setFailingStreak(null); + } + if (\array_key_exists('Log', $data) && $data['Log'] !== null) { + $values = []; + foreach ($data['Log'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\HealthcheckResult::class, 'json', $context); + } + $object->setLog($values); + } + elseif (\array_key_exists('Log', $data) && $data['Log'] === null) { + $object->setLog(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['Status'] = $object->getStatus(); + } + if ($object->isInitialized('failingStreak') && null !== $object->getFailingStreak()) { + $data['FailingStreak'] = $object->getFailingStreak(); + } + if ($object->isInitialized('log') && null !== $object->getLog()) { + $values = []; + foreach ($object->getLog() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Log'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Health::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/HealthcheckResultNormalizer.php b/generated/Normalizer/HealthcheckResultNormalizer.php new file mode 100644 index 00000000..544f75f1 --- /dev/null +++ b/generated/Normalizer/HealthcheckResultNormalizer.php @@ -0,0 +1,172 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class HealthcheckResultNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\HealthcheckResult::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\HealthcheckResult::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\HealthcheckResult(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Start', $data) && $data['Start'] !== null) { + $object->setStart(\DateTime::createFromFormat('Y-m-d\TH:i:sP', $data['Start'])); + } + elseif (\array_key_exists('Start', $data) && $data['Start'] === null) { + $object->setStart(null); + } + if (\array_key_exists('End', $data) && $data['End'] !== null) { + $object->setEnd($data['End']); + } + elseif (\array_key_exists('End', $data) && $data['End'] === null) { + $object->setEnd(null); + } + if (\array_key_exists('ExitCode', $data) && $data['ExitCode'] !== null) { + $object->setExitCode($data['ExitCode']); + } + elseif (\array_key_exists('ExitCode', $data) && $data['ExitCode'] === null) { + $object->setExitCode(null); + } + if (\array_key_exists('Output', $data) && $data['Output'] !== null) { + $object->setOutput($data['Output']); + } + elseif (\array_key_exists('Output', $data) && $data['Output'] === null) { + $object->setOutput(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('start') && null !== $object->getStart()) { + $data['Start'] = $object->getStart()->format('Y-m-d\TH:i:sP'); + } + if ($object->isInitialized('end') && null !== $object->getEnd()) { + $data['End'] = $object->getEnd(); + } + if ($object->isInitialized('exitCode') && null !== $object->getExitCode()) { + $data['ExitCode'] = $object->getExitCode(); + } + if ($object->isInitialized('output') && null !== $object->getOutput()) { + $data['Output'] = $object->getOutput(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\HealthcheckResult::class => false]; + } + } +} else { + class HealthcheckResultNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\HealthcheckResult::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\HealthcheckResult::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\HealthcheckResult(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Start', $data) && $data['Start'] !== null) { + $object->setStart(\DateTime::createFromFormat('Y-m-d\TH:i:sP', $data['Start'])); + } + elseif (\array_key_exists('Start', $data) && $data['Start'] === null) { + $object->setStart(null); + } + if (\array_key_exists('End', $data) && $data['End'] !== null) { + $object->setEnd($data['End']); + } + elseif (\array_key_exists('End', $data) && $data['End'] === null) { + $object->setEnd(null); + } + if (\array_key_exists('ExitCode', $data) && $data['ExitCode'] !== null) { + $object->setExitCode($data['ExitCode']); + } + elseif (\array_key_exists('ExitCode', $data) && $data['ExitCode'] === null) { + $object->setExitCode(null); + } + if (\array_key_exists('Output', $data) && $data['Output'] !== null) { + $object->setOutput($data['Output']); + } + elseif (\array_key_exists('Output', $data) && $data['Output'] === null) { + $object->setOutput(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('start') && null !== $object->getStart()) { + $data['Start'] = $object->getStart()->format('Y-m-d\TH:i:sP'); + } + if ($object->isInitialized('end') && null !== $object->getEnd()) { + $data['End'] = $object->getEnd(); + } + if ($object->isInitialized('exitCode') && null !== $object->getExitCode()) { + $data['ExitCode'] = $object->getExitCode(); + } + if ($object->isInitialized('output') && null !== $object->getOutput()) { + $data['Output'] = $object->getOutput(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\HealthcheckResult::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/HostConfigLogConfigNormalizer.php b/generated/Normalizer/HostConfigLogConfigNormalizer.php new file mode 100644 index 00000000..f792e5ac --- /dev/null +++ b/generated/Normalizer/HostConfigLogConfigNormalizer.php @@ -0,0 +1,152 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class HostConfigLogConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\HostConfigLogConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\HostConfigLogConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\HostConfigLogConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Config'] as $key => $value) { + $values[$key] = $value; + } + $object->setConfig($values); + } + elseif (\array_key_exists('Config', $data) && $data['Config'] === null) { + $object->setConfig(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $values = []; + foreach ($object->getConfig() as $key => $value) { + $values[$key] = $value; + } + $data['Config'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\HostConfigLogConfig::class => false]; + } + } +} else { + class HostConfigLogConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\HostConfigLogConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\HostConfigLogConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\HostConfigLogConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Config'] as $key => $value) { + $values[$key] = $value; + } + $object->setConfig($values); + } + elseif (\array_key_exists('Config', $data) && $data['Config'] === null) { + $object->setConfig(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $values = []; + foreach ($object->getConfig() as $key => $value) { + $values[$key] = $value; + } + $data['Config'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\HostConfigLogConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/HostConfigNormalizer.php b/generated/Normalizer/HostConfigNormalizer.php index 2fc6bf2b..209680f7 100644 --- a/generated/Normalizer/HostConfigNormalizer.php +++ b/generated/Normalizer/HostConfigNormalizer.php @@ -2,826 +2,1839 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class HostConfigNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class HostConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\HostConfig') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\HostConfig::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\HostConfig) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\HostConfig::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\HostConfig(); - if (property_exists($data, 'Binds')) { - $value = $data->{'Binds'}; - if (is_array($data->{'Binds'})) { + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\HostConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CpuShares', $data) && $data['CpuShares'] !== null) { + $object->setCpuShares($data['CpuShares']); + } + elseif (\array_key_exists('CpuShares', $data) && $data['CpuShares'] === null) { + $object->setCpuShares(null); + } + if (\array_key_exists('Memory', $data) && $data['Memory'] !== null) { + $object->setMemory($data['Memory']); + } + elseif (\array_key_exists('Memory', $data) && $data['Memory'] === null) { + $object->setMemory(null); + } + if (\array_key_exists('CgroupParent', $data) && $data['CgroupParent'] !== null) { + $object->setCgroupParent($data['CgroupParent']); + } + elseif (\array_key_exists('CgroupParent', $data) && $data['CgroupParent'] === null) { + $object->setCgroupParent(null); + } + if (\array_key_exists('BlkioWeight', $data) && $data['BlkioWeight'] !== null) { + $object->setBlkioWeight($data['BlkioWeight']); + } + elseif (\array_key_exists('BlkioWeight', $data) && $data['BlkioWeight'] === null) { + $object->setBlkioWeight(null); + } + if (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] !== null) { $values = []; - foreach ($data->{'Binds'} as $value_1) { - $values[] = $value_1; + foreach ($data['BlkioWeightDevice'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class, 'json', $context); } - $value = $values; + $object->setBlkioWeightDevice($values); } - if (is_null($data->{'Binds'})) { - $value = $data->{'Binds'}; + elseif (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] === null) { + $object->setBlkioWeightDevice(null); } - $object->setBinds($value); - } - if (property_exists($data, 'Tmpfs')) { - $value_2 = $data->{'Tmpfs'}; - if (is_object($data->{'Tmpfs'})) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Tmpfs'} as $key => $value_3) { - $values_1[$key] = $value_3; + if (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] !== null) { + $values_1 = []; + foreach ($data['BlkioDeviceReadBps'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } - $value_2 = $values_1; + $object->setBlkioDeviceReadBps($values_1); } - if (is_null($data->{'Tmpfs'})) { - $value_2 = $data->{'Tmpfs'}; + elseif (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] === null) { + $object->setBlkioDeviceReadBps(null); } - $object->setTmpfs($value_2); - } - if (property_exists($data, 'Links')) { - $value_4 = $data->{'Links'}; - if (is_array($data->{'Links'})) { + if (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] !== null) { $values_2 = []; - foreach ($data->{'Links'} as $value_5) { - $values_2[] = $value_5; + foreach ($data['BlkioDeviceWriteBps'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } - $value_4 = $values_2; + $object->setBlkioDeviceWriteBps($values_2); } - if (is_null($data->{'Links'})) { - $value_4 = $data->{'Links'}; + elseif (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] === null) { + $object->setBlkioDeviceWriteBps(null); } - $object->setLinks($value_4); - } - if (property_exists($data, 'LxcConf')) { - $value_6 = $data->{'LxcConf'}; - if (is_object($data->{'LxcConf'})) { - $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'LxcConf'} as $key_1 => $value_7) { - $values_3[$key_1] = $value_7; + if (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] !== null) { + $values_3 = []; + foreach ($data['BlkioDeviceReadIOps'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } - $value_6 = $values_3; + $object->setBlkioDeviceReadIOps($values_3); } - if (is_null($data->{'LxcConf'})) { - $value_6 = $data->{'LxcConf'}; + elseif (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] === null) { + $object->setBlkioDeviceReadIOps(null); } - $object->setLxcConf($value_6); - } - if (property_exists($data, 'Memory')) { - $object->setMemory($data->{'Memory'}); - } - if (property_exists($data, 'MemorySwap')) { - $object->setMemorySwap($data->{'MemorySwap'}); - } - if (property_exists($data, 'MemoryReservation')) { - $object->setMemoryReservation($data->{'MemoryReservation'}); - } - if (property_exists($data, 'KernelMemory')) { - $object->setKernelMemory($data->{'KernelMemory'}); - } - if (property_exists($data, 'CpuShares')) { - $object->setCpuShares($data->{'CpuShares'}); - } - if (property_exists($data, 'CpuPeriod')) { - $object->setCpuPeriod($data->{'CpuPeriod'}); - } - if (property_exists($data, 'CpuQuota')) { - $object->setCpuQuota($data->{'CpuQuota'}); - } - if (property_exists($data, 'CpusetCpus')) { - $object->setCpusetCpus($data->{'CpusetCpus'}); - } - if (property_exists($data, 'CpusetMems')) { - $object->setCpusetMems($data->{'CpusetMems'}); - } - if (property_exists($data, 'MaximumIOps')) { - $object->setMaximumIOps($data->{'MaximumIOps'}); - } - if (property_exists($data, 'MaximumIOBps')) { - $object->setMaximumIOBps($data->{'MaximumIOBps'}); - } - if (property_exists($data, 'BlkioWeight')) { - $object->setBlkioWeight($data->{'BlkioWeight'}); - } - if (property_exists($data, 'BlkioWeightDevice')) { - $value_8 = $data->{'BlkioWeightDevice'}; - if (is_array($data->{'BlkioWeightDevice'})) { + if (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] !== null) { $values_4 = []; - foreach ($data->{'BlkioWeightDevice'} as $value_9) { - $values_4[] = $this->serializer->denormalize($value_9, 'Docker\\API\\Model\\DeviceWeight', 'raw', $context); + foreach ($data['BlkioDeviceWriteIOps'] as $value_4) { + $values_4[] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } - $value_8 = $values_4; + $object->setBlkioDeviceWriteIOps($values_4); } - if (is_null($data->{'BlkioWeightDevice'})) { - $value_8 = $data->{'BlkioWeightDevice'}; + elseif (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] === null) { + $object->setBlkioDeviceWriteIOps(null); } - $object->setBlkioWeightDevice($value_8); - } - if (property_exists($data, 'BlkioDeviceReadBps')) { - $value_10 = $data->{'BlkioDeviceReadBps'}; - if (is_array($data->{'BlkioDeviceReadBps'})) { + if (\array_key_exists('CpuPeriod', $data) && $data['CpuPeriod'] !== null) { + $object->setCpuPeriod($data['CpuPeriod']); + } + elseif (\array_key_exists('CpuPeriod', $data) && $data['CpuPeriod'] === null) { + $object->setCpuPeriod(null); + } + if (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] !== null) { + $object->setCpuQuota($data['CpuQuota']); + } + elseif (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] === null) { + $object->setCpuQuota(null); + } + if (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] !== null) { + $object->setCpuRealtimePeriod($data['CpuRealtimePeriod']); + } + elseif (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] === null) { + $object->setCpuRealtimePeriod(null); + } + if (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] !== null) { + $object->setCpuRealtimeRuntime($data['CpuRealtimeRuntime']); + } + elseif (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] === null) { + $object->setCpuRealtimeRuntime(null); + } + if (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] !== null) { + $object->setCpusetCpus($data['CpusetCpus']); + } + elseif (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] === null) { + $object->setCpusetCpus(null); + } + if (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] !== null) { + $object->setCpusetMems($data['CpusetMems']); + } + elseif (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] === null) { + $object->setCpusetMems(null); + } + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { $values_5 = []; - foreach ($data->{'BlkioDeviceReadBps'} as $value_11) { - $values_5[] = $this->serializer->denormalize($value_11, 'Docker\\API\\Model\\DeviceRate', 'raw', $context); + foreach ($data['Devices'] as $value_5) { + $values_5[] = $this->denormalizer->denormalize($value_5, \Docker\API\Model\DeviceMapping::class, 'json', $context); } - $value_10 = $values_5; + $object->setDevices($values_5); } - if (is_null($data->{'BlkioDeviceReadBps'})) { - $value_10 = $data->{'BlkioDeviceReadBps'}; + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); } - $object->setBlkioDeviceReadBps($value_10); - } - if (property_exists($data, 'BlkioDeviceReadIOps')) { - $value_12 = $data->{'BlkioDeviceReadIOps'}; - if (is_array($data->{'BlkioDeviceReadIOps'})) { + if (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] !== null) { $values_6 = []; - foreach ($data->{'BlkioDeviceReadIOps'} as $value_13) { - $values_6[] = $this->serializer->denormalize($value_13, 'Docker\\API\\Model\\DeviceRate', 'raw', $context); + foreach ($data['DeviceCgroupRules'] as $value_6) { + $values_6[] = $value_6; } - $value_12 = $values_6; + $object->setDeviceCgroupRules($values_6); } - if (is_null($data->{'BlkioDeviceReadIOps'})) { - $value_12 = $data->{'BlkioDeviceReadIOps'}; + elseif (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] === null) { + $object->setDeviceCgroupRules(null); } - $object->setBlkioDeviceReadIOps($value_12); - } - if (property_exists($data, 'BlkioDeviceWriteBps')) { - $value_14 = $data->{'BlkioDeviceWriteBps'}; - if (is_array($data->{'BlkioDeviceWriteBps'})) { + if (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] !== null) { $values_7 = []; - foreach ($data->{'BlkioDeviceWriteBps'} as $value_15) { - $values_7[] = $this->serializer->denormalize($value_15, 'Docker\\API\\Model\\DeviceRate', 'raw', $context); + foreach ($data['DeviceRequests'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, \Docker\API\Model\DeviceRequest::class, 'json', $context); } - $value_14 = $values_7; + $object->setDeviceRequests($values_7); } - if (is_null($data->{'BlkioDeviceWriteBps'})) { - $value_14 = $data->{'BlkioDeviceWriteBps'}; + elseif (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] === null) { + $object->setDeviceRequests(null); } - $object->setBlkioDeviceWriteBps($value_14); - } - if (property_exists($data, 'BlkioDeviceWriteIOps')) { - $value_16 = $data->{'BlkioDeviceWriteIOps'}; - if (is_array($data->{'BlkioDeviceWriteIOps'})) { + if (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] !== null) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); + } + elseif (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] === null) { + $object->setKernelMemoryTCP(null); + } + if (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] !== null) { + $object->setMemoryReservation($data['MemoryReservation']); + } + elseif (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] === null) { + $object->setMemoryReservation(null); + } + if (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] !== null) { + $object->setMemorySwap($data['MemorySwap']); + } + elseif (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] === null) { + $object->setMemorySwap(null); + } + if (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] !== null) { + $object->setMemorySwappiness($data['MemorySwappiness']); + } + elseif (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] === null) { + $object->setMemorySwappiness(null); + } + if (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] !== null) { + $object->setNanoCpus($data['NanoCpus']); + } + elseif (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] === null) { + $object->setNanoCpus(null); + } + if (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] !== null) { + $object->setOomKillDisable($data['OomKillDisable']); + } + elseif (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] === null) { + $object->setOomKillDisable(null); + } + if (\array_key_exists('Init', $data) && $data['Init'] !== null) { + $object->setInit($data['Init']); + } + elseif (\array_key_exists('Init', $data) && $data['Init'] === null) { + $object->setInit(null); + } + if (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] !== null) { + $object->setPidsLimit($data['PidsLimit']); + } + elseif (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] === null) { + $object->setPidsLimit(null); + } + if (\array_key_exists('Ulimits', $data) && $data['Ulimits'] !== null) { $values_8 = []; - foreach ($data->{'BlkioDeviceWriteIOps'} as $value_17) { - $values_8[] = $this->serializer->denormalize($value_17, 'Docker\\API\\Model\\DeviceRate', 'raw', $context); + foreach ($data['Ulimits'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, \Docker\API\Model\ResourcesUlimitsItem::class, 'json', $context); } - $value_16 = $values_8; + $object->setUlimits($values_8); } - if (is_null($data->{'BlkioDeviceWriteIOps'})) { - $value_16 = $data->{'BlkioDeviceWriteIOps'}; + elseif (\array_key_exists('Ulimits', $data) && $data['Ulimits'] === null) { + $object->setUlimits(null); } - $object->setBlkioDeviceWriteIOps($value_16); - } - if (property_exists($data, 'MemorySwappiness')) { - $object->setMemorySwappiness($data->{'MemorySwappiness'}); - } - if (property_exists($data, 'OomKillDisable')) { - $object->setOomKillDisable($data->{'OomKillDisable'}); - } - if (property_exists($data, 'OomScoreAdj')) { - $object->setOomScoreAdj($data->{'OomScoreAdj'}); - } - if (property_exists($data, 'PidsLimit')) { - $object->setPidsLimit($data->{'PidsLimit'}); - } - if (property_exists($data, 'PortBindings')) { - $value_18 = $data->{'PortBindings'}; - if (is_object($data->{'PortBindings'})) { - $values_9 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'PortBindings'} as $key_2 => $value_19) { - $value_20 = $value_19; - if (is_array($value_19)) { - $values_10 = []; - foreach ($value_19 as $value_21) { - $values_10[] = $this->serializer->denormalize($value_21, 'Docker\\API\\Model\\PortBinding', 'raw', $context); - } - $value_20 = $values_10; - } - if (is_null($value_19)) { - $value_20 = $value_19; - } - $values_9[$key_2] = $value_20; + if (\array_key_exists('CpuCount', $data) && $data['CpuCount'] !== null) { + $object->setCpuCount($data['CpuCount']); + } + elseif (\array_key_exists('CpuCount', $data) && $data['CpuCount'] === null) { + $object->setCpuCount(null); + } + if (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] !== null) { + $object->setCpuPercent($data['CpuPercent']); + } + elseif (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] === null) { + $object->setCpuPercent(null); + } + if (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] !== null) { + $object->setIOMaximumIOps($data['IOMaximumIOps']); + } + elseif (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] === null) { + $object->setIOMaximumIOps(null); + } + if (\array_key_exists('IOMaximumBandwidth', $data) && $data['IOMaximumBandwidth'] !== null) { + $object->setIOMaximumBandwidth($data['IOMaximumBandwidth']); + } + elseif (\array_key_exists('IOMaximumBandwidth', $data) && $data['IOMaximumBandwidth'] === null) { + $object->setIOMaximumBandwidth(null); + } + if (\array_key_exists('Binds', $data) && $data['Binds'] !== null) { + $values_9 = []; + foreach ($data['Binds'] as $value_9) { + $values_9[] = $value_9; } - $value_18 = $values_9; + $object->setBinds($values_9); } - if (is_null($data->{'PortBindings'})) { - $value_18 = $data->{'PortBindings'}; + elseif (\array_key_exists('Binds', $data) && $data['Binds'] === null) { + $object->setBinds(null); } - $object->setPortBindings($value_18); - } - if (property_exists($data, 'PublishAllPorts')) { - $object->setPublishAllPorts($data->{'PublishAllPorts'}); - } - if (property_exists($data, 'Privileged')) { - $object->setPrivileged($data->{'Privileged'}); - } - if (property_exists($data, 'ReadonlyRootfs')) { - $object->setReadonlyRootfs($data->{'ReadonlyRootfs'}); - } - if (property_exists($data, 'Sysctls')) { - $value_22 = $data->{'Sysctls'}; - if (is_object($data->{'Sysctls'})) { - $values_11 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Sysctls'} as $key_3 => $value_23) { - $values_11[$key_3] = $value_23; + if (\array_key_exists('ContainerIDFile', $data) && $data['ContainerIDFile'] !== null) { + $object->setContainerIDFile($data['ContainerIDFile']); + } + elseif (\array_key_exists('ContainerIDFile', $data) && $data['ContainerIDFile'] === null) { + $object->setContainerIDFile(null); + } + if (\array_key_exists('LogConfig', $data) && $data['LogConfig'] !== null) { + $object->setLogConfig($this->denormalizer->denormalize($data['LogConfig'], \Docker\API\Model\HostConfigLogConfig::class, 'json', $context)); + } + elseif (\array_key_exists('LogConfig', $data) && $data['LogConfig'] === null) { + $object->setLogConfig(null); + } + if (\array_key_exists('NetworkMode', $data) && $data['NetworkMode'] !== null) { + $object->setNetworkMode($data['NetworkMode']); + } + elseif (\array_key_exists('NetworkMode', $data) && $data['NetworkMode'] === null) { + $object->setNetworkMode(null); + } + if (\array_key_exists('PortBindings', $data) && $data['PortBindings'] !== null) { + $values_10 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['PortBindings'] as $key => $value_10) { + $values_11 = []; + foreach ($value_10 as $value_11) { + $values_11[] = $this->denormalizer->denormalize($value_11, \Docker\API\Model\PortBinding::class, 'json', $context); + } + $values_10[$key] = $values_11; } - $value_22 = $values_11; + $object->setPortBindings($values_10); } - if (is_null($data->{'Sysctls'})) { - $value_22 = $data->{'Sysctls'}; + elseif (\array_key_exists('PortBindings', $data) && $data['PortBindings'] === null) { + $object->setPortBindings(null); } - $object->setSysctls($value_22); - } - if (property_exists($data, 'StorageOpt')) { - $value_24 = $data->{'StorageOpt'}; - if (is_object($data->{'StorageOpt'})) { - $values_12 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'StorageOpt'} as $key_4 => $value_25) { - $values_12[$key_4] = $value_25; + if (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] !== null) { + $object->setRestartPolicy($this->denormalizer->denormalize($data['RestartPolicy'], \Docker\API\Model\RestartPolicy::class, 'json', $context)); + } + elseif (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] === null) { + $object->setRestartPolicy(null); + } + if (\array_key_exists('AutoRemove', $data) && $data['AutoRemove'] !== null) { + $object->setAutoRemove($data['AutoRemove']); + } + elseif (\array_key_exists('AutoRemove', $data) && $data['AutoRemove'] === null) { + $object->setAutoRemove(null); + } + if (\array_key_exists('VolumeDriver', $data) && $data['VolumeDriver'] !== null) { + $object->setVolumeDriver($data['VolumeDriver']); + } + elseif (\array_key_exists('VolumeDriver', $data) && $data['VolumeDriver'] === null) { + $object->setVolumeDriver(null); + } + if (\array_key_exists('VolumesFrom', $data) && $data['VolumesFrom'] !== null) { + $values_12 = []; + foreach ($data['VolumesFrom'] as $value_12) { + $values_12[] = $value_12; } - $value_24 = $values_12; + $object->setVolumesFrom($values_12); } - if (is_null($data->{'StorageOpt'})) { - $value_24 = $data->{'StorageOpt'}; + elseif (\array_key_exists('VolumesFrom', $data) && $data['VolumesFrom'] === null) { + $object->setVolumesFrom(null); } - $object->setStorageOpt($value_24); - } - if (property_exists($data, 'Dns')) { - $value_26 = $data->{'Dns'}; - if (is_array($data->{'Dns'})) { + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { $values_13 = []; - foreach ($data->{'Dns'} as $value_27) { - $values_13[] = $value_27; + foreach ($data['Mounts'] as $value_13) { + $values_13[] = $this->denormalizer->denormalize($value_13, \Docker\API\Model\Mount::class, 'json', $context); } - $value_26 = $values_13; + $object->setMounts($values_13); } - if (is_null($data->{'Dns'})) { - $value_26 = $data->{'Dns'}; + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); } - $object->setDns($value_26); - } - if (property_exists($data, 'DnsOptions')) { - $value_28 = $data->{'DnsOptions'}; - if (is_array($data->{'DnsOptions'})) { + if (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] !== null) { $values_14 = []; - foreach ($data->{'DnsOptions'} as $value_29) { - $values_14[] = $value_29; + foreach ($data['ConsoleSize'] as $value_14) { + $values_14[] = $value_14; } - $value_28 = $values_14; + $object->setConsoleSize($values_14); } - if (is_null($data->{'DnsOptions'})) { - $value_28 = $data->{'DnsOptions'}; + elseif (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] === null) { + $object->setConsoleSize(null); } - $object->setDnsOptions($value_28); - } - if (property_exists($data, 'DnsSearch')) { - $value_30 = $data->{'DnsSearch'}; - if (is_array($data->{'DnsSearch'})) { - $values_15 = []; - foreach ($data->{'DnsSearch'} as $value_31) { - $values_15[] = $value_31; + if (\array_key_exists('Annotations', $data) && $data['Annotations'] !== null) { + $values_15 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Annotations'] as $key_1 => $value_15) { + $values_15[$key_1] = $value_15; } - $value_30 = $values_15; + $object->setAnnotations($values_15); } - if (is_null($data->{'DnsSearch'})) { - $value_30 = $data->{'DnsSearch'}; + elseif (\array_key_exists('Annotations', $data) && $data['Annotations'] === null) { + $object->setAnnotations(null); } - $object->setDnsSearch($value_30); - } - if (property_exists($data, 'ExtraHosts')) { - $value_32 = $data->{'ExtraHosts'}; - if (is_array($data->{'ExtraHosts'})) { + if (\array_key_exists('CapAdd', $data) && $data['CapAdd'] !== null) { $values_16 = []; - foreach ($data->{'ExtraHosts'} as $value_33) { - $values_16[] = $value_33; + foreach ($data['CapAdd'] as $value_16) { + $values_16[] = $value_16; } - $value_32 = $values_16; + $object->setCapAdd($values_16); } - if (is_null($data->{'ExtraHosts'})) { - $value_32 = $data->{'ExtraHosts'}; + elseif (\array_key_exists('CapAdd', $data) && $data['CapAdd'] === null) { + $object->setCapAdd(null); } - $object->setExtraHosts($value_32); - } - if (property_exists($data, 'VolumesFrom')) { - $value_34 = $data->{'VolumesFrom'}; - if (is_array($data->{'VolumesFrom'})) { + if (\array_key_exists('CapDrop', $data) && $data['CapDrop'] !== null) { $values_17 = []; - foreach ($data->{'VolumesFrom'} as $value_35) { - $values_17[] = $value_35; + foreach ($data['CapDrop'] as $value_17) { + $values_17[] = $value_17; } - $value_34 = $values_17; + $object->setCapDrop($values_17); } - if (is_null($data->{'VolumesFrom'})) { - $value_34 = $data->{'VolumesFrom'}; + elseif (\array_key_exists('CapDrop', $data) && $data['CapDrop'] === null) { + $object->setCapDrop(null); } - $object->setVolumesFrom($value_34); - } - if (property_exists($data, 'CapAdd')) { - $value_36 = $data->{'CapAdd'}; - if (is_array($data->{'CapAdd'})) { + if (\array_key_exists('CgroupnsMode', $data) && $data['CgroupnsMode'] !== null) { + $object->setCgroupnsMode($data['CgroupnsMode']); + } + elseif (\array_key_exists('CgroupnsMode', $data) && $data['CgroupnsMode'] === null) { + $object->setCgroupnsMode(null); + } + if (\array_key_exists('Dns', $data) && $data['Dns'] !== null) { $values_18 = []; - foreach ($data->{'CapAdd'} as $value_37) { - $values_18[] = $value_37; + foreach ($data['Dns'] as $value_18) { + $values_18[] = $value_18; } - $value_36 = $values_18; + $object->setDns($values_18); } - if (is_null($data->{'CapAdd'})) { - $value_36 = $data->{'CapAdd'}; + elseif (\array_key_exists('Dns', $data) && $data['Dns'] === null) { + $object->setDns(null); } - $object->setCapAdd($value_36); - } - if (property_exists($data, 'CapDrop')) { - $value_38 = $data->{'CapDrop'}; - if (is_array($data->{'CapDrop'})) { + if (\array_key_exists('DnsOptions', $data) && $data['DnsOptions'] !== null) { $values_19 = []; - foreach ($data->{'CapDrop'} as $value_39) { - $values_19[] = $value_39; + foreach ($data['DnsOptions'] as $value_19) { + $values_19[] = $value_19; } - $value_38 = $values_19; + $object->setDnsOptions($values_19); } - if (is_null($data->{'CapDrop'})) { - $value_38 = $data->{'CapDrop'}; + elseif (\array_key_exists('DnsOptions', $data) && $data['DnsOptions'] === null) { + $object->setDnsOptions(null); } - $object->setCapDrop($value_38); - } - if (property_exists($data, 'GroupAdd')) { - $value_40 = $data->{'GroupAdd'}; - if (is_array($data->{'GroupAdd'})) { + if (\array_key_exists('DnsSearch', $data) && $data['DnsSearch'] !== null) { $values_20 = []; - foreach ($data->{'GroupAdd'} as $value_41) { - $values_20[] = $value_41; + foreach ($data['DnsSearch'] as $value_20) { + $values_20[] = $value_20; } - $value_40 = $values_20; + $object->setDnsSearch($values_20); } - if (is_null($data->{'GroupAdd'})) { - $value_40 = $data->{'GroupAdd'}; + elseif (\array_key_exists('DnsSearch', $data) && $data['DnsSearch'] === null) { + $object->setDnsSearch(null); } - $object->setGroupAdd($value_40); - } - if (property_exists($data, 'RestartPolicy')) { - $object->setRestartPolicy($this->serializer->denormalize($data->{'RestartPolicy'}, 'Docker\\API\\Model\\RestartPolicy', 'raw', $context)); - } - if (property_exists($data, 'UsernsMode')) { - $object->setUsernsMode($data->{'UsernsMode'}); - } - if (property_exists($data, 'NetworkMode')) { - $object->setNetworkMode($data->{'NetworkMode'}); - } - if (property_exists($data, 'Devices')) { - $value_42 = $data->{'Devices'}; - if (is_array($data->{'Devices'})) { + if (\array_key_exists('ExtraHosts', $data) && $data['ExtraHosts'] !== null) { $values_21 = []; - foreach ($data->{'Devices'} as $value_43) { - $values_21[] = $this->serializer->denormalize($value_43, 'Docker\\API\\Model\\Device', 'raw', $context); + foreach ($data['ExtraHosts'] as $value_21) { + $values_21[] = $value_21; } - $value_42 = $values_21; + $object->setExtraHosts($values_21); } - if (is_null($data->{'Devices'})) { - $value_42 = $data->{'Devices'}; + elseif (\array_key_exists('ExtraHosts', $data) && $data['ExtraHosts'] === null) { + $object->setExtraHosts(null); } - $object->setDevices($value_42); - } - if (property_exists($data, 'Ulimits')) { - $value_44 = $data->{'Ulimits'}; - if (is_array($data->{'Ulimits'})) { + if (\array_key_exists('GroupAdd', $data) && $data['GroupAdd'] !== null) { $values_22 = []; - foreach ($data->{'Ulimits'} as $value_45) { - $values_22[] = $this->serializer->denormalize($value_45, 'Docker\\API\\Model\\Ulimit', 'raw', $context); + foreach ($data['GroupAdd'] as $value_22) { + $values_22[] = $value_22; } - $value_44 = $values_22; + $object->setGroupAdd($values_22); } - if (is_null($data->{'Ulimits'})) { - $value_44 = $data->{'Ulimits'}; + elseif (\array_key_exists('GroupAdd', $data) && $data['GroupAdd'] === null) { + $object->setGroupAdd(null); } - $object->setUlimits($value_44); - } - if (property_exists($data, 'SecurityOpt')) { - $value_46 = $data->{'SecurityOpt'}; - if (is_array($data->{'SecurityOpt'})) { + if (\array_key_exists('IpcMode', $data) && $data['IpcMode'] !== null) { + $object->setIpcMode($data['IpcMode']); + } + elseif (\array_key_exists('IpcMode', $data) && $data['IpcMode'] === null) { + $object->setIpcMode(null); + } + if (\array_key_exists('Cgroup', $data) && $data['Cgroup'] !== null) { + $object->setCgroup($data['Cgroup']); + } + elseif (\array_key_exists('Cgroup', $data) && $data['Cgroup'] === null) { + $object->setCgroup(null); + } + if (\array_key_exists('Links', $data) && $data['Links'] !== null) { $values_23 = []; - foreach ($data->{'SecurityOpt'} as $value_47) { - $values_23[] = $value_47; + foreach ($data['Links'] as $value_23) { + $values_23[] = $value_23; } - $value_46 = $values_23; + $object->setLinks($values_23); } - if (is_null($data->{'SecurityOpt'})) { - $value_46 = $data->{'SecurityOpt'}; + elseif (\array_key_exists('Links', $data) && $data['Links'] === null) { + $object->setLinks(null); } - $object->setSecurityOpt($value_46); - } - if (property_exists($data, 'LogConfig')) { - $object->setLogConfig($this->serializer->denormalize($data->{'LogConfig'}, 'Docker\\API\\Model\\LogConfig', 'raw', $context)); - } - if (property_exists($data, 'CgroupParent')) { - $object->setCgroupParent($data->{'CgroupParent'}); - } - if (property_exists($data, 'VolumeDriver')) { - $object->setVolumeDriver($data->{'VolumeDriver'}); - } - if (property_exists($data, 'ShmSize')) { - $object->setShmSize($data->{'ShmSize'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - $value = $object->getBinds(); - if (is_array($object->getBinds())) { - $values = []; - foreach ($object->getBinds() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getBinds())) { - $value = $object->getBinds(); - } - $data->{'Binds'} = $value; - $value_2 = $object->getTmpfs(); - if (is_object($object->getTmpfs())) { - $values_1 = new \stdClass(); - foreach ($object->getTmpfs() as $key => $value_3) { - $values_1->{$key} = $value_3; - } - $value_2 = $values_1; - } - if (is_null($object->getTmpfs())) { - $value_2 = $object->getTmpfs(); - } - $data->{'Tmpfs'} = $value_2; - $value_4 = $object->getLinks(); - if (is_array($object->getLinks())) { - $values_2 = []; - foreach ($object->getLinks() as $value_5) { - $values_2[] = $value_5; - } - $value_4 = $values_2; - } - if (is_null($object->getLinks())) { - $value_4 = $object->getLinks(); - } - $data->{'Links'} = $value_4; - $value_6 = $object->getLxcConf(); - if (is_object($object->getLxcConf())) { - $values_3 = new \stdClass(); - foreach ($object->getLxcConf() as $key_1 => $value_7) { - $values_3->{$key_1} = $value_7; - } - $value_6 = $values_3; - } - if (is_null($object->getLxcConf())) { - $value_6 = $object->getLxcConf(); - } - $data->{'LxcConf'} = $value_6; - if (null !== $object->getMemory()) { - $data->{'Memory'} = $object->getMemory(); - } - if (null !== $object->getMemorySwap()) { - $data->{'MemorySwap'} = $object->getMemorySwap(); - } - if (null !== $object->getMemoryReservation()) { - $data->{'MemoryReservation'} = $object->getMemoryReservation(); - } - if (null !== $object->getKernelMemory()) { - $data->{'KernelMemory'} = $object->getKernelMemory(); - } - if (null !== $object->getCpuShares()) { - $data->{'CpuShares'} = $object->getCpuShares(); - } - if (null !== $object->getCpuPeriod()) { - $data->{'CpuPeriod'} = $object->getCpuPeriod(); - } - if (null !== $object->getCpuQuota()) { - $data->{'CpuQuota'} = $object->getCpuQuota(); - } - if (null !== $object->getCpusetCpus()) { - $data->{'CpusetCpus'} = $object->getCpusetCpus(); - } - if (null !== $object->getCpusetMems()) { - $data->{'CpusetMems'} = $object->getCpusetMems(); - } - if (null !== $object->getMaximumIOps()) { - $data->{'MaximumIOps'} = $object->getMaximumIOps(); - } - if (null !== $object->getMaximumIOBps()) { - $data->{'MaximumIOBps'} = $object->getMaximumIOBps(); - } - if (null !== $object->getBlkioWeight()) { - $data->{'BlkioWeight'} = $object->getBlkioWeight(); - } - $value_8 = $object->getBlkioWeightDevice(); - if (is_array($object->getBlkioWeightDevice())) { - $values_4 = []; - foreach ($object->getBlkioWeightDevice() as $value_9) { - $values_4[] = $value_9; + if (\array_key_exists('OomScoreAdj', $data) && $data['OomScoreAdj'] !== null) { + $object->setOomScoreAdj($data['OomScoreAdj']); } - $value_8 = $values_4; - } - if (is_null($object->getBlkioWeightDevice())) { - $value_8 = $object->getBlkioWeightDevice(); - } - $data->{'BlkioWeightDevice'} = $value_8; - $value_10 = $object->getBlkioDeviceReadBps(); - if (is_array($object->getBlkioDeviceReadBps())) { - $values_5 = []; - foreach ($object->getBlkioDeviceReadBps() as $value_11) { - $values_5[] = $value_11; - } - $value_10 = $values_5; - } - if (is_null($object->getBlkioDeviceReadBps())) { - $value_10 = $object->getBlkioDeviceReadBps(); - } - $data->{'BlkioDeviceReadBps'} = $value_10; - $value_12 = $object->getBlkioDeviceReadIOps(); - if (is_array($object->getBlkioDeviceReadIOps())) { - $values_6 = []; - foreach ($object->getBlkioDeviceReadIOps() as $value_13) { - $values_6[] = $value_13; - } - $value_12 = $values_6; - } - if (is_null($object->getBlkioDeviceReadIOps())) { - $value_12 = $object->getBlkioDeviceReadIOps(); - } - $data->{'BlkioDeviceReadIOps'} = $value_12; - $value_14 = $object->getBlkioDeviceWriteBps(); - if (is_array($object->getBlkioDeviceWriteBps())) { - $values_7 = []; - foreach ($object->getBlkioDeviceWriteBps() as $value_15) { - $values_7[] = $value_15; - } - $value_14 = $values_7; - } - if (is_null($object->getBlkioDeviceWriteBps())) { - $value_14 = $object->getBlkioDeviceWriteBps(); - } - $data->{'BlkioDeviceWriteBps'} = $value_14; - $value_16 = $object->getBlkioDeviceWriteIOps(); - if (is_array($object->getBlkioDeviceWriteIOps())) { - $values_8 = []; - foreach ($object->getBlkioDeviceWriteIOps() as $value_17) { - $values_8[] = $value_17; - } - $value_16 = $values_8; - } - if (is_null($object->getBlkioDeviceWriteIOps())) { - $value_16 = $object->getBlkioDeviceWriteIOps(); - } - $data->{'BlkioDeviceWriteIOps'} = $value_16; - if (null !== $object->getMemorySwappiness()) { - $data->{'MemorySwappiness'} = $object->getMemorySwappiness(); - } - if (null !== $object->getOomKillDisable()) { - $data->{'OomKillDisable'} = $object->getOomKillDisable(); - } - if (null !== $object->getOomScoreAdj()) { - $data->{'OomScoreAdj'} = $object->getOomScoreAdj(); - } - if (null !== $object->getPidsLimit()) { - $data->{'PidsLimit'} = $object->getPidsLimit(); - } - $value_18 = $object->getPortBindings(); - if (is_object($object->getPortBindings())) { - $values_9 = new \stdClass(); - foreach ($object->getPortBindings() as $key_2 => $value_19) { - $value_20 = $value_19; - if (is_array($value_19)) { - $values_10 = []; - foreach ($value_19 as $value_21) { - $values_10[] = $value_21; - } - $value_20 = $values_10; + elseif (\array_key_exists('OomScoreAdj', $data) && $data['OomScoreAdj'] === null) { + $object->setOomScoreAdj(null); + } + if (\array_key_exists('PidMode', $data) && $data['PidMode'] !== null) { + $object->setPidMode($data['PidMode']); + } + elseif (\array_key_exists('PidMode', $data) && $data['PidMode'] === null) { + $object->setPidMode(null); + } + if (\array_key_exists('Privileged', $data) && $data['Privileged'] !== null) { + $object->setPrivileged($data['Privileged']); + } + elseif (\array_key_exists('Privileged', $data) && $data['Privileged'] === null) { + $object->setPrivileged(null); + } + if (\array_key_exists('PublishAllPorts', $data) && $data['PublishAllPorts'] !== null) { + $object->setPublishAllPorts($data['PublishAllPorts']); + } + elseif (\array_key_exists('PublishAllPorts', $data) && $data['PublishAllPorts'] === null) { + $object->setPublishAllPorts(null); + } + if (\array_key_exists('ReadonlyRootfs', $data) && $data['ReadonlyRootfs'] !== null) { + $object->setReadonlyRootfs($data['ReadonlyRootfs']); + } + elseif (\array_key_exists('ReadonlyRootfs', $data) && $data['ReadonlyRootfs'] === null) { + $object->setReadonlyRootfs(null); + } + if (\array_key_exists('SecurityOpt', $data) && $data['SecurityOpt'] !== null) { + $values_24 = []; + foreach ($data['SecurityOpt'] as $value_24) { + $values_24[] = $value_24; } - if (is_null($value_19)) { - $value_20 = $value_19; + $object->setSecurityOpt($values_24); + } + elseif (\array_key_exists('SecurityOpt', $data) && $data['SecurityOpt'] === null) { + $object->setSecurityOpt(null); + } + if (\array_key_exists('StorageOpt', $data) && $data['StorageOpt'] !== null) { + $values_25 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['StorageOpt'] as $key_2 => $value_25) { + $values_25[$key_2] = $value_25; } - $values_9->{$key_2} = $value_20; + $object->setStorageOpt($values_25); } - $value_18 = $values_9; - } - if (is_null($object->getPortBindings())) { - $value_18 = $object->getPortBindings(); - } - $data->{'PortBindings'} = $value_18; - if (null !== $object->getPublishAllPorts()) { - $data->{'PublishAllPorts'} = $object->getPublishAllPorts(); - } - if (null !== $object->getPrivileged()) { - $data->{'Privileged'} = $object->getPrivileged(); - } - if (null !== $object->getReadonlyRootfs()) { - $data->{'ReadonlyRootfs'} = $object->getReadonlyRootfs(); - } - $value_22 = $object->getSysctls(); - if (is_object($object->getSysctls())) { - $values_11 = new \stdClass(); - foreach ($object->getSysctls() as $key_3 => $value_23) { - $values_11->{$key_3} = $value_23; + elseif (\array_key_exists('StorageOpt', $data) && $data['StorageOpt'] === null) { + $object->setStorageOpt(null); } - $value_22 = $values_11; - } - if (is_null($object->getSysctls())) { - $value_22 = $object->getSysctls(); - } - $data->{'Sysctls'} = $value_22; - $value_24 = $object->getStorageOpt(); - if (is_object($object->getStorageOpt())) { - $values_12 = new \stdClass(); - foreach ($object->getStorageOpt() as $key_4 => $value_25) { - $values_12->{$key_4} = $value_25; - } - $value_24 = $values_12; - } - if (is_null($object->getStorageOpt())) { - $value_24 = $object->getStorageOpt(); - } - $data->{'StorageOpt'} = $value_24; - $value_26 = $object->getDns(); - if (is_array($object->getDns())) { - $values_13 = []; - foreach ($object->getDns() as $value_27) { - $values_13[] = $value_27; - } - $value_26 = $values_13; - } - if (is_null($object->getDns())) { - $value_26 = $object->getDns(); - } - $data->{'Dns'} = $value_26; - $value_28 = $object->getDnsOptions(); - if (is_array($object->getDnsOptions())) { - $values_14 = []; - foreach ($object->getDnsOptions() as $value_29) { - $values_14[] = $value_29; - } - $value_28 = $values_14; - } - if (is_null($object->getDnsOptions())) { - $value_28 = $object->getDnsOptions(); - } - $data->{'DnsOptions'} = $value_28; - $value_30 = $object->getDnsSearch(); - if (is_array($object->getDnsSearch())) { - $values_15 = []; - foreach ($object->getDnsSearch() as $value_31) { - $values_15[] = $value_31; - } - $value_30 = $values_15; - } - if (is_null($object->getDnsSearch())) { - $value_30 = $object->getDnsSearch(); - } - $data->{'DnsSearch'} = $value_30; - $value_32 = $object->getExtraHosts(); - if (is_array($object->getExtraHosts())) { - $values_16 = []; - foreach ($object->getExtraHosts() as $value_33) { - $values_16[] = $value_33; - } - $value_32 = $values_16; - } - if (is_null($object->getExtraHosts())) { - $value_32 = $object->getExtraHosts(); - } - $data->{'ExtraHosts'} = $value_32; - $value_34 = $object->getVolumesFrom(); - if (is_array($object->getVolumesFrom())) { - $values_17 = []; - foreach ($object->getVolumesFrom() as $value_35) { - $values_17[] = $value_35; - } - $value_34 = $values_17; - } - if (is_null($object->getVolumesFrom())) { - $value_34 = $object->getVolumesFrom(); - } - $data->{'VolumesFrom'} = $value_34; - $value_36 = $object->getCapAdd(); - if (is_array($object->getCapAdd())) { - $values_18 = []; - foreach ($object->getCapAdd() as $value_37) { - $values_18[] = $value_37; - } - $value_36 = $values_18; - } - if (is_null($object->getCapAdd())) { - $value_36 = $object->getCapAdd(); - } - $data->{'CapAdd'} = $value_36; - $value_38 = $object->getCapDrop(); - if (is_array($object->getCapDrop())) { - $values_19 = []; - foreach ($object->getCapDrop() as $value_39) { - $values_19[] = $value_39; - } - $value_38 = $values_19; - } - if (is_null($object->getCapDrop())) { - $value_38 = $object->getCapDrop(); - } - $data->{'CapDrop'} = $value_38; - $value_40 = $object->getGroupAdd(); - if (is_array($object->getGroupAdd())) { - $values_20 = []; - foreach ($object->getGroupAdd() as $value_41) { - $values_20[] = $value_41; - } - $value_40 = $values_20; - } - if (is_null($object->getGroupAdd())) { - $value_40 = $object->getGroupAdd(); - } - $data->{'GroupAdd'} = $value_40; - if (null !== $object->getRestartPolicy()) { - $data->{'RestartPolicy'} = json_decode($this->serializer->normalize($object->getRestartPolicy(), 'raw', $context)); - } - if (null !== $object->getUsernsMode()) { - $data->{'UsernsMode'} = $object->getUsernsMode(); - } - if (null !== $object->getNetworkMode()) { - $data->{'NetworkMode'} = $object->getNetworkMode(); - } - $value_42 = $object->getDevices(); - if (is_array($object->getDevices())) { - $values_21 = []; - foreach ($object->getDevices() as $value_43) { - $values_21[] = $this->serializer->normalize($value_43, 'raw', $context); + if (\array_key_exists('Tmpfs', $data) && $data['Tmpfs'] !== null) { + $values_26 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Tmpfs'] as $key_3 => $value_26) { + $values_26[$key_3] = $value_26; + } + $object->setTmpfs($values_26); } - $value_42 = $values_21; - } - if (is_null($object->getDevices())) { - $value_42 = $object->getDevices(); - } - $data->{'Devices'} = $value_42; - $value_44 = $object->getUlimits(); - if (is_array($object->getUlimits())) { - $values_22 = []; - foreach ($object->getUlimits() as $value_45) { - $values_22[] = $this->serializer->normalize($value_45, 'raw', $context); - } - $value_44 = $values_22; - } - if (is_null($object->getUlimits())) { - $value_44 = $object->getUlimits(); - } - $data->{'Ulimits'} = $value_44; - $value_46 = $object->getSecurityOpt(); - if (is_array($object->getSecurityOpt())) { - $values_23 = []; - foreach ($object->getSecurityOpt() as $value_47) { - $values_23[] = $value_47; - } - $value_46 = $values_23; - } - if (is_null($object->getSecurityOpt())) { - $value_46 = $object->getSecurityOpt(); - } - $data->{'SecurityOpt'} = $value_46; - if (null !== $object->getLogConfig()) { - $data->{'LogConfig'} = json_decode($this->serializer->normalize($object->getLogConfig(), 'raw', $context)); - } - if (null !== $object->getCgroupParent()) { - $data->{'CgroupParent'} = $object->getCgroupParent(); - } - if (null !== $object->getVolumeDriver()) { - $data->{'VolumeDriver'} = $object->getVolumeDriver(); - } - if (null !== $object->getShmSize()) { - $data->{'ShmSize'} = $object->getShmSize(); + elseif (\array_key_exists('Tmpfs', $data) && $data['Tmpfs'] === null) { + $object->setTmpfs(null); + } + if (\array_key_exists('UTSMode', $data) && $data['UTSMode'] !== null) { + $object->setUTSMode($data['UTSMode']); + } + elseif (\array_key_exists('UTSMode', $data) && $data['UTSMode'] === null) { + $object->setUTSMode(null); + } + if (\array_key_exists('UsernsMode', $data) && $data['UsernsMode'] !== null) { + $object->setUsernsMode($data['UsernsMode']); + } + elseif (\array_key_exists('UsernsMode', $data) && $data['UsernsMode'] === null) { + $object->setUsernsMode(null); + } + if (\array_key_exists('ShmSize', $data) && $data['ShmSize'] !== null) { + $object->setShmSize($data['ShmSize']); + } + elseif (\array_key_exists('ShmSize', $data) && $data['ShmSize'] === null) { + $object->setShmSize(null); + } + if (\array_key_exists('Sysctls', $data) && $data['Sysctls'] !== null) { + $values_27 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Sysctls'] as $key_4 => $value_27) { + $values_27[$key_4] = $value_27; + } + $object->setSysctls($values_27); + } + elseif (\array_key_exists('Sysctls', $data) && $data['Sysctls'] === null) { + $object->setSysctls(null); + } + if (\array_key_exists('Runtime', $data) && $data['Runtime'] !== null) { + $object->setRuntime($data['Runtime']); + } + elseif (\array_key_exists('Runtime', $data) && $data['Runtime'] === null) { + $object->setRuntime(null); + } + if (\array_key_exists('Isolation', $data) && $data['Isolation'] !== null) { + $object->setIsolation($data['Isolation']); + } + elseif (\array_key_exists('Isolation', $data) && $data['Isolation'] === null) { + $object->setIsolation(null); + } + if (\array_key_exists('MaskedPaths', $data) && $data['MaskedPaths'] !== null) { + $values_28 = []; + foreach ($data['MaskedPaths'] as $value_28) { + $values_28[] = $value_28; + } + $object->setMaskedPaths($values_28); + } + elseif (\array_key_exists('MaskedPaths', $data) && $data['MaskedPaths'] === null) { + $object->setMaskedPaths(null); + } + if (\array_key_exists('ReadonlyPaths', $data) && $data['ReadonlyPaths'] !== null) { + $values_29 = []; + foreach ($data['ReadonlyPaths'] as $value_29) { + $values_29[] = $value_29; + } + $object->setReadonlyPaths($values_29); + } + elseif (\array_key_exists('ReadonlyPaths', $data) && $data['ReadonlyPaths'] === null) { + $object->setReadonlyPaths(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('cpuShares') && null !== $object->getCpuShares()) { + $data['CpuShares'] = $object->getCpuShares(); + } + if ($object->isInitialized('memory') && null !== $object->getMemory()) { + $data['Memory'] = $object->getMemory(); + } + if ($object->isInitialized('cgroupParent') && null !== $object->getCgroupParent()) { + $data['CgroupParent'] = $object->getCgroupParent(); + } + if ($object->isInitialized('blkioWeight') && null !== $object->getBlkioWeight()) { + $data['BlkioWeight'] = $object->getBlkioWeight(); + } + if ($object->isInitialized('blkioWeightDevice') && null !== $object->getBlkioWeightDevice()) { + $values = []; + foreach ($object->getBlkioWeightDevice() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['BlkioWeightDevice'] = $values; + } + if ($object->isInitialized('blkioDeviceReadBps') && null !== $object->getBlkioDeviceReadBps()) { + $values_1 = []; + foreach ($object->getBlkioDeviceReadBps() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['BlkioDeviceReadBps'] = $values_1; + } + if ($object->isInitialized('blkioDeviceWriteBps') && null !== $object->getBlkioDeviceWriteBps()) { + $values_2 = []; + foreach ($object->getBlkioDeviceWriteBps() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['BlkioDeviceWriteBps'] = $values_2; + } + if ($object->isInitialized('blkioDeviceReadIOps') && null !== $object->getBlkioDeviceReadIOps()) { + $values_3 = []; + foreach ($object->getBlkioDeviceReadIOps() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['BlkioDeviceReadIOps'] = $values_3; + } + if ($object->isInitialized('blkioDeviceWriteIOps') && null !== $object->getBlkioDeviceWriteIOps()) { + $values_4 = []; + foreach ($object->getBlkioDeviceWriteIOps() as $value_4) { + $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); + } + $data['BlkioDeviceWriteIOps'] = $values_4; + } + if ($object->isInitialized('cpuPeriod') && null !== $object->getCpuPeriod()) { + $data['CpuPeriod'] = $object->getCpuPeriod(); + } + if ($object->isInitialized('cpuQuota') && null !== $object->getCpuQuota()) { + $data['CpuQuota'] = $object->getCpuQuota(); + } + if ($object->isInitialized('cpuRealtimePeriod') && null !== $object->getCpuRealtimePeriod()) { + $data['CpuRealtimePeriod'] = $object->getCpuRealtimePeriod(); + } + if ($object->isInitialized('cpuRealtimeRuntime') && null !== $object->getCpuRealtimeRuntime()) { + $data['CpuRealtimeRuntime'] = $object->getCpuRealtimeRuntime(); + } + if ($object->isInitialized('cpusetCpus') && null !== $object->getCpusetCpus()) { + $data['CpusetCpus'] = $object->getCpusetCpus(); + } + if ($object->isInitialized('cpusetMems') && null !== $object->getCpusetMems()) { + $data['CpusetMems'] = $object->getCpusetMems(); + } + if ($object->isInitialized('devices') && null !== $object->getDevices()) { + $values_5 = []; + foreach ($object->getDevices() as $value_5) { + $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); + } + $data['Devices'] = $values_5; + } + if ($object->isInitialized('deviceCgroupRules') && null !== $object->getDeviceCgroupRules()) { + $values_6 = []; + foreach ($object->getDeviceCgroupRules() as $value_6) { + $values_6[] = $value_6; + } + $data['DeviceCgroupRules'] = $values_6; + } + if ($object->isInitialized('deviceRequests') && null !== $object->getDeviceRequests()) { + $values_7 = []; + foreach ($object->getDeviceRequests() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $data['DeviceRequests'] = $values_7; + } + if ($object->isInitialized('kernelMemoryTCP') && null !== $object->getKernelMemoryTCP()) { + $data['KernelMemoryTCP'] = $object->getKernelMemoryTCP(); + } + if ($object->isInitialized('memoryReservation') && null !== $object->getMemoryReservation()) { + $data['MemoryReservation'] = $object->getMemoryReservation(); + } + if ($object->isInitialized('memorySwap') && null !== $object->getMemorySwap()) { + $data['MemorySwap'] = $object->getMemorySwap(); + } + if ($object->isInitialized('memorySwappiness') && null !== $object->getMemorySwappiness()) { + $data['MemorySwappiness'] = $object->getMemorySwappiness(); + } + if ($object->isInitialized('nanoCpus') && null !== $object->getNanoCpus()) { + $data['NanoCpus'] = $object->getNanoCpus(); + } + if ($object->isInitialized('oomKillDisable') && null !== $object->getOomKillDisable()) { + $data['OomKillDisable'] = $object->getOomKillDisable(); + } + if ($object->isInitialized('init') && null !== $object->getInit()) { + $data['Init'] = $object->getInit(); + } + if ($object->isInitialized('pidsLimit') && null !== $object->getPidsLimit()) { + $data['PidsLimit'] = $object->getPidsLimit(); + } + if ($object->isInitialized('ulimits') && null !== $object->getUlimits()) { + $values_8 = []; + foreach ($object->getUlimits() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); + } + $data['Ulimits'] = $values_8; + } + if ($object->isInitialized('cpuCount') && null !== $object->getCpuCount()) { + $data['CpuCount'] = $object->getCpuCount(); + } + if ($object->isInitialized('cpuPercent') && null !== $object->getCpuPercent()) { + $data['CpuPercent'] = $object->getCpuPercent(); + } + if ($object->isInitialized('iOMaximumIOps') && null !== $object->getIOMaximumIOps()) { + $data['IOMaximumIOps'] = $object->getIOMaximumIOps(); + } + if ($object->isInitialized('iOMaximumBandwidth') && null !== $object->getIOMaximumBandwidth()) { + $data['IOMaximumBandwidth'] = $object->getIOMaximumBandwidth(); + } + if ($object->isInitialized('binds') && null !== $object->getBinds()) { + $values_9 = []; + foreach ($object->getBinds() as $value_9) { + $values_9[] = $value_9; + } + $data['Binds'] = $values_9; + } + if ($object->isInitialized('containerIDFile') && null !== $object->getContainerIDFile()) { + $data['ContainerIDFile'] = $object->getContainerIDFile(); + } + if ($object->isInitialized('logConfig') && null !== $object->getLogConfig()) { + $data['LogConfig'] = $this->normalizer->normalize($object->getLogConfig(), 'json', $context); + } + if ($object->isInitialized('networkMode') && null !== $object->getNetworkMode()) { + $data['NetworkMode'] = $object->getNetworkMode(); + } + if ($object->isInitialized('portBindings') && null !== $object->getPortBindings()) { + $values_10 = []; + foreach ($object->getPortBindings() as $key => $value_10) { + $values_11 = []; + foreach ($value_10 as $value_11) { + $values_11[] = $this->normalizer->normalize($value_11, 'json', $context); + } + $values_10[$key] = $values_11; + } + $data['PortBindings'] = $values_10; + } + if ($object->isInitialized('restartPolicy') && null !== $object->getRestartPolicy()) { + $data['RestartPolicy'] = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); + } + if ($object->isInitialized('autoRemove') && null !== $object->getAutoRemove()) { + $data['AutoRemove'] = $object->getAutoRemove(); + } + if ($object->isInitialized('volumeDriver') && null !== $object->getVolumeDriver()) { + $data['VolumeDriver'] = $object->getVolumeDriver(); + } + if ($object->isInitialized('volumesFrom') && null !== $object->getVolumesFrom()) { + $values_12 = []; + foreach ($object->getVolumesFrom() as $value_12) { + $values_12[] = $value_12; + } + $data['VolumesFrom'] = $values_12; + } + if ($object->isInitialized('mounts') && null !== $object->getMounts()) { + $values_13 = []; + foreach ($object->getMounts() as $value_13) { + $values_13[] = $this->normalizer->normalize($value_13, 'json', $context); + } + $data['Mounts'] = $values_13; + } + if ($object->isInitialized('consoleSize') && null !== $object->getConsoleSize()) { + $values_14 = []; + foreach ($object->getConsoleSize() as $value_14) { + $values_14[] = $value_14; + } + $data['ConsoleSize'] = $values_14; + } + if ($object->isInitialized('annotations') && null !== $object->getAnnotations()) { + $values_15 = []; + foreach ($object->getAnnotations() as $key_1 => $value_15) { + $values_15[$key_1] = $value_15; + } + $data['Annotations'] = $values_15; + } + if ($object->isInitialized('capAdd') && null !== $object->getCapAdd()) { + $values_16 = []; + foreach ($object->getCapAdd() as $value_16) { + $values_16[] = $value_16; + } + $data['CapAdd'] = $values_16; + } + if ($object->isInitialized('capDrop') && null !== $object->getCapDrop()) { + $values_17 = []; + foreach ($object->getCapDrop() as $value_17) { + $values_17[] = $value_17; + } + $data['CapDrop'] = $values_17; + } + if ($object->isInitialized('cgroupnsMode') && null !== $object->getCgroupnsMode()) { + $data['CgroupnsMode'] = $object->getCgroupnsMode(); + } + if ($object->isInitialized('dns') && null !== $object->getDns()) { + $values_18 = []; + foreach ($object->getDns() as $value_18) { + $values_18[] = $value_18; + } + $data['Dns'] = $values_18; + } + if ($object->isInitialized('dnsOptions') && null !== $object->getDnsOptions()) { + $values_19 = []; + foreach ($object->getDnsOptions() as $value_19) { + $values_19[] = $value_19; + } + $data['DnsOptions'] = $values_19; + } + if ($object->isInitialized('dnsSearch') && null !== $object->getDnsSearch()) { + $values_20 = []; + foreach ($object->getDnsSearch() as $value_20) { + $values_20[] = $value_20; + } + $data['DnsSearch'] = $values_20; + } + if ($object->isInitialized('extraHosts') && null !== $object->getExtraHosts()) { + $values_21 = []; + foreach ($object->getExtraHosts() as $value_21) { + $values_21[] = $value_21; + } + $data['ExtraHosts'] = $values_21; + } + if ($object->isInitialized('groupAdd') && null !== $object->getGroupAdd()) { + $values_22 = []; + foreach ($object->getGroupAdd() as $value_22) { + $values_22[] = $value_22; + } + $data['GroupAdd'] = $values_22; + } + if ($object->isInitialized('ipcMode') && null !== $object->getIpcMode()) { + $data['IpcMode'] = $object->getIpcMode(); + } + if ($object->isInitialized('cgroup') && null !== $object->getCgroup()) { + $data['Cgroup'] = $object->getCgroup(); + } + if ($object->isInitialized('links') && null !== $object->getLinks()) { + $values_23 = []; + foreach ($object->getLinks() as $value_23) { + $values_23[] = $value_23; + } + $data['Links'] = $values_23; + } + if ($object->isInitialized('oomScoreAdj') && null !== $object->getOomScoreAdj()) { + $data['OomScoreAdj'] = $object->getOomScoreAdj(); + } + if ($object->isInitialized('pidMode') && null !== $object->getPidMode()) { + $data['PidMode'] = $object->getPidMode(); + } + if ($object->isInitialized('privileged') && null !== $object->getPrivileged()) { + $data['Privileged'] = $object->getPrivileged(); + } + if ($object->isInitialized('publishAllPorts') && null !== $object->getPublishAllPorts()) { + $data['PublishAllPorts'] = $object->getPublishAllPorts(); + } + if ($object->isInitialized('readonlyRootfs') && null !== $object->getReadonlyRootfs()) { + $data['ReadonlyRootfs'] = $object->getReadonlyRootfs(); + } + if ($object->isInitialized('securityOpt') && null !== $object->getSecurityOpt()) { + $values_24 = []; + foreach ($object->getSecurityOpt() as $value_24) { + $values_24[] = $value_24; + } + $data['SecurityOpt'] = $values_24; + } + if ($object->isInitialized('storageOpt') && null !== $object->getStorageOpt()) { + $values_25 = []; + foreach ($object->getStorageOpt() as $key_2 => $value_25) { + $values_25[$key_2] = $value_25; + } + $data['StorageOpt'] = $values_25; + } + if ($object->isInitialized('tmpfs') && null !== $object->getTmpfs()) { + $values_26 = []; + foreach ($object->getTmpfs() as $key_3 => $value_26) { + $values_26[$key_3] = $value_26; + } + $data['Tmpfs'] = $values_26; + } + if ($object->isInitialized('uTSMode') && null !== $object->getUTSMode()) { + $data['UTSMode'] = $object->getUTSMode(); + } + if ($object->isInitialized('usernsMode') && null !== $object->getUsernsMode()) { + $data['UsernsMode'] = $object->getUsernsMode(); + } + if ($object->isInitialized('shmSize') && null !== $object->getShmSize()) { + $data['ShmSize'] = $object->getShmSize(); + } + if ($object->isInitialized('sysctls') && null !== $object->getSysctls()) { + $values_27 = []; + foreach ($object->getSysctls() as $key_4 => $value_27) { + $values_27[$key_4] = $value_27; + } + $data['Sysctls'] = $values_27; + } + if ($object->isInitialized('runtime') && null !== $object->getRuntime()) { + $data['Runtime'] = $object->getRuntime(); + } + if ($object->isInitialized('isolation') && null !== $object->getIsolation()) { + $data['Isolation'] = $object->getIsolation(); + } + if ($object->isInitialized('maskedPaths') && null !== $object->getMaskedPaths()) { + $values_28 = []; + foreach ($object->getMaskedPaths() as $value_28) { + $values_28[] = $value_28; + } + $data['MaskedPaths'] = $values_28; + } + if ($object->isInitialized('readonlyPaths') && null !== $object->getReadonlyPaths()) { + $values_29 = []; + foreach ($object->getReadonlyPaths() as $value_29) { + $values_29[] = $value_29; + } + $data['ReadonlyPaths'] = $values_29; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\HostConfig::class => false]; + } + } +} else { + class HostConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\HostConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\HostConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\HostConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CpuShares', $data) && $data['CpuShares'] !== null) { + $object->setCpuShares($data['CpuShares']); + } + elseif (\array_key_exists('CpuShares', $data) && $data['CpuShares'] === null) { + $object->setCpuShares(null); + } + if (\array_key_exists('Memory', $data) && $data['Memory'] !== null) { + $object->setMemory($data['Memory']); + } + elseif (\array_key_exists('Memory', $data) && $data['Memory'] === null) { + $object->setMemory(null); + } + if (\array_key_exists('CgroupParent', $data) && $data['CgroupParent'] !== null) { + $object->setCgroupParent($data['CgroupParent']); + } + elseif (\array_key_exists('CgroupParent', $data) && $data['CgroupParent'] === null) { + $object->setCgroupParent(null); + } + if (\array_key_exists('BlkioWeight', $data) && $data['BlkioWeight'] !== null) { + $object->setBlkioWeight($data['BlkioWeight']); + } + elseif (\array_key_exists('BlkioWeight', $data) && $data['BlkioWeight'] === null) { + $object->setBlkioWeight(null); + } + if (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] !== null) { + $values = []; + foreach ($data['BlkioWeightDevice'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class, 'json', $context); + } + $object->setBlkioWeightDevice($values); + } + elseif (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] === null) { + $object->setBlkioWeightDevice(null); + } + if (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] !== null) { + $values_1 = []; + foreach ($data['BlkioDeviceReadBps'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceReadBps($values_1); + } + elseif (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] === null) { + $object->setBlkioDeviceReadBps(null); + } + if (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] !== null) { + $values_2 = []; + foreach ($data['BlkioDeviceWriteBps'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceWriteBps($values_2); + } + elseif (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] === null) { + $object->setBlkioDeviceWriteBps(null); + } + if (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] !== null) { + $values_3 = []; + foreach ($data['BlkioDeviceReadIOps'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceReadIOps($values_3); + } + elseif (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] === null) { + $object->setBlkioDeviceReadIOps(null); + } + if (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] !== null) { + $values_4 = []; + foreach ($data['BlkioDeviceWriteIOps'] as $value_4) { + $values_4[] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceWriteIOps($values_4); + } + elseif (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] === null) { + $object->setBlkioDeviceWriteIOps(null); + } + if (\array_key_exists('CpuPeriod', $data) && $data['CpuPeriod'] !== null) { + $object->setCpuPeriod($data['CpuPeriod']); + } + elseif (\array_key_exists('CpuPeriod', $data) && $data['CpuPeriod'] === null) { + $object->setCpuPeriod(null); + } + if (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] !== null) { + $object->setCpuQuota($data['CpuQuota']); + } + elseif (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] === null) { + $object->setCpuQuota(null); + } + if (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] !== null) { + $object->setCpuRealtimePeriod($data['CpuRealtimePeriod']); + } + elseif (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] === null) { + $object->setCpuRealtimePeriod(null); + } + if (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] !== null) { + $object->setCpuRealtimeRuntime($data['CpuRealtimeRuntime']); + } + elseif (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] === null) { + $object->setCpuRealtimeRuntime(null); + } + if (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] !== null) { + $object->setCpusetCpus($data['CpusetCpus']); + } + elseif (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] === null) { + $object->setCpusetCpus(null); + } + if (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] !== null) { + $object->setCpusetMems($data['CpusetMems']); + } + elseif (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] === null) { + $object->setCpusetMems(null); + } + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { + $values_5 = []; + foreach ($data['Devices'] as $value_5) { + $values_5[] = $this->denormalizer->denormalize($value_5, \Docker\API\Model\DeviceMapping::class, 'json', $context); + } + $object->setDevices($values_5); + } + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } + if (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] !== null) { + $values_6 = []; + foreach ($data['DeviceCgroupRules'] as $value_6) { + $values_6[] = $value_6; + } + $object->setDeviceCgroupRules($values_6); + } + elseif (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] === null) { + $object->setDeviceCgroupRules(null); + } + if (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] !== null) { + $values_7 = []; + foreach ($data['DeviceRequests'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, \Docker\API\Model\DeviceRequest::class, 'json', $context); + } + $object->setDeviceRequests($values_7); + } + elseif (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] === null) { + $object->setDeviceRequests(null); + } + if (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] !== null) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); + } + elseif (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] === null) { + $object->setKernelMemoryTCP(null); + } + if (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] !== null) { + $object->setMemoryReservation($data['MemoryReservation']); + } + elseif (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] === null) { + $object->setMemoryReservation(null); + } + if (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] !== null) { + $object->setMemorySwap($data['MemorySwap']); + } + elseif (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] === null) { + $object->setMemorySwap(null); + } + if (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] !== null) { + $object->setMemorySwappiness($data['MemorySwappiness']); + } + elseif (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] === null) { + $object->setMemorySwappiness(null); + } + if (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] !== null) { + $object->setNanoCpus($data['NanoCpus']); + } + elseif (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] === null) { + $object->setNanoCpus(null); + } + if (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] !== null) { + $object->setOomKillDisable($data['OomKillDisable']); + } + elseif (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] === null) { + $object->setOomKillDisable(null); + } + if (\array_key_exists('Init', $data) && $data['Init'] !== null) { + $object->setInit($data['Init']); + } + elseif (\array_key_exists('Init', $data) && $data['Init'] === null) { + $object->setInit(null); + } + if (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] !== null) { + $object->setPidsLimit($data['PidsLimit']); + } + elseif (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] === null) { + $object->setPidsLimit(null); + } + if (\array_key_exists('Ulimits', $data) && $data['Ulimits'] !== null) { + $values_8 = []; + foreach ($data['Ulimits'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, \Docker\API\Model\ResourcesUlimitsItem::class, 'json', $context); + } + $object->setUlimits($values_8); + } + elseif (\array_key_exists('Ulimits', $data) && $data['Ulimits'] === null) { + $object->setUlimits(null); + } + if (\array_key_exists('CpuCount', $data) && $data['CpuCount'] !== null) { + $object->setCpuCount($data['CpuCount']); + } + elseif (\array_key_exists('CpuCount', $data) && $data['CpuCount'] === null) { + $object->setCpuCount(null); + } + if (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] !== null) { + $object->setCpuPercent($data['CpuPercent']); + } + elseif (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] === null) { + $object->setCpuPercent(null); + } + if (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] !== null) { + $object->setIOMaximumIOps($data['IOMaximumIOps']); + } + elseif (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] === null) { + $object->setIOMaximumIOps(null); + } + if (\array_key_exists('IOMaximumBandwidth', $data) && $data['IOMaximumBandwidth'] !== null) { + $object->setIOMaximumBandwidth($data['IOMaximumBandwidth']); + } + elseif (\array_key_exists('IOMaximumBandwidth', $data) && $data['IOMaximumBandwidth'] === null) { + $object->setIOMaximumBandwidth(null); + } + if (\array_key_exists('Binds', $data) && $data['Binds'] !== null) { + $values_9 = []; + foreach ($data['Binds'] as $value_9) { + $values_9[] = $value_9; + } + $object->setBinds($values_9); + } + elseif (\array_key_exists('Binds', $data) && $data['Binds'] === null) { + $object->setBinds(null); + } + if (\array_key_exists('ContainerIDFile', $data) && $data['ContainerIDFile'] !== null) { + $object->setContainerIDFile($data['ContainerIDFile']); + } + elseif (\array_key_exists('ContainerIDFile', $data) && $data['ContainerIDFile'] === null) { + $object->setContainerIDFile(null); + } + if (\array_key_exists('LogConfig', $data) && $data['LogConfig'] !== null) { + $object->setLogConfig($this->denormalizer->denormalize($data['LogConfig'], \Docker\API\Model\HostConfigLogConfig::class, 'json', $context)); + } + elseif (\array_key_exists('LogConfig', $data) && $data['LogConfig'] === null) { + $object->setLogConfig(null); + } + if (\array_key_exists('NetworkMode', $data) && $data['NetworkMode'] !== null) { + $object->setNetworkMode($data['NetworkMode']); + } + elseif (\array_key_exists('NetworkMode', $data) && $data['NetworkMode'] === null) { + $object->setNetworkMode(null); + } + if (\array_key_exists('PortBindings', $data) && $data['PortBindings'] !== null) { + $values_10 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['PortBindings'] as $key => $value_10) { + $values_11 = []; + foreach ($value_10 as $value_11) { + $values_11[] = $this->denormalizer->denormalize($value_11, \Docker\API\Model\PortBinding::class, 'json', $context); + } + $values_10[$key] = $values_11; + } + $object->setPortBindings($values_10); + } + elseif (\array_key_exists('PortBindings', $data) && $data['PortBindings'] === null) { + $object->setPortBindings(null); + } + if (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] !== null) { + $object->setRestartPolicy($this->denormalizer->denormalize($data['RestartPolicy'], \Docker\API\Model\RestartPolicy::class, 'json', $context)); + } + elseif (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] === null) { + $object->setRestartPolicy(null); + } + if (\array_key_exists('AutoRemove', $data) && $data['AutoRemove'] !== null) { + $object->setAutoRemove($data['AutoRemove']); + } + elseif (\array_key_exists('AutoRemove', $data) && $data['AutoRemove'] === null) { + $object->setAutoRemove(null); + } + if (\array_key_exists('VolumeDriver', $data) && $data['VolumeDriver'] !== null) { + $object->setVolumeDriver($data['VolumeDriver']); + } + elseif (\array_key_exists('VolumeDriver', $data) && $data['VolumeDriver'] === null) { + $object->setVolumeDriver(null); + } + if (\array_key_exists('VolumesFrom', $data) && $data['VolumesFrom'] !== null) { + $values_12 = []; + foreach ($data['VolumesFrom'] as $value_12) { + $values_12[] = $value_12; + } + $object->setVolumesFrom($values_12); + } + elseif (\array_key_exists('VolumesFrom', $data) && $data['VolumesFrom'] === null) { + $object->setVolumesFrom(null); + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values_13 = []; + foreach ($data['Mounts'] as $value_13) { + $values_13[] = $this->denormalizer->denormalize($value_13, \Docker\API\Model\Mount::class, 'json', $context); + } + $object->setMounts($values_13); + } + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); + } + if (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] !== null) { + $values_14 = []; + foreach ($data['ConsoleSize'] as $value_14) { + $values_14[] = $value_14; + } + $object->setConsoleSize($values_14); + } + elseif (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] === null) { + $object->setConsoleSize(null); + } + if (\array_key_exists('Annotations', $data) && $data['Annotations'] !== null) { + $values_15 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Annotations'] as $key_1 => $value_15) { + $values_15[$key_1] = $value_15; + } + $object->setAnnotations($values_15); + } + elseif (\array_key_exists('Annotations', $data) && $data['Annotations'] === null) { + $object->setAnnotations(null); + } + if (\array_key_exists('CapAdd', $data) && $data['CapAdd'] !== null) { + $values_16 = []; + foreach ($data['CapAdd'] as $value_16) { + $values_16[] = $value_16; + } + $object->setCapAdd($values_16); + } + elseif (\array_key_exists('CapAdd', $data) && $data['CapAdd'] === null) { + $object->setCapAdd(null); + } + if (\array_key_exists('CapDrop', $data) && $data['CapDrop'] !== null) { + $values_17 = []; + foreach ($data['CapDrop'] as $value_17) { + $values_17[] = $value_17; + } + $object->setCapDrop($values_17); + } + elseif (\array_key_exists('CapDrop', $data) && $data['CapDrop'] === null) { + $object->setCapDrop(null); + } + if (\array_key_exists('CgroupnsMode', $data) && $data['CgroupnsMode'] !== null) { + $object->setCgroupnsMode($data['CgroupnsMode']); + } + elseif (\array_key_exists('CgroupnsMode', $data) && $data['CgroupnsMode'] === null) { + $object->setCgroupnsMode(null); + } + if (\array_key_exists('Dns', $data) && $data['Dns'] !== null) { + $values_18 = []; + foreach ($data['Dns'] as $value_18) { + $values_18[] = $value_18; + } + $object->setDns($values_18); + } + elseif (\array_key_exists('Dns', $data) && $data['Dns'] === null) { + $object->setDns(null); + } + if (\array_key_exists('DnsOptions', $data) && $data['DnsOptions'] !== null) { + $values_19 = []; + foreach ($data['DnsOptions'] as $value_19) { + $values_19[] = $value_19; + } + $object->setDnsOptions($values_19); + } + elseif (\array_key_exists('DnsOptions', $data) && $data['DnsOptions'] === null) { + $object->setDnsOptions(null); + } + if (\array_key_exists('DnsSearch', $data) && $data['DnsSearch'] !== null) { + $values_20 = []; + foreach ($data['DnsSearch'] as $value_20) { + $values_20[] = $value_20; + } + $object->setDnsSearch($values_20); + } + elseif (\array_key_exists('DnsSearch', $data) && $data['DnsSearch'] === null) { + $object->setDnsSearch(null); + } + if (\array_key_exists('ExtraHosts', $data) && $data['ExtraHosts'] !== null) { + $values_21 = []; + foreach ($data['ExtraHosts'] as $value_21) { + $values_21[] = $value_21; + } + $object->setExtraHosts($values_21); + } + elseif (\array_key_exists('ExtraHosts', $data) && $data['ExtraHosts'] === null) { + $object->setExtraHosts(null); + } + if (\array_key_exists('GroupAdd', $data) && $data['GroupAdd'] !== null) { + $values_22 = []; + foreach ($data['GroupAdd'] as $value_22) { + $values_22[] = $value_22; + } + $object->setGroupAdd($values_22); + } + elseif (\array_key_exists('GroupAdd', $data) && $data['GroupAdd'] === null) { + $object->setGroupAdd(null); + } + if (\array_key_exists('IpcMode', $data) && $data['IpcMode'] !== null) { + $object->setIpcMode($data['IpcMode']); + } + elseif (\array_key_exists('IpcMode', $data) && $data['IpcMode'] === null) { + $object->setIpcMode(null); + } + if (\array_key_exists('Cgroup', $data) && $data['Cgroup'] !== null) { + $object->setCgroup($data['Cgroup']); + } + elseif (\array_key_exists('Cgroup', $data) && $data['Cgroup'] === null) { + $object->setCgroup(null); + } + if (\array_key_exists('Links', $data) && $data['Links'] !== null) { + $values_23 = []; + foreach ($data['Links'] as $value_23) { + $values_23[] = $value_23; + } + $object->setLinks($values_23); + } + elseif (\array_key_exists('Links', $data) && $data['Links'] === null) { + $object->setLinks(null); + } + if (\array_key_exists('OomScoreAdj', $data) && $data['OomScoreAdj'] !== null) { + $object->setOomScoreAdj($data['OomScoreAdj']); + } + elseif (\array_key_exists('OomScoreAdj', $data) && $data['OomScoreAdj'] === null) { + $object->setOomScoreAdj(null); + } + if (\array_key_exists('PidMode', $data) && $data['PidMode'] !== null) { + $object->setPidMode($data['PidMode']); + } + elseif (\array_key_exists('PidMode', $data) && $data['PidMode'] === null) { + $object->setPidMode(null); + } + if (\array_key_exists('Privileged', $data) && $data['Privileged'] !== null) { + $object->setPrivileged($data['Privileged']); + } + elseif (\array_key_exists('Privileged', $data) && $data['Privileged'] === null) { + $object->setPrivileged(null); + } + if (\array_key_exists('PublishAllPorts', $data) && $data['PublishAllPorts'] !== null) { + $object->setPublishAllPorts($data['PublishAllPorts']); + } + elseif (\array_key_exists('PublishAllPorts', $data) && $data['PublishAllPorts'] === null) { + $object->setPublishAllPorts(null); + } + if (\array_key_exists('ReadonlyRootfs', $data) && $data['ReadonlyRootfs'] !== null) { + $object->setReadonlyRootfs($data['ReadonlyRootfs']); + } + elseif (\array_key_exists('ReadonlyRootfs', $data) && $data['ReadonlyRootfs'] === null) { + $object->setReadonlyRootfs(null); + } + if (\array_key_exists('SecurityOpt', $data) && $data['SecurityOpt'] !== null) { + $values_24 = []; + foreach ($data['SecurityOpt'] as $value_24) { + $values_24[] = $value_24; + } + $object->setSecurityOpt($values_24); + } + elseif (\array_key_exists('SecurityOpt', $data) && $data['SecurityOpt'] === null) { + $object->setSecurityOpt(null); + } + if (\array_key_exists('StorageOpt', $data) && $data['StorageOpt'] !== null) { + $values_25 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['StorageOpt'] as $key_2 => $value_25) { + $values_25[$key_2] = $value_25; + } + $object->setStorageOpt($values_25); + } + elseif (\array_key_exists('StorageOpt', $data) && $data['StorageOpt'] === null) { + $object->setStorageOpt(null); + } + if (\array_key_exists('Tmpfs', $data) && $data['Tmpfs'] !== null) { + $values_26 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Tmpfs'] as $key_3 => $value_26) { + $values_26[$key_3] = $value_26; + } + $object->setTmpfs($values_26); + } + elseif (\array_key_exists('Tmpfs', $data) && $data['Tmpfs'] === null) { + $object->setTmpfs(null); + } + if (\array_key_exists('UTSMode', $data) && $data['UTSMode'] !== null) { + $object->setUTSMode($data['UTSMode']); + } + elseif (\array_key_exists('UTSMode', $data) && $data['UTSMode'] === null) { + $object->setUTSMode(null); + } + if (\array_key_exists('UsernsMode', $data) && $data['UsernsMode'] !== null) { + $object->setUsernsMode($data['UsernsMode']); + } + elseif (\array_key_exists('UsernsMode', $data) && $data['UsernsMode'] === null) { + $object->setUsernsMode(null); + } + if (\array_key_exists('ShmSize', $data) && $data['ShmSize'] !== null) { + $object->setShmSize($data['ShmSize']); + } + elseif (\array_key_exists('ShmSize', $data) && $data['ShmSize'] === null) { + $object->setShmSize(null); + } + if (\array_key_exists('Sysctls', $data) && $data['Sysctls'] !== null) { + $values_27 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Sysctls'] as $key_4 => $value_27) { + $values_27[$key_4] = $value_27; + } + $object->setSysctls($values_27); + } + elseif (\array_key_exists('Sysctls', $data) && $data['Sysctls'] === null) { + $object->setSysctls(null); + } + if (\array_key_exists('Runtime', $data) && $data['Runtime'] !== null) { + $object->setRuntime($data['Runtime']); + } + elseif (\array_key_exists('Runtime', $data) && $data['Runtime'] === null) { + $object->setRuntime(null); + } + if (\array_key_exists('Isolation', $data) && $data['Isolation'] !== null) { + $object->setIsolation($data['Isolation']); + } + elseif (\array_key_exists('Isolation', $data) && $data['Isolation'] === null) { + $object->setIsolation(null); + } + if (\array_key_exists('MaskedPaths', $data) && $data['MaskedPaths'] !== null) { + $values_28 = []; + foreach ($data['MaskedPaths'] as $value_28) { + $values_28[] = $value_28; + } + $object->setMaskedPaths($values_28); + } + elseif (\array_key_exists('MaskedPaths', $data) && $data['MaskedPaths'] === null) { + $object->setMaskedPaths(null); + } + if (\array_key_exists('ReadonlyPaths', $data) && $data['ReadonlyPaths'] !== null) { + $values_29 = []; + foreach ($data['ReadonlyPaths'] as $value_29) { + $values_29[] = $value_29; + } + $object->setReadonlyPaths($values_29); + } + elseif (\array_key_exists('ReadonlyPaths', $data) && $data['ReadonlyPaths'] === null) { + $object->setReadonlyPaths(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('cpuShares') && null !== $object->getCpuShares()) { + $data['CpuShares'] = $object->getCpuShares(); + } + if ($object->isInitialized('memory') && null !== $object->getMemory()) { + $data['Memory'] = $object->getMemory(); + } + if ($object->isInitialized('cgroupParent') && null !== $object->getCgroupParent()) { + $data['CgroupParent'] = $object->getCgroupParent(); + } + if ($object->isInitialized('blkioWeight') && null !== $object->getBlkioWeight()) { + $data['BlkioWeight'] = $object->getBlkioWeight(); + } + if ($object->isInitialized('blkioWeightDevice') && null !== $object->getBlkioWeightDevice()) { + $values = []; + foreach ($object->getBlkioWeightDevice() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['BlkioWeightDevice'] = $values; + } + if ($object->isInitialized('blkioDeviceReadBps') && null !== $object->getBlkioDeviceReadBps()) { + $values_1 = []; + foreach ($object->getBlkioDeviceReadBps() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['BlkioDeviceReadBps'] = $values_1; + } + if ($object->isInitialized('blkioDeviceWriteBps') && null !== $object->getBlkioDeviceWriteBps()) { + $values_2 = []; + foreach ($object->getBlkioDeviceWriteBps() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['BlkioDeviceWriteBps'] = $values_2; + } + if ($object->isInitialized('blkioDeviceReadIOps') && null !== $object->getBlkioDeviceReadIOps()) { + $values_3 = []; + foreach ($object->getBlkioDeviceReadIOps() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['BlkioDeviceReadIOps'] = $values_3; + } + if ($object->isInitialized('blkioDeviceWriteIOps') && null !== $object->getBlkioDeviceWriteIOps()) { + $values_4 = []; + foreach ($object->getBlkioDeviceWriteIOps() as $value_4) { + $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); + } + $data['BlkioDeviceWriteIOps'] = $values_4; + } + if ($object->isInitialized('cpuPeriod') && null !== $object->getCpuPeriod()) { + $data['CpuPeriod'] = $object->getCpuPeriod(); + } + if ($object->isInitialized('cpuQuota') && null !== $object->getCpuQuota()) { + $data['CpuQuota'] = $object->getCpuQuota(); + } + if ($object->isInitialized('cpuRealtimePeriod') && null !== $object->getCpuRealtimePeriod()) { + $data['CpuRealtimePeriod'] = $object->getCpuRealtimePeriod(); + } + if ($object->isInitialized('cpuRealtimeRuntime') && null !== $object->getCpuRealtimeRuntime()) { + $data['CpuRealtimeRuntime'] = $object->getCpuRealtimeRuntime(); + } + if ($object->isInitialized('cpusetCpus') && null !== $object->getCpusetCpus()) { + $data['CpusetCpus'] = $object->getCpusetCpus(); + } + if ($object->isInitialized('cpusetMems') && null !== $object->getCpusetMems()) { + $data['CpusetMems'] = $object->getCpusetMems(); + } + if ($object->isInitialized('devices') && null !== $object->getDevices()) { + $values_5 = []; + foreach ($object->getDevices() as $value_5) { + $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); + } + $data['Devices'] = $values_5; + } + if ($object->isInitialized('deviceCgroupRules') && null !== $object->getDeviceCgroupRules()) { + $values_6 = []; + foreach ($object->getDeviceCgroupRules() as $value_6) { + $values_6[] = $value_6; + } + $data['DeviceCgroupRules'] = $values_6; + } + if ($object->isInitialized('deviceRequests') && null !== $object->getDeviceRequests()) { + $values_7 = []; + foreach ($object->getDeviceRequests() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $data['DeviceRequests'] = $values_7; + } + if ($object->isInitialized('kernelMemoryTCP') && null !== $object->getKernelMemoryTCP()) { + $data['KernelMemoryTCP'] = $object->getKernelMemoryTCP(); + } + if ($object->isInitialized('memoryReservation') && null !== $object->getMemoryReservation()) { + $data['MemoryReservation'] = $object->getMemoryReservation(); + } + if ($object->isInitialized('memorySwap') && null !== $object->getMemorySwap()) { + $data['MemorySwap'] = $object->getMemorySwap(); + } + if ($object->isInitialized('memorySwappiness') && null !== $object->getMemorySwappiness()) { + $data['MemorySwappiness'] = $object->getMemorySwappiness(); + } + if ($object->isInitialized('nanoCpus') && null !== $object->getNanoCpus()) { + $data['NanoCpus'] = $object->getNanoCpus(); + } + if ($object->isInitialized('oomKillDisable') && null !== $object->getOomKillDisable()) { + $data['OomKillDisable'] = $object->getOomKillDisable(); + } + if ($object->isInitialized('init') && null !== $object->getInit()) { + $data['Init'] = $object->getInit(); + } + if ($object->isInitialized('pidsLimit') && null !== $object->getPidsLimit()) { + $data['PidsLimit'] = $object->getPidsLimit(); + } + if ($object->isInitialized('ulimits') && null !== $object->getUlimits()) { + $values_8 = []; + foreach ($object->getUlimits() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); + } + $data['Ulimits'] = $values_8; + } + if ($object->isInitialized('cpuCount') && null !== $object->getCpuCount()) { + $data['CpuCount'] = $object->getCpuCount(); + } + if ($object->isInitialized('cpuPercent') && null !== $object->getCpuPercent()) { + $data['CpuPercent'] = $object->getCpuPercent(); + } + if ($object->isInitialized('iOMaximumIOps') && null !== $object->getIOMaximumIOps()) { + $data['IOMaximumIOps'] = $object->getIOMaximumIOps(); + } + if ($object->isInitialized('iOMaximumBandwidth') && null !== $object->getIOMaximumBandwidth()) { + $data['IOMaximumBandwidth'] = $object->getIOMaximumBandwidth(); + } + if ($object->isInitialized('binds') && null !== $object->getBinds()) { + $values_9 = []; + foreach ($object->getBinds() as $value_9) { + $values_9[] = $value_9; + } + $data['Binds'] = $values_9; + } + if ($object->isInitialized('containerIDFile') && null !== $object->getContainerIDFile()) { + $data['ContainerIDFile'] = $object->getContainerIDFile(); + } + if ($object->isInitialized('logConfig') && null !== $object->getLogConfig()) { + $data['LogConfig'] = $this->normalizer->normalize($object->getLogConfig(), 'json', $context); + } + if ($object->isInitialized('networkMode') && null !== $object->getNetworkMode()) { + $data['NetworkMode'] = $object->getNetworkMode(); + } + if ($object->isInitialized('portBindings') && null !== $object->getPortBindings()) { + $values_10 = []; + foreach ($object->getPortBindings() as $key => $value_10) { + $values_11 = []; + foreach ($value_10 as $value_11) { + $values_11[] = $this->normalizer->normalize($value_11, 'json', $context); + } + $values_10[$key] = $values_11; + } + $data['PortBindings'] = $values_10; + } + if ($object->isInitialized('restartPolicy') && null !== $object->getRestartPolicy()) { + $data['RestartPolicy'] = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); + } + if ($object->isInitialized('autoRemove') && null !== $object->getAutoRemove()) { + $data['AutoRemove'] = $object->getAutoRemove(); + } + if ($object->isInitialized('volumeDriver') && null !== $object->getVolumeDriver()) { + $data['VolumeDriver'] = $object->getVolumeDriver(); + } + if ($object->isInitialized('volumesFrom') && null !== $object->getVolumesFrom()) { + $values_12 = []; + foreach ($object->getVolumesFrom() as $value_12) { + $values_12[] = $value_12; + } + $data['VolumesFrom'] = $values_12; + } + if ($object->isInitialized('mounts') && null !== $object->getMounts()) { + $values_13 = []; + foreach ($object->getMounts() as $value_13) { + $values_13[] = $this->normalizer->normalize($value_13, 'json', $context); + } + $data['Mounts'] = $values_13; + } + if ($object->isInitialized('consoleSize') && null !== $object->getConsoleSize()) { + $values_14 = []; + foreach ($object->getConsoleSize() as $value_14) { + $values_14[] = $value_14; + } + $data['ConsoleSize'] = $values_14; + } + if ($object->isInitialized('annotations') && null !== $object->getAnnotations()) { + $values_15 = []; + foreach ($object->getAnnotations() as $key_1 => $value_15) { + $values_15[$key_1] = $value_15; + } + $data['Annotations'] = $values_15; + } + if ($object->isInitialized('capAdd') && null !== $object->getCapAdd()) { + $values_16 = []; + foreach ($object->getCapAdd() as $value_16) { + $values_16[] = $value_16; + } + $data['CapAdd'] = $values_16; + } + if ($object->isInitialized('capDrop') && null !== $object->getCapDrop()) { + $values_17 = []; + foreach ($object->getCapDrop() as $value_17) { + $values_17[] = $value_17; + } + $data['CapDrop'] = $values_17; + } + if ($object->isInitialized('cgroupnsMode') && null !== $object->getCgroupnsMode()) { + $data['CgroupnsMode'] = $object->getCgroupnsMode(); + } + if ($object->isInitialized('dns') && null !== $object->getDns()) { + $values_18 = []; + foreach ($object->getDns() as $value_18) { + $values_18[] = $value_18; + } + $data['Dns'] = $values_18; + } + if ($object->isInitialized('dnsOptions') && null !== $object->getDnsOptions()) { + $values_19 = []; + foreach ($object->getDnsOptions() as $value_19) { + $values_19[] = $value_19; + } + $data['DnsOptions'] = $values_19; + } + if ($object->isInitialized('dnsSearch') && null !== $object->getDnsSearch()) { + $values_20 = []; + foreach ($object->getDnsSearch() as $value_20) { + $values_20[] = $value_20; + } + $data['DnsSearch'] = $values_20; + } + if ($object->isInitialized('extraHosts') && null !== $object->getExtraHosts()) { + $values_21 = []; + foreach ($object->getExtraHosts() as $value_21) { + $values_21[] = $value_21; + } + $data['ExtraHosts'] = $values_21; + } + if ($object->isInitialized('groupAdd') && null !== $object->getGroupAdd()) { + $values_22 = []; + foreach ($object->getGroupAdd() as $value_22) { + $values_22[] = $value_22; + } + $data['GroupAdd'] = $values_22; + } + if ($object->isInitialized('ipcMode') && null !== $object->getIpcMode()) { + $data['IpcMode'] = $object->getIpcMode(); + } + if ($object->isInitialized('cgroup') && null !== $object->getCgroup()) { + $data['Cgroup'] = $object->getCgroup(); + } + if ($object->isInitialized('links') && null !== $object->getLinks()) { + $values_23 = []; + foreach ($object->getLinks() as $value_23) { + $values_23[] = $value_23; + } + $data['Links'] = $values_23; + } + if ($object->isInitialized('oomScoreAdj') && null !== $object->getOomScoreAdj()) { + $data['OomScoreAdj'] = $object->getOomScoreAdj(); + } + if ($object->isInitialized('pidMode') && null !== $object->getPidMode()) { + $data['PidMode'] = $object->getPidMode(); + } + if ($object->isInitialized('privileged') && null !== $object->getPrivileged()) { + $data['Privileged'] = $object->getPrivileged(); + } + if ($object->isInitialized('publishAllPorts') && null !== $object->getPublishAllPorts()) { + $data['PublishAllPorts'] = $object->getPublishAllPorts(); + } + if ($object->isInitialized('readonlyRootfs') && null !== $object->getReadonlyRootfs()) { + $data['ReadonlyRootfs'] = $object->getReadonlyRootfs(); + } + if ($object->isInitialized('securityOpt') && null !== $object->getSecurityOpt()) { + $values_24 = []; + foreach ($object->getSecurityOpt() as $value_24) { + $values_24[] = $value_24; + } + $data['SecurityOpt'] = $values_24; + } + if ($object->isInitialized('storageOpt') && null !== $object->getStorageOpt()) { + $values_25 = []; + foreach ($object->getStorageOpt() as $key_2 => $value_25) { + $values_25[$key_2] = $value_25; + } + $data['StorageOpt'] = $values_25; + } + if ($object->isInitialized('tmpfs') && null !== $object->getTmpfs()) { + $values_26 = []; + foreach ($object->getTmpfs() as $key_3 => $value_26) { + $values_26[$key_3] = $value_26; + } + $data['Tmpfs'] = $values_26; + } + if ($object->isInitialized('uTSMode') && null !== $object->getUTSMode()) { + $data['UTSMode'] = $object->getUTSMode(); + } + if ($object->isInitialized('usernsMode') && null !== $object->getUsernsMode()) { + $data['UsernsMode'] = $object->getUsernsMode(); + } + if ($object->isInitialized('shmSize') && null !== $object->getShmSize()) { + $data['ShmSize'] = $object->getShmSize(); + } + if ($object->isInitialized('sysctls') && null !== $object->getSysctls()) { + $values_27 = []; + foreach ($object->getSysctls() as $key_4 => $value_27) { + $values_27[$key_4] = $value_27; + } + $data['Sysctls'] = $values_27; + } + if ($object->isInitialized('runtime') && null !== $object->getRuntime()) { + $data['Runtime'] = $object->getRuntime(); + } + if ($object->isInitialized('isolation') && null !== $object->getIsolation()) { + $data['Isolation'] = $object->getIsolation(); + } + if ($object->isInitialized('maskedPaths') && null !== $object->getMaskedPaths()) { + $values_28 = []; + foreach ($object->getMaskedPaths() as $value_28) { + $values_28[] = $value_28; + } + $data['MaskedPaths'] = $values_28; + } + if ($object->isInitialized('readonlyPaths') && null !== $object->getReadonlyPaths()) { + $values_29 = []; + foreach ($object->getReadonlyPaths() as $value_29) { + $values_29[] = $value_29; + } + $data['ReadonlyPaths'] = $values_29; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\HostConfig::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/IPAMConfigNormalizer.php b/generated/Normalizer/IPAMConfigNormalizer.php index f9fcaad4..ba73d5e6 100644 --- a/generated/Normalizer/IPAMConfigNormalizer.php +++ b/generated/Normalizer/IPAMConfigNormalizer.php @@ -2,68 +2,187 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class IPAMConfigNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class IPAMConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\IPAMConfig') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\IPAMConfig::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\IPAMConfig) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\IPAMConfig::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\IPAMConfig(); - if (property_exists($data, 'Subnet')) { - $object->setSubnet($data->{'Subnet'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\IPAMConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Subnet', $data) && $data['Subnet'] !== null) { + $object->setSubnet($data['Subnet']); + } + elseif (\array_key_exists('Subnet', $data) && $data['Subnet'] === null) { + $object->setSubnet(null); + } + if (\array_key_exists('IPRange', $data) && $data['IPRange'] !== null) { + $object->setIPRange($data['IPRange']); + } + elseif (\array_key_exists('IPRange', $data) && $data['IPRange'] === null) { + $object->setIPRange(null); + } + if (\array_key_exists('Gateway', $data) && $data['Gateway'] !== null) { + $object->setGateway($data['Gateway']); + } + elseif (\array_key_exists('Gateway', $data) && $data['Gateway'] === null) { + $object->setGateway(null); + } + if (\array_key_exists('AuxiliaryAddresses', $data) && $data['AuxiliaryAddresses'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['AuxiliaryAddresses'] as $key => $value) { + $values[$key] = $value; + } + $object->setAuxiliaryAddresses($values); + } + elseif (\array_key_exists('AuxiliaryAddresses', $data) && $data['AuxiliaryAddresses'] === null) { + $object->setAuxiliaryAddresses(null); + } + return $object; } - if (property_exists($data, 'IPRange')) { - $object->setIPRange($data->{'IPRange'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('subnet') && null !== $object->getSubnet()) { + $data['Subnet'] = $object->getSubnet(); + } + if ($object->isInitialized('iPRange') && null !== $object->getIPRange()) { + $data['IPRange'] = $object->getIPRange(); + } + if ($object->isInitialized('gateway') && null !== $object->getGateway()) { + $data['Gateway'] = $object->getGateway(); + } + if ($object->isInitialized('auxiliaryAddresses') && null !== $object->getAuxiliaryAddresses()) { + $values = []; + foreach ($object->getAuxiliaryAddresses() as $key => $value) { + $values[$key] = $value; + } + $data['AuxiliaryAddresses'] = $values; + } + return $data; } - if (property_exists($data, 'Gateway')) { - $object->setGateway($data->{'Gateway'}); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\IPAMConfig::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class IPAMConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getSubnet()) { - $data->{'Subnet'} = $object->getSubnet(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\IPAMConfig::class; } - if (null !== $object->getIPRange()) { - $data->{'IPRange'} = $object->getIPRange(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\IPAMConfig::class; } - if (null !== $object->getGateway()) { - $data->{'Gateway'} = $object->getGateway(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\IPAMConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Subnet', $data) && $data['Subnet'] !== null) { + $object->setSubnet($data['Subnet']); + } + elseif (\array_key_exists('Subnet', $data) && $data['Subnet'] === null) { + $object->setSubnet(null); + } + if (\array_key_exists('IPRange', $data) && $data['IPRange'] !== null) { + $object->setIPRange($data['IPRange']); + } + elseif (\array_key_exists('IPRange', $data) && $data['IPRange'] === null) { + $object->setIPRange(null); + } + if (\array_key_exists('Gateway', $data) && $data['Gateway'] !== null) { + $object->setGateway($data['Gateway']); + } + elseif (\array_key_exists('Gateway', $data) && $data['Gateway'] === null) { + $object->setGateway(null); + } + if (\array_key_exists('AuxiliaryAddresses', $data) && $data['AuxiliaryAddresses'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['AuxiliaryAddresses'] as $key => $value) { + $values[$key] = $value; + } + $object->setAuxiliaryAddresses($values); + } + elseif (\array_key_exists('AuxiliaryAddresses', $data) && $data['AuxiliaryAddresses'] === null) { + $object->setAuxiliaryAddresses(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('subnet') && null !== $object->getSubnet()) { + $data['Subnet'] = $object->getSubnet(); + } + if ($object->isInitialized('iPRange') && null !== $object->getIPRange()) { + $data['IPRange'] = $object->getIPRange(); + } + if ($object->isInitialized('gateway') && null !== $object->getGateway()) { + $data['Gateway'] = $object->getGateway(); + } + if ($object->isInitialized('auxiliaryAddresses') && null !== $object->getAuxiliaryAddresses()) { + $values = []; + foreach ($object->getAuxiliaryAddresses() as $key => $value) { + $values[$key] = $value; + } + $data['AuxiliaryAddresses'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\IPAMConfig::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/IPAMNormalizer.php b/generated/Normalizer/IPAMNormalizer.php index 87eef1f5..758fb275 100644 --- a/generated/Normalizer/IPAMNormalizer.php +++ b/generated/Normalizer/IPAMNormalizer.php @@ -2,108 +2,185 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class IPAMNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\IPAM') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class IPAMNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\IPAM) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\IPAM::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\IPAM(); - if (property_exists($data, 'Driver')) { - $object->setDriver($data->{'Driver'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\IPAM::class; } - if (property_exists($data, 'Config')) { - $value = $data->{'Config'}; - if (is_array($data->{'Config'})) { + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\IPAM(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { $values = []; - foreach ($data->{'Config'} as $value_1) { - $values[] = $this->serializer->denormalize($value_1, 'Docker\\API\\Model\\IPAMConfig', 'raw', $context); + foreach ($data['Config'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\IPAMConfig::class, 'json', $context); } - $value = $values; + $object->setConfig($values); } - if (is_null($data->{'Config'})) { - $value = $data->{'Config'}; + elseif (\array_key_exists('Config', $data) && $data['Config'] === null) { + $object->setConfig(null); } - $object->setConfig($value); - } - if (property_exists($data, 'Options')) { - $value_2 = $data->{'Options'}; - if (is_object($data->{'Options'})) { + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value_3) { - $values_1[$key] = $value_3; + foreach ($data['Options'] as $key => $value_1) { + $values_1[$key] = $value_1; } - $value_2 = $values_1; + $object->setOptions($values_1); } - if (is_null($data->{'Options'})) { - $value_2 = $data->{'Options'}; + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); } - $object->setOptions($value_2); + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $values = []; + foreach ($object->getConfig() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Config'] = $values; + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values_1 = []; + foreach ($object->getOptions() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $data['Options'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\IPAM::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class IPAMNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\IPAM::class; } - $value = $object->getConfig(); - if (is_array($object->getConfig())) { - $values = []; - foreach ($object->getConfig() as $value_1) { - $values[] = $value_1; - } - $value = $values; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\IPAM::class; } - if (is_null($object->getConfig())) { - $value = $object->getConfig(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\IPAM(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $values = []; + foreach ($data['Config'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\IPAMConfig::class, 'json', $context); + } + $object->setConfig($values); + } + elseif (\array_key_exists('Config', $data) && $data['Config'] === null) { + $object->setConfig(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value_1) { + $values_1[$key] = $value_1; + } + $object->setOptions($values_1); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; } - $data->{'Config'} = $value; - $value_2 = $object->getOptions(); - if (is_object($object->getOptions())) { - $values_1 = new \stdClass(); - foreach ($object->getOptions() as $key => $value_3) { - $values_1->{$key} = $value_3; - } - $value_2 = $values_1; + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $values = []; + foreach ($object->getConfig() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Config'] = $values; + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values_1 = []; + foreach ($object->getOptions() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $data['Options'] = $values_1; + } + return $data; } - if (is_null($object->getOptions())) { - $value_2 = $object->getOptions(); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\IPAM::class => false]; } - $data->{'Options'} = $value_2; - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/IdResponseNormalizer.php b/generated/Normalizer/IdResponseNormalizer.php new file mode 100644 index 00000000..e2659989 --- /dev/null +++ b/generated/Normalizer/IdResponseNormalizer.php @@ -0,0 +1,114 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class IdResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\IdResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\IdResponse::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\IdResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Id'] = $object->getId(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\IdResponse::class => false]; + } + } +} else { + class IdResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\IdResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\IdResponse::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\IdResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Id'] = $object->getId(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\IdResponse::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImageConfigNormalizer.php b/generated/Normalizer/ImageConfigNormalizer.php new file mode 100644 index 00000000..2f933e9a --- /dev/null +++ b/generated/Normalizer/ImageConfigNormalizer.php @@ -0,0 +1,678 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImageConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Hostname', $data) && $data['Hostname'] !== null) { + $object->setHostname($data['Hostname']); + } + elseif (\array_key_exists('Hostname', $data) && $data['Hostname'] === null) { + $object->setHostname(null); + } + if (\array_key_exists('Domainname', $data) && $data['Domainname'] !== null) { + $object->setDomainname($data['Domainname']); + } + elseif (\array_key_exists('Domainname', $data) && $data['Domainname'] === null) { + $object->setDomainname(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] !== null) { + $object->setAttachStdin($data['AttachStdin']); + } + elseif (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] === null) { + $object->setAttachStdin(null); + } + if (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] !== null) { + $object->setAttachStdout($data['AttachStdout']); + } + elseif (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] === null) { + $object->setAttachStdout(null); + } + if (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] !== null) { + $object->setAttachStderr($data['AttachStderr']); + } + elseif (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] === null) { + $object->setAttachStderr(null); + } + if (\array_key_exists('ExposedPorts', $data) && $data['ExposedPorts'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['ExposedPorts'] as $key => $value) { + $values[$key] = $value; + } + $object->setExposedPorts($values); + } + elseif (\array_key_exists('ExposedPorts', $data) && $data['ExposedPorts'] === null) { + $object->setExposedPorts(null); + } + if (\array_key_exists('Tty', $data) && $data['Tty'] !== null) { + $object->setTty($data['Tty']); + } + elseif (\array_key_exists('Tty', $data) && $data['Tty'] === null) { + $object->setTty(null); + } + if (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] !== null) { + $object->setOpenStdin($data['OpenStdin']); + } + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); + } + if (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] !== null) { + $object->setStdinOnce($data['StdinOnce']); + } + elseif (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] === null) { + $object->setStdinOnce(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_1 = []; + foreach ($data['Env'] as $value_1) { + $values_1[] = $value_1; + } + $object->setEnv($values_1); + } + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Cmd', $data) && $data['Cmd'] !== null) { + $values_2 = []; + foreach ($data['Cmd'] as $value_2) { + $values_2[] = $value_2; + } + $object->setCmd($values_2); + } + elseif (\array_key_exists('Cmd', $data) && $data['Cmd'] === null) { + $object->setCmd(null); + } + if (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] !== null) { + $object->setHealthcheck($this->denormalizer->denormalize($data['Healthcheck'], \Docker\API\Model\HealthConfig::class, 'json', $context)); + } + elseif (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] === null) { + $object->setHealthcheck(null); + } + if (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] !== null) { + $object->setArgsEscaped($data['ArgsEscaped']); + } + elseif (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] === null) { + $object->setArgsEscaped(null); + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); + } + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('Volumes', $data) && $data['Volumes'] !== null) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Volumes'] as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $object->setVolumes($values_3); + } + elseif (\array_key_exists('Volumes', $data) && $data['Volumes'] === null) { + $object->setVolumes(null); + } + if (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] !== null) { + $object->setWorkingDir($data['WorkingDir']); + } + elseif (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] === null) { + $object->setWorkingDir(null); + } + if (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] !== null) { + $values_4 = []; + foreach ($data['Entrypoint'] as $value_4) { + $values_4[] = $value_4; + } + $object->setEntrypoint($values_4); + } + elseif (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] === null) { + $object->setEntrypoint(null); + } + if (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] !== null) { + $object->setNetworkDisabled($data['NetworkDisabled']); + } + elseif (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] === null) { + $object->setNetworkDisabled(null); + } + if (\array_key_exists('MacAddress', $data) && $data['MacAddress'] !== null) { + $object->setMacAddress($data['MacAddress']); + } + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); + } + if (\array_key_exists('OnBuild', $data) && $data['OnBuild'] !== null) { + $values_5 = []; + foreach ($data['OnBuild'] as $value_5) { + $values_5[] = $value_5; + } + $object->setOnBuild($values_5); + } + elseif (\array_key_exists('OnBuild', $data) && $data['OnBuild'] === null) { + $object->setOnBuild(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; + } + $object->setLabels($values_6); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('StopSignal', $data) && $data['StopSignal'] !== null) { + $object->setStopSignal($data['StopSignal']); + } + elseif (\array_key_exists('StopSignal', $data) && $data['StopSignal'] === null) { + $object->setStopSignal(null); + } + if (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] !== null) { + $object->setStopTimeout($data['StopTimeout']); + } + elseif (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] === null) { + $object->setStopTimeout(null); + } + if (\array_key_exists('Shell', $data) && $data['Shell'] !== null) { + $values_7 = []; + foreach ($data['Shell'] as $value_7) { + $values_7[] = $value_7; + } + $object->setShell($values_7); + } + elseif (\array_key_exists('Shell', $data) && $data['Shell'] === null) { + $object->setShell(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); + } + if ($object->isInitialized('domainname') && null !== $object->getDomainname()) { + $data['Domainname'] = $object->getDomainname(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); + } + if ($object->isInitialized('attachStdin') && null !== $object->getAttachStdin()) { + $data['AttachStdin'] = $object->getAttachStdin(); + } + if ($object->isInitialized('attachStdout') && null !== $object->getAttachStdout()) { + $data['AttachStdout'] = $object->getAttachStdout(); + } + if ($object->isInitialized('attachStderr') && null !== $object->getAttachStderr()) { + $data['AttachStderr'] = $object->getAttachStderr(); + } + if ($object->isInitialized('exposedPorts') && null !== $object->getExposedPorts()) { + $values = []; + foreach ($object->getExposedPorts() as $key => $value) { + $values[$key] = $value; + } + $data['ExposedPorts'] = $values; + } + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); + } + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); + } + if ($object->isInitialized('stdinOnce') && null !== $object->getStdinOnce()) { + $data['StdinOnce'] = $object->getStdinOnce(); + } + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_1 = []; + foreach ($object->getEnv() as $value_1) { + $values_1[] = $value_1; + } + $data['Env'] = $values_1; + } + if ($object->isInitialized('cmd') && null !== $object->getCmd()) { + $values_2 = []; + foreach ($object->getCmd() as $value_2) { + $values_2[] = $value_2; + } + $data['Cmd'] = $values_2; + } + if ($object->isInitialized('healthcheck') && null !== $object->getHealthcheck()) { + $data['Healthcheck'] = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context); + } + if ($object->isInitialized('argsEscaped') && null !== $object->getArgsEscaped()) { + $data['ArgsEscaped'] = $object->getArgsEscaped(); + } + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); + } + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values_3 = []; + foreach ($object->getVolumes() as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $data['Volumes'] = $values_3; + } + if ($object->isInitialized('workingDir') && null !== $object->getWorkingDir()) { + $data['WorkingDir'] = $object->getWorkingDir(); + } + if ($object->isInitialized('entrypoint') && null !== $object->getEntrypoint()) { + $values_4 = []; + foreach ($object->getEntrypoint() as $value_4) { + $values_4[] = $value_4; + } + $data['Entrypoint'] = $values_4; + } + if ($object->isInitialized('networkDisabled') && null !== $object->getNetworkDisabled()) { + $data['NetworkDisabled'] = $object->getNetworkDisabled(); + } + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); + } + if ($object->isInitialized('onBuild') && null !== $object->getOnBuild()) { + $values_5 = []; + foreach ($object->getOnBuild() as $value_5) { + $values_5[] = $value_5; + } + $data['OnBuild'] = $values_5; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_6 = []; + foreach ($object->getLabels() as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; + } + $data['Labels'] = $values_6; + } + if ($object->isInitialized('stopSignal') && null !== $object->getStopSignal()) { + $data['StopSignal'] = $object->getStopSignal(); + } + if ($object->isInitialized('stopTimeout') && null !== $object->getStopTimeout()) { + $data['StopTimeout'] = $object->getStopTimeout(); + } + if ($object->isInitialized('shell') && null !== $object->getShell()) { + $values_7 = []; + foreach ($object->getShell() as $value_7) { + $values_7[] = $value_7; + } + $data['Shell'] = $values_7; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageConfig::class => false]; + } + } +} else { + class ImageConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Hostname', $data) && $data['Hostname'] !== null) { + $object->setHostname($data['Hostname']); + } + elseif (\array_key_exists('Hostname', $data) && $data['Hostname'] === null) { + $object->setHostname(null); + } + if (\array_key_exists('Domainname', $data) && $data['Domainname'] !== null) { + $object->setDomainname($data['Domainname']); + } + elseif (\array_key_exists('Domainname', $data) && $data['Domainname'] === null) { + $object->setDomainname(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] !== null) { + $object->setAttachStdin($data['AttachStdin']); + } + elseif (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] === null) { + $object->setAttachStdin(null); + } + if (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] !== null) { + $object->setAttachStdout($data['AttachStdout']); + } + elseif (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] === null) { + $object->setAttachStdout(null); + } + if (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] !== null) { + $object->setAttachStderr($data['AttachStderr']); + } + elseif (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] === null) { + $object->setAttachStderr(null); + } + if (\array_key_exists('ExposedPorts', $data) && $data['ExposedPorts'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['ExposedPorts'] as $key => $value) { + $values[$key] = $value; + } + $object->setExposedPorts($values); + } + elseif (\array_key_exists('ExposedPorts', $data) && $data['ExposedPorts'] === null) { + $object->setExposedPorts(null); + } + if (\array_key_exists('Tty', $data) && $data['Tty'] !== null) { + $object->setTty($data['Tty']); + } + elseif (\array_key_exists('Tty', $data) && $data['Tty'] === null) { + $object->setTty(null); + } + if (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] !== null) { + $object->setOpenStdin($data['OpenStdin']); + } + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); + } + if (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] !== null) { + $object->setStdinOnce($data['StdinOnce']); + } + elseif (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] === null) { + $object->setStdinOnce(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_1 = []; + foreach ($data['Env'] as $value_1) { + $values_1[] = $value_1; + } + $object->setEnv($values_1); + } + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Cmd', $data) && $data['Cmd'] !== null) { + $values_2 = []; + foreach ($data['Cmd'] as $value_2) { + $values_2[] = $value_2; + } + $object->setCmd($values_2); + } + elseif (\array_key_exists('Cmd', $data) && $data['Cmd'] === null) { + $object->setCmd(null); + } + if (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] !== null) { + $object->setHealthcheck($this->denormalizer->denormalize($data['Healthcheck'], \Docker\API\Model\HealthConfig::class, 'json', $context)); + } + elseif (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] === null) { + $object->setHealthcheck(null); + } + if (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] !== null) { + $object->setArgsEscaped($data['ArgsEscaped']); + } + elseif (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] === null) { + $object->setArgsEscaped(null); + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); + } + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('Volumes', $data) && $data['Volumes'] !== null) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Volumes'] as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $object->setVolumes($values_3); + } + elseif (\array_key_exists('Volumes', $data) && $data['Volumes'] === null) { + $object->setVolumes(null); + } + if (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] !== null) { + $object->setWorkingDir($data['WorkingDir']); + } + elseif (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] === null) { + $object->setWorkingDir(null); + } + if (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] !== null) { + $values_4 = []; + foreach ($data['Entrypoint'] as $value_4) { + $values_4[] = $value_4; + } + $object->setEntrypoint($values_4); + } + elseif (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] === null) { + $object->setEntrypoint(null); + } + if (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] !== null) { + $object->setNetworkDisabled($data['NetworkDisabled']); + } + elseif (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] === null) { + $object->setNetworkDisabled(null); + } + if (\array_key_exists('MacAddress', $data) && $data['MacAddress'] !== null) { + $object->setMacAddress($data['MacAddress']); + } + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); + } + if (\array_key_exists('OnBuild', $data) && $data['OnBuild'] !== null) { + $values_5 = []; + foreach ($data['OnBuild'] as $value_5) { + $values_5[] = $value_5; + } + $object->setOnBuild($values_5); + } + elseif (\array_key_exists('OnBuild', $data) && $data['OnBuild'] === null) { + $object->setOnBuild(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; + } + $object->setLabels($values_6); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('StopSignal', $data) && $data['StopSignal'] !== null) { + $object->setStopSignal($data['StopSignal']); + } + elseif (\array_key_exists('StopSignal', $data) && $data['StopSignal'] === null) { + $object->setStopSignal(null); + } + if (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] !== null) { + $object->setStopTimeout($data['StopTimeout']); + } + elseif (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] === null) { + $object->setStopTimeout(null); + } + if (\array_key_exists('Shell', $data) && $data['Shell'] !== null) { + $values_7 = []; + foreach ($data['Shell'] as $value_7) { + $values_7[] = $value_7; + } + $object->setShell($values_7); + } + elseif (\array_key_exists('Shell', $data) && $data['Shell'] === null) { + $object->setShell(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); + } + if ($object->isInitialized('domainname') && null !== $object->getDomainname()) { + $data['Domainname'] = $object->getDomainname(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); + } + if ($object->isInitialized('attachStdin') && null !== $object->getAttachStdin()) { + $data['AttachStdin'] = $object->getAttachStdin(); + } + if ($object->isInitialized('attachStdout') && null !== $object->getAttachStdout()) { + $data['AttachStdout'] = $object->getAttachStdout(); + } + if ($object->isInitialized('attachStderr') && null !== $object->getAttachStderr()) { + $data['AttachStderr'] = $object->getAttachStderr(); + } + if ($object->isInitialized('exposedPorts') && null !== $object->getExposedPorts()) { + $values = []; + foreach ($object->getExposedPorts() as $key => $value) { + $values[$key] = $value; + } + $data['ExposedPorts'] = $values; + } + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); + } + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); + } + if ($object->isInitialized('stdinOnce') && null !== $object->getStdinOnce()) { + $data['StdinOnce'] = $object->getStdinOnce(); + } + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_1 = []; + foreach ($object->getEnv() as $value_1) { + $values_1[] = $value_1; + } + $data['Env'] = $values_1; + } + if ($object->isInitialized('cmd') && null !== $object->getCmd()) { + $values_2 = []; + foreach ($object->getCmd() as $value_2) { + $values_2[] = $value_2; + } + $data['Cmd'] = $values_2; + } + if ($object->isInitialized('healthcheck') && null !== $object->getHealthcheck()) { + $data['Healthcheck'] = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context); + } + if ($object->isInitialized('argsEscaped') && null !== $object->getArgsEscaped()) { + $data['ArgsEscaped'] = $object->getArgsEscaped(); + } + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); + } + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values_3 = []; + foreach ($object->getVolumes() as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $data['Volumes'] = $values_3; + } + if ($object->isInitialized('workingDir') && null !== $object->getWorkingDir()) { + $data['WorkingDir'] = $object->getWorkingDir(); + } + if ($object->isInitialized('entrypoint') && null !== $object->getEntrypoint()) { + $values_4 = []; + foreach ($object->getEntrypoint() as $value_4) { + $values_4[] = $value_4; + } + $data['Entrypoint'] = $values_4; + } + if ($object->isInitialized('networkDisabled') && null !== $object->getNetworkDisabled()) { + $data['NetworkDisabled'] = $object->getNetworkDisabled(); + } + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); + } + if ($object->isInitialized('onBuild') && null !== $object->getOnBuild()) { + $values_5 = []; + foreach ($object->getOnBuild() as $value_5) { + $values_5[] = $value_5; + } + $data['OnBuild'] = $values_5; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_6 = []; + foreach ($object->getLabels() as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; + } + $data['Labels'] = $values_6; + } + if ($object->isInitialized('stopSignal') && null !== $object->getStopSignal()) { + $data['StopSignal'] = $object->getStopSignal(); + } + if ($object->isInitialized('stopTimeout') && null !== $object->getStopTimeout()) { + $data['StopTimeout'] = $object->getStopTimeout(); + } + if ($object->isInitialized('shell') && null !== $object->getShell()) { + $values_7 = []; + foreach ($object->getShell() as $value_7) { + $values_7[] = $value_7; + } + $data['Shell'] = $values_7; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImageDeleteResponseItemNormalizer.php b/generated/Normalizer/ImageDeleteResponseItemNormalizer.php new file mode 100644 index 00000000..b42fc4ee --- /dev/null +++ b/generated/Normalizer/ImageDeleteResponseItemNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImageDeleteResponseItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageDeleteResponseItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageDeleteResponseItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageDeleteResponseItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Untagged', $data) && $data['Untagged'] !== null) { + $object->setUntagged($data['Untagged']); + } + elseif (\array_key_exists('Untagged', $data) && $data['Untagged'] === null) { + $object->setUntagged(null); + } + if (\array_key_exists('Deleted', $data) && $data['Deleted'] !== null) { + $object->setDeleted($data['Deleted']); + } + elseif (\array_key_exists('Deleted', $data) && $data['Deleted'] === null) { + $object->setDeleted(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('untagged') && null !== $object->getUntagged()) { + $data['Untagged'] = $object->getUntagged(); + } + if ($object->isInitialized('deleted') && null !== $object->getDeleted()) { + $data['Deleted'] = $object->getDeleted(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageDeleteResponseItem::class => false]; + } + } +} else { + class ImageDeleteResponseItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageDeleteResponseItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageDeleteResponseItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageDeleteResponseItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Untagged', $data) && $data['Untagged'] !== null) { + $object->setUntagged($data['Untagged']); + } + elseif (\array_key_exists('Untagged', $data) && $data['Untagged'] === null) { + $object->setUntagged(null); + } + if (\array_key_exists('Deleted', $data) && $data['Deleted'] !== null) { + $object->setDeleted($data['Deleted']); + } + elseif (\array_key_exists('Deleted', $data) && $data['Deleted'] === null) { + $object->setDeleted(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('untagged') && null !== $object->getUntagged()) { + $data['Untagged'] = $object->getUntagged(); + } + if ($object->isInitialized('deleted') && null !== $object->getDeleted()) { + $data['Deleted'] = $object->getDeleted(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageDeleteResponseItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImageHistoryItemNormalizer.php b/generated/Normalizer/ImageHistoryItemNormalizer.php deleted file mode 100644 index b4df6ec7..00000000 --- a/generated/Normalizer/ImageHistoryItemNormalizer.php +++ /dev/null @@ -1,107 +0,0 @@ -setId($data->{'Id'}); - } - if (property_exists($data, 'Created')) { - $object->setCreated($data->{'Created'}); - } - if (property_exists($data, 'CreatedBy')) { - $object->setCreatedBy($data->{'CreatedBy'}); - } - if (property_exists($data, 'Tags')) { - $value = $data->{'Tags'}; - if (is_array($data->{'Tags'})) { - $values = []; - foreach ($data->{'Tags'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Tags'})) { - $value = $data->{'Tags'}; - } - $object->setTags($value); - } - if (property_exists($data, 'Size')) { - $object->setSize($data->{'Size'}); - } - if (property_exists($data, 'Comment')) { - $object->setComment($data->{'Comment'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); - } - if (null !== $object->getCreatedBy()) { - $data->{'CreatedBy'} = $object->getCreatedBy(); - } - $value = $object->getTags(); - if (is_array($object->getTags())) { - $values = []; - foreach ($object->getTags() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getTags())) { - $value = $object->getTags(); - } - $data->{'Tags'} = $value; - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); - } - if (null !== $object->getComment()) { - $data->{'Comment'} = $object->getComment(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ImageIDNormalizer.php b/generated/Normalizer/ImageIDNormalizer.php new file mode 100644 index 00000000..3f2a2d21 --- /dev/null +++ b/generated/Normalizer/ImageIDNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImageIDNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageID::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageID::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageID(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageID::class => false]; + } + } +} else { + class ImageIDNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageID::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageID::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageID(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageID::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImageInspectMetadataNormalizer.php b/generated/Normalizer/ImageInspectMetadataNormalizer.php new file mode 100644 index 00000000..0b94d342 --- /dev/null +++ b/generated/Normalizer/ImageInspectMetadataNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImageInspectMetadataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageInspectMetadata::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageInspectMetadata::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageInspectMetadata(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('LastTagTime', $data) && $data['LastTagTime'] !== null) { + $object->setLastTagTime($data['LastTagTime']); + } + elseif (\array_key_exists('LastTagTime', $data) && $data['LastTagTime'] === null) { + $object->setLastTagTime(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('lastTagTime') && null !== $object->getLastTagTime()) { + $data['LastTagTime'] = $object->getLastTagTime(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageInspectMetadata::class => false]; + } + } +} else { + class ImageInspectMetadataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageInspectMetadata::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageInspectMetadata::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageInspectMetadata(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('LastTagTime', $data) && $data['LastTagTime'] !== null) { + $object->setLastTagTime($data['LastTagTime']); + } + elseif (\array_key_exists('LastTagTime', $data) && $data['LastTagTime'] === null) { + $object->setLastTagTime(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('lastTagTime') && null !== $object->getLastTagTime()) { + $data['LastTagTime'] = $object->getLastTagTime(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageInspectMetadata::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImageInspectNormalizer.php b/generated/Normalizer/ImageInspectNormalizer.php new file mode 100644 index 00000000..ca549de7 --- /dev/null +++ b/generated/Normalizer/ImageInspectNormalizer.php @@ -0,0 +1,456 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImageInspectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageInspect::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageInspect::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageInspect(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('RepoTags', $data) && $data['RepoTags'] !== null) { + $values = []; + foreach ($data['RepoTags'] as $value) { + $values[] = $value; + } + $object->setRepoTags($values); + } + elseif (\array_key_exists('RepoTags', $data) && $data['RepoTags'] === null) { + $object->setRepoTags(null); + } + if (\array_key_exists('RepoDigests', $data) && $data['RepoDigests'] !== null) { + $values_1 = []; + foreach ($data['RepoDigests'] as $value_1) { + $values_1[] = $value_1; + } + $object->setRepoDigests($values_1); + } + elseif (\array_key_exists('RepoDigests', $data) && $data['RepoDigests'] === null) { + $object->setRepoDigests(null); + } + if (\array_key_exists('Parent', $data) && $data['Parent'] !== null) { + $object->setParent($data['Parent']); + } + elseif (\array_key_exists('Parent', $data) && $data['Parent'] === null) { + $object->setParent(null); + } + if (\array_key_exists('Comment', $data) && $data['Comment'] !== null) { + $object->setComment($data['Comment']); + } + elseif (\array_key_exists('Comment', $data) && $data['Comment'] === null) { + $object->setComment(null); + } + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); + } + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); + } + if (\array_key_exists('DockerVersion', $data) && $data['DockerVersion'] !== null) { + $object->setDockerVersion($data['DockerVersion']); + } + elseif (\array_key_exists('DockerVersion', $data) && $data['DockerVersion'] === null) { + $object->setDockerVersion(null); + } + if (\array_key_exists('Author', $data) && $data['Author'] !== null) { + $object->setAuthor($data['Author']); + } + elseif (\array_key_exists('Author', $data) && $data['Author'] === null) { + $object->setAuthor(null); + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $object->setConfig($this->denormalizer->denormalize($data['Config'], \Docker\API\Model\ImageConfig::class, 'json', $context)); + } + elseif (\array_key_exists('Config', $data) && $data['Config'] === null) { + $object->setConfig(null); + } + if (\array_key_exists('Architecture', $data) && $data['Architecture'] !== null) { + $object->setArchitecture($data['Architecture']); + } + elseif (\array_key_exists('Architecture', $data) && $data['Architecture'] === null) { + $object->setArchitecture(null); + } + if (\array_key_exists('Variant', $data) && $data['Variant'] !== null) { + $object->setVariant($data['Variant']); + } + elseif (\array_key_exists('Variant', $data) && $data['Variant'] === null) { + $object->setVariant(null); + } + if (\array_key_exists('Os', $data) && $data['Os'] !== null) { + $object->setOs($data['Os']); + } + elseif (\array_key_exists('Os', $data) && $data['Os'] === null) { + $object->setOs(null); + } + if (\array_key_exists('OsVersion', $data) && $data['OsVersion'] !== null) { + $object->setOsVersion($data['OsVersion']); + } + elseif (\array_key_exists('OsVersion', $data) && $data['OsVersion'] === null) { + $object->setOsVersion(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + if (\array_key_exists('VirtualSize', $data) && $data['VirtualSize'] !== null) { + $object->setVirtualSize($data['VirtualSize']); + } + elseif (\array_key_exists('VirtualSize', $data) && $data['VirtualSize'] === null) { + $object->setVirtualSize(null); + } + if (\array_key_exists('GraphDriver', $data) && $data['GraphDriver'] !== null) { + $object->setGraphDriver($this->denormalizer->denormalize($data['GraphDriver'], \Docker\API\Model\DriverData::class, 'json', $context)); + } + elseif (\array_key_exists('GraphDriver', $data) && $data['GraphDriver'] === null) { + $object->setGraphDriver(null); + } + if (\array_key_exists('RootFS', $data) && $data['RootFS'] !== null) { + $object->setRootFS($this->denormalizer->denormalize($data['RootFS'], \Docker\API\Model\ImageInspectRootFS::class, 'json', $context)); + } + elseif (\array_key_exists('RootFS', $data) && $data['RootFS'] === null) { + $object->setRootFS(null); + } + if (\array_key_exists('Metadata', $data) && $data['Metadata'] !== null) { + $object->setMetadata($this->denormalizer->denormalize($data['Metadata'], \Docker\API\Model\ImageInspectMetadata::class, 'json', $context)); + } + elseif (\array_key_exists('Metadata', $data) && $data['Metadata'] === null) { + $object->setMetadata(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); + } + if ($object->isInitialized('repoTags') && null !== $object->getRepoTags()) { + $values = []; + foreach ($object->getRepoTags() as $value) { + $values[] = $value; + } + $data['RepoTags'] = $values; + } + if ($object->isInitialized('repoDigests') && null !== $object->getRepoDigests()) { + $values_1 = []; + foreach ($object->getRepoDigests() as $value_1) { + $values_1[] = $value_1; + } + $data['RepoDigests'] = $values_1; + } + if ($object->isInitialized('parent') && null !== $object->getParent()) { + $data['Parent'] = $object->getParent(); + } + if ($object->isInitialized('comment') && null !== $object->getComment()) { + $data['Comment'] = $object->getComment(); + } + if ($object->isInitialized('created') && null !== $object->getCreated()) { + $data['Created'] = $object->getCreated(); + } + if ($object->isInitialized('dockerVersion') && null !== $object->getDockerVersion()) { + $data['DockerVersion'] = $object->getDockerVersion(); + } + if ($object->isInitialized('author') && null !== $object->getAuthor()) { + $data['Author'] = $object->getAuthor(); + } + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $data['Config'] = $this->normalizer->normalize($object->getConfig(), 'json', $context); + } + if ($object->isInitialized('architecture') && null !== $object->getArchitecture()) { + $data['Architecture'] = $object->getArchitecture(); + } + if ($object->isInitialized('variant') && null !== $object->getVariant()) { + $data['Variant'] = $object->getVariant(); + } + if ($object->isInitialized('os') && null !== $object->getOs()) { + $data['Os'] = $object->getOs(); + } + if ($object->isInitialized('osVersion') && null !== $object->getOsVersion()) { + $data['OsVersion'] = $object->getOsVersion(); + } + if ($object->isInitialized('size') && null !== $object->getSize()) { + $data['Size'] = $object->getSize(); + } + if ($object->isInitialized('virtualSize') && null !== $object->getVirtualSize()) { + $data['VirtualSize'] = $object->getVirtualSize(); + } + if ($object->isInitialized('graphDriver') && null !== $object->getGraphDriver()) { + $data['GraphDriver'] = $this->normalizer->normalize($object->getGraphDriver(), 'json', $context); + } + if ($object->isInitialized('rootFS') && null !== $object->getRootFS()) { + $data['RootFS'] = $this->normalizer->normalize($object->getRootFS(), 'json', $context); + } + if ($object->isInitialized('metadata') && null !== $object->getMetadata()) { + $data['Metadata'] = $this->normalizer->normalize($object->getMetadata(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageInspect::class => false]; + } + } +} else { + class ImageInspectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageInspect::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageInspect::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageInspect(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('RepoTags', $data) && $data['RepoTags'] !== null) { + $values = []; + foreach ($data['RepoTags'] as $value) { + $values[] = $value; + } + $object->setRepoTags($values); + } + elseif (\array_key_exists('RepoTags', $data) && $data['RepoTags'] === null) { + $object->setRepoTags(null); + } + if (\array_key_exists('RepoDigests', $data) && $data['RepoDigests'] !== null) { + $values_1 = []; + foreach ($data['RepoDigests'] as $value_1) { + $values_1[] = $value_1; + } + $object->setRepoDigests($values_1); + } + elseif (\array_key_exists('RepoDigests', $data) && $data['RepoDigests'] === null) { + $object->setRepoDigests(null); + } + if (\array_key_exists('Parent', $data) && $data['Parent'] !== null) { + $object->setParent($data['Parent']); + } + elseif (\array_key_exists('Parent', $data) && $data['Parent'] === null) { + $object->setParent(null); + } + if (\array_key_exists('Comment', $data) && $data['Comment'] !== null) { + $object->setComment($data['Comment']); + } + elseif (\array_key_exists('Comment', $data) && $data['Comment'] === null) { + $object->setComment(null); + } + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); + } + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); + } + if (\array_key_exists('DockerVersion', $data) && $data['DockerVersion'] !== null) { + $object->setDockerVersion($data['DockerVersion']); + } + elseif (\array_key_exists('DockerVersion', $data) && $data['DockerVersion'] === null) { + $object->setDockerVersion(null); + } + if (\array_key_exists('Author', $data) && $data['Author'] !== null) { + $object->setAuthor($data['Author']); + } + elseif (\array_key_exists('Author', $data) && $data['Author'] === null) { + $object->setAuthor(null); + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $object->setConfig($this->denormalizer->denormalize($data['Config'], \Docker\API\Model\ImageConfig::class, 'json', $context)); + } + elseif (\array_key_exists('Config', $data) && $data['Config'] === null) { + $object->setConfig(null); + } + if (\array_key_exists('Architecture', $data) && $data['Architecture'] !== null) { + $object->setArchitecture($data['Architecture']); + } + elseif (\array_key_exists('Architecture', $data) && $data['Architecture'] === null) { + $object->setArchitecture(null); + } + if (\array_key_exists('Variant', $data) && $data['Variant'] !== null) { + $object->setVariant($data['Variant']); + } + elseif (\array_key_exists('Variant', $data) && $data['Variant'] === null) { + $object->setVariant(null); + } + if (\array_key_exists('Os', $data) && $data['Os'] !== null) { + $object->setOs($data['Os']); + } + elseif (\array_key_exists('Os', $data) && $data['Os'] === null) { + $object->setOs(null); + } + if (\array_key_exists('OsVersion', $data) && $data['OsVersion'] !== null) { + $object->setOsVersion($data['OsVersion']); + } + elseif (\array_key_exists('OsVersion', $data) && $data['OsVersion'] === null) { + $object->setOsVersion(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + if (\array_key_exists('VirtualSize', $data) && $data['VirtualSize'] !== null) { + $object->setVirtualSize($data['VirtualSize']); + } + elseif (\array_key_exists('VirtualSize', $data) && $data['VirtualSize'] === null) { + $object->setVirtualSize(null); + } + if (\array_key_exists('GraphDriver', $data) && $data['GraphDriver'] !== null) { + $object->setGraphDriver($this->denormalizer->denormalize($data['GraphDriver'], \Docker\API\Model\DriverData::class, 'json', $context)); + } + elseif (\array_key_exists('GraphDriver', $data) && $data['GraphDriver'] === null) { + $object->setGraphDriver(null); + } + if (\array_key_exists('RootFS', $data) && $data['RootFS'] !== null) { + $object->setRootFS($this->denormalizer->denormalize($data['RootFS'], \Docker\API\Model\ImageInspectRootFS::class, 'json', $context)); + } + elseif (\array_key_exists('RootFS', $data) && $data['RootFS'] === null) { + $object->setRootFS(null); + } + if (\array_key_exists('Metadata', $data) && $data['Metadata'] !== null) { + $object->setMetadata($this->denormalizer->denormalize($data['Metadata'], \Docker\API\Model\ImageInspectMetadata::class, 'json', $context)); + } + elseif (\array_key_exists('Metadata', $data) && $data['Metadata'] === null) { + $object->setMetadata(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); + } + if ($object->isInitialized('repoTags') && null !== $object->getRepoTags()) { + $values = []; + foreach ($object->getRepoTags() as $value) { + $values[] = $value; + } + $data['RepoTags'] = $values; + } + if ($object->isInitialized('repoDigests') && null !== $object->getRepoDigests()) { + $values_1 = []; + foreach ($object->getRepoDigests() as $value_1) { + $values_1[] = $value_1; + } + $data['RepoDigests'] = $values_1; + } + if ($object->isInitialized('parent') && null !== $object->getParent()) { + $data['Parent'] = $object->getParent(); + } + if ($object->isInitialized('comment') && null !== $object->getComment()) { + $data['Comment'] = $object->getComment(); + } + if ($object->isInitialized('created') && null !== $object->getCreated()) { + $data['Created'] = $object->getCreated(); + } + if ($object->isInitialized('dockerVersion') && null !== $object->getDockerVersion()) { + $data['DockerVersion'] = $object->getDockerVersion(); + } + if ($object->isInitialized('author') && null !== $object->getAuthor()) { + $data['Author'] = $object->getAuthor(); + } + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $data['Config'] = $this->normalizer->normalize($object->getConfig(), 'json', $context); + } + if ($object->isInitialized('architecture') && null !== $object->getArchitecture()) { + $data['Architecture'] = $object->getArchitecture(); + } + if ($object->isInitialized('variant') && null !== $object->getVariant()) { + $data['Variant'] = $object->getVariant(); + } + if ($object->isInitialized('os') && null !== $object->getOs()) { + $data['Os'] = $object->getOs(); + } + if ($object->isInitialized('osVersion') && null !== $object->getOsVersion()) { + $data['OsVersion'] = $object->getOsVersion(); + } + if ($object->isInitialized('size') && null !== $object->getSize()) { + $data['Size'] = $object->getSize(); + } + if ($object->isInitialized('virtualSize') && null !== $object->getVirtualSize()) { + $data['VirtualSize'] = $object->getVirtualSize(); + } + if ($object->isInitialized('graphDriver') && null !== $object->getGraphDriver()) { + $data['GraphDriver'] = $this->normalizer->normalize($object->getGraphDriver(), 'json', $context); + } + if ($object->isInitialized('rootFS') && null !== $object->getRootFS()) { + $data['RootFS'] = $this->normalizer->normalize($object->getRootFS(), 'json', $context); + } + if ($object->isInitialized('metadata') && null !== $object->getMetadata()) { + $data['Metadata'] = $this->normalizer->normalize($object->getMetadata(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageInspect::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImageInspectRootFSNormalizer.php b/generated/Normalizer/ImageInspectRootFSNormalizer.php new file mode 100644 index 00000000..323893db --- /dev/null +++ b/generated/Normalizer/ImageInspectRootFSNormalizer.php @@ -0,0 +1,148 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImageInspectRootFSNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageInspectRootFS::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageInspectRootFS::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageInspectRootFS(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Layers', $data) && $data['Layers'] !== null) { + $values = []; + foreach ($data['Layers'] as $value) { + $values[] = $value; + } + $object->setLayers($values); + } + elseif (\array_key_exists('Layers', $data) && $data['Layers'] === null) { + $object->setLayers(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Type'] = $object->getType(); + if ($object->isInitialized('layers') && null !== $object->getLayers()) { + $values = []; + foreach ($object->getLayers() as $value) { + $values[] = $value; + } + $data['Layers'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageInspectRootFS::class => false]; + } + } +} else { + class ImageInspectRootFSNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageInspectRootFS::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageInspectRootFS::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageInspectRootFS(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Layers', $data) && $data['Layers'] !== null) { + $values = []; + foreach ($data['Layers'] as $value) { + $values[] = $value; + } + $object->setLayers($values); + } + elseif (\array_key_exists('Layers', $data) && $data['Layers'] === null) { + $object->setLayers(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Type'] = $object->getType(); + if ($object->isInitialized('layers') && null !== $object->getLayers()) { + $values = []; + foreach ($object->getLayers() as $value) { + $values[] = $value; + } + $data['Layers'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageInspectRootFS::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImageItemNormalizer.php b/generated/Normalizer/ImageItemNormalizer.php deleted file mode 100644 index c1ca6f13..00000000 --- a/generated/Normalizer/ImageItemNormalizer.php +++ /dev/null @@ -1,159 +0,0 @@ -{'RepoTags'}; - if (is_array($data->{'RepoTags'})) { - $values = []; - foreach ($data->{'RepoTags'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'RepoTags'})) { - $value = $data->{'RepoTags'}; - } - $object->setRepoTags($value); - } - if (property_exists($data, 'Id')) { - $object->setId($data->{'Id'}); - } - if (property_exists($data, 'ParentId')) { - $object->setParentId($data->{'ParentId'}); - } - if (property_exists($data, 'Created')) { - $object->setCreated($data->{'Created'}); - } - if (property_exists($data, 'Size')) { - $object->setSize($data->{'Size'}); - } - if (property_exists($data, 'VirtualSize')) { - $object->setVirtualSize($data->{'VirtualSize'}); - } - if (property_exists($data, 'Labels')) { - $value_2 = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_3) { - $values_1[$key] = $value_3; - } - $value_2 = $values_1; - } - if (is_null($data->{'Labels'})) { - $value_2 = $data->{'Labels'}; - } - $object->setLabels($value_2); - } - if (property_exists($data, 'RepoDigests')) { - $value_4 = $data->{'RepoDigests'}; - if (is_array($data->{'RepoDigests'})) { - $values_2 = []; - foreach ($data->{'RepoDigests'} as $value_5) { - $values_2[] = $value_5; - } - $value_4 = $values_2; - } - if (is_null($data->{'RepoDigests'})) { - $value_4 = $data->{'RepoDigests'}; - } - $object->setRepoDigests($value_4); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - $value = $object->getRepoTags(); - if (is_array($object->getRepoTags())) { - $values = []; - foreach ($object->getRepoTags() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getRepoTags())) { - $value = $object->getRepoTags(); - } - $data->{'RepoTags'} = $value; - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getParentId()) { - $data->{'ParentId'} = $object->getParentId(); - } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); - } - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); - } - if (null !== $object->getVirtualSize()) { - $data->{'VirtualSize'} = $object->getVirtualSize(); - } - $value_2 = $object->getLabels(); - if (is_object($object->getLabels())) { - $values_1 = new \stdClass(); - foreach ($object->getLabels() as $key => $value_3) { - $values_1->{$key} = $value_3; - } - $value_2 = $values_1; - } - if (is_null($object->getLabels())) { - $value_2 = $object->getLabels(); - } - $data->{'Labels'} = $value_2; - $value_4 = $object->getRepoDigests(); - if (is_array($object->getRepoDigests())) { - $values_2 = []; - foreach ($object->getRepoDigests() as $value_5) { - $values_2[] = $value_5; - } - $value_4 = $values_2; - } - if (is_null($object->getRepoDigests())) { - $value_4 = $object->getRepoDigests(); - } - $data->{'RepoDigests'} = $value_4; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ImageManifestSummaryAttestationDataNormalizer.php b/generated/Normalizer/ImageManifestSummaryAttestationDataNormalizer.php new file mode 100644 index 00000000..3b8b1bba --- /dev/null +++ b/generated/Normalizer/ImageManifestSummaryAttestationDataNormalizer.php @@ -0,0 +1,114 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImageManifestSummaryAttestationDataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageManifestSummaryAttestationData::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageManifestSummaryAttestationData::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageManifestSummaryAttestationData(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('For', $data) && $data['For'] !== null) { + $object->setFor($data['For']); + } + elseif (\array_key_exists('For', $data) && $data['For'] === null) { + $object->setFor(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['For'] = $object->getFor(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageManifestSummaryAttestationData::class => false]; + } + } +} else { + class ImageManifestSummaryAttestationDataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageManifestSummaryAttestationData::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageManifestSummaryAttestationData::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageManifestSummaryAttestationData(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('For', $data) && $data['For'] !== null) { + $object->setFor($data['For']); + } + elseif (\array_key_exists('For', $data) && $data['For'] === null) { + $object->setFor(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['For'] = $object->getFor(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageManifestSummaryAttestationData::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImageManifestSummaryImageDataNormalizer.php b/generated/Normalizer/ImageManifestSummaryImageDataNormalizer.php new file mode 100644 index 00000000..002eb73f --- /dev/null +++ b/generated/Normalizer/ImageManifestSummaryImageDataNormalizer.php @@ -0,0 +1,158 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImageManifestSummaryImageDataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageManifestSummaryImageData::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageManifestSummaryImageData::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageManifestSummaryImageData(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Platform', $data) && $data['Platform'] !== null) { + $object->setPlatform($this->denormalizer->denormalize($data['Platform'], \Docker\API\Model\OCIPlatform::class, 'json', $context)); + } + elseif (\array_key_exists('Platform', $data) && $data['Platform'] === null) { + $object->setPlatform(null); + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $values = []; + foreach ($data['Containers'] as $value) { + $values[] = $value; + } + $object->setContainers($values); + } + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($this->denormalizer->denormalize($data['Size'], \Docker\API\Model\ImageManifestSummaryImageDataSize::class, 'json', $context)); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Platform'] = $this->normalizer->normalize($object->getPlatform(), 'json', $context); + $values = []; + foreach ($object->getContainers() as $value) { + $values[] = $value; + } + $data['Containers'] = $values; + $data['Size'] = $this->normalizer->normalize($object->getSize(), 'json', $context); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageManifestSummaryImageData::class => false]; + } + } +} else { + class ImageManifestSummaryImageDataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageManifestSummaryImageData::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageManifestSummaryImageData::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageManifestSummaryImageData(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Platform', $data) && $data['Platform'] !== null) { + $object->setPlatform($this->denormalizer->denormalize($data['Platform'], \Docker\API\Model\OCIPlatform::class, 'json', $context)); + } + elseif (\array_key_exists('Platform', $data) && $data['Platform'] === null) { + $object->setPlatform(null); + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $values = []; + foreach ($data['Containers'] as $value) { + $values[] = $value; + } + $object->setContainers($values); + } + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($this->denormalizer->denormalize($data['Size'], \Docker\API\Model\ImageManifestSummaryImageDataSize::class, 'json', $context)); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Platform'] = $this->normalizer->normalize($object->getPlatform(), 'json', $context); + $values = []; + foreach ($object->getContainers() as $value) { + $values[] = $value; + } + $data['Containers'] = $values; + $data['Size'] = $this->normalizer->normalize($object->getSize(), 'json', $context); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageManifestSummaryImageData::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImageManifestSummaryImageDataSizeNormalizer.php b/generated/Normalizer/ImageManifestSummaryImageDataSizeNormalizer.php new file mode 100644 index 00000000..3167d37a --- /dev/null +++ b/generated/Normalizer/ImageManifestSummaryImageDataSizeNormalizer.php @@ -0,0 +1,114 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImageManifestSummaryImageDataSizeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageManifestSummaryImageDataSize::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageManifestSummaryImageDataSize::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageManifestSummaryImageDataSize(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Unpacked', $data) && $data['Unpacked'] !== null) { + $object->setUnpacked($data['Unpacked']); + } + elseif (\array_key_exists('Unpacked', $data) && $data['Unpacked'] === null) { + $object->setUnpacked(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Unpacked'] = $object->getUnpacked(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageManifestSummaryImageDataSize::class => false]; + } + } +} else { + class ImageManifestSummaryImageDataSizeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageManifestSummaryImageDataSize::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageManifestSummaryImageDataSize::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageManifestSummaryImageDataSize(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Unpacked', $data) && $data['Unpacked'] !== null) { + $object->setUnpacked($data['Unpacked']); + } + elseif (\array_key_exists('Unpacked', $data) && $data['Unpacked'] === null) { + $object->setUnpacked(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Unpacked'] = $object->getUnpacked(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageManifestSummaryImageDataSize::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImageManifestSummaryNormalizer.php b/generated/Normalizer/ImageManifestSummaryNormalizer.php new file mode 100644 index 00000000..dac1e2fd --- /dev/null +++ b/generated/Normalizer/ImageManifestSummaryNormalizer.php @@ -0,0 +1,206 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImageManifestSummaryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageManifestSummary::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageManifestSummary::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageManifestSummary(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Descriptor', $data) && $data['Descriptor'] !== null) { + $object->setDescriptor($this->denormalizer->denormalize($data['Descriptor'], \Docker\API\Model\OCIDescriptor::class, 'json', $context)); + } + elseif (\array_key_exists('Descriptor', $data) && $data['Descriptor'] === null) { + $object->setDescriptor(null); + } + if (\array_key_exists('Available', $data) && $data['Available'] !== null) { + $object->setAvailable($data['Available']); + } + elseif (\array_key_exists('Available', $data) && $data['Available'] === null) { + $object->setAvailable(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($this->denormalizer->denormalize($data['Size'], \Docker\API\Model\ImageManifestSummarySize::class, 'json', $context)); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + if (\array_key_exists('Kind', $data) && $data['Kind'] !== null) { + $object->setKind($data['Kind']); + } + elseif (\array_key_exists('Kind', $data) && $data['Kind'] === null) { + $object->setKind(null); + } + if (\array_key_exists('ImageData', $data) && $data['ImageData'] !== null) { + $object->setImageData($this->denormalizer->denormalize($data['ImageData'], \Docker\API\Model\ImageManifestSummaryImageData::class, 'json', $context)); + } + elseif (\array_key_exists('ImageData', $data) && $data['ImageData'] === null) { + $object->setImageData(null); + } + if (\array_key_exists('AttestationData', $data) && $data['AttestationData'] !== null) { + $object->setAttestationData($this->denormalizer->denormalize($data['AttestationData'], \Docker\API\Model\ImageManifestSummaryAttestationData::class, 'json', $context)); + } + elseif (\array_key_exists('AttestationData', $data) && $data['AttestationData'] === null) { + $object->setAttestationData(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['ID'] = $object->getID(); + $data['Descriptor'] = $this->normalizer->normalize($object->getDescriptor(), 'json', $context); + $data['Available'] = $object->getAvailable(); + $data['Size'] = $this->normalizer->normalize($object->getSize(), 'json', $context); + $data['Kind'] = $object->getKind(); + if ($object->isInitialized('imageData') && null !== $object->getImageData()) { + $data['ImageData'] = $this->normalizer->normalize($object->getImageData(), 'json', $context); + } + if ($object->isInitialized('attestationData') && null !== $object->getAttestationData()) { + $data['AttestationData'] = $this->normalizer->normalize($object->getAttestationData(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageManifestSummary::class => false]; + } + } +} else { + class ImageManifestSummaryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageManifestSummary::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageManifestSummary::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageManifestSummary(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Descriptor', $data) && $data['Descriptor'] !== null) { + $object->setDescriptor($this->denormalizer->denormalize($data['Descriptor'], \Docker\API\Model\OCIDescriptor::class, 'json', $context)); + } + elseif (\array_key_exists('Descriptor', $data) && $data['Descriptor'] === null) { + $object->setDescriptor(null); + } + if (\array_key_exists('Available', $data) && $data['Available'] !== null) { + $object->setAvailable($data['Available']); + } + elseif (\array_key_exists('Available', $data) && $data['Available'] === null) { + $object->setAvailable(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($this->denormalizer->denormalize($data['Size'], \Docker\API\Model\ImageManifestSummarySize::class, 'json', $context)); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + if (\array_key_exists('Kind', $data) && $data['Kind'] !== null) { + $object->setKind($data['Kind']); + } + elseif (\array_key_exists('Kind', $data) && $data['Kind'] === null) { + $object->setKind(null); + } + if (\array_key_exists('ImageData', $data) && $data['ImageData'] !== null) { + $object->setImageData($this->denormalizer->denormalize($data['ImageData'], \Docker\API\Model\ImageManifestSummaryImageData::class, 'json', $context)); + } + elseif (\array_key_exists('ImageData', $data) && $data['ImageData'] === null) { + $object->setImageData(null); + } + if (\array_key_exists('AttestationData', $data) && $data['AttestationData'] !== null) { + $object->setAttestationData($this->denormalizer->denormalize($data['AttestationData'], \Docker\API\Model\ImageManifestSummaryAttestationData::class, 'json', $context)); + } + elseif (\array_key_exists('AttestationData', $data) && $data['AttestationData'] === null) { + $object->setAttestationData(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['ID'] = $object->getID(); + $data['Descriptor'] = $this->normalizer->normalize($object->getDescriptor(), 'json', $context); + $data['Available'] = $object->getAvailable(); + $data['Size'] = $this->normalizer->normalize($object->getSize(), 'json', $context); + $data['Kind'] = $object->getKind(); + if ($object->isInitialized('imageData') && null !== $object->getImageData()) { + $data['ImageData'] = $this->normalizer->normalize($object->getImageData(), 'json', $context); + } + if ($object->isInitialized('attestationData') && null !== $object->getAttestationData()) { + $data['AttestationData'] = $this->normalizer->normalize($object->getAttestationData(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageManifestSummary::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImageManifestSummarySizeNormalizer.php b/generated/Normalizer/ImageManifestSummarySizeNormalizer.php new file mode 100644 index 00000000..3a532ad3 --- /dev/null +++ b/generated/Normalizer/ImageManifestSummarySizeNormalizer.php @@ -0,0 +1,128 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImageManifestSummarySizeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageManifestSummarySize::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageManifestSummarySize::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageManifestSummarySize(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Total', $data) && $data['Total'] !== null) { + $object->setTotal($data['Total']); + } + elseif (\array_key_exists('Total', $data) && $data['Total'] === null) { + $object->setTotal(null); + } + if (\array_key_exists('Content', $data) && $data['Content'] !== null) { + $object->setContent($data['Content']); + } + elseif (\array_key_exists('Content', $data) && $data['Content'] === null) { + $object->setContent(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Total'] = $object->getTotal(); + $data['Content'] = $object->getContent(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageManifestSummarySize::class => false]; + } + } +} else { + class ImageManifestSummarySizeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageManifestSummarySize::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageManifestSummarySize::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageManifestSummarySize(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Total', $data) && $data['Total'] !== null) { + $object->setTotal($data['Total']); + } + elseif (\array_key_exists('Total', $data) && $data['Total'] === null) { + $object->setTotal(null); + } + if (\array_key_exists('Content', $data) && $data['Content'] !== null) { + $object->setContent($data['Content']); + } + elseif (\array_key_exists('Content', $data) && $data['Content'] === null) { + $object->setContent(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Total'] = $object->getTotal(); + $data['Content'] = $object->getContent(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageManifestSummarySize::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImageNormalizer.php b/generated/Normalizer/ImageNormalizer.php deleted file mode 100644 index 5a093583..00000000 --- a/generated/Normalizer/ImageNormalizer.php +++ /dev/null @@ -1,187 +0,0 @@ -setId($data->{'Id'}); - } - if (property_exists($data, 'Container')) { - $object->setContainer($data->{'Container'}); - } - if (property_exists($data, 'Comment')) { - $object->setComment($data->{'Comment'}); - } - if (property_exists($data, 'Os')) { - $object->setOs($data->{'Os'}); - } - if (property_exists($data, 'Architecture')) { - $object->setArchitecture($data->{'Architecture'}); - } - if (property_exists($data, 'Parent')) { - $object->setParent($data->{'Parent'}); - } - if (property_exists($data, 'ContainerConfig')) { - $object->setContainerConfig($this->serializer->denormalize($data->{'ContainerConfig'}, 'Docker\\API\\Model\\ContainerConfig', 'raw', $context)); - } - if (property_exists($data, 'DockerVersion')) { - $object->setDockerVersion($data->{'DockerVersion'}); - } - if (property_exists($data, 'VirtualSize')) { - $object->setVirtualSize($data->{'VirtualSize'}); - } - if (property_exists($data, 'Size')) { - $object->setSize($data->{'Size'}); - } - if (property_exists($data, 'Author')) { - $object->setAuthor($data->{'Author'}); - } - if (property_exists($data, 'Created')) { - $object->setCreated($data->{'Created'}); - } - if (property_exists($data, 'GraphDriver')) { - $object->setGraphDriver($this->serializer->denormalize($data->{'GraphDriver'}, 'Docker\\API\\Model\\GraphDriver', 'raw', $context)); - } - if (property_exists($data, 'RepoDigests')) { - $value = $data->{'RepoDigests'}; - if (is_array($data->{'RepoDigests'})) { - $values = []; - foreach ($data->{'RepoDigests'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'RepoDigests'})) { - $value = $data->{'RepoDigests'}; - } - $object->setRepoDigests($value); - } - if (property_exists($data, 'RepoTags')) { - $value_2 = $data->{'RepoTags'}; - if (is_array($data->{'RepoTags'})) { - $values_1 = []; - foreach ($data->{'RepoTags'} as $value_3) { - $values_1[] = $value_3; - } - $value_2 = $values_1; - } - if (is_null($data->{'RepoTags'})) { - $value_2 = $data->{'RepoTags'}; - } - $object->setRepoTags($value_2); - } - if (property_exists($data, 'Config')) { - $object->setConfig($this->serializer->denormalize($data->{'Config'}, 'Docker\\API\\Model\\ContainerConfig', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getContainer()) { - $data->{'Container'} = $object->getContainer(); - } - if (null !== $object->getComment()) { - $data->{'Comment'} = $object->getComment(); - } - if (null !== $object->getOs()) { - $data->{'Os'} = $object->getOs(); - } - if (null !== $object->getArchitecture()) { - $data->{'Architecture'} = $object->getArchitecture(); - } - if (null !== $object->getParent()) { - $data->{'Parent'} = $object->getParent(); - } - if (null !== $object->getContainerConfig()) { - $data->{'ContainerConfig'} = json_decode($this->serializer->normalize($object->getContainerConfig(), 'raw', $context)); - } - if (null !== $object->getDockerVersion()) { - $data->{'DockerVersion'} = $object->getDockerVersion(); - } - if (null !== $object->getVirtualSize()) { - $data->{'VirtualSize'} = $object->getVirtualSize(); - } - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); - } - if (null !== $object->getAuthor()) { - $data->{'Author'} = $object->getAuthor(); - } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); - } - if (null !== $object->getGraphDriver()) { - $data->{'GraphDriver'} = json_decode($this->serializer->normalize($object->getGraphDriver(), 'raw', $context)); - } - $value = $object->getRepoDigests(); - if (is_array($object->getRepoDigests())) { - $values = []; - foreach ($object->getRepoDigests() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getRepoDigests())) { - $value = $object->getRepoDigests(); - } - $data->{'RepoDigests'} = $value; - $value_2 = $object->getRepoTags(); - if (is_array($object->getRepoTags())) { - $values_1 = []; - foreach ($object->getRepoTags() as $value_3) { - $values_1[] = $value_3; - } - $value_2 = $values_1; - } - if (is_null($object->getRepoTags())) { - $value_2 = $object->getRepoTags(); - } - $data->{'RepoTags'} = $value_2; - if (null !== $object->getConfig()) { - $data->{'Config'} = json_decode($this->serializer->normalize($object->getConfig(), 'raw', $context)); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ImageSearchResultNormalizer.php b/generated/Normalizer/ImageSearchResultNormalizer.php deleted file mode 100644 index 7d18e63e..00000000 --- a/generated/Normalizer/ImageSearchResultNormalizer.php +++ /dev/null @@ -1,81 +0,0 @@ -setDescription($data->{'description'}); - } - if (property_exists($data, 'is_official')) { - $object->setIsOfficial($data->{'is_official'}); - } - if (property_exists($data, 'is_automated')) { - $object->setIsAutomated($data->{'is_automated'}); - } - if (property_exists($data, 'name')) { - $object->setName($data->{'name'}); - } - if (property_exists($data, 'star_count')) { - $object->setStarCount($data->{'star_count'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getDescription()) { - $data->{'description'} = $object->getDescription(); - } - if (null !== $object->getIsOfficial()) { - $data->{'is_official'} = $object->getIsOfficial(); - } - if (null !== $object->getIsAutomated()) { - $data->{'is_automated'} = $object->getIsAutomated(); - } - if (null !== $object->getName()) { - $data->{'name'} = $object->getName(); - } - if (null !== $object->getStarCount()) { - $data->{'star_count'} = $object->getStarCount(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ImageSummaryNormalizer.php b/generated/Normalizer/ImageSummaryNormalizer.php new file mode 100644 index 00000000..e9c5e812 --- /dev/null +++ b/generated/Normalizer/ImageSummaryNormalizer.php @@ -0,0 +1,326 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImageSummaryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageSummary::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageSummary::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageSummary(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('ParentId', $data) && $data['ParentId'] !== null) { + $object->setParentId($data['ParentId']); + } + elseif (\array_key_exists('ParentId', $data) && $data['ParentId'] === null) { + $object->setParentId(null); + } + if (\array_key_exists('RepoTags', $data) && $data['RepoTags'] !== null) { + $values = []; + foreach ($data['RepoTags'] as $value) { + $values[] = $value; + } + $object->setRepoTags($values); + } + elseif (\array_key_exists('RepoTags', $data) && $data['RepoTags'] === null) { + $object->setRepoTags(null); + } + if (\array_key_exists('RepoDigests', $data) && $data['RepoDigests'] !== null) { + $values_1 = []; + foreach ($data['RepoDigests'] as $value_1) { + $values_1[] = $value_1; + } + $object->setRepoDigests($values_1); + } + elseif (\array_key_exists('RepoDigests', $data) && $data['RepoDigests'] === null) { + $object->setRepoDigests(null); + } + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); + } + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + if (\array_key_exists('SharedSize', $data) && $data['SharedSize'] !== null) { + $object->setSharedSize($data['SharedSize']); + } + elseif (\array_key_exists('SharedSize', $data) && $data['SharedSize'] === null) { + $object->setSharedSize(null); + } + if (\array_key_exists('VirtualSize', $data) && $data['VirtualSize'] !== null) { + $object->setVirtualSize($data['VirtualSize']); + } + elseif (\array_key_exists('VirtualSize', $data) && $data['VirtualSize'] === null) { + $object->setVirtualSize(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value_2) { + $values_2[$key] = $value_2; + } + $object->setLabels($values_2); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $object->setContainers($data['Containers']); + } + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); + } + if (\array_key_exists('Manifests', $data) && $data['Manifests'] !== null) { + $values_3 = []; + foreach ($data['Manifests'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ImageManifestSummary::class, 'json', $context); + } + $object->setManifests($values_3); + } + elseif (\array_key_exists('Manifests', $data) && $data['Manifests'] === null) { + $object->setManifests(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Id'] = $object->getId(); + $data['ParentId'] = $object->getParentId(); + $values = []; + foreach ($object->getRepoTags() as $value) { + $values[] = $value; + } + $data['RepoTags'] = $values; + $values_1 = []; + foreach ($object->getRepoDigests() as $value_1) { + $values_1[] = $value_1; + } + $data['RepoDigests'] = $values_1; + $data['Created'] = $object->getCreated(); + $data['Size'] = $object->getSize(); + $data['SharedSize'] = $object->getSharedSize(); + if ($object->isInitialized('virtualSize') && null !== $object->getVirtualSize()) { + $data['VirtualSize'] = $object->getVirtualSize(); + } + $values_2 = []; + foreach ($object->getLabels() as $key => $value_2) { + $values_2[$key] = $value_2; + } + $data['Labels'] = $values_2; + $data['Containers'] = $object->getContainers(); + if ($object->isInitialized('manifests') && null !== $object->getManifests()) { + $values_3 = []; + foreach ($object->getManifests() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['Manifests'] = $values_3; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageSummary::class => false]; + } + } +} else { + class ImageSummaryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImageSummary::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImageSummary::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImageSummary(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('ParentId', $data) && $data['ParentId'] !== null) { + $object->setParentId($data['ParentId']); + } + elseif (\array_key_exists('ParentId', $data) && $data['ParentId'] === null) { + $object->setParentId(null); + } + if (\array_key_exists('RepoTags', $data) && $data['RepoTags'] !== null) { + $values = []; + foreach ($data['RepoTags'] as $value) { + $values[] = $value; + } + $object->setRepoTags($values); + } + elseif (\array_key_exists('RepoTags', $data) && $data['RepoTags'] === null) { + $object->setRepoTags(null); + } + if (\array_key_exists('RepoDigests', $data) && $data['RepoDigests'] !== null) { + $values_1 = []; + foreach ($data['RepoDigests'] as $value_1) { + $values_1[] = $value_1; + } + $object->setRepoDigests($values_1); + } + elseif (\array_key_exists('RepoDigests', $data) && $data['RepoDigests'] === null) { + $object->setRepoDigests(null); + } + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); + } + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + if (\array_key_exists('SharedSize', $data) && $data['SharedSize'] !== null) { + $object->setSharedSize($data['SharedSize']); + } + elseif (\array_key_exists('SharedSize', $data) && $data['SharedSize'] === null) { + $object->setSharedSize(null); + } + if (\array_key_exists('VirtualSize', $data) && $data['VirtualSize'] !== null) { + $object->setVirtualSize($data['VirtualSize']); + } + elseif (\array_key_exists('VirtualSize', $data) && $data['VirtualSize'] === null) { + $object->setVirtualSize(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value_2) { + $values_2[$key] = $value_2; + } + $object->setLabels($values_2); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $object->setContainers($data['Containers']); + } + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); + } + if (\array_key_exists('Manifests', $data) && $data['Manifests'] !== null) { + $values_3 = []; + foreach ($data['Manifests'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ImageManifestSummary::class, 'json', $context); + } + $object->setManifests($values_3); + } + elseif (\array_key_exists('Manifests', $data) && $data['Manifests'] === null) { + $object->setManifests(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Id'] = $object->getId(); + $data['ParentId'] = $object->getParentId(); + $values = []; + foreach ($object->getRepoTags() as $value) { + $values[] = $value; + } + $data['RepoTags'] = $values; + $values_1 = []; + foreach ($object->getRepoDigests() as $value_1) { + $values_1[] = $value_1; + } + $data['RepoDigests'] = $values_1; + $data['Created'] = $object->getCreated(); + $data['Size'] = $object->getSize(); + $data['SharedSize'] = $object->getSharedSize(); + if ($object->isInitialized('virtualSize') && null !== $object->getVirtualSize()) { + $data['VirtualSize'] = $object->getVirtualSize(); + } + $values_2 = []; + foreach ($object->getLabels() as $key => $value_2) { + $values_2[$key] = $value_2; + } + $data['Labels'] = $values_2; + $data['Containers'] = $object->getContainers(); + if ($object->isInitialized('manifests') && null !== $object->getManifests()) { + $values_3 = []; + foreach ($object->getManifests() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['Manifests'] = $values_3; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageSummary::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImagesNameHistoryGetResponse200ItemNormalizer.php b/generated/Normalizer/ImagesNameHistoryGetResponse200ItemNormalizer.php new file mode 100644 index 00000000..f15086f3 --- /dev/null +++ b/generated/Normalizer/ImagesNameHistoryGetResponse200ItemNormalizer.php @@ -0,0 +1,200 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImagesNameHistoryGetResponse200ItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImagesNameHistoryGetResponse200Item::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImagesNameHistoryGetResponse200Item::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImagesNameHistoryGetResponse200Item(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); + } + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); + } + if (\array_key_exists('CreatedBy', $data) && $data['CreatedBy'] !== null) { + $object->setCreatedBy($data['CreatedBy']); + } + elseif (\array_key_exists('CreatedBy', $data) && $data['CreatedBy'] === null) { + $object->setCreatedBy(null); + } + if (\array_key_exists('Tags', $data) && $data['Tags'] !== null) { + $values = []; + foreach ($data['Tags'] as $value) { + $values[] = $value; + } + $object->setTags($values); + } + elseif (\array_key_exists('Tags', $data) && $data['Tags'] === null) { + $object->setTags(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + if (\array_key_exists('Comment', $data) && $data['Comment'] !== null) { + $object->setComment($data['Comment']); + } + elseif (\array_key_exists('Comment', $data) && $data['Comment'] === null) { + $object->setComment(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Id'] = $object->getId(); + $data['Created'] = $object->getCreated(); + $data['CreatedBy'] = $object->getCreatedBy(); + $values = []; + foreach ($object->getTags() as $value) { + $values[] = $value; + } + $data['Tags'] = $values; + $data['Size'] = $object->getSize(); + $data['Comment'] = $object->getComment(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImagesNameHistoryGetResponse200Item::class => false]; + } + } +} else { + class ImagesNameHistoryGetResponse200ItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImagesNameHistoryGetResponse200Item::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImagesNameHistoryGetResponse200Item::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImagesNameHistoryGetResponse200Item(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); + } + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); + } + if (\array_key_exists('CreatedBy', $data) && $data['CreatedBy'] !== null) { + $object->setCreatedBy($data['CreatedBy']); + } + elseif (\array_key_exists('CreatedBy', $data) && $data['CreatedBy'] === null) { + $object->setCreatedBy(null); + } + if (\array_key_exists('Tags', $data) && $data['Tags'] !== null) { + $values = []; + foreach ($data['Tags'] as $value) { + $values[] = $value; + } + $object->setTags($values); + } + elseif (\array_key_exists('Tags', $data) && $data['Tags'] === null) { + $object->setTags(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + if (\array_key_exists('Comment', $data) && $data['Comment'] !== null) { + $object->setComment($data['Comment']); + } + elseif (\array_key_exists('Comment', $data) && $data['Comment'] === null) { + $object->setComment(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Id'] = $object->getId(); + $data['Created'] = $object->getCreated(); + $data['CreatedBy'] = $object->getCreatedBy(); + $values = []; + foreach ($object->getTags() as $value) { + $values[] = $value; + } + $data['Tags'] = $values; + $data['Size'] = $object->getSize(); + $data['Comment'] = $object->getComment(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImagesNameHistoryGetResponse200Item::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImagesPrunePostResponse200Normalizer.php b/generated/Normalizer/ImagesPrunePostResponse200Normalizer.php new file mode 100644 index 00000000..c17efb0a --- /dev/null +++ b/generated/Normalizer/ImagesPrunePostResponse200Normalizer.php @@ -0,0 +1,152 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImagesPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImagesPrunePostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImagesPrunePostResponse200::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImagesPrunePostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ImagesDeleted', $data) && $data['ImagesDeleted'] !== null) { + $values = []; + foreach ($data['ImagesDeleted'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ImageDeleteResponseItem::class, 'json', $context); + } + $object->setImagesDeleted($values); + } + elseif (\array_key_exists('ImagesDeleted', $data) && $data['ImagesDeleted'] === null) { + $object->setImagesDeleted(null); + } + if (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] !== null) { + $object->setSpaceReclaimed($data['SpaceReclaimed']); + } + elseif (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] === null) { + $object->setSpaceReclaimed(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('imagesDeleted') && null !== $object->getImagesDeleted()) { + $values = []; + foreach ($object->getImagesDeleted() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['ImagesDeleted'] = $values; + } + if ($object->isInitialized('spaceReclaimed') && null !== $object->getSpaceReclaimed()) { + $data['SpaceReclaimed'] = $object->getSpaceReclaimed(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImagesPrunePostResponse200::class => false]; + } + } +} else { + class ImagesPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImagesPrunePostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImagesPrunePostResponse200::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImagesPrunePostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ImagesDeleted', $data) && $data['ImagesDeleted'] !== null) { + $values = []; + foreach ($data['ImagesDeleted'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ImageDeleteResponseItem::class, 'json', $context); + } + $object->setImagesDeleted($values); + } + elseif (\array_key_exists('ImagesDeleted', $data) && $data['ImagesDeleted'] === null) { + $object->setImagesDeleted(null); + } + if (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] !== null) { + $object->setSpaceReclaimed($data['SpaceReclaimed']); + } + elseif (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] === null) { + $object->setSpaceReclaimed(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('imagesDeleted') && null !== $object->getImagesDeleted()) { + $values = []; + foreach ($object->getImagesDeleted() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['ImagesDeleted'] = $values; + } + if ($object->isInitialized('spaceReclaimed') && null !== $object->getSpaceReclaimed()) { + $data['SpaceReclaimed'] = $object->getSpaceReclaimed(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImagesPrunePostResponse200::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ImagesSearchGetResponse200ItemNormalizer.php b/generated/Normalizer/ImagesSearchGetResponse200ItemNormalizer.php new file mode 100644 index 00000000..e9ac04b7 --- /dev/null +++ b/generated/Normalizer/ImagesSearchGetResponse200ItemNormalizer.php @@ -0,0 +1,190 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ImagesSearchGetResponse200ItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImagesSearchGetResponse200Item::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImagesSearchGetResponse200Item::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImagesSearchGetResponse200Item(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('description', $data) && $data['description'] !== null) { + $object->setDescription($data['description']); + } + elseif (\array_key_exists('description', $data) && $data['description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('is_official', $data) && $data['is_official'] !== null) { + $object->setIsOfficial($data['is_official']); + } + elseif (\array_key_exists('is_official', $data) && $data['is_official'] === null) { + $object->setIsOfficial(null); + } + if (\array_key_exists('is_automated', $data) && $data['is_automated'] !== null) { + $object->setIsAutomated($data['is_automated']); + } + elseif (\array_key_exists('is_automated', $data) && $data['is_automated'] === null) { + $object->setIsAutomated(null); + } + if (\array_key_exists('name', $data) && $data['name'] !== null) { + $object->setName($data['name']); + } + elseif (\array_key_exists('name', $data) && $data['name'] === null) { + $object->setName(null); + } + if (\array_key_exists('star_count', $data) && $data['star_count'] !== null) { + $object->setStarCount($data['star_count']); + } + elseif (\array_key_exists('star_count', $data) && $data['star_count'] === null) { + $object->setStarCount(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['description'] = $object->getDescription(); + } + if ($object->isInitialized('isOfficial') && null !== $object->getIsOfficial()) { + $data['is_official'] = $object->getIsOfficial(); + } + if ($object->isInitialized('isAutomated') && null !== $object->getIsAutomated()) { + $data['is_automated'] = $object->getIsAutomated(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); + } + if ($object->isInitialized('starCount') && null !== $object->getStarCount()) { + $data['star_count'] = $object->getStarCount(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImagesSearchGetResponse200Item::class => false]; + } + } +} else { + class ImagesSearchGetResponse200ItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ImagesSearchGetResponse200Item::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ImagesSearchGetResponse200Item::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ImagesSearchGetResponse200Item(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('description', $data) && $data['description'] !== null) { + $object->setDescription($data['description']); + } + elseif (\array_key_exists('description', $data) && $data['description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('is_official', $data) && $data['is_official'] !== null) { + $object->setIsOfficial($data['is_official']); + } + elseif (\array_key_exists('is_official', $data) && $data['is_official'] === null) { + $object->setIsOfficial(null); + } + if (\array_key_exists('is_automated', $data) && $data['is_automated'] !== null) { + $object->setIsAutomated($data['is_automated']); + } + elseif (\array_key_exists('is_automated', $data) && $data['is_automated'] === null) { + $object->setIsAutomated(null); + } + if (\array_key_exists('name', $data) && $data['name'] !== null) { + $object->setName($data['name']); + } + elseif (\array_key_exists('name', $data) && $data['name'] === null) { + $object->setName(null); + } + if (\array_key_exists('star_count', $data) && $data['star_count'] !== null) { + $object->setStarCount($data['star_count']); + } + elseif (\array_key_exists('star_count', $data) && $data['star_count'] === null) { + $object->setStarCount(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['description'] = $object->getDescription(); + } + if ($object->isInitialized('isOfficial') && null !== $object->getIsOfficial()) { + $data['is_official'] = $object->getIsOfficial(); + } + if ($object->isInitialized('isAutomated') && null !== $object->getIsAutomated()) { + $data['is_automated'] = $object->getIsAutomated(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); + } + if ($object->isInitialized('starCount') && null !== $object->getStarCount()) { + $data['star_count'] = $object->getStarCount(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImagesSearchGetResponse200Item::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/IndexInfoNormalizer.php b/generated/Normalizer/IndexInfoNormalizer.php new file mode 100644 index 00000000..3d6492dd --- /dev/null +++ b/generated/Normalizer/IndexInfoNormalizer.php @@ -0,0 +1,188 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class IndexInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\IndexInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\IndexInfo::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\IndexInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Mirrors', $data) && $data['Mirrors'] !== null) { + $values = []; + foreach ($data['Mirrors'] as $value) { + $values[] = $value; + } + $object->setMirrors($values); + } + elseif (\array_key_exists('Mirrors', $data) && $data['Mirrors'] === null) { + $object->setMirrors(null); + } + if (\array_key_exists('Secure', $data) && $data['Secure'] !== null) { + $object->setSecure($data['Secure']); + } + elseif (\array_key_exists('Secure', $data) && $data['Secure'] === null) { + $object->setSecure(null); + } + if (\array_key_exists('Official', $data) && $data['Official'] !== null) { + $object->setOfficial($data['Official']); + } + elseif (\array_key_exists('Official', $data) && $data['Official'] === null) { + $object->setOfficial(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('mirrors') && null !== $object->getMirrors()) { + $values = []; + foreach ($object->getMirrors() as $value) { + $values[] = $value; + } + $data['Mirrors'] = $values; + } + if ($object->isInitialized('secure') && null !== $object->getSecure()) { + $data['Secure'] = $object->getSecure(); + } + if ($object->isInitialized('official') && null !== $object->getOfficial()) { + $data['Official'] = $object->getOfficial(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\IndexInfo::class => false]; + } + } +} else { + class IndexInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\IndexInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\IndexInfo::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\IndexInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Mirrors', $data) && $data['Mirrors'] !== null) { + $values = []; + foreach ($data['Mirrors'] as $value) { + $values[] = $value; + } + $object->setMirrors($values); + } + elseif (\array_key_exists('Mirrors', $data) && $data['Mirrors'] === null) { + $object->setMirrors(null); + } + if (\array_key_exists('Secure', $data) && $data['Secure'] !== null) { + $object->setSecure($data['Secure']); + } + elseif (\array_key_exists('Secure', $data) && $data['Secure'] === null) { + $object->setSecure(null); + } + if (\array_key_exists('Official', $data) && $data['Official'] !== null) { + $object->setOfficial($data['Official']); + } + elseif (\array_key_exists('Official', $data) && $data['Official'] === null) { + $object->setOfficial(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('mirrors') && null !== $object->getMirrors()) { + $values = []; + foreach ($object->getMirrors() as $value) { + $values[] = $value; + } + $data['Mirrors'] = $values; + } + if ($object->isInitialized('secure') && null !== $object->getSecure()) { + $data['Secure'] = $object->getSecure(); + } + if ($object->isInitialized('official') && null !== $object->getOfficial()) { + $data['Official'] = $object->getOfficial(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\IndexInfo::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/JaneObjectNormalizer.php b/generated/Normalizer/JaneObjectNormalizer.php new file mode 100644 index 00000000..9fef1991 --- /dev/null +++ b/generated/Normalizer/JaneObjectNormalizer.php @@ -0,0 +1,1394 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + protected $normalizers = [ + + \Docker\API\Model\Port::class => \Docker\API\Normalizer\PortNormalizer::class, + + \Docker\API\Model\MountPoint::class => \Docker\API\Normalizer\MountPointNormalizer::class, + + \Docker\API\Model\DeviceMapping::class => \Docker\API\Normalizer\DeviceMappingNormalizer::class, + + \Docker\API\Model\DeviceRequest::class => \Docker\API\Normalizer\DeviceRequestNormalizer::class, + + \Docker\API\Model\ThrottleDevice::class => \Docker\API\Normalizer\ThrottleDeviceNormalizer::class, + + \Docker\API\Model\Mount::class => \Docker\API\Normalizer\MountNormalizer::class, + + \Docker\API\Model\MountBindOptions::class => \Docker\API\Normalizer\MountBindOptionsNormalizer::class, + + \Docker\API\Model\MountVolumeOptions::class => \Docker\API\Normalizer\MountVolumeOptionsNormalizer::class, + + \Docker\API\Model\MountVolumeOptionsDriverConfig::class => \Docker\API\Normalizer\MountVolumeOptionsDriverConfigNormalizer::class, + + \Docker\API\Model\MountTmpfsOptions::class => \Docker\API\Normalizer\MountTmpfsOptionsNormalizer::class, + + \Docker\API\Model\RestartPolicy::class => \Docker\API\Normalizer\RestartPolicyNormalizer::class, + + \Docker\API\Model\Resources::class => \Docker\API\Normalizer\ResourcesNormalizer::class, + + \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class => \Docker\API\Normalizer\ResourcesBlkioWeightDeviceItemNormalizer::class, + + \Docker\API\Model\ResourcesUlimitsItem::class => \Docker\API\Normalizer\ResourcesUlimitsItemNormalizer::class, + + \Docker\API\Model\Limit::class => \Docker\API\Normalizer\LimitNormalizer::class, + + \Docker\API\Model\ResourceObject::class => \Docker\API\Normalizer\ResourceObjectNormalizer::class, + + \Docker\API\Model\GenericResourcesItem::class => \Docker\API\Normalizer\GenericResourcesItemNormalizer::class, + + \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class => \Docker\API\Normalizer\GenericResourcesItemNamedResourceSpecNormalizer::class, + + \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class => \Docker\API\Normalizer\GenericResourcesItemDiscreteResourceSpecNormalizer::class, + + \Docker\API\Model\HealthConfig::class => \Docker\API\Normalizer\HealthConfigNormalizer::class, + + \Docker\API\Model\Health::class => \Docker\API\Normalizer\HealthNormalizer::class, + + \Docker\API\Model\HealthcheckResult::class => \Docker\API\Normalizer\HealthcheckResultNormalizer::class, + + \Docker\API\Model\HostConfig::class => \Docker\API\Normalizer\HostConfigNormalizer::class, + + \Docker\API\Model\HostConfigLogConfig::class => \Docker\API\Normalizer\HostConfigLogConfigNormalizer::class, + + \Docker\API\Model\ContainerConfig::class => \Docker\API\Normalizer\ContainerConfigNormalizer::class, + + \Docker\API\Model\ImageConfig::class => \Docker\API\Normalizer\ImageConfigNormalizer::class, + + \Docker\API\Model\NetworkingConfig::class => \Docker\API\Normalizer\NetworkingConfigNormalizer::class, + + \Docker\API\Model\NetworkSettings::class => \Docker\API\Normalizer\NetworkSettingsNormalizer::class, + + \Docker\API\Model\Address::class => \Docker\API\Normalizer\AddressNormalizer::class, + + \Docker\API\Model\PortBinding::class => \Docker\API\Normalizer\PortBindingNormalizer::class, + + \Docker\API\Model\DriverData::class => \Docker\API\Normalizer\DriverDataNormalizer::class, + + \Docker\API\Model\FilesystemChange::class => \Docker\API\Normalizer\FilesystemChangeNormalizer::class, + + \Docker\API\Model\ImageInspect::class => \Docker\API\Normalizer\ImageInspectNormalizer::class, + + \Docker\API\Model\ImageInspectRootFS::class => \Docker\API\Normalizer\ImageInspectRootFSNormalizer::class, + + \Docker\API\Model\ImageInspectMetadata::class => \Docker\API\Normalizer\ImageInspectMetadataNormalizer::class, + + \Docker\API\Model\ImageSummary::class => \Docker\API\Normalizer\ImageSummaryNormalizer::class, + + \Docker\API\Model\AuthConfig::class => \Docker\API\Normalizer\AuthConfigNormalizer::class, + + \Docker\API\Model\ProcessConfig::class => \Docker\API\Normalizer\ProcessConfigNormalizer::class, + + \Docker\API\Model\Volume::class => \Docker\API\Normalizer\VolumeNormalizer::class, + + \Docker\API\Model\VolumeUsageData::class => \Docker\API\Normalizer\VolumeUsageDataNormalizer::class, + + \Docker\API\Model\VolumeCreateOptions::class => \Docker\API\Normalizer\VolumeCreateOptionsNormalizer::class, + + \Docker\API\Model\VolumeListResponse::class => \Docker\API\Normalizer\VolumeListResponseNormalizer::class, + + \Docker\API\Model\Network::class => \Docker\API\Normalizer\NetworkNormalizer::class, + + \Docker\API\Model\ConfigReference::class => \Docker\API\Normalizer\ConfigReferenceNormalizer::class, + + \Docker\API\Model\IPAM::class => \Docker\API\Normalizer\IPAMNormalizer::class, + + \Docker\API\Model\IPAMConfig::class => \Docker\API\Normalizer\IPAMConfigNormalizer::class, + + \Docker\API\Model\NetworkContainer::class => \Docker\API\Normalizer\NetworkContainerNormalizer::class, + + \Docker\API\Model\PeerInfo::class => \Docker\API\Normalizer\PeerInfoNormalizer::class, + + \Docker\API\Model\NetworkCreateResponse::class => \Docker\API\Normalizer\NetworkCreateResponseNormalizer::class, + + \Docker\API\Model\BuildInfo::class => \Docker\API\Normalizer\BuildInfoNormalizer::class, + + \Docker\API\Model\BuildCache::class => \Docker\API\Normalizer\BuildCacheNormalizer::class, + + \Docker\API\Model\ImageID::class => \Docker\API\Normalizer\ImageIDNormalizer::class, + + \Docker\API\Model\CreateImageInfo::class => \Docker\API\Normalizer\CreateImageInfoNormalizer::class, + + \Docker\API\Model\PushImageInfo::class => \Docker\API\Normalizer\PushImageInfoNormalizer::class, + + \Docker\API\Model\ErrorDetail::class => \Docker\API\Normalizer\ErrorDetailNormalizer::class, + + \Docker\API\Model\ProgressDetail::class => \Docker\API\Normalizer\ProgressDetailNormalizer::class, + + \Docker\API\Model\ErrorResponse::class => \Docker\API\Normalizer\ErrorResponseNormalizer::class, + + \Docker\API\Model\IdResponse::class => \Docker\API\Normalizer\IdResponseNormalizer::class, + + \Docker\API\Model\EndpointSettings::class => \Docker\API\Normalizer\EndpointSettingsNormalizer::class, + + \Docker\API\Model\EndpointIPAMConfig::class => \Docker\API\Normalizer\EndpointIPAMConfigNormalizer::class, + + \Docker\API\Model\PluginMount::class => \Docker\API\Normalizer\PluginMountNormalizer::class, + + \Docker\API\Model\PluginDevice::class => \Docker\API\Normalizer\PluginDeviceNormalizer::class, + + \Docker\API\Model\PluginEnv::class => \Docker\API\Normalizer\PluginEnvNormalizer::class, + + \Docker\API\Model\PluginInterfaceType::class => \Docker\API\Normalizer\PluginInterfaceTypeNormalizer::class, + + \Docker\API\Model\PluginPrivilege::class => \Docker\API\Normalizer\PluginPrivilegeNormalizer::class, + + \Docker\API\Model\Plugin::class => \Docker\API\Normalizer\PluginNormalizer::class, + + \Docker\API\Model\PluginSettings::class => \Docker\API\Normalizer\PluginSettingsNormalizer::class, + + \Docker\API\Model\PluginConfig::class => \Docker\API\Normalizer\PluginConfigNormalizer::class, + + \Docker\API\Model\PluginConfigInterface::class => \Docker\API\Normalizer\PluginConfigInterfaceNormalizer::class, + + \Docker\API\Model\PluginConfigUser::class => \Docker\API\Normalizer\PluginConfigUserNormalizer::class, + + \Docker\API\Model\PluginConfigNetwork::class => \Docker\API\Normalizer\PluginConfigNetworkNormalizer::class, + + \Docker\API\Model\PluginConfigLinux::class => \Docker\API\Normalizer\PluginConfigLinuxNormalizer::class, + + \Docker\API\Model\PluginConfigArgs::class => \Docker\API\Normalizer\PluginConfigArgsNormalizer::class, + + \Docker\API\Model\PluginConfigRootfs::class => \Docker\API\Normalizer\PluginConfigRootfsNormalizer::class, + + \Docker\API\Model\ObjectVersion::class => \Docker\API\Normalizer\ObjectVersionNormalizer::class, + + \Docker\API\Model\NodeSpec::class => \Docker\API\Normalizer\NodeSpecNormalizer::class, + + \Docker\API\Model\Node::class => \Docker\API\Normalizer\NodeNormalizer::class, + + \Docker\API\Model\NodeDescription::class => \Docker\API\Normalizer\NodeDescriptionNormalizer::class, + + \Docker\API\Model\Platform::class => \Docker\API\Normalizer\PlatformNormalizer::class, + + \Docker\API\Model\EngineDescription::class => \Docker\API\Normalizer\EngineDescriptionNormalizer::class, + + \Docker\API\Model\EngineDescriptionPluginsItem::class => \Docker\API\Normalizer\EngineDescriptionPluginsItemNormalizer::class, + + \Docker\API\Model\TLSInfo::class => \Docker\API\Normalizer\TLSInfoNormalizer::class, + + \Docker\API\Model\NodeStatus::class => \Docker\API\Normalizer\NodeStatusNormalizer::class, + + \Docker\API\Model\ManagerStatus::class => \Docker\API\Normalizer\ManagerStatusNormalizer::class, + + \Docker\API\Model\SwarmSpec::class => \Docker\API\Normalizer\SwarmSpecNormalizer::class, + + \Docker\API\Model\SwarmSpecOrchestration::class => \Docker\API\Normalizer\SwarmSpecOrchestrationNormalizer::class, + + \Docker\API\Model\SwarmSpecRaft::class => \Docker\API\Normalizer\SwarmSpecRaftNormalizer::class, + + \Docker\API\Model\SwarmSpecDispatcher::class => \Docker\API\Normalizer\SwarmSpecDispatcherNormalizer::class, + + \Docker\API\Model\SwarmSpecCAConfig::class => \Docker\API\Normalizer\SwarmSpecCAConfigNormalizer::class, + + \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class => \Docker\API\Normalizer\SwarmSpecCAConfigExternalCAsItemNormalizer::class, + + \Docker\API\Model\SwarmSpecEncryptionConfig::class => \Docker\API\Normalizer\SwarmSpecEncryptionConfigNormalizer::class, + + \Docker\API\Model\SwarmSpecTaskDefaults::class => \Docker\API\Normalizer\SwarmSpecTaskDefaultsNormalizer::class, + + \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class => \Docker\API\Normalizer\SwarmSpecTaskDefaultsLogDriverNormalizer::class, + + \Docker\API\Model\ClusterInfo::class => \Docker\API\Normalizer\ClusterInfoNormalizer::class, + + \Docker\API\Model\JoinTokens::class => \Docker\API\Normalizer\JoinTokensNormalizer::class, + + \Docker\API\Model\Swarm::class => \Docker\API\Normalizer\SwarmNormalizer::class, + + \Docker\API\Model\TaskSpec::class => \Docker\API\Normalizer\TaskSpecNormalizer::class, + + \Docker\API\Model\TaskSpecPluginSpec::class => \Docker\API\Normalizer\TaskSpecPluginSpecNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpec::class => \Docker\API\Normalizer\TaskSpecContainerSpecNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivileges::class => \Docker\API\Normalizer\TaskSpecContainerSpecPrivilegesNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class => \Docker\API\Normalizer\TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class => \Docker\API\Normalizer\TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class => \Docker\API\Normalizer\TaskSpecContainerSpecPrivilegesSeccompNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class => \Docker\API\Normalizer\TaskSpecContainerSpecPrivilegesAppArmorNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class => \Docker\API\Normalizer\TaskSpecContainerSpecDNSConfigNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class => \Docker\API\Normalizer\TaskSpecContainerSpecSecretsItemNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class => \Docker\API\Normalizer\TaskSpecContainerSpecSecretsItemFileNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class => \Docker\API\Normalizer\TaskSpecContainerSpecConfigsItemNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class => \Docker\API\Normalizer\TaskSpecContainerSpecConfigsItemFileNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class => \Docker\API\Normalizer\TaskSpecContainerSpecUlimitsItemNormalizer::class, + + \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class => \Docker\API\Normalizer\TaskSpecNetworkAttachmentSpecNormalizer::class, + + \Docker\API\Model\TaskSpecResources::class => \Docker\API\Normalizer\TaskSpecResourcesNormalizer::class, + + \Docker\API\Model\TaskSpecRestartPolicy::class => \Docker\API\Normalizer\TaskSpecRestartPolicyNormalizer::class, + + \Docker\API\Model\TaskSpecPlacement::class => \Docker\API\Normalizer\TaskSpecPlacementNormalizer::class, + + \Docker\API\Model\TaskSpecPlacementPreferencesItem::class => \Docker\API\Normalizer\TaskSpecPlacementPreferencesItemNormalizer::class, + + \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class => \Docker\API\Normalizer\TaskSpecPlacementPreferencesItemSpreadNormalizer::class, + + \Docker\API\Model\TaskSpecLogDriver::class => \Docker\API\Normalizer\TaskSpecLogDriverNormalizer::class, + + \Docker\API\Model\ContainerStatus::class => \Docker\API\Normalizer\ContainerStatusNormalizer::class, + + \Docker\API\Model\PortStatus::class => \Docker\API\Normalizer\PortStatusNormalizer::class, + + \Docker\API\Model\TaskStatus::class => \Docker\API\Normalizer\TaskStatusNormalizer::class, + + \Docker\API\Model\Task::class => \Docker\API\Normalizer\TaskNormalizer::class, + + \Docker\API\Model\ServiceSpec::class => \Docker\API\Normalizer\ServiceSpecNormalizer::class, + + \Docker\API\Model\ServiceSpecMode::class => \Docker\API\Normalizer\ServiceSpecModeNormalizer::class, + + \Docker\API\Model\ServiceSpecModeReplicated::class => \Docker\API\Normalizer\ServiceSpecModeReplicatedNormalizer::class, + + \Docker\API\Model\ServiceSpecModeReplicatedJob::class => \Docker\API\Normalizer\ServiceSpecModeReplicatedJobNormalizer::class, + + \Docker\API\Model\ServiceSpecUpdateConfig::class => \Docker\API\Normalizer\ServiceSpecUpdateConfigNormalizer::class, + + \Docker\API\Model\ServiceSpecRollbackConfig::class => \Docker\API\Normalizer\ServiceSpecRollbackConfigNormalizer::class, + + \Docker\API\Model\EndpointPortConfig::class => \Docker\API\Normalizer\EndpointPortConfigNormalizer::class, + + \Docker\API\Model\EndpointSpec::class => \Docker\API\Normalizer\EndpointSpecNormalizer::class, + + \Docker\API\Model\Service::class => \Docker\API\Normalizer\ServiceNormalizer::class, + + \Docker\API\Model\ServiceEndpoint::class => \Docker\API\Normalizer\ServiceEndpointNormalizer::class, + + \Docker\API\Model\ServiceEndpointVirtualIPsItem::class => \Docker\API\Normalizer\ServiceEndpointVirtualIPsItemNormalizer::class, + + \Docker\API\Model\ServiceUpdateStatus::class => \Docker\API\Normalizer\ServiceUpdateStatusNormalizer::class, + + \Docker\API\Model\ServiceServiceStatus::class => \Docker\API\Normalizer\ServiceServiceStatusNormalizer::class, + + \Docker\API\Model\ServiceJobStatus::class => \Docker\API\Normalizer\ServiceJobStatusNormalizer::class, + + \Docker\API\Model\ImageDeleteResponseItem::class => \Docker\API\Normalizer\ImageDeleteResponseItemNormalizer::class, + + \Docker\API\Model\ServiceCreateResponse::class => \Docker\API\Normalizer\ServiceCreateResponseNormalizer::class, + + \Docker\API\Model\ServiceUpdateResponse::class => \Docker\API\Normalizer\ServiceUpdateResponseNormalizer::class, + + \Docker\API\Model\ContainerSummary::class => \Docker\API\Normalizer\ContainerSummaryNormalizer::class, + + \Docker\API\Model\ContainerSummaryHostConfig::class => \Docker\API\Normalizer\ContainerSummaryHostConfigNormalizer::class, + + \Docker\API\Model\ContainerSummaryNetworkSettings::class => \Docker\API\Normalizer\ContainerSummaryNetworkSettingsNormalizer::class, + + \Docker\API\Model\Driver::class => \Docker\API\Normalizer\DriverNormalizer::class, + + \Docker\API\Model\SecretSpec::class => \Docker\API\Normalizer\SecretSpecNormalizer::class, + + \Docker\API\Model\Secret::class => \Docker\API\Normalizer\SecretNormalizer::class, + + \Docker\API\Model\ConfigSpec::class => \Docker\API\Normalizer\ConfigSpecNormalizer::class, + + \Docker\API\Model\Config::class => \Docker\API\Normalizer\ConfigNormalizer::class, + + \Docker\API\Model\ContainerState::class => \Docker\API\Normalizer\ContainerStateNormalizer::class, + + \Docker\API\Model\ContainerCreateResponse::class => \Docker\API\Normalizer\ContainerCreateResponseNormalizer::class, + + \Docker\API\Model\ContainerWaitResponse::class => \Docker\API\Normalizer\ContainerWaitResponseNormalizer::class, + + \Docker\API\Model\ContainerWaitExitError::class => \Docker\API\Normalizer\ContainerWaitExitErrorNormalizer::class, + + \Docker\API\Model\SystemVersion::class => \Docker\API\Normalizer\SystemVersionNormalizer::class, + + \Docker\API\Model\SystemVersionPlatform::class => \Docker\API\Normalizer\SystemVersionPlatformNormalizer::class, + + \Docker\API\Model\SystemVersionComponentsItem::class => \Docker\API\Normalizer\SystemVersionComponentsItemNormalizer::class, + + \Docker\API\Model\SystemInfo::class => \Docker\API\Normalizer\SystemInfoNormalizer::class, + + \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class => \Docker\API\Normalizer\SystemInfoDefaultAddressPoolsItemNormalizer::class, + + \Docker\API\Model\ContainerdInfo::class => \Docker\API\Normalizer\ContainerdInfoNormalizer::class, + + \Docker\API\Model\ContainerdInfoNamespaces::class => \Docker\API\Normalizer\ContainerdInfoNamespacesNormalizer::class, + + \Docker\API\Model\PluginsInfo::class => \Docker\API\Normalizer\PluginsInfoNormalizer::class, + + \Docker\API\Model\RegistryServiceConfig::class => \Docker\API\Normalizer\RegistryServiceConfigNormalizer::class, + + \Docker\API\Model\IndexInfo::class => \Docker\API\Normalizer\IndexInfoNormalizer::class, + + \Docker\API\Model\Runtime::class => \Docker\API\Normalizer\RuntimeNormalizer::class, + + \Docker\API\Model\Commit::class => \Docker\API\Normalizer\CommitNormalizer::class, + + \Docker\API\Model\SwarmInfo::class => \Docker\API\Normalizer\SwarmInfoNormalizer::class, + + \Docker\API\Model\PeerNode::class => \Docker\API\Normalizer\PeerNodeNormalizer::class, + + \Docker\API\Model\NetworkAttachmentConfig::class => \Docker\API\Normalizer\NetworkAttachmentConfigNormalizer::class, + + \Docker\API\Model\EventActor::class => \Docker\API\Normalizer\EventActorNormalizer::class, + + \Docker\API\Model\EventMessage::class => \Docker\API\Normalizer\EventMessageNormalizer::class, + + \Docker\API\Model\OCIDescriptor::class => \Docker\API\Normalizer\OCIDescriptorNormalizer::class, + + \Docker\API\Model\OCIPlatform::class => \Docker\API\Normalizer\OCIPlatformNormalizer::class, + + \Docker\API\Model\DistributionInspect::class => \Docker\API\Normalizer\DistributionInspectNormalizer::class, + + \Docker\API\Model\ClusterVolume::class => \Docker\API\Normalizer\ClusterVolumeNormalizer::class, + + \Docker\API\Model\ClusterVolumeInfo::class => \Docker\API\Normalizer\ClusterVolumeInfoNormalizer::class, + + \Docker\API\Model\ClusterVolumePublishStatusItem::class => \Docker\API\Normalizer\ClusterVolumePublishStatusItemNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpec::class => \Docker\API\Normalizer\ClusterVolumeSpecNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessMode::class => \Docker\API\Normalizer\ClusterVolumeSpecAccessModeNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class => \Docker\API\Normalizer\ClusterVolumeSpecAccessModeSecretsItemNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class => \Docker\API\Normalizer\ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class => \Docker\API\Normalizer\ClusterVolumeSpecAccessModeCapacityRangeNormalizer::class, + + \Docker\API\Model\ImageManifestSummary::class => \Docker\API\Normalizer\ImageManifestSummaryNormalizer::class, + + \Docker\API\Model\ImageManifestSummarySize::class => \Docker\API\Normalizer\ImageManifestSummarySizeNormalizer::class, + + \Docker\API\Model\ImageManifestSummaryImageData::class => \Docker\API\Normalizer\ImageManifestSummaryImageDataNormalizer::class, + + \Docker\API\Model\ImageManifestSummaryImageDataSize::class => \Docker\API\Normalizer\ImageManifestSummaryImageDataSizeNormalizer::class, + + \Docker\API\Model\ImageManifestSummaryAttestationData::class => \Docker\API\Normalizer\ImageManifestSummaryAttestationDataNormalizer::class, + + \Docker\API\Model\ContainersCreatePostBody::class => \Docker\API\Normalizer\ContainersCreatePostBodyNormalizer::class, + + \Docker\API\Model\ContainersIdJsonGetResponse200::class => \Docker\API\Normalizer\ContainersIdJsonGetResponse200Normalizer::class, + + \Docker\API\Model\ContainersIdTopGetResponse200::class => \Docker\API\Normalizer\ContainersIdTopGetResponse200Normalizer::class, + + \Docker\API\Model\ContainersIdUpdatePostBody::class => \Docker\API\Normalizer\ContainersIdUpdatePostBodyNormalizer::class, + + \Docker\API\Model\ContainersIdUpdatePostResponse200::class => \Docker\API\Normalizer\ContainersIdUpdatePostResponse200Normalizer::class, + + \Docker\API\Model\ContainersPrunePostResponse200::class => \Docker\API\Normalizer\ContainersPrunePostResponse200Normalizer::class, + + \Docker\API\Model\BuildPrunePostResponse200::class => \Docker\API\Normalizer\BuildPrunePostResponse200Normalizer::class, + + \Docker\API\Model\ImagesNameHistoryGetResponse200Item::class => \Docker\API\Normalizer\ImagesNameHistoryGetResponse200ItemNormalizer::class, + + \Docker\API\Model\ImagesSearchGetResponse200Item::class => \Docker\API\Normalizer\ImagesSearchGetResponse200ItemNormalizer::class, + + \Docker\API\Model\ImagesPrunePostResponse200::class => \Docker\API\Normalizer\ImagesPrunePostResponse200Normalizer::class, + + \Docker\API\Model\AuthPostResponse200::class => \Docker\API\Normalizer\AuthPostResponse200Normalizer::class, + + \Docker\API\Model\SystemDfGetResponse200::class => \Docker\API\Normalizer\SystemDfGetResponse200Normalizer::class, + + \Docker\API\Model\ContainersIdExecPostBody::class => \Docker\API\Normalizer\ContainersIdExecPostBodyNormalizer::class, + + \Docker\API\Model\ExecIdStartPostBody::class => \Docker\API\Normalizer\ExecIdStartPostBodyNormalizer::class, + + \Docker\API\Model\ExecIdJsonGetResponse200::class => \Docker\API\Normalizer\ExecIdJsonGetResponse200Normalizer::class, + + \Docker\API\Model\VolumesNamePutBody::class => \Docker\API\Normalizer\VolumesNamePutBodyNormalizer::class, + + \Docker\API\Model\VolumesPrunePostResponse200::class => \Docker\API\Normalizer\VolumesPrunePostResponse200Normalizer::class, + + \Docker\API\Model\NetworksCreatePostBody::class => \Docker\API\Normalizer\NetworksCreatePostBodyNormalizer::class, + + \Docker\API\Model\NetworksIdConnectPostBody::class => \Docker\API\Normalizer\NetworksIdConnectPostBodyNormalizer::class, + + \Docker\API\Model\NetworksIdDisconnectPostBody::class => \Docker\API\Normalizer\NetworksIdDisconnectPostBodyNormalizer::class, + + \Docker\API\Model\NetworksPrunePostResponse200::class => \Docker\API\Normalizer\NetworksPrunePostResponse200Normalizer::class, + + \Docker\API\Model\SwarmInitPostBody::class => \Docker\API\Normalizer\SwarmInitPostBodyNormalizer::class, + + \Docker\API\Model\SwarmJoinPostBody::class => \Docker\API\Normalizer\SwarmJoinPostBodyNormalizer::class, + + \Docker\API\Model\SwarmUnlockkeyGetResponse200::class => \Docker\API\Normalizer\SwarmUnlockkeyGetResponse200Normalizer::class, + + \Docker\API\Model\SwarmUnlockPostBody::class => \Docker\API\Normalizer\SwarmUnlockPostBodyNormalizer::class, + + \Docker\API\Model\ServicesCreatePostBody::class => \Docker\API\Normalizer\ServicesCreatePostBodyNormalizer::class, + + \Docker\API\Model\ServicesIdUpdatePostBody::class => \Docker\API\Normalizer\ServicesIdUpdatePostBodyNormalizer::class, + + \Docker\API\Model\SecretsCreatePostBody::class => \Docker\API\Normalizer\SecretsCreatePostBodyNormalizer::class, + + \Docker\API\Model\ConfigsCreatePostBody::class => \Docker\API\Normalizer\ConfigsCreatePostBodyNormalizer::class, + + \Jane\Component\JsonSchemaRuntime\Reference::class => \Docker\API\Runtime\Normalizer\ReferenceNormalizer::class, + ], $normalizersCache = []; + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool + { + return array_key_exists($type, $this->normalizers); + } + public function supportsNormalization($data, $format = null, array $context = []): bool + { + return is_object($data) && array_key_exists(get_class($data), $this->normalizers); + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $normalizerClass = $this->normalizers[get_class($object)]; + $normalizer = $this->getNormalizer($normalizerClass); + return $normalizer->normalize($object, $format, $context); + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + $denormalizerClass = $this->normalizers[$type]; + $denormalizer = $this->getNormalizer($denormalizerClass); + return $denormalizer->denormalize($data, $type, $format, $context); + } + private function getNormalizer(string $normalizerClass) + { + return $this->normalizersCache[$normalizerClass] ?? $this->initNormalizer($normalizerClass); + } + private function initNormalizer(string $normalizerClass) + { + $normalizer = new $normalizerClass(); + $normalizer->setNormalizer($this->normalizer); + $normalizer->setDenormalizer($this->denormalizer); + $this->normalizersCache[$normalizerClass] = $normalizer; + return $normalizer; + } + public function getSupportedTypes(?string $format = null): array + { + return [ + + \Docker\API\Model\Port::class => false, + \Docker\API\Model\MountPoint::class => false, + \Docker\API\Model\DeviceMapping::class => false, + \Docker\API\Model\DeviceRequest::class => false, + \Docker\API\Model\ThrottleDevice::class => false, + \Docker\API\Model\Mount::class => false, + \Docker\API\Model\MountBindOptions::class => false, + \Docker\API\Model\MountVolumeOptions::class => false, + \Docker\API\Model\MountVolumeOptionsDriverConfig::class => false, + \Docker\API\Model\MountTmpfsOptions::class => false, + \Docker\API\Model\RestartPolicy::class => false, + \Docker\API\Model\Resources::class => false, + \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class => false, + \Docker\API\Model\ResourcesUlimitsItem::class => false, + \Docker\API\Model\Limit::class => false, + \Docker\API\Model\ResourceObject::class => false, + \Docker\API\Model\GenericResourcesItem::class => false, + \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class => false, + \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class => false, + \Docker\API\Model\HealthConfig::class => false, + \Docker\API\Model\Health::class => false, + \Docker\API\Model\HealthcheckResult::class => false, + \Docker\API\Model\HostConfig::class => false, + \Docker\API\Model\HostConfigLogConfig::class => false, + \Docker\API\Model\ContainerConfig::class => false, + \Docker\API\Model\ImageConfig::class => false, + \Docker\API\Model\NetworkingConfig::class => false, + \Docker\API\Model\NetworkSettings::class => false, + \Docker\API\Model\Address::class => false, + \Docker\API\Model\PortBinding::class => false, + \Docker\API\Model\DriverData::class => false, + \Docker\API\Model\FilesystemChange::class => false, + \Docker\API\Model\ImageInspect::class => false, + \Docker\API\Model\ImageInspectRootFS::class => false, + \Docker\API\Model\ImageInspectMetadata::class => false, + \Docker\API\Model\ImageSummary::class => false, + \Docker\API\Model\AuthConfig::class => false, + \Docker\API\Model\ProcessConfig::class => false, + \Docker\API\Model\Volume::class => false, + \Docker\API\Model\VolumeUsageData::class => false, + \Docker\API\Model\VolumeCreateOptions::class => false, + \Docker\API\Model\VolumeListResponse::class => false, + \Docker\API\Model\Network::class => false, + \Docker\API\Model\ConfigReference::class => false, + \Docker\API\Model\IPAM::class => false, + \Docker\API\Model\IPAMConfig::class => false, + \Docker\API\Model\NetworkContainer::class => false, + \Docker\API\Model\PeerInfo::class => false, + \Docker\API\Model\NetworkCreateResponse::class => false, + \Docker\API\Model\BuildInfo::class => false, + \Docker\API\Model\BuildCache::class => false, + \Docker\API\Model\ImageID::class => false, + \Docker\API\Model\CreateImageInfo::class => false, + \Docker\API\Model\PushImageInfo::class => false, + \Docker\API\Model\ErrorDetail::class => false, + \Docker\API\Model\ProgressDetail::class => false, + \Docker\API\Model\ErrorResponse::class => false, + \Docker\API\Model\IdResponse::class => false, + \Docker\API\Model\EndpointSettings::class => false, + \Docker\API\Model\EndpointIPAMConfig::class => false, + \Docker\API\Model\PluginMount::class => false, + \Docker\API\Model\PluginDevice::class => false, + \Docker\API\Model\PluginEnv::class => false, + \Docker\API\Model\PluginInterfaceType::class => false, + \Docker\API\Model\PluginPrivilege::class => false, + \Docker\API\Model\Plugin::class => false, + \Docker\API\Model\PluginSettings::class => false, + \Docker\API\Model\PluginConfig::class => false, + \Docker\API\Model\PluginConfigInterface::class => false, + \Docker\API\Model\PluginConfigUser::class => false, + \Docker\API\Model\PluginConfigNetwork::class => false, + \Docker\API\Model\PluginConfigLinux::class => false, + \Docker\API\Model\PluginConfigArgs::class => false, + \Docker\API\Model\PluginConfigRootfs::class => false, + \Docker\API\Model\ObjectVersion::class => false, + \Docker\API\Model\NodeSpec::class => false, + \Docker\API\Model\Node::class => false, + \Docker\API\Model\NodeDescription::class => false, + \Docker\API\Model\Platform::class => false, + \Docker\API\Model\EngineDescription::class => false, + \Docker\API\Model\EngineDescriptionPluginsItem::class => false, + \Docker\API\Model\TLSInfo::class => false, + \Docker\API\Model\NodeStatus::class => false, + \Docker\API\Model\ManagerStatus::class => false, + \Docker\API\Model\SwarmSpec::class => false, + \Docker\API\Model\SwarmSpecOrchestration::class => false, + \Docker\API\Model\SwarmSpecRaft::class => false, + \Docker\API\Model\SwarmSpecDispatcher::class => false, + \Docker\API\Model\SwarmSpecCAConfig::class => false, + \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class => false, + \Docker\API\Model\SwarmSpecEncryptionConfig::class => false, + \Docker\API\Model\SwarmSpecTaskDefaults::class => false, + \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class => false, + \Docker\API\Model\ClusterInfo::class => false, + \Docker\API\Model\JoinTokens::class => false, + \Docker\API\Model\Swarm::class => false, + \Docker\API\Model\TaskSpec::class => false, + \Docker\API\Model\TaskSpecPluginSpec::class => false, + \Docker\API\Model\TaskSpecContainerSpec::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivileges::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class => false, + \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class => false, + \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class => false, + \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class => false, + \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class => false, + \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class => false, + \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class => false, + \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class => false, + \Docker\API\Model\TaskSpecResources::class => false, + \Docker\API\Model\TaskSpecRestartPolicy::class => false, + \Docker\API\Model\TaskSpecPlacement::class => false, + \Docker\API\Model\TaskSpecPlacementPreferencesItem::class => false, + \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class => false, + \Docker\API\Model\TaskSpecLogDriver::class => false, + \Docker\API\Model\ContainerStatus::class => false, + \Docker\API\Model\PortStatus::class => false, + \Docker\API\Model\TaskStatus::class => false, + \Docker\API\Model\Task::class => false, + \Docker\API\Model\ServiceSpec::class => false, + \Docker\API\Model\ServiceSpecMode::class => false, + \Docker\API\Model\ServiceSpecModeReplicated::class => false, + \Docker\API\Model\ServiceSpecModeReplicatedJob::class => false, + \Docker\API\Model\ServiceSpecUpdateConfig::class => false, + \Docker\API\Model\ServiceSpecRollbackConfig::class => false, + \Docker\API\Model\EndpointPortConfig::class => false, + \Docker\API\Model\EndpointSpec::class => false, + \Docker\API\Model\Service::class => false, + \Docker\API\Model\ServiceEndpoint::class => false, + \Docker\API\Model\ServiceEndpointVirtualIPsItem::class => false, + \Docker\API\Model\ServiceUpdateStatus::class => false, + \Docker\API\Model\ServiceServiceStatus::class => false, + \Docker\API\Model\ServiceJobStatus::class => false, + \Docker\API\Model\ImageDeleteResponseItem::class => false, + \Docker\API\Model\ServiceCreateResponse::class => false, + \Docker\API\Model\ServiceUpdateResponse::class => false, + \Docker\API\Model\ContainerSummary::class => false, + \Docker\API\Model\ContainerSummaryHostConfig::class => false, + \Docker\API\Model\ContainerSummaryNetworkSettings::class => false, + \Docker\API\Model\Driver::class => false, + \Docker\API\Model\SecretSpec::class => false, + \Docker\API\Model\Secret::class => false, + \Docker\API\Model\ConfigSpec::class => false, + \Docker\API\Model\Config::class => false, + \Docker\API\Model\ContainerState::class => false, + \Docker\API\Model\ContainerCreateResponse::class => false, + \Docker\API\Model\ContainerWaitResponse::class => false, + \Docker\API\Model\ContainerWaitExitError::class => false, + \Docker\API\Model\SystemVersion::class => false, + \Docker\API\Model\SystemVersionPlatform::class => false, + \Docker\API\Model\SystemVersionComponentsItem::class => false, + \Docker\API\Model\SystemInfo::class => false, + \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class => false, + \Docker\API\Model\ContainerdInfo::class => false, + \Docker\API\Model\ContainerdInfoNamespaces::class => false, + \Docker\API\Model\PluginsInfo::class => false, + \Docker\API\Model\RegistryServiceConfig::class => false, + \Docker\API\Model\IndexInfo::class => false, + \Docker\API\Model\Runtime::class => false, + \Docker\API\Model\Commit::class => false, + \Docker\API\Model\SwarmInfo::class => false, + \Docker\API\Model\PeerNode::class => false, + \Docker\API\Model\NetworkAttachmentConfig::class => false, + \Docker\API\Model\EventActor::class => false, + \Docker\API\Model\EventMessage::class => false, + \Docker\API\Model\OCIDescriptor::class => false, + \Docker\API\Model\OCIPlatform::class => false, + \Docker\API\Model\DistributionInspect::class => false, + \Docker\API\Model\ClusterVolume::class => false, + \Docker\API\Model\ClusterVolumeInfo::class => false, + \Docker\API\Model\ClusterVolumePublishStatusItem::class => false, + \Docker\API\Model\ClusterVolumeSpec::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessMode::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class => false, + \Docker\API\Model\ImageManifestSummary::class => false, + \Docker\API\Model\ImageManifestSummarySize::class => false, + \Docker\API\Model\ImageManifestSummaryImageData::class => false, + \Docker\API\Model\ImageManifestSummaryImageDataSize::class => false, + \Docker\API\Model\ImageManifestSummaryAttestationData::class => false, + \Docker\API\Model\ContainersCreatePostBody::class => false, + \Docker\API\Model\ContainersIdJsonGetResponse200::class => false, + \Docker\API\Model\ContainersIdTopGetResponse200::class => false, + \Docker\API\Model\ContainersIdUpdatePostBody::class => false, + \Docker\API\Model\ContainersIdUpdatePostResponse200::class => false, + \Docker\API\Model\ContainersPrunePostResponse200::class => false, + \Docker\API\Model\BuildPrunePostResponse200::class => false, + \Docker\API\Model\ImagesNameHistoryGetResponse200Item::class => false, + \Docker\API\Model\ImagesSearchGetResponse200Item::class => false, + \Docker\API\Model\ImagesPrunePostResponse200::class => false, + \Docker\API\Model\AuthPostResponse200::class => false, + \Docker\API\Model\SystemDfGetResponse200::class => false, + \Docker\API\Model\ContainersIdExecPostBody::class => false, + \Docker\API\Model\ExecIdStartPostBody::class => false, + \Docker\API\Model\ExecIdJsonGetResponse200::class => false, + \Docker\API\Model\VolumesNamePutBody::class => false, + \Docker\API\Model\VolumesPrunePostResponse200::class => false, + \Docker\API\Model\NetworksCreatePostBody::class => false, + \Docker\API\Model\NetworksIdConnectPostBody::class => false, + \Docker\API\Model\NetworksIdDisconnectPostBody::class => false, + \Docker\API\Model\NetworksPrunePostResponse200::class => false, + \Docker\API\Model\SwarmInitPostBody::class => false, + \Docker\API\Model\SwarmJoinPostBody::class => false, + \Docker\API\Model\SwarmUnlockkeyGetResponse200::class => false, + \Docker\API\Model\SwarmUnlockPostBody::class => false, + \Docker\API\Model\ServicesCreatePostBody::class => false, + \Docker\API\Model\ServicesIdUpdatePostBody::class => false, + \Docker\API\Model\SecretsCreatePostBody::class => false, + \Docker\API\Model\ConfigsCreatePostBody::class => false, + \Jane\Component\JsonSchemaRuntime\Reference::class => false, + ]; + } + } +} else { + class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + protected $normalizers = [ + + \Docker\API\Model\Port::class => \Docker\API\Normalizer\PortNormalizer::class, + + \Docker\API\Model\MountPoint::class => \Docker\API\Normalizer\MountPointNormalizer::class, + + \Docker\API\Model\DeviceMapping::class => \Docker\API\Normalizer\DeviceMappingNormalizer::class, + + \Docker\API\Model\DeviceRequest::class => \Docker\API\Normalizer\DeviceRequestNormalizer::class, + + \Docker\API\Model\ThrottleDevice::class => \Docker\API\Normalizer\ThrottleDeviceNormalizer::class, + + \Docker\API\Model\Mount::class => \Docker\API\Normalizer\MountNormalizer::class, + + \Docker\API\Model\MountBindOptions::class => \Docker\API\Normalizer\MountBindOptionsNormalizer::class, + + \Docker\API\Model\MountVolumeOptions::class => \Docker\API\Normalizer\MountVolumeOptionsNormalizer::class, + + \Docker\API\Model\MountVolumeOptionsDriverConfig::class => \Docker\API\Normalizer\MountVolumeOptionsDriverConfigNormalizer::class, + + \Docker\API\Model\MountTmpfsOptions::class => \Docker\API\Normalizer\MountTmpfsOptionsNormalizer::class, + + \Docker\API\Model\RestartPolicy::class => \Docker\API\Normalizer\RestartPolicyNormalizer::class, + + \Docker\API\Model\Resources::class => \Docker\API\Normalizer\ResourcesNormalizer::class, + + \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class => \Docker\API\Normalizer\ResourcesBlkioWeightDeviceItemNormalizer::class, + + \Docker\API\Model\ResourcesUlimitsItem::class => \Docker\API\Normalizer\ResourcesUlimitsItemNormalizer::class, + + \Docker\API\Model\Limit::class => \Docker\API\Normalizer\LimitNormalizer::class, + + \Docker\API\Model\ResourceObject::class => \Docker\API\Normalizer\ResourceObjectNormalizer::class, + + \Docker\API\Model\GenericResourcesItem::class => \Docker\API\Normalizer\GenericResourcesItemNormalizer::class, + + \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class => \Docker\API\Normalizer\GenericResourcesItemNamedResourceSpecNormalizer::class, + + \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class => \Docker\API\Normalizer\GenericResourcesItemDiscreteResourceSpecNormalizer::class, + + \Docker\API\Model\HealthConfig::class => \Docker\API\Normalizer\HealthConfigNormalizer::class, + + \Docker\API\Model\Health::class => \Docker\API\Normalizer\HealthNormalizer::class, + + \Docker\API\Model\HealthcheckResult::class => \Docker\API\Normalizer\HealthcheckResultNormalizer::class, + + \Docker\API\Model\HostConfig::class => \Docker\API\Normalizer\HostConfigNormalizer::class, + + \Docker\API\Model\HostConfigLogConfig::class => \Docker\API\Normalizer\HostConfigLogConfigNormalizer::class, + + \Docker\API\Model\ContainerConfig::class => \Docker\API\Normalizer\ContainerConfigNormalizer::class, + + \Docker\API\Model\ImageConfig::class => \Docker\API\Normalizer\ImageConfigNormalizer::class, + + \Docker\API\Model\NetworkingConfig::class => \Docker\API\Normalizer\NetworkingConfigNormalizer::class, + + \Docker\API\Model\NetworkSettings::class => \Docker\API\Normalizer\NetworkSettingsNormalizer::class, + + \Docker\API\Model\Address::class => \Docker\API\Normalizer\AddressNormalizer::class, + + \Docker\API\Model\PortBinding::class => \Docker\API\Normalizer\PortBindingNormalizer::class, + + \Docker\API\Model\DriverData::class => \Docker\API\Normalizer\DriverDataNormalizer::class, + + \Docker\API\Model\FilesystemChange::class => \Docker\API\Normalizer\FilesystemChangeNormalizer::class, + + \Docker\API\Model\ImageInspect::class => \Docker\API\Normalizer\ImageInspectNormalizer::class, + + \Docker\API\Model\ImageInspectRootFS::class => \Docker\API\Normalizer\ImageInspectRootFSNormalizer::class, + + \Docker\API\Model\ImageInspectMetadata::class => \Docker\API\Normalizer\ImageInspectMetadataNormalizer::class, + + \Docker\API\Model\ImageSummary::class => \Docker\API\Normalizer\ImageSummaryNormalizer::class, + + \Docker\API\Model\AuthConfig::class => \Docker\API\Normalizer\AuthConfigNormalizer::class, + + \Docker\API\Model\ProcessConfig::class => \Docker\API\Normalizer\ProcessConfigNormalizer::class, + + \Docker\API\Model\Volume::class => \Docker\API\Normalizer\VolumeNormalizer::class, + + \Docker\API\Model\VolumeUsageData::class => \Docker\API\Normalizer\VolumeUsageDataNormalizer::class, + + \Docker\API\Model\VolumeCreateOptions::class => \Docker\API\Normalizer\VolumeCreateOptionsNormalizer::class, + + \Docker\API\Model\VolumeListResponse::class => \Docker\API\Normalizer\VolumeListResponseNormalizer::class, + + \Docker\API\Model\Network::class => \Docker\API\Normalizer\NetworkNormalizer::class, + + \Docker\API\Model\ConfigReference::class => \Docker\API\Normalizer\ConfigReferenceNormalizer::class, + + \Docker\API\Model\IPAM::class => \Docker\API\Normalizer\IPAMNormalizer::class, + + \Docker\API\Model\IPAMConfig::class => \Docker\API\Normalizer\IPAMConfigNormalizer::class, + + \Docker\API\Model\NetworkContainer::class => \Docker\API\Normalizer\NetworkContainerNormalizer::class, + + \Docker\API\Model\PeerInfo::class => \Docker\API\Normalizer\PeerInfoNormalizer::class, + + \Docker\API\Model\NetworkCreateResponse::class => \Docker\API\Normalizer\NetworkCreateResponseNormalizer::class, + + \Docker\API\Model\BuildInfo::class => \Docker\API\Normalizer\BuildInfoNormalizer::class, + + \Docker\API\Model\BuildCache::class => \Docker\API\Normalizer\BuildCacheNormalizer::class, + + \Docker\API\Model\ImageID::class => \Docker\API\Normalizer\ImageIDNormalizer::class, + + \Docker\API\Model\CreateImageInfo::class => \Docker\API\Normalizer\CreateImageInfoNormalizer::class, + + \Docker\API\Model\PushImageInfo::class => \Docker\API\Normalizer\PushImageInfoNormalizer::class, + + \Docker\API\Model\ErrorDetail::class => \Docker\API\Normalizer\ErrorDetailNormalizer::class, + + \Docker\API\Model\ProgressDetail::class => \Docker\API\Normalizer\ProgressDetailNormalizer::class, + + \Docker\API\Model\ErrorResponse::class => \Docker\API\Normalizer\ErrorResponseNormalizer::class, + + \Docker\API\Model\IdResponse::class => \Docker\API\Normalizer\IdResponseNormalizer::class, + + \Docker\API\Model\EndpointSettings::class => \Docker\API\Normalizer\EndpointSettingsNormalizer::class, + + \Docker\API\Model\EndpointIPAMConfig::class => \Docker\API\Normalizer\EndpointIPAMConfigNormalizer::class, + + \Docker\API\Model\PluginMount::class => \Docker\API\Normalizer\PluginMountNormalizer::class, + + \Docker\API\Model\PluginDevice::class => \Docker\API\Normalizer\PluginDeviceNormalizer::class, + + \Docker\API\Model\PluginEnv::class => \Docker\API\Normalizer\PluginEnvNormalizer::class, + + \Docker\API\Model\PluginInterfaceType::class => \Docker\API\Normalizer\PluginInterfaceTypeNormalizer::class, + + \Docker\API\Model\PluginPrivilege::class => \Docker\API\Normalizer\PluginPrivilegeNormalizer::class, + + \Docker\API\Model\Plugin::class => \Docker\API\Normalizer\PluginNormalizer::class, + + \Docker\API\Model\PluginSettings::class => \Docker\API\Normalizer\PluginSettingsNormalizer::class, + + \Docker\API\Model\PluginConfig::class => \Docker\API\Normalizer\PluginConfigNormalizer::class, + + \Docker\API\Model\PluginConfigInterface::class => \Docker\API\Normalizer\PluginConfigInterfaceNormalizer::class, + + \Docker\API\Model\PluginConfigUser::class => \Docker\API\Normalizer\PluginConfigUserNormalizer::class, + + \Docker\API\Model\PluginConfigNetwork::class => \Docker\API\Normalizer\PluginConfigNetworkNormalizer::class, + + \Docker\API\Model\PluginConfigLinux::class => \Docker\API\Normalizer\PluginConfigLinuxNormalizer::class, + + \Docker\API\Model\PluginConfigArgs::class => \Docker\API\Normalizer\PluginConfigArgsNormalizer::class, + + \Docker\API\Model\PluginConfigRootfs::class => \Docker\API\Normalizer\PluginConfigRootfsNormalizer::class, + + \Docker\API\Model\ObjectVersion::class => \Docker\API\Normalizer\ObjectVersionNormalizer::class, + + \Docker\API\Model\NodeSpec::class => \Docker\API\Normalizer\NodeSpecNormalizer::class, + + \Docker\API\Model\Node::class => \Docker\API\Normalizer\NodeNormalizer::class, + + \Docker\API\Model\NodeDescription::class => \Docker\API\Normalizer\NodeDescriptionNormalizer::class, + + \Docker\API\Model\Platform::class => \Docker\API\Normalizer\PlatformNormalizer::class, + + \Docker\API\Model\EngineDescription::class => \Docker\API\Normalizer\EngineDescriptionNormalizer::class, + + \Docker\API\Model\EngineDescriptionPluginsItem::class => \Docker\API\Normalizer\EngineDescriptionPluginsItemNormalizer::class, + + \Docker\API\Model\TLSInfo::class => \Docker\API\Normalizer\TLSInfoNormalizer::class, + + \Docker\API\Model\NodeStatus::class => \Docker\API\Normalizer\NodeStatusNormalizer::class, + + \Docker\API\Model\ManagerStatus::class => \Docker\API\Normalizer\ManagerStatusNormalizer::class, + + \Docker\API\Model\SwarmSpec::class => \Docker\API\Normalizer\SwarmSpecNormalizer::class, + + \Docker\API\Model\SwarmSpecOrchestration::class => \Docker\API\Normalizer\SwarmSpecOrchestrationNormalizer::class, + + \Docker\API\Model\SwarmSpecRaft::class => \Docker\API\Normalizer\SwarmSpecRaftNormalizer::class, + + \Docker\API\Model\SwarmSpecDispatcher::class => \Docker\API\Normalizer\SwarmSpecDispatcherNormalizer::class, + + \Docker\API\Model\SwarmSpecCAConfig::class => \Docker\API\Normalizer\SwarmSpecCAConfigNormalizer::class, + + \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class => \Docker\API\Normalizer\SwarmSpecCAConfigExternalCAsItemNormalizer::class, + + \Docker\API\Model\SwarmSpecEncryptionConfig::class => \Docker\API\Normalizer\SwarmSpecEncryptionConfigNormalizer::class, + + \Docker\API\Model\SwarmSpecTaskDefaults::class => \Docker\API\Normalizer\SwarmSpecTaskDefaultsNormalizer::class, + + \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class => \Docker\API\Normalizer\SwarmSpecTaskDefaultsLogDriverNormalizer::class, + + \Docker\API\Model\ClusterInfo::class => \Docker\API\Normalizer\ClusterInfoNormalizer::class, + + \Docker\API\Model\JoinTokens::class => \Docker\API\Normalizer\JoinTokensNormalizer::class, + + \Docker\API\Model\Swarm::class => \Docker\API\Normalizer\SwarmNormalizer::class, + + \Docker\API\Model\TaskSpec::class => \Docker\API\Normalizer\TaskSpecNormalizer::class, + + \Docker\API\Model\TaskSpecPluginSpec::class => \Docker\API\Normalizer\TaskSpecPluginSpecNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpec::class => \Docker\API\Normalizer\TaskSpecContainerSpecNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivileges::class => \Docker\API\Normalizer\TaskSpecContainerSpecPrivilegesNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class => \Docker\API\Normalizer\TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class => \Docker\API\Normalizer\TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class => \Docker\API\Normalizer\TaskSpecContainerSpecPrivilegesSeccompNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class => \Docker\API\Normalizer\TaskSpecContainerSpecPrivilegesAppArmorNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class => \Docker\API\Normalizer\TaskSpecContainerSpecDNSConfigNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class => \Docker\API\Normalizer\TaskSpecContainerSpecSecretsItemNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class => \Docker\API\Normalizer\TaskSpecContainerSpecSecretsItemFileNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class => \Docker\API\Normalizer\TaskSpecContainerSpecConfigsItemNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class => \Docker\API\Normalizer\TaskSpecContainerSpecConfigsItemFileNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class => \Docker\API\Normalizer\TaskSpecContainerSpecUlimitsItemNormalizer::class, + + \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class => \Docker\API\Normalizer\TaskSpecNetworkAttachmentSpecNormalizer::class, + + \Docker\API\Model\TaskSpecResources::class => \Docker\API\Normalizer\TaskSpecResourcesNormalizer::class, + + \Docker\API\Model\TaskSpecRestartPolicy::class => \Docker\API\Normalizer\TaskSpecRestartPolicyNormalizer::class, + + \Docker\API\Model\TaskSpecPlacement::class => \Docker\API\Normalizer\TaskSpecPlacementNormalizer::class, + + \Docker\API\Model\TaskSpecPlacementPreferencesItem::class => \Docker\API\Normalizer\TaskSpecPlacementPreferencesItemNormalizer::class, + + \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class => \Docker\API\Normalizer\TaskSpecPlacementPreferencesItemSpreadNormalizer::class, + + \Docker\API\Model\TaskSpecLogDriver::class => \Docker\API\Normalizer\TaskSpecLogDriverNormalizer::class, + + \Docker\API\Model\ContainerStatus::class => \Docker\API\Normalizer\ContainerStatusNormalizer::class, + + \Docker\API\Model\PortStatus::class => \Docker\API\Normalizer\PortStatusNormalizer::class, + + \Docker\API\Model\TaskStatus::class => \Docker\API\Normalizer\TaskStatusNormalizer::class, + + \Docker\API\Model\Task::class => \Docker\API\Normalizer\TaskNormalizer::class, + + \Docker\API\Model\ServiceSpec::class => \Docker\API\Normalizer\ServiceSpecNormalizer::class, + + \Docker\API\Model\ServiceSpecMode::class => \Docker\API\Normalizer\ServiceSpecModeNormalizer::class, + + \Docker\API\Model\ServiceSpecModeReplicated::class => \Docker\API\Normalizer\ServiceSpecModeReplicatedNormalizer::class, + + \Docker\API\Model\ServiceSpecModeReplicatedJob::class => \Docker\API\Normalizer\ServiceSpecModeReplicatedJobNormalizer::class, + + \Docker\API\Model\ServiceSpecUpdateConfig::class => \Docker\API\Normalizer\ServiceSpecUpdateConfigNormalizer::class, + + \Docker\API\Model\ServiceSpecRollbackConfig::class => \Docker\API\Normalizer\ServiceSpecRollbackConfigNormalizer::class, + + \Docker\API\Model\EndpointPortConfig::class => \Docker\API\Normalizer\EndpointPortConfigNormalizer::class, + + \Docker\API\Model\EndpointSpec::class => \Docker\API\Normalizer\EndpointSpecNormalizer::class, + + \Docker\API\Model\Service::class => \Docker\API\Normalizer\ServiceNormalizer::class, + + \Docker\API\Model\ServiceEndpoint::class => \Docker\API\Normalizer\ServiceEndpointNormalizer::class, + + \Docker\API\Model\ServiceEndpointVirtualIPsItem::class => \Docker\API\Normalizer\ServiceEndpointVirtualIPsItemNormalizer::class, + + \Docker\API\Model\ServiceUpdateStatus::class => \Docker\API\Normalizer\ServiceUpdateStatusNormalizer::class, + + \Docker\API\Model\ServiceServiceStatus::class => \Docker\API\Normalizer\ServiceServiceStatusNormalizer::class, + + \Docker\API\Model\ServiceJobStatus::class => \Docker\API\Normalizer\ServiceJobStatusNormalizer::class, + + \Docker\API\Model\ImageDeleteResponseItem::class => \Docker\API\Normalizer\ImageDeleteResponseItemNormalizer::class, + + \Docker\API\Model\ServiceCreateResponse::class => \Docker\API\Normalizer\ServiceCreateResponseNormalizer::class, + + \Docker\API\Model\ServiceUpdateResponse::class => \Docker\API\Normalizer\ServiceUpdateResponseNormalizer::class, + + \Docker\API\Model\ContainerSummary::class => \Docker\API\Normalizer\ContainerSummaryNormalizer::class, + + \Docker\API\Model\ContainerSummaryHostConfig::class => \Docker\API\Normalizer\ContainerSummaryHostConfigNormalizer::class, + + \Docker\API\Model\ContainerSummaryNetworkSettings::class => \Docker\API\Normalizer\ContainerSummaryNetworkSettingsNormalizer::class, + + \Docker\API\Model\Driver::class => \Docker\API\Normalizer\DriverNormalizer::class, + + \Docker\API\Model\SecretSpec::class => \Docker\API\Normalizer\SecretSpecNormalizer::class, + + \Docker\API\Model\Secret::class => \Docker\API\Normalizer\SecretNormalizer::class, + + \Docker\API\Model\ConfigSpec::class => \Docker\API\Normalizer\ConfigSpecNormalizer::class, + + \Docker\API\Model\Config::class => \Docker\API\Normalizer\ConfigNormalizer::class, + + \Docker\API\Model\ContainerState::class => \Docker\API\Normalizer\ContainerStateNormalizer::class, + + \Docker\API\Model\ContainerCreateResponse::class => \Docker\API\Normalizer\ContainerCreateResponseNormalizer::class, + + \Docker\API\Model\ContainerWaitResponse::class => \Docker\API\Normalizer\ContainerWaitResponseNormalizer::class, + + \Docker\API\Model\ContainerWaitExitError::class => \Docker\API\Normalizer\ContainerWaitExitErrorNormalizer::class, + + \Docker\API\Model\SystemVersion::class => \Docker\API\Normalizer\SystemVersionNormalizer::class, + + \Docker\API\Model\SystemVersionPlatform::class => \Docker\API\Normalizer\SystemVersionPlatformNormalizer::class, + + \Docker\API\Model\SystemVersionComponentsItem::class => \Docker\API\Normalizer\SystemVersionComponentsItemNormalizer::class, + + \Docker\API\Model\SystemInfo::class => \Docker\API\Normalizer\SystemInfoNormalizer::class, + + \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class => \Docker\API\Normalizer\SystemInfoDefaultAddressPoolsItemNormalizer::class, + + \Docker\API\Model\ContainerdInfo::class => \Docker\API\Normalizer\ContainerdInfoNormalizer::class, + + \Docker\API\Model\ContainerdInfoNamespaces::class => \Docker\API\Normalizer\ContainerdInfoNamespacesNormalizer::class, + + \Docker\API\Model\PluginsInfo::class => \Docker\API\Normalizer\PluginsInfoNormalizer::class, + + \Docker\API\Model\RegistryServiceConfig::class => \Docker\API\Normalizer\RegistryServiceConfigNormalizer::class, + + \Docker\API\Model\IndexInfo::class => \Docker\API\Normalizer\IndexInfoNormalizer::class, + + \Docker\API\Model\Runtime::class => \Docker\API\Normalizer\RuntimeNormalizer::class, + + \Docker\API\Model\Commit::class => \Docker\API\Normalizer\CommitNormalizer::class, + + \Docker\API\Model\SwarmInfo::class => \Docker\API\Normalizer\SwarmInfoNormalizer::class, + + \Docker\API\Model\PeerNode::class => \Docker\API\Normalizer\PeerNodeNormalizer::class, + + \Docker\API\Model\NetworkAttachmentConfig::class => \Docker\API\Normalizer\NetworkAttachmentConfigNormalizer::class, + + \Docker\API\Model\EventActor::class => \Docker\API\Normalizer\EventActorNormalizer::class, + + \Docker\API\Model\EventMessage::class => \Docker\API\Normalizer\EventMessageNormalizer::class, + + \Docker\API\Model\OCIDescriptor::class => \Docker\API\Normalizer\OCIDescriptorNormalizer::class, + + \Docker\API\Model\OCIPlatform::class => \Docker\API\Normalizer\OCIPlatformNormalizer::class, + + \Docker\API\Model\DistributionInspect::class => \Docker\API\Normalizer\DistributionInspectNormalizer::class, + + \Docker\API\Model\ClusterVolume::class => \Docker\API\Normalizer\ClusterVolumeNormalizer::class, + + \Docker\API\Model\ClusterVolumeInfo::class => \Docker\API\Normalizer\ClusterVolumeInfoNormalizer::class, + + \Docker\API\Model\ClusterVolumePublishStatusItem::class => \Docker\API\Normalizer\ClusterVolumePublishStatusItemNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpec::class => \Docker\API\Normalizer\ClusterVolumeSpecNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessMode::class => \Docker\API\Normalizer\ClusterVolumeSpecAccessModeNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class => \Docker\API\Normalizer\ClusterVolumeSpecAccessModeSecretsItemNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class => \Docker\API\Normalizer\ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class => \Docker\API\Normalizer\ClusterVolumeSpecAccessModeCapacityRangeNormalizer::class, + + \Docker\API\Model\ImageManifestSummary::class => \Docker\API\Normalizer\ImageManifestSummaryNormalizer::class, + + \Docker\API\Model\ImageManifestSummarySize::class => \Docker\API\Normalizer\ImageManifestSummarySizeNormalizer::class, + + \Docker\API\Model\ImageManifestSummaryImageData::class => \Docker\API\Normalizer\ImageManifestSummaryImageDataNormalizer::class, + + \Docker\API\Model\ImageManifestSummaryImageDataSize::class => \Docker\API\Normalizer\ImageManifestSummaryImageDataSizeNormalizer::class, + + \Docker\API\Model\ImageManifestSummaryAttestationData::class => \Docker\API\Normalizer\ImageManifestSummaryAttestationDataNormalizer::class, + + \Docker\API\Model\ContainersCreatePostBody::class => \Docker\API\Normalizer\ContainersCreatePostBodyNormalizer::class, + + \Docker\API\Model\ContainersIdJsonGetResponse200::class => \Docker\API\Normalizer\ContainersIdJsonGetResponse200Normalizer::class, + + \Docker\API\Model\ContainersIdTopGetResponse200::class => \Docker\API\Normalizer\ContainersIdTopGetResponse200Normalizer::class, + + \Docker\API\Model\ContainersIdUpdatePostBody::class => \Docker\API\Normalizer\ContainersIdUpdatePostBodyNormalizer::class, + + \Docker\API\Model\ContainersIdUpdatePostResponse200::class => \Docker\API\Normalizer\ContainersIdUpdatePostResponse200Normalizer::class, + + \Docker\API\Model\ContainersPrunePostResponse200::class => \Docker\API\Normalizer\ContainersPrunePostResponse200Normalizer::class, + + \Docker\API\Model\BuildPrunePostResponse200::class => \Docker\API\Normalizer\BuildPrunePostResponse200Normalizer::class, + + \Docker\API\Model\ImagesNameHistoryGetResponse200Item::class => \Docker\API\Normalizer\ImagesNameHistoryGetResponse200ItemNormalizer::class, + + \Docker\API\Model\ImagesSearchGetResponse200Item::class => \Docker\API\Normalizer\ImagesSearchGetResponse200ItemNormalizer::class, + + \Docker\API\Model\ImagesPrunePostResponse200::class => \Docker\API\Normalizer\ImagesPrunePostResponse200Normalizer::class, + + \Docker\API\Model\AuthPostResponse200::class => \Docker\API\Normalizer\AuthPostResponse200Normalizer::class, + + \Docker\API\Model\SystemDfGetResponse200::class => \Docker\API\Normalizer\SystemDfGetResponse200Normalizer::class, + + \Docker\API\Model\ContainersIdExecPostBody::class => \Docker\API\Normalizer\ContainersIdExecPostBodyNormalizer::class, + + \Docker\API\Model\ExecIdStartPostBody::class => \Docker\API\Normalizer\ExecIdStartPostBodyNormalizer::class, + + \Docker\API\Model\ExecIdJsonGetResponse200::class => \Docker\API\Normalizer\ExecIdJsonGetResponse200Normalizer::class, + + \Docker\API\Model\VolumesNamePutBody::class => \Docker\API\Normalizer\VolumesNamePutBodyNormalizer::class, + + \Docker\API\Model\VolumesPrunePostResponse200::class => \Docker\API\Normalizer\VolumesPrunePostResponse200Normalizer::class, + + \Docker\API\Model\NetworksCreatePostBody::class => \Docker\API\Normalizer\NetworksCreatePostBodyNormalizer::class, + + \Docker\API\Model\NetworksIdConnectPostBody::class => \Docker\API\Normalizer\NetworksIdConnectPostBodyNormalizer::class, + + \Docker\API\Model\NetworksIdDisconnectPostBody::class => \Docker\API\Normalizer\NetworksIdDisconnectPostBodyNormalizer::class, + + \Docker\API\Model\NetworksPrunePostResponse200::class => \Docker\API\Normalizer\NetworksPrunePostResponse200Normalizer::class, + + \Docker\API\Model\SwarmInitPostBody::class => \Docker\API\Normalizer\SwarmInitPostBodyNormalizer::class, + + \Docker\API\Model\SwarmJoinPostBody::class => \Docker\API\Normalizer\SwarmJoinPostBodyNormalizer::class, + + \Docker\API\Model\SwarmUnlockkeyGetResponse200::class => \Docker\API\Normalizer\SwarmUnlockkeyGetResponse200Normalizer::class, + + \Docker\API\Model\SwarmUnlockPostBody::class => \Docker\API\Normalizer\SwarmUnlockPostBodyNormalizer::class, + + \Docker\API\Model\ServicesCreatePostBody::class => \Docker\API\Normalizer\ServicesCreatePostBodyNormalizer::class, + + \Docker\API\Model\ServicesIdUpdatePostBody::class => \Docker\API\Normalizer\ServicesIdUpdatePostBodyNormalizer::class, + + \Docker\API\Model\SecretsCreatePostBody::class => \Docker\API\Normalizer\SecretsCreatePostBodyNormalizer::class, + + \Docker\API\Model\ConfigsCreatePostBody::class => \Docker\API\Normalizer\ConfigsCreatePostBodyNormalizer::class, + + \Jane\Component\JsonSchemaRuntime\Reference::class => \Docker\API\Runtime\Normalizer\ReferenceNormalizer::class, + ], $normalizersCache = []; + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool + { + return array_key_exists($type, $this->normalizers); + } + public function supportsNormalization($data, $format = null, array $context = []): bool + { + return is_object($data) && array_key_exists(get_class($data), $this->normalizers); + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $normalizerClass = $this->normalizers[get_class($object)]; + $normalizer = $this->getNormalizer($normalizerClass); + return $normalizer->normalize($object, $format, $context); + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + $denormalizerClass = $this->normalizers[$type]; + $denormalizer = $this->getNormalizer($denormalizerClass); + return $denormalizer->denormalize($data, $type, $format, $context); + } + private function getNormalizer(string $normalizerClass) + { + return $this->normalizersCache[$normalizerClass] ?? $this->initNormalizer($normalizerClass); + } + private function initNormalizer(string $normalizerClass) + { + $normalizer = new $normalizerClass(); + $normalizer->setNormalizer($this->normalizer); + $normalizer->setDenormalizer($this->denormalizer); + $this->normalizersCache[$normalizerClass] = $normalizer; + return $normalizer; + } + public function getSupportedTypes(?string $format = null): array + { + return [ + + \Docker\API\Model\Port::class => false, + \Docker\API\Model\MountPoint::class => false, + \Docker\API\Model\DeviceMapping::class => false, + \Docker\API\Model\DeviceRequest::class => false, + \Docker\API\Model\ThrottleDevice::class => false, + \Docker\API\Model\Mount::class => false, + \Docker\API\Model\MountBindOptions::class => false, + \Docker\API\Model\MountVolumeOptions::class => false, + \Docker\API\Model\MountVolumeOptionsDriverConfig::class => false, + \Docker\API\Model\MountTmpfsOptions::class => false, + \Docker\API\Model\RestartPolicy::class => false, + \Docker\API\Model\Resources::class => false, + \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class => false, + \Docker\API\Model\ResourcesUlimitsItem::class => false, + \Docker\API\Model\Limit::class => false, + \Docker\API\Model\ResourceObject::class => false, + \Docker\API\Model\GenericResourcesItem::class => false, + \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class => false, + \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class => false, + \Docker\API\Model\HealthConfig::class => false, + \Docker\API\Model\Health::class => false, + \Docker\API\Model\HealthcheckResult::class => false, + \Docker\API\Model\HostConfig::class => false, + \Docker\API\Model\HostConfigLogConfig::class => false, + \Docker\API\Model\ContainerConfig::class => false, + \Docker\API\Model\ImageConfig::class => false, + \Docker\API\Model\NetworkingConfig::class => false, + \Docker\API\Model\NetworkSettings::class => false, + \Docker\API\Model\Address::class => false, + \Docker\API\Model\PortBinding::class => false, + \Docker\API\Model\DriverData::class => false, + \Docker\API\Model\FilesystemChange::class => false, + \Docker\API\Model\ImageInspect::class => false, + \Docker\API\Model\ImageInspectRootFS::class => false, + \Docker\API\Model\ImageInspectMetadata::class => false, + \Docker\API\Model\ImageSummary::class => false, + \Docker\API\Model\AuthConfig::class => false, + \Docker\API\Model\ProcessConfig::class => false, + \Docker\API\Model\Volume::class => false, + \Docker\API\Model\VolumeUsageData::class => false, + \Docker\API\Model\VolumeCreateOptions::class => false, + \Docker\API\Model\VolumeListResponse::class => false, + \Docker\API\Model\Network::class => false, + \Docker\API\Model\ConfigReference::class => false, + \Docker\API\Model\IPAM::class => false, + \Docker\API\Model\IPAMConfig::class => false, + \Docker\API\Model\NetworkContainer::class => false, + \Docker\API\Model\PeerInfo::class => false, + \Docker\API\Model\NetworkCreateResponse::class => false, + \Docker\API\Model\BuildInfo::class => false, + \Docker\API\Model\BuildCache::class => false, + \Docker\API\Model\ImageID::class => false, + \Docker\API\Model\CreateImageInfo::class => false, + \Docker\API\Model\PushImageInfo::class => false, + \Docker\API\Model\ErrorDetail::class => false, + \Docker\API\Model\ProgressDetail::class => false, + \Docker\API\Model\ErrorResponse::class => false, + \Docker\API\Model\IdResponse::class => false, + \Docker\API\Model\EndpointSettings::class => false, + \Docker\API\Model\EndpointIPAMConfig::class => false, + \Docker\API\Model\PluginMount::class => false, + \Docker\API\Model\PluginDevice::class => false, + \Docker\API\Model\PluginEnv::class => false, + \Docker\API\Model\PluginInterfaceType::class => false, + \Docker\API\Model\PluginPrivilege::class => false, + \Docker\API\Model\Plugin::class => false, + \Docker\API\Model\PluginSettings::class => false, + \Docker\API\Model\PluginConfig::class => false, + \Docker\API\Model\PluginConfigInterface::class => false, + \Docker\API\Model\PluginConfigUser::class => false, + \Docker\API\Model\PluginConfigNetwork::class => false, + \Docker\API\Model\PluginConfigLinux::class => false, + \Docker\API\Model\PluginConfigArgs::class => false, + \Docker\API\Model\PluginConfigRootfs::class => false, + \Docker\API\Model\ObjectVersion::class => false, + \Docker\API\Model\NodeSpec::class => false, + \Docker\API\Model\Node::class => false, + \Docker\API\Model\NodeDescription::class => false, + \Docker\API\Model\Platform::class => false, + \Docker\API\Model\EngineDescription::class => false, + \Docker\API\Model\EngineDescriptionPluginsItem::class => false, + \Docker\API\Model\TLSInfo::class => false, + \Docker\API\Model\NodeStatus::class => false, + \Docker\API\Model\ManagerStatus::class => false, + \Docker\API\Model\SwarmSpec::class => false, + \Docker\API\Model\SwarmSpecOrchestration::class => false, + \Docker\API\Model\SwarmSpecRaft::class => false, + \Docker\API\Model\SwarmSpecDispatcher::class => false, + \Docker\API\Model\SwarmSpecCAConfig::class => false, + \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class => false, + \Docker\API\Model\SwarmSpecEncryptionConfig::class => false, + \Docker\API\Model\SwarmSpecTaskDefaults::class => false, + \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class => false, + \Docker\API\Model\ClusterInfo::class => false, + \Docker\API\Model\JoinTokens::class => false, + \Docker\API\Model\Swarm::class => false, + \Docker\API\Model\TaskSpec::class => false, + \Docker\API\Model\TaskSpecPluginSpec::class => false, + \Docker\API\Model\TaskSpecContainerSpec::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivileges::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class => false, + \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class => false, + \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class => false, + \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class => false, + \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class => false, + \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class => false, + \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class => false, + \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class => false, + \Docker\API\Model\TaskSpecResources::class => false, + \Docker\API\Model\TaskSpecRestartPolicy::class => false, + \Docker\API\Model\TaskSpecPlacement::class => false, + \Docker\API\Model\TaskSpecPlacementPreferencesItem::class => false, + \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class => false, + \Docker\API\Model\TaskSpecLogDriver::class => false, + \Docker\API\Model\ContainerStatus::class => false, + \Docker\API\Model\PortStatus::class => false, + \Docker\API\Model\TaskStatus::class => false, + \Docker\API\Model\Task::class => false, + \Docker\API\Model\ServiceSpec::class => false, + \Docker\API\Model\ServiceSpecMode::class => false, + \Docker\API\Model\ServiceSpecModeReplicated::class => false, + \Docker\API\Model\ServiceSpecModeReplicatedJob::class => false, + \Docker\API\Model\ServiceSpecUpdateConfig::class => false, + \Docker\API\Model\ServiceSpecRollbackConfig::class => false, + \Docker\API\Model\EndpointPortConfig::class => false, + \Docker\API\Model\EndpointSpec::class => false, + \Docker\API\Model\Service::class => false, + \Docker\API\Model\ServiceEndpoint::class => false, + \Docker\API\Model\ServiceEndpointVirtualIPsItem::class => false, + \Docker\API\Model\ServiceUpdateStatus::class => false, + \Docker\API\Model\ServiceServiceStatus::class => false, + \Docker\API\Model\ServiceJobStatus::class => false, + \Docker\API\Model\ImageDeleteResponseItem::class => false, + \Docker\API\Model\ServiceCreateResponse::class => false, + \Docker\API\Model\ServiceUpdateResponse::class => false, + \Docker\API\Model\ContainerSummary::class => false, + \Docker\API\Model\ContainerSummaryHostConfig::class => false, + \Docker\API\Model\ContainerSummaryNetworkSettings::class => false, + \Docker\API\Model\Driver::class => false, + \Docker\API\Model\SecretSpec::class => false, + \Docker\API\Model\Secret::class => false, + \Docker\API\Model\ConfigSpec::class => false, + \Docker\API\Model\Config::class => false, + \Docker\API\Model\ContainerState::class => false, + \Docker\API\Model\ContainerCreateResponse::class => false, + \Docker\API\Model\ContainerWaitResponse::class => false, + \Docker\API\Model\ContainerWaitExitError::class => false, + \Docker\API\Model\SystemVersion::class => false, + \Docker\API\Model\SystemVersionPlatform::class => false, + \Docker\API\Model\SystemVersionComponentsItem::class => false, + \Docker\API\Model\SystemInfo::class => false, + \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class => false, + \Docker\API\Model\ContainerdInfo::class => false, + \Docker\API\Model\ContainerdInfoNamespaces::class => false, + \Docker\API\Model\PluginsInfo::class => false, + \Docker\API\Model\RegistryServiceConfig::class => false, + \Docker\API\Model\IndexInfo::class => false, + \Docker\API\Model\Runtime::class => false, + \Docker\API\Model\Commit::class => false, + \Docker\API\Model\SwarmInfo::class => false, + \Docker\API\Model\PeerNode::class => false, + \Docker\API\Model\NetworkAttachmentConfig::class => false, + \Docker\API\Model\EventActor::class => false, + \Docker\API\Model\EventMessage::class => false, + \Docker\API\Model\OCIDescriptor::class => false, + \Docker\API\Model\OCIPlatform::class => false, + \Docker\API\Model\DistributionInspect::class => false, + \Docker\API\Model\ClusterVolume::class => false, + \Docker\API\Model\ClusterVolumeInfo::class => false, + \Docker\API\Model\ClusterVolumePublishStatusItem::class => false, + \Docker\API\Model\ClusterVolumeSpec::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessMode::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class => false, + \Docker\API\Model\ImageManifestSummary::class => false, + \Docker\API\Model\ImageManifestSummarySize::class => false, + \Docker\API\Model\ImageManifestSummaryImageData::class => false, + \Docker\API\Model\ImageManifestSummaryImageDataSize::class => false, + \Docker\API\Model\ImageManifestSummaryAttestationData::class => false, + \Docker\API\Model\ContainersCreatePostBody::class => false, + \Docker\API\Model\ContainersIdJsonGetResponse200::class => false, + \Docker\API\Model\ContainersIdTopGetResponse200::class => false, + \Docker\API\Model\ContainersIdUpdatePostBody::class => false, + \Docker\API\Model\ContainersIdUpdatePostResponse200::class => false, + \Docker\API\Model\ContainersPrunePostResponse200::class => false, + \Docker\API\Model\BuildPrunePostResponse200::class => false, + \Docker\API\Model\ImagesNameHistoryGetResponse200Item::class => false, + \Docker\API\Model\ImagesSearchGetResponse200Item::class => false, + \Docker\API\Model\ImagesPrunePostResponse200::class => false, + \Docker\API\Model\AuthPostResponse200::class => false, + \Docker\API\Model\SystemDfGetResponse200::class => false, + \Docker\API\Model\ContainersIdExecPostBody::class => false, + \Docker\API\Model\ExecIdStartPostBody::class => false, + \Docker\API\Model\ExecIdJsonGetResponse200::class => false, + \Docker\API\Model\VolumesNamePutBody::class => false, + \Docker\API\Model\VolumesPrunePostResponse200::class => false, + \Docker\API\Model\NetworksCreatePostBody::class => false, + \Docker\API\Model\NetworksIdConnectPostBody::class => false, + \Docker\API\Model\NetworksIdDisconnectPostBody::class => false, + \Docker\API\Model\NetworksPrunePostResponse200::class => false, + \Docker\API\Model\SwarmInitPostBody::class => false, + \Docker\API\Model\SwarmJoinPostBody::class => false, + \Docker\API\Model\SwarmUnlockkeyGetResponse200::class => false, + \Docker\API\Model\SwarmUnlockPostBody::class => false, + \Docker\API\Model\ServicesCreatePostBody::class => false, + \Docker\API\Model\ServicesIdUpdatePostBody::class => false, + \Docker\API\Model\SecretsCreatePostBody::class => false, + \Docker\API\Model\ConfigsCreatePostBody::class => false, + \Jane\Component\JsonSchemaRuntime\Reference::class => false, + ]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/JoinTokensNormalizer.php b/generated/Normalizer/JoinTokensNormalizer.php new file mode 100644 index 00000000..69063873 --- /dev/null +++ b/generated/Normalizer/JoinTokensNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class JoinTokensNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\JoinTokens::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\JoinTokens::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\JoinTokens(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Worker', $data) && $data['Worker'] !== null) { + $object->setWorker($data['Worker']); + } + elseif (\array_key_exists('Worker', $data) && $data['Worker'] === null) { + $object->setWorker(null); + } + if (\array_key_exists('Manager', $data) && $data['Manager'] !== null) { + $object->setManager($data['Manager']); + } + elseif (\array_key_exists('Manager', $data) && $data['Manager'] === null) { + $object->setManager(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('worker') && null !== $object->getWorker()) { + $data['Worker'] = $object->getWorker(); + } + if ($object->isInitialized('manager') && null !== $object->getManager()) { + $data['Manager'] = $object->getManager(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\JoinTokens::class => false]; + } + } +} else { + class JoinTokensNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\JoinTokens::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\JoinTokens::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\JoinTokens(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Worker', $data) && $data['Worker'] !== null) { + $object->setWorker($data['Worker']); + } + elseif (\array_key_exists('Worker', $data) && $data['Worker'] === null) { + $object->setWorker(null); + } + if (\array_key_exists('Manager', $data) && $data['Manager'] !== null) { + $object->setManager($data['Manager']); + } + elseif (\array_key_exists('Manager', $data) && $data['Manager'] === null) { + $object->setManager(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('worker') && null !== $object->getWorker()) { + $data['Worker'] = $object->getWorker(); + } + if ($object->isInitialized('manager') && null !== $object->getManager()) { + $data['Manager'] = $object->getManager(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\JoinTokens::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/LimitNormalizer.php b/generated/Normalizer/LimitNormalizer.php new file mode 100644 index 00000000..6580fd26 --- /dev/null +++ b/generated/Normalizer/LimitNormalizer.php @@ -0,0 +1,154 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class LimitNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Limit::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Limit::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Limit(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NanoCPUs', $data) && $data['NanoCPUs'] !== null) { + $object->setNanoCPUs($data['NanoCPUs']); + } + elseif (\array_key_exists('NanoCPUs', $data) && $data['NanoCPUs'] === null) { + $object->setNanoCPUs(null); + } + if (\array_key_exists('MemoryBytes', $data) && $data['MemoryBytes'] !== null) { + $object->setMemoryBytes($data['MemoryBytes']); + } + elseif (\array_key_exists('MemoryBytes', $data) && $data['MemoryBytes'] === null) { + $object->setMemoryBytes(null); + } + if (\array_key_exists('Pids', $data) && $data['Pids'] !== null) { + $object->setPids($data['Pids']); + } + elseif (\array_key_exists('Pids', $data) && $data['Pids'] === null) { + $object->setPids(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('nanoCPUs') && null !== $object->getNanoCPUs()) { + $data['NanoCPUs'] = $object->getNanoCPUs(); + } + if ($object->isInitialized('memoryBytes') && null !== $object->getMemoryBytes()) { + $data['MemoryBytes'] = $object->getMemoryBytes(); + } + if ($object->isInitialized('pids') && null !== $object->getPids()) { + $data['Pids'] = $object->getPids(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Limit::class => false]; + } + } +} else { + class LimitNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Limit::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Limit::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Limit(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NanoCPUs', $data) && $data['NanoCPUs'] !== null) { + $object->setNanoCPUs($data['NanoCPUs']); + } + elseif (\array_key_exists('NanoCPUs', $data) && $data['NanoCPUs'] === null) { + $object->setNanoCPUs(null); + } + if (\array_key_exists('MemoryBytes', $data) && $data['MemoryBytes'] !== null) { + $object->setMemoryBytes($data['MemoryBytes']); + } + elseif (\array_key_exists('MemoryBytes', $data) && $data['MemoryBytes'] === null) { + $object->setMemoryBytes(null); + } + if (\array_key_exists('Pids', $data) && $data['Pids'] !== null) { + $object->setPids($data['Pids']); + } + elseif (\array_key_exists('Pids', $data) && $data['Pids'] === null) { + $object->setPids(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('nanoCPUs') && null !== $object->getNanoCPUs()) { + $data['NanoCPUs'] = $object->getNanoCPUs(); + } + if ($object->isInitialized('memoryBytes') && null !== $object->getMemoryBytes()) { + $data['MemoryBytes'] = $object->getMemoryBytes(); + } + if ($object->isInitialized('pids') && null !== $object->getPids()) { + $data['Pids'] = $object->getPids(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Limit::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/LogConfigNormalizer.php b/generated/Normalizer/LogConfigNormalizer.php deleted file mode 100644 index fa5d6992..00000000 --- a/generated/Normalizer/LogConfigNormalizer.php +++ /dev/null @@ -1,83 +0,0 @@ -setType($data->{'Type'}); - } - if (property_exists($data, 'Config')) { - $value = $data->{'Config'}; - if (is_object($data->{'Config'})) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Config'} as $key => $value_1) { - $values[$key] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Config'})) { - $value = $data->{'Config'}; - } - $object->setConfig($value); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); - } - $value = $object->getConfig(); - if (is_object($object->getConfig())) { - $values = new \stdClass(); - foreach ($object->getConfig() as $key => $value_1) { - $values->{$key} = $value_1; - } - $value = $values; - } - if (is_null($object->getConfig())) { - $value = $object->getConfig(); - } - $data->{'Config'} = $value; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ManagerStatusNormalizer.php b/generated/Normalizer/ManagerStatusNormalizer.php new file mode 100644 index 00000000..33033741 --- /dev/null +++ b/generated/Normalizer/ManagerStatusNormalizer.php @@ -0,0 +1,154 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ManagerStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ManagerStatus::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ManagerStatus::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ManagerStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Leader', $data) && $data['Leader'] !== null) { + $object->setLeader($data['Leader']); + } + elseif (\array_key_exists('Leader', $data) && $data['Leader'] === null) { + $object->setLeader(null); + } + if (\array_key_exists('Reachability', $data) && $data['Reachability'] !== null) { + $object->setReachability($data['Reachability']); + } + elseif (\array_key_exists('Reachability', $data) && $data['Reachability'] === null) { + $object->setReachability(null); + } + if (\array_key_exists('Addr', $data) && $data['Addr'] !== null) { + $object->setAddr($data['Addr']); + } + elseif (\array_key_exists('Addr', $data) && $data['Addr'] === null) { + $object->setAddr(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('leader') && null !== $object->getLeader()) { + $data['Leader'] = $object->getLeader(); + } + if ($object->isInitialized('reachability') && null !== $object->getReachability()) { + $data['Reachability'] = $object->getReachability(); + } + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ManagerStatus::class => false]; + } + } +} else { + class ManagerStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ManagerStatus::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ManagerStatus::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ManagerStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Leader', $data) && $data['Leader'] !== null) { + $object->setLeader($data['Leader']); + } + elseif (\array_key_exists('Leader', $data) && $data['Leader'] === null) { + $object->setLeader(null); + } + if (\array_key_exists('Reachability', $data) && $data['Reachability'] !== null) { + $object->setReachability($data['Reachability']); + } + elseif (\array_key_exists('Reachability', $data) && $data['Reachability'] === null) { + $object->setReachability(null); + } + if (\array_key_exists('Addr', $data) && $data['Addr'] !== null) { + $object->setAddr($data['Addr']); + } + elseif (\array_key_exists('Addr', $data) && $data['Addr'] === null) { + $object->setAddr(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('leader') && null !== $object->getLeader()) { + $data['Leader'] = $object->getLeader(); + } + if ($object->isInitialized('reachability') && null !== $object->getReachability()) { + $data['Reachability'] = $object->getReachability(); + } + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ManagerStatus::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/MountBindOptionsNormalizer.php b/generated/Normalizer/MountBindOptionsNormalizer.php new file mode 100644 index 00000000..206a9d6e --- /dev/null +++ b/generated/Normalizer/MountBindOptionsNormalizer.php @@ -0,0 +1,190 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MountBindOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\MountBindOptions::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\MountBindOptions::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\MountBindOptions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Propagation', $data) && $data['Propagation'] !== null) { + $object->setPropagation($data['Propagation']); + } + elseif (\array_key_exists('Propagation', $data) && $data['Propagation'] === null) { + $object->setPropagation(null); + } + if (\array_key_exists('NonRecursive', $data) && $data['NonRecursive'] !== null) { + $object->setNonRecursive($data['NonRecursive']); + } + elseif (\array_key_exists('NonRecursive', $data) && $data['NonRecursive'] === null) { + $object->setNonRecursive(null); + } + if (\array_key_exists('CreateMountpoint', $data) && $data['CreateMountpoint'] !== null) { + $object->setCreateMountpoint($data['CreateMountpoint']); + } + elseif (\array_key_exists('CreateMountpoint', $data) && $data['CreateMountpoint'] === null) { + $object->setCreateMountpoint(null); + } + if (\array_key_exists('ReadOnlyNonRecursive', $data) && $data['ReadOnlyNonRecursive'] !== null) { + $object->setReadOnlyNonRecursive($data['ReadOnlyNonRecursive']); + } + elseif (\array_key_exists('ReadOnlyNonRecursive', $data) && $data['ReadOnlyNonRecursive'] === null) { + $object->setReadOnlyNonRecursive(null); + } + if (\array_key_exists('ReadOnlyForceRecursive', $data) && $data['ReadOnlyForceRecursive'] !== null) { + $object->setReadOnlyForceRecursive($data['ReadOnlyForceRecursive']); + } + elseif (\array_key_exists('ReadOnlyForceRecursive', $data) && $data['ReadOnlyForceRecursive'] === null) { + $object->setReadOnlyForceRecursive(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('propagation') && null !== $object->getPropagation()) { + $data['Propagation'] = $object->getPropagation(); + } + if ($object->isInitialized('nonRecursive') && null !== $object->getNonRecursive()) { + $data['NonRecursive'] = $object->getNonRecursive(); + } + if ($object->isInitialized('createMountpoint') && null !== $object->getCreateMountpoint()) { + $data['CreateMountpoint'] = $object->getCreateMountpoint(); + } + if ($object->isInitialized('readOnlyNonRecursive') && null !== $object->getReadOnlyNonRecursive()) { + $data['ReadOnlyNonRecursive'] = $object->getReadOnlyNonRecursive(); + } + if ($object->isInitialized('readOnlyForceRecursive') && null !== $object->getReadOnlyForceRecursive()) { + $data['ReadOnlyForceRecursive'] = $object->getReadOnlyForceRecursive(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountBindOptions::class => false]; + } + } +} else { + class MountBindOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\MountBindOptions::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\MountBindOptions::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\MountBindOptions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Propagation', $data) && $data['Propagation'] !== null) { + $object->setPropagation($data['Propagation']); + } + elseif (\array_key_exists('Propagation', $data) && $data['Propagation'] === null) { + $object->setPropagation(null); + } + if (\array_key_exists('NonRecursive', $data) && $data['NonRecursive'] !== null) { + $object->setNonRecursive($data['NonRecursive']); + } + elseif (\array_key_exists('NonRecursive', $data) && $data['NonRecursive'] === null) { + $object->setNonRecursive(null); + } + if (\array_key_exists('CreateMountpoint', $data) && $data['CreateMountpoint'] !== null) { + $object->setCreateMountpoint($data['CreateMountpoint']); + } + elseif (\array_key_exists('CreateMountpoint', $data) && $data['CreateMountpoint'] === null) { + $object->setCreateMountpoint(null); + } + if (\array_key_exists('ReadOnlyNonRecursive', $data) && $data['ReadOnlyNonRecursive'] !== null) { + $object->setReadOnlyNonRecursive($data['ReadOnlyNonRecursive']); + } + elseif (\array_key_exists('ReadOnlyNonRecursive', $data) && $data['ReadOnlyNonRecursive'] === null) { + $object->setReadOnlyNonRecursive(null); + } + if (\array_key_exists('ReadOnlyForceRecursive', $data) && $data['ReadOnlyForceRecursive'] !== null) { + $object->setReadOnlyForceRecursive($data['ReadOnlyForceRecursive']); + } + elseif (\array_key_exists('ReadOnlyForceRecursive', $data) && $data['ReadOnlyForceRecursive'] === null) { + $object->setReadOnlyForceRecursive(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('propagation') && null !== $object->getPropagation()) { + $data['Propagation'] = $object->getPropagation(); + } + if ($object->isInitialized('nonRecursive') && null !== $object->getNonRecursive()) { + $data['NonRecursive'] = $object->getNonRecursive(); + } + if ($object->isInitialized('createMountpoint') && null !== $object->getCreateMountpoint()) { + $data['CreateMountpoint'] = $object->getCreateMountpoint(); + } + if ($object->isInitialized('readOnlyNonRecursive') && null !== $object->getReadOnlyNonRecursive()) { + $data['ReadOnlyNonRecursive'] = $object->getReadOnlyNonRecursive(); + } + if ($object->isInitialized('readOnlyForceRecursive') && null !== $object->getReadOnlyForceRecursive()) { + $data['ReadOnlyForceRecursive'] = $object->getReadOnlyForceRecursive(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountBindOptions::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/MountNormalizer.php b/generated/Normalizer/MountNormalizer.php index 1ab0025f..941d010d 100644 --- a/generated/Normalizer/MountNormalizer.php +++ b/generated/Normalizer/MountNormalizer.php @@ -2,92 +2,243 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class MountNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\Mount') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MountNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\Mount) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Mount::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Mount::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Mount(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Target', $data) && $data['Target'] !== null) { + $object->setTarget($data['Target']); + } + elseif (\array_key_exists('Target', $data) && $data['Target'] === null) { + $object->setTarget(null); + } + if (\array_key_exists('Source', $data) && $data['Source'] !== null) { + $object->setSource($data['Source']); + } + elseif (\array_key_exists('Source', $data) && $data['Source'] === null) { + $object->setSource(null); + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('ReadOnly', $data) && $data['ReadOnly'] !== null) { + $object->setReadOnly($data['ReadOnly']); + } + elseif (\array_key_exists('ReadOnly', $data) && $data['ReadOnly'] === null) { + $object->setReadOnly(null); + } + if (\array_key_exists('Consistency', $data) && $data['Consistency'] !== null) { + $object->setConsistency($data['Consistency']); + } + elseif (\array_key_exists('Consistency', $data) && $data['Consistency'] === null) { + $object->setConsistency(null); + } + if (\array_key_exists('BindOptions', $data) && $data['BindOptions'] !== null) { + $object->setBindOptions($this->denormalizer->denormalize($data['BindOptions'], \Docker\API\Model\MountBindOptions::class, 'json', $context)); + } + elseif (\array_key_exists('BindOptions', $data) && $data['BindOptions'] === null) { + $object->setBindOptions(null); + } + if (\array_key_exists('VolumeOptions', $data) && $data['VolumeOptions'] !== null) { + $object->setVolumeOptions($this->denormalizer->denormalize($data['VolumeOptions'], \Docker\API\Model\MountVolumeOptions::class, 'json', $context)); + } + elseif (\array_key_exists('VolumeOptions', $data) && $data['VolumeOptions'] === null) { + $object->setVolumeOptions(null); + } + if (\array_key_exists('TmpfsOptions', $data) && $data['TmpfsOptions'] !== null) { + $object->setTmpfsOptions($this->denormalizer->denormalize($data['TmpfsOptions'], \Docker\API\Model\MountTmpfsOptions::class, 'json', $context)); + } + elseif (\array_key_exists('TmpfsOptions', $data) && $data['TmpfsOptions'] === null) { + $object->setTmpfsOptions(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('target') && null !== $object->getTarget()) { + $data['Target'] = $object->getTarget(); + } + if ($object->isInitialized('source') && null !== $object->getSource()) { + $data['Source'] = $object->getSource(); + } + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('readOnly') && null !== $object->getReadOnly()) { + $data['ReadOnly'] = $object->getReadOnly(); + } + if ($object->isInitialized('consistency') && null !== $object->getConsistency()) { + $data['Consistency'] = $object->getConsistency(); + } + if ($object->isInitialized('bindOptions') && null !== $object->getBindOptions()) { + $data['BindOptions'] = $this->normalizer->normalize($object->getBindOptions(), 'json', $context); + } + if ($object->isInitialized('volumeOptions') && null !== $object->getVolumeOptions()) { + $data['VolumeOptions'] = $this->normalizer->normalize($object->getVolumeOptions(), 'json', $context); + } + if ($object->isInitialized('tmpfsOptions') && null !== $object->getTmpfsOptions()) { + $data['TmpfsOptions'] = $this->normalizer->normalize($object->getTmpfsOptions(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Mount::class => false]; } - - return false; } - - public function denormalize($data, $class, $format = null, array $context = []) +} else { + class MountNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\Mount(); - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Source')) { - $object->setSource($data->{'Source'}); - } - if (property_exists($data, 'Destination')) { - $object->setDestination($data->{'Destination'}); - } - if (property_exists($data, 'Driver')) { - $object->setDriver($data->{'Driver'}); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Mount::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Mount::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Mount(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Target', $data) && $data['Target'] !== null) { + $object->setTarget($data['Target']); + } + elseif (\array_key_exists('Target', $data) && $data['Target'] === null) { + $object->setTarget(null); + } + if (\array_key_exists('Source', $data) && $data['Source'] !== null) { + $object->setSource($data['Source']); + } + elseif (\array_key_exists('Source', $data) && $data['Source'] === null) { + $object->setSource(null); + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('ReadOnly', $data) && $data['ReadOnly'] !== null) { + $object->setReadOnly($data['ReadOnly']); + } + elseif (\array_key_exists('ReadOnly', $data) && $data['ReadOnly'] === null) { + $object->setReadOnly(null); + } + if (\array_key_exists('Consistency', $data) && $data['Consistency'] !== null) { + $object->setConsistency($data['Consistency']); + } + elseif (\array_key_exists('Consistency', $data) && $data['Consistency'] === null) { + $object->setConsistency(null); + } + if (\array_key_exists('BindOptions', $data) && $data['BindOptions'] !== null) { + $object->setBindOptions($this->denormalizer->denormalize($data['BindOptions'], \Docker\API\Model\MountBindOptions::class, 'json', $context)); + } + elseif (\array_key_exists('BindOptions', $data) && $data['BindOptions'] === null) { + $object->setBindOptions(null); + } + if (\array_key_exists('VolumeOptions', $data) && $data['VolumeOptions'] !== null) { + $object->setVolumeOptions($this->denormalizer->denormalize($data['VolumeOptions'], \Docker\API\Model\MountVolumeOptions::class, 'json', $context)); + } + elseif (\array_key_exists('VolumeOptions', $data) && $data['VolumeOptions'] === null) { + $object->setVolumeOptions(null); + } + if (\array_key_exists('TmpfsOptions', $data) && $data['TmpfsOptions'] !== null) { + $object->setTmpfsOptions($this->denormalizer->denormalize($data['TmpfsOptions'], \Docker\API\Model\MountTmpfsOptions::class, 'json', $context)); + } + elseif (\array_key_exists('TmpfsOptions', $data) && $data['TmpfsOptions'] === null) { + $object->setTmpfsOptions(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('target') && null !== $object->getTarget()) { + $data['Target'] = $object->getTarget(); + } + if ($object->isInitialized('source') && null !== $object->getSource()) { + $data['Source'] = $object->getSource(); + } + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('readOnly') && null !== $object->getReadOnly()) { + $data['ReadOnly'] = $object->getReadOnly(); + } + if ($object->isInitialized('consistency') && null !== $object->getConsistency()) { + $data['Consistency'] = $object->getConsistency(); + } + if ($object->isInitialized('bindOptions') && null !== $object->getBindOptions()) { + $data['BindOptions'] = $this->normalizer->normalize($object->getBindOptions(), 'json', $context); + } + if ($object->isInitialized('volumeOptions') && null !== $object->getVolumeOptions()) { + $data['VolumeOptions'] = $this->normalizer->normalize($object->getVolumeOptions(), 'json', $context); + } + if ($object->isInitialized('tmpfsOptions') && null !== $object->getTmpfsOptions()) { + $data['TmpfsOptions'] = $this->normalizer->normalize($object->getTmpfsOptions(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Mount::class => false]; } - if (property_exists($data, 'Mode')) { - $object->setMode($data->{'Mode'}); - } - if (property_exists($data, 'RW')) { - $object->setRW($data->{'RW'}); - } - if (property_exists($data, 'Propagation')) { - $object->setPropagation($data->{'Propagation'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getSource()) { - $data->{'Source'} = $object->getSource(); - } - if (null !== $object->getDestination()) { - $data->{'Destination'} = $object->getDestination(); - } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); - } - if (null !== $object->getMode()) { - $data->{'Mode'} = $object->getMode(); - } - if (null !== $object->getRW()) { - $data->{'RW'} = $object->getRW(); - } - if (null !== $object->getPropagation()) { - $data->{'Propagation'} = $object->getPropagation(); - } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/MountPointNormalizer.php b/generated/Normalizer/MountPointNormalizer.php new file mode 100644 index 00000000..17128caa --- /dev/null +++ b/generated/Normalizer/MountPointNormalizer.php @@ -0,0 +1,244 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MountPointNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\MountPoint::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\MountPoint::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\MountPoint(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Source', $data) && $data['Source'] !== null) { + $object->setSource($data['Source']); + } + elseif (\array_key_exists('Source', $data) && $data['Source'] === null) { + $object->setSource(null); + } + if (\array_key_exists('Destination', $data) && $data['Destination'] !== null) { + $object->setDestination($data['Destination']); + } + elseif (\array_key_exists('Destination', $data) && $data['Destination'] === null) { + $object->setDestination(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('RW', $data) && $data['RW'] !== null) { + $object->setRW($data['RW']); + } + elseif (\array_key_exists('RW', $data) && $data['RW'] === null) { + $object->setRW(null); + } + if (\array_key_exists('Propagation', $data) && $data['Propagation'] !== null) { + $object->setPropagation($data['Propagation']); + } + elseif (\array_key_exists('Propagation', $data) && $data['Propagation'] === null) { + $object->setPropagation(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('source') && null !== $object->getSource()) { + $data['Source'] = $object->getSource(); + } + if ($object->isInitialized('destination') && null !== $object->getDestination()) { + $data['Destination'] = $object->getDestination(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + if ($object->isInitialized('rW') && null !== $object->getRW()) { + $data['RW'] = $object->getRW(); + } + if ($object->isInitialized('propagation') && null !== $object->getPropagation()) { + $data['Propagation'] = $object->getPropagation(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountPoint::class => false]; + } + } +} else { + class MountPointNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\MountPoint::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\MountPoint::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\MountPoint(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Source', $data) && $data['Source'] !== null) { + $object->setSource($data['Source']); + } + elseif (\array_key_exists('Source', $data) && $data['Source'] === null) { + $object->setSource(null); + } + if (\array_key_exists('Destination', $data) && $data['Destination'] !== null) { + $object->setDestination($data['Destination']); + } + elseif (\array_key_exists('Destination', $data) && $data['Destination'] === null) { + $object->setDestination(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('RW', $data) && $data['RW'] !== null) { + $object->setRW($data['RW']); + } + elseif (\array_key_exists('RW', $data) && $data['RW'] === null) { + $object->setRW(null); + } + if (\array_key_exists('Propagation', $data) && $data['Propagation'] !== null) { + $object->setPropagation($data['Propagation']); + } + elseif (\array_key_exists('Propagation', $data) && $data['Propagation'] === null) { + $object->setPropagation(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('source') && null !== $object->getSource()) { + $data['Source'] = $object->getSource(); + } + if ($object->isInitialized('destination') && null !== $object->getDestination()) { + $data['Destination'] = $object->getDestination(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + if ($object->isInitialized('rW') && null !== $object->getRW()) { + $data['RW'] = $object->getRW(); + } + if ($object->isInitialized('propagation') && null !== $object->getPropagation()) { + $data['Propagation'] = $object->getPropagation(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountPoint::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/MountTmpfsOptionsNormalizer.php b/generated/Normalizer/MountTmpfsOptionsNormalizer.php new file mode 100644 index 00000000..8588f3a2 --- /dev/null +++ b/generated/Normalizer/MountTmpfsOptionsNormalizer.php @@ -0,0 +1,186 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MountTmpfsOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\MountTmpfsOptions::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\MountTmpfsOptions::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\MountTmpfsOptions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('SizeBytes', $data) && $data['SizeBytes'] !== null) { + $object->setSizeBytes($data['SizeBytes']); + } + elseif (\array_key_exists('SizeBytes', $data) && $data['SizeBytes'] === null) { + $object->setSizeBytes(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = []; + foreach ($data['Options'] as $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $value_1; + } + $values[] = $values_1; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('sizeBytes') && null !== $object->getSizeBytes()) { + $data['SizeBytes'] = $object->getSizeBytes(); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $value_1; + } + $values[] = $values_1; + } + $data['Options'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountTmpfsOptions::class => false]; + } + } +} else { + class MountTmpfsOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\MountTmpfsOptions::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\MountTmpfsOptions::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\MountTmpfsOptions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('SizeBytes', $data) && $data['SizeBytes'] !== null) { + $object->setSizeBytes($data['SizeBytes']); + } + elseif (\array_key_exists('SizeBytes', $data) && $data['SizeBytes'] === null) { + $object->setSizeBytes(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = []; + foreach ($data['Options'] as $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $value_1; + } + $values[] = $values_1; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('sizeBytes') && null !== $object->getSizeBytes()) { + $data['SizeBytes'] = $object->getSizeBytes(); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $value_1; + } + $values[] = $values_1; + } + $data['Options'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountTmpfsOptions::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/MountVolumeOptionsDriverConfigNormalizer.php b/generated/Normalizer/MountVolumeOptionsDriverConfigNormalizer.php new file mode 100644 index 00000000..d569a981 --- /dev/null +++ b/generated/Normalizer/MountVolumeOptionsDriverConfigNormalizer.php @@ -0,0 +1,152 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MountVolumeOptionsDriverConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\MountVolumeOptionsDriverConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\MountVolumeOptionsDriverConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\MountVolumeOptionsDriverConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { + $values[$key] = $value; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $key => $value) { + $values[$key] = $value; + } + $data['Options'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountVolumeOptionsDriverConfig::class => false]; + } + } +} else { + class MountVolumeOptionsDriverConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\MountVolumeOptionsDriverConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\MountVolumeOptionsDriverConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\MountVolumeOptionsDriverConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { + $values[$key] = $value; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $key => $value) { + $values[$key] = $value; + } + $data['Options'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountVolumeOptionsDriverConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/MountVolumeOptionsNormalizer.php b/generated/Normalizer/MountVolumeOptionsNormalizer.php new file mode 100644 index 00000000..1234e20e --- /dev/null +++ b/generated/Normalizer/MountVolumeOptionsNormalizer.php @@ -0,0 +1,188 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MountVolumeOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\MountVolumeOptions::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\MountVolumeOptions::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\MountVolumeOptions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NoCopy', $data) && $data['NoCopy'] !== null) { + $object->setNoCopy($data['NoCopy']); + } + elseif (\array_key_exists('NoCopy', $data) && $data['NoCopy'] === null) { + $object->setNoCopy(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('DriverConfig', $data) && $data['DriverConfig'] !== null) { + $object->setDriverConfig($this->denormalizer->denormalize($data['DriverConfig'], \Docker\API\Model\MountVolumeOptionsDriverConfig::class, 'json', $context)); + } + elseif (\array_key_exists('DriverConfig', $data) && $data['DriverConfig'] === null) { + $object->setDriverConfig(null); + } + if (\array_key_exists('Subpath', $data) && $data['Subpath'] !== null) { + $object->setSubpath($data['Subpath']); + } + elseif (\array_key_exists('Subpath', $data) && $data['Subpath'] === null) { + $object->setSubpath(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('noCopy') && null !== $object->getNoCopy()) { + $data['NoCopy'] = $object->getNoCopy(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('driverConfig') && null !== $object->getDriverConfig()) { + $data['DriverConfig'] = $this->normalizer->normalize($object->getDriverConfig(), 'json', $context); + } + if ($object->isInitialized('subpath') && null !== $object->getSubpath()) { + $data['Subpath'] = $object->getSubpath(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountVolumeOptions::class => false]; + } + } +} else { + class MountVolumeOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\MountVolumeOptions::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\MountVolumeOptions::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\MountVolumeOptions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NoCopy', $data) && $data['NoCopy'] !== null) { + $object->setNoCopy($data['NoCopy']); + } + elseif (\array_key_exists('NoCopy', $data) && $data['NoCopy'] === null) { + $object->setNoCopy(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('DriverConfig', $data) && $data['DriverConfig'] !== null) { + $object->setDriverConfig($this->denormalizer->denormalize($data['DriverConfig'], \Docker\API\Model\MountVolumeOptionsDriverConfig::class, 'json', $context)); + } + elseif (\array_key_exists('DriverConfig', $data) && $data['DriverConfig'] === null) { + $object->setDriverConfig(null); + } + if (\array_key_exists('Subpath', $data) && $data['Subpath'] !== null) { + $object->setSubpath($data['Subpath']); + } + elseif (\array_key_exists('Subpath', $data) && $data['Subpath'] === null) { + $object->setSubpath(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('noCopy') && null !== $object->getNoCopy()) { + $data['NoCopy'] = $object->getNoCopy(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('driverConfig') && null !== $object->getDriverConfig()) { + $data['DriverConfig'] = $this->normalizer->normalize($object->getDriverConfig(), 'json', $context); + } + if ($object->isInitialized('subpath') && null !== $object->getSubpath()) { + $data['Subpath'] = $object->getSubpath(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountVolumeOptions::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/NetworkAttachmentConfigNormalizer.php b/generated/Normalizer/NetworkAttachmentConfigNormalizer.php index 95d7c958..fc7c5d6d 100644 --- a/generated/Normalizer/NetworkAttachmentConfigNormalizer.php +++ b/generated/Normalizer/NetworkAttachmentConfigNormalizer.php @@ -2,81 +2,185 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class NetworkAttachmentConfigNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NetworkAttachmentConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\NetworkAttachmentConfig') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworkAttachmentConfig::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\NetworkAttachmentConfig) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworkAttachmentConfig::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\NetworkAttachmentConfig(); - if (property_exists($data, 'Target')) { - $object->setTarget($data->{'Target'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworkAttachmentConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Target', $data) && $data['Target'] !== null) { + $object->setTarget($data['Target']); + } + elseif (\array_key_exists('Target', $data) && $data['Target'] === null) { + $object->setTarget(null); + } + if (\array_key_exists('Aliases', $data) && $data['Aliases'] !== null) { + $values = []; + foreach ($data['Aliases'] as $value) { + $values[] = $value; + } + $object->setAliases($values); + } + elseif (\array_key_exists('Aliases', $data) && $data['Aliases'] === null) { + $object->setAliases(null); + } + if (\array_key_exists('DriverOpts', $data) && $data['DriverOpts'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['DriverOpts'] as $key => $value_1) { + $values_1[$key] = $value_1; + } + $object->setDriverOpts($values_1); + } + elseif (\array_key_exists('DriverOpts', $data) && $data['DriverOpts'] === null) { + $object->setDriverOpts(null); + } + return $object; } - if (property_exists($data, 'Aliases')) { - $value = $data->{'Aliases'}; - if (is_array($data->{'Aliases'})) { + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('target') && null !== $object->getTarget()) { + $data['Target'] = $object->getTarget(); + } + if ($object->isInitialized('aliases') && null !== $object->getAliases()) { $values = []; - foreach ($data->{'Aliases'} as $value_1) { - $values[] = $value_1; + foreach ($object->getAliases() as $value) { + $values[] = $value; } - $value = $values; + $data['Aliases'] = $values; } - if (is_null($data->{'Aliases'})) { - $value = $data->{'Aliases'}; + if ($object->isInitialized('driverOpts') && null !== $object->getDriverOpts()) { + $values_1 = []; + foreach ($object->getDriverOpts() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $data['DriverOpts'] = $values_1; } - $object->setAliases($value); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkAttachmentConfig::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class NetworkAttachmentConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getTarget()) { - $data->{'Target'} = $object->getTarget(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworkAttachmentConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworkAttachmentConfig::class; } - $value = $object->getAliases(); - if (is_array($object->getAliases())) { - $values = []; - foreach ($object->getAliases() as $value_1) { - $values[] = $value_1; + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworkAttachmentConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Target', $data) && $data['Target'] !== null) { + $object->setTarget($data['Target']); + } + elseif (\array_key_exists('Target', $data) && $data['Target'] === null) { + $object->setTarget(null); + } + if (\array_key_exists('Aliases', $data) && $data['Aliases'] !== null) { + $values = []; + foreach ($data['Aliases'] as $value) { + $values[] = $value; + } + $object->setAliases($values); } - $value = $values; + elseif (\array_key_exists('Aliases', $data) && $data['Aliases'] === null) { + $object->setAliases(null); + } + if (\array_key_exists('DriverOpts', $data) && $data['DriverOpts'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['DriverOpts'] as $key => $value_1) { + $values_1[$key] = $value_1; + } + $object->setDriverOpts($values_1); + } + elseif (\array_key_exists('DriverOpts', $data) && $data['DriverOpts'] === null) { + $object->setDriverOpts(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('target') && null !== $object->getTarget()) { + $data['Target'] = $object->getTarget(); + } + if ($object->isInitialized('aliases') && null !== $object->getAliases()) { + $values = []; + foreach ($object->getAliases() as $value) { + $values[] = $value; + } + $data['Aliases'] = $values; + } + if ($object->isInitialized('driverOpts') && null !== $object->getDriverOpts()) { + $values_1 = []; + foreach ($object->getDriverOpts() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $data['DriverOpts'] = $values_1; + } + return $data; } - if (is_null($object->getAliases())) { - $value = $object->getAliases(); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkAttachmentConfig::class => false]; } - $data->{'Aliases'} = $value; - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/NetworkAttachmentNormalizer.php b/generated/Normalizer/NetworkAttachmentNormalizer.php deleted file mode 100644 index 78905031..00000000 --- a/generated/Normalizer/NetworkAttachmentNormalizer.php +++ /dev/null @@ -1,82 +0,0 @@ -setNetwork($this->serializer->denormalize($data->{'Network'}, 'Docker\\API\\Model\\SwarmNetwork', 'raw', $context)); - } - if (property_exists($data, 'Addresses')) { - $value = $data->{'Addresses'}; - if (is_array($data->{'Addresses'})) { - $values = []; - foreach ($data->{'Addresses'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Addresses'})) { - $value = $data->{'Addresses'}; - } - $object->setAddresses($value); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getNetwork()) { - $data->{'Network'} = json_decode($this->serializer->normalize($object->getNetwork())); - } - $value = $object->getAddresses(); - if (is_array($object->getAddresses())) { - $values = []; - foreach ($object->getAddresses() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getAddresses())) { - $value = $object->getAddresses(); - } - $data->{'Addresses'} = $value; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/NetworkConfigNormalizer.php b/generated/Normalizer/NetworkConfigNormalizer.php deleted file mode 100644 index 4253cfe1..00000000 --- a/generated/Normalizer/NetworkConfigNormalizer.php +++ /dev/null @@ -1,149 +0,0 @@ -setBridge($data->{'Bridge'}); - } - if (property_exists($data, 'Gateway')) { - $object->setGateway($data->{'Gateway'}); - } - if (property_exists($data, 'IPAddress')) { - $object->setIPAddress($data->{'IPAddress'}); - } - if (property_exists($data, 'IPPrefixLen')) { - $object->setIPPrefixLen($data->{'IPPrefixLen'}); - } - if (property_exists($data, 'MacAddress')) { - $object->setMacAddress($data->{'MacAddress'}); - } - if (property_exists($data, 'PortMapping')) { - $object->setPortMapping($data->{'PortMapping'}); - } - if (property_exists($data, 'Networks')) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Networks'} as $key => $value) { - $values[$key] = $this->serializer->denormalize($value, 'Docker\\API\\Model\\ContainerNetwork', 'raw', $context); - } - $object->setNetworks($values); - } - if (property_exists($data, 'Ports')) { - $value_1 = $data->{'Ports'}; - if (is_object($data->{'Ports'})) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Ports'} as $key_1 => $value_2) { - $value_3 = $value_2; - if (is_array($value_2)) { - $values_2 = []; - foreach ($value_2 as $value_4) { - $values_2[] = $this->serializer->denormalize($value_4, 'Docker\\API\\Model\\PortBinding', 'raw', $context); - } - $value_3 = $values_2; - } - if (is_null($value_2)) { - $value_3 = $value_2; - } - $values_1[$key_1] = $value_3; - } - $value_1 = $values_1; - } - if (is_null($data->{'Ports'})) { - $value_1 = $data->{'Ports'}; - } - $object->setPorts($value_1); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getBridge()) { - $data->{'Bridge'} = $object->getBridge(); - } - if (null !== $object->getGateway()) { - $data->{'Gateway'} = $object->getGateway(); - } - if (null !== $object->getIPAddress()) { - $data->{'IPAddress'} = $object->getIPAddress(); - } - if (null !== $object->getIPPrefixLen()) { - $data->{'IPPrefixLen'} = $object->getIPPrefixLen(); - } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); - } - if (null !== $object->getPortMapping()) { - $data->{'PortMapping'} = $object->getPortMapping(); - } - if (null !== $object->getNetworks()) { - $values = new \stdClass(); - foreach ($object->getNetworks() as $key => $value) { - $values->{$key} = $value; - } - $data->{'Networks'} = $values; - } - $value_1 = $object->getPorts(); - if (is_object($object->getPorts())) { - $values_1 = new \stdClass(); - foreach ($object->getPorts() as $key_1 => $value_2) { - $value_3 = $value_2; - if (is_array($value_2)) { - $values_2 = []; - foreach ($value_2 as $value_4) { - $values_2[] = $value_4; - } - $value_3 = $values_2; - } - if (is_null($value_2)) { - $value_3 = $value_2; - } - $values_1->{$key_1} = $value_3; - } - $value_1 = $values_1; - } - if (is_null($object->getPorts())) { - $value_1 = $object->getPorts(); - } - $data->{'Ports'} = $value_1; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/NetworkContainerNormalizer.php b/generated/Normalizer/NetworkContainerNormalizer.php index 7f6b5bcf..a37c84de 100644 --- a/generated/Normalizer/NetworkContainerNormalizer.php +++ b/generated/Normalizer/NetworkContainerNormalizer.php @@ -2,80 +2,189 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class NetworkContainerNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\NetworkContainer') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\NetworkContainer) { - return true; - } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NetworkContainerNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\NetworkContainer(); - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworkContainer::class; } - if (property_exists($data, 'EndpointID')) { - $object->setEndpointID($data->{'EndpointID'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworkContainer::class; } - if (property_exists($data, 'MacAddress')) { - $object->setMacAddress($data->{'MacAddress'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworkContainer(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('EndpointID', $data) && $data['EndpointID'] !== null) { + $object->setEndpointID($data['EndpointID']); + } + elseif (\array_key_exists('EndpointID', $data) && $data['EndpointID'] === null) { + $object->setEndpointID(null); + } + if (\array_key_exists('MacAddress', $data) && $data['MacAddress'] !== null) { + $object->setMacAddress($data['MacAddress']); + } + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); + } + if (\array_key_exists('IPv4Address', $data) && $data['IPv4Address'] !== null) { + $object->setIPv4Address($data['IPv4Address']); + } + elseif (\array_key_exists('IPv4Address', $data) && $data['IPv4Address'] === null) { + $object->setIPv4Address(null); + } + if (\array_key_exists('IPv6Address', $data) && $data['IPv6Address'] !== null) { + $object->setIPv6Address($data['IPv6Address']); + } + elseif (\array_key_exists('IPv6Address', $data) && $data['IPv6Address'] === null) { + $object->setIPv6Address(null); + } + return $object; } - if (property_exists($data, 'IPv4Address')) { - $object->setIPv4Address($data->{'IPv4Address'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('endpointID') && null !== $object->getEndpointID()) { + $data['EndpointID'] = $object->getEndpointID(); + } + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); + } + if ($object->isInitialized('iPv4Address') && null !== $object->getIPv4Address()) { + $data['IPv4Address'] = $object->getIPv4Address(); + } + if ($object->isInitialized('iPv6Address') && null !== $object->getIPv6Address()) { + $data['IPv6Address'] = $object->getIPv6Address(); + } + return $data; } - if (property_exists($data, 'IPv6Address')) { - $object->setIPv6Address($data->{'IPv6Address'}); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkContainer::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class NetworkContainerNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworkContainer::class; } - if (null !== $object->getEndpointID()) { - $data->{'EndpointID'} = $object->getEndpointID(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworkContainer::class; } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworkContainer(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('EndpointID', $data) && $data['EndpointID'] !== null) { + $object->setEndpointID($data['EndpointID']); + } + elseif (\array_key_exists('EndpointID', $data) && $data['EndpointID'] === null) { + $object->setEndpointID(null); + } + if (\array_key_exists('MacAddress', $data) && $data['MacAddress'] !== null) { + $object->setMacAddress($data['MacAddress']); + } + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); + } + if (\array_key_exists('IPv4Address', $data) && $data['IPv4Address'] !== null) { + $object->setIPv4Address($data['IPv4Address']); + } + elseif (\array_key_exists('IPv4Address', $data) && $data['IPv4Address'] === null) { + $object->setIPv4Address(null); + } + if (\array_key_exists('IPv6Address', $data) && $data['IPv6Address'] !== null) { + $object->setIPv6Address($data['IPv6Address']); + } + elseif (\array_key_exists('IPv6Address', $data) && $data['IPv6Address'] === null) { + $object->setIPv6Address(null); + } + return $object; } - if (null !== $object->getIPv4Address()) { - $data->{'IPv4Address'} = $object->getIPv4Address(); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('endpointID') && null !== $object->getEndpointID()) { + $data['EndpointID'] = $object->getEndpointID(); + } + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); + } + if ($object->isInitialized('iPv4Address') && null !== $object->getIPv4Address()) { + $data['IPv4Address'] = $object->getIPv4Address(); + } + if ($object->isInitialized('iPv6Address') && null !== $object->getIPv6Address()) { + $data['IPv6Address'] = $object->getIPv6Address(); + } + return $data; } - if (null !== $object->getIPv6Address()) { - $data->{'IPv6Address'} = $object->getIPv6Address(); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkContainer::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/NetworkCreateConfigNormalizer.php b/generated/Normalizer/NetworkCreateConfigNormalizer.php deleted file mode 100644 index 990a530d..00000000 --- a/generated/Normalizer/NetworkCreateConfigNormalizer.php +++ /dev/null @@ -1,126 +0,0 @@ -setName($data->{'Name'}); - } - if (property_exists($data, 'CheckDuplicate')) { - $object->setCheckDuplicate($data->{'CheckDuplicate'}); - } - if (property_exists($data, 'Driver')) { - $object->setDriver($data->{'Driver'}); - } - if (property_exists($data, 'EnableIPv6')) { - $object->setEnableIPv6($data->{'EnableIPv6'}); - } - if (property_exists($data, 'IPAM')) { - $object->setIPAM($this->serializer->denormalize($data->{'IPAM'}, 'Docker\\API\\Model\\IPAM', 'raw', $context)); - } - if (property_exists($data, 'Internal')) { - $object->setInternal($data->{'Internal'}); - } - if (property_exists($data, 'Options')) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { - $values[$key] = $value; - } - $object->setOptions($values); - } - if (property_exists($data, 'Labels')) { - $value_1 = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_1 => $value_2) { - $values_1[$key_1] = $value_2; - } - $value_1 = $values_1; - } - if (is_null($data->{'Labels'})) { - $value_1 = $data->{'Labels'}; - } - $object->setLabels($value_1); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getCheckDuplicate()) { - $data->{'CheckDuplicate'} = $object->getCheckDuplicate(); - } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); - } - if (null !== $object->getEnableIPv6()) { - $data->{'EnableIPv6'} = $object->getEnableIPv6(); - } - if (null !== $object->getIPAM()) { - $data->{'IPAM'} = json_decode($this->serializer->normalize($object->getIPAM(), 'raw', $context)); - } - if (null !== $object->getInternal()) { - $data->{'Internal'} = $object->getInternal(); - } - if (null !== $object->getOptions()) { - $values = new \stdClass(); - foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; - } - $data->{'Options'} = $values; - } - $value_1 = $object->getLabels(); - if (is_object($object->getLabels())) { - $values_1 = new \stdClass(); - foreach ($object->getLabels() as $key_1 => $value_2) { - $values_1->{$key_1} = $value_2; - } - $value_1 = $values_1; - } - if (is_null($object->getLabels())) { - $value_1 = $object->getLabels(); - } - $data->{'Labels'} = $value_1; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/NetworkCreateResponseNormalizer.php b/generated/Normalizer/NetworkCreateResponseNormalizer.php new file mode 100644 index 00000000..72a83964 --- /dev/null +++ b/generated/Normalizer/NetworkCreateResponseNormalizer.php @@ -0,0 +1,128 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NetworkCreateResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworkCreateResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworkCreateResponse::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworkCreateResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Warning', $data) && $data['Warning'] !== null) { + $object->setWarning($data['Warning']); + } + elseif (\array_key_exists('Warning', $data) && $data['Warning'] === null) { + $object->setWarning(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Id'] = $object->getId(); + $data['Warning'] = $object->getWarning(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkCreateResponse::class => false]; + } + } +} else { + class NetworkCreateResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworkCreateResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworkCreateResponse::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworkCreateResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Warning', $data) && $data['Warning'] !== null) { + $object->setWarning($data['Warning']); + } + elseif (\array_key_exists('Warning', $data) && $data['Warning'] === null) { + $object->setWarning(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Id'] = $object->getId(); + $data['Warning'] = $object->getWarning(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkCreateResponse::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/NetworkCreateResultNormalizer.php b/generated/Normalizer/NetworkCreateResultNormalizer.php deleted file mode 100644 index 382497ed..00000000 --- a/generated/Normalizer/NetworkCreateResultNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setId($data->{'Id'}); - } - if (property_exists($data, 'Warning')) { - $object->setWarning($data->{'Warning'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getWarning()) { - $data->{'Warning'} = $object->getWarning(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/NetworkNormalizer.php b/generated/Normalizer/NetworkNormalizer.php index 0763a51f..7b1c7d5e 100644 --- a/generated/Normalizer/NetworkNormalizer.php +++ b/generated/Normalizer/NetworkNormalizer.php @@ -2,158 +2,469 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class NetworkNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\Network') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\Network) { - return true; - } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NetworkNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\Network(); - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Id')) { - $object->setId($data->{'Id'}); - } - if (property_exists($data, 'Scope')) { - $object->setScope($data->{'Scope'}); - } - if (property_exists($data, 'Driver')) { - $object->setDriver($data->{'Driver'}); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Network::class; } - if (property_exists($data, 'EnableIPv6')) { - $object->setEnableIPv6($data->{'EnableIPv6'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Network::class; } - if (property_exists($data, 'IPAM')) { - $object->setIPAM($this->serializer->denormalize($data->{'IPAM'}, 'Docker\\API\\Model\\IPAM', 'raw', $context)); - } - if (property_exists($data, 'Internal')) { - $object->setInternal($data->{'Internal'}); - } - if (property_exists($data, 'Containers')) { - $value = $data->{'Containers'}; - if (is_object($data->{'Containers'})) { + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Network(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); + } + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); + } + if (\array_key_exists('Scope', $data) && $data['Scope'] !== null) { + $object->setScope($data['Scope']); + } + elseif (\array_key_exists('Scope', $data) && $data['Scope'] === null) { + $object->setScope(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('EnableIPv4', $data) && $data['EnableIPv4'] !== null) { + $object->setEnableIPv4($data['EnableIPv4']); + } + elseif (\array_key_exists('EnableIPv4', $data) && $data['EnableIPv4'] === null) { + $object->setEnableIPv4(null); + } + if (\array_key_exists('EnableIPv6', $data) && $data['EnableIPv6'] !== null) { + $object->setEnableIPv6($data['EnableIPv6']); + } + elseif (\array_key_exists('EnableIPv6', $data) && $data['EnableIPv6'] === null) { + $object->setEnableIPv6(null); + } + if (\array_key_exists('IPAM', $data) && $data['IPAM'] !== null) { + $object->setIPAM($this->denormalizer->denormalize($data['IPAM'], \Docker\API\Model\IPAM::class, 'json', $context)); + } + elseif (\array_key_exists('IPAM', $data) && $data['IPAM'] === null) { + $object->setIPAM(null); + } + if (\array_key_exists('Internal', $data) && $data['Internal'] !== null) { + $object->setInternal($data['Internal']); + } + elseif (\array_key_exists('Internal', $data) && $data['Internal'] === null) { + $object->setInternal(null); + } + if (\array_key_exists('Attachable', $data) && $data['Attachable'] !== null) { + $object->setAttachable($data['Attachable']); + } + elseif (\array_key_exists('Attachable', $data) && $data['Attachable'] === null) { + $object->setAttachable(null); + } + if (\array_key_exists('Ingress', $data) && $data['Ingress'] !== null) { + $object->setIngress($data['Ingress']); + } + elseif (\array_key_exists('Ingress', $data) && $data['Ingress'] === null) { + $object->setIngress(null); + } + if (\array_key_exists('ConfigFrom', $data) && $data['ConfigFrom'] !== null) { + $object->setConfigFrom($this->denormalizer->denormalize($data['ConfigFrom'], \Docker\API\Model\ConfigReference::class, 'json', $context)); + } + elseif (\array_key_exists('ConfigFrom', $data) && $data['ConfigFrom'] === null) { + $object->setConfigFrom(null); + } + if (\array_key_exists('ConfigOnly', $data) && $data['ConfigOnly'] !== null) { + $object->setConfigOnly($data['ConfigOnly']); + } + elseif (\array_key_exists('ConfigOnly', $data) && $data['ConfigOnly'] === null) { + $object->setConfigOnly(null); + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Containers'} as $key => $value_1) { - $values[$key] = $this->serializer->denormalize($value_1, 'Docker\\API\\Model\\NetworkContainer', 'raw', $context); + foreach ($data['Containers'] as $key => $value) { + $values[$key] = $this->denormalizer->denormalize($value, \Docker\API\Model\NetworkContainer::class, 'json', $context); } - $value = $values; + $object->setContainers($values); } - if (is_null($data->{'Containers'})) { - $value = $data->{'Containers'}; + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); } - $object->setContainers($value); - } - if (property_exists($data, 'Options')) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key_1 => $value_2) { - $values_1[$key_1] = $value_2; + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $object->setOptions($values_1); } - $object->setOptions($values_1); - } - if (property_exists($data, 'Labels')) { - $value_3 = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_2 => $value_4) { - $values_2[$key_2] = $value_4; + foreach ($data['Labels'] as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; } - $value_3 = $values_2; + $object->setLabels($values_2); } - if (is_null($data->{'Labels'})) { - $value_3 = $data->{'Labels'}; + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); } - $object->setLabels($value_3); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getScope()) { - $data->{'Scope'} = $object->getScope(); + if (\array_key_exists('Peers', $data) && $data['Peers'] !== null) { + $values_3 = []; + foreach ($data['Peers'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\PeerInfo::class, 'json', $context); + } + $object->setPeers($values_3); + } + elseif (\array_key_exists('Peers', $data) && $data['Peers'] === null) { + $object->setPeers(null); + } + return $object; } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); + } + if ($object->isInitialized('created') && null !== $object->getCreated()) { + $data['Created'] = $object->getCreated(); + } + if ($object->isInitialized('scope') && null !== $object->getScope()) { + $data['Scope'] = $object->getScope(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('enableIPv4') && null !== $object->getEnableIPv4()) { + $data['EnableIPv4'] = $object->getEnableIPv4(); + } + if ($object->isInitialized('enableIPv6') && null !== $object->getEnableIPv6()) { + $data['EnableIPv6'] = $object->getEnableIPv6(); + } + if ($object->isInitialized('iPAM') && null !== $object->getIPAM()) { + $data['IPAM'] = $this->normalizer->normalize($object->getIPAM(), 'json', $context); + } + if ($object->isInitialized('internal') && null !== $object->getInternal()) { + $data['Internal'] = $object->getInternal(); + } + if ($object->isInitialized('attachable') && null !== $object->getAttachable()) { + $data['Attachable'] = $object->getAttachable(); + } + if ($object->isInitialized('ingress') && null !== $object->getIngress()) { + $data['Ingress'] = $object->getIngress(); + } + if ($object->isInitialized('configFrom') && null !== $object->getConfigFrom()) { + $data['ConfigFrom'] = $this->normalizer->normalize($object->getConfigFrom(), 'json', $context); + } + if ($object->isInitialized('configOnly') && null !== $object->getConfigOnly()) { + $data['ConfigOnly'] = $object->getConfigOnly(); + } + if ($object->isInitialized('containers') && null !== $object->getContainers()) { + $values = []; + foreach ($object->getContainers() as $key => $value) { + $values[$key] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Containers'] = $values; + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values_1 = []; + foreach ($object->getOptions() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $data['Options'] = $values_1; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_2 = []; + foreach ($object->getLabels() as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; + } + $data['Labels'] = $values_2; + } + if ($object->isInitialized('peers') && null !== $object->getPeers()) { + $values_3 = []; + foreach ($object->getPeers() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['Peers'] = $values_3; + } + return $data; } - if (null !== $object->getEnableIPv6()) { - $data->{'EnableIPv6'} = $object->getEnableIPv6(); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Network::class => false]; } - if (null !== $object->getIPAM()) { - $data->{'IPAM'} = json_decode($this->serializer->normalize($object->getIPAM(), 'raw', $context)); + } +} else { + class NetworkNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Network::class; } - if (null !== $object->getInternal()) { - $data->{'Internal'} = $object->getInternal(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Network::class; } - $value = $object->getContainers(); - if (is_object($object->getContainers())) { - $values = new \stdClass(); - foreach ($object->getContainers() as $key => $value_1) { - $values->{$key} = $value_1; + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $value = $values; - } - if (is_null($object->getContainers())) { - $value = $object->getContainers(); - } - $data->{'Containers'} = $value; - if (null !== $object->getOptions()) { - $values_1 = new \stdClass(); - foreach ($object->getOptions() as $key_1 => $value_2) { - $values_1->{$key_1} = $value_2; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Network(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); + } + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); + } + if (\array_key_exists('Scope', $data) && $data['Scope'] !== null) { + $object->setScope($data['Scope']); + } + elseif (\array_key_exists('Scope', $data) && $data['Scope'] === null) { + $object->setScope(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('EnableIPv4', $data) && $data['EnableIPv4'] !== null) { + $object->setEnableIPv4($data['EnableIPv4']); + } + elseif (\array_key_exists('EnableIPv4', $data) && $data['EnableIPv4'] === null) { + $object->setEnableIPv4(null); + } + if (\array_key_exists('EnableIPv6', $data) && $data['EnableIPv6'] !== null) { + $object->setEnableIPv6($data['EnableIPv6']); + } + elseif (\array_key_exists('EnableIPv6', $data) && $data['EnableIPv6'] === null) { + $object->setEnableIPv6(null); + } + if (\array_key_exists('IPAM', $data) && $data['IPAM'] !== null) { + $object->setIPAM($this->denormalizer->denormalize($data['IPAM'], \Docker\API\Model\IPAM::class, 'json', $context)); + } + elseif (\array_key_exists('IPAM', $data) && $data['IPAM'] === null) { + $object->setIPAM(null); + } + if (\array_key_exists('Internal', $data) && $data['Internal'] !== null) { + $object->setInternal($data['Internal']); + } + elseif (\array_key_exists('Internal', $data) && $data['Internal'] === null) { + $object->setInternal(null); + } + if (\array_key_exists('Attachable', $data) && $data['Attachable'] !== null) { + $object->setAttachable($data['Attachable']); + } + elseif (\array_key_exists('Attachable', $data) && $data['Attachable'] === null) { + $object->setAttachable(null); + } + if (\array_key_exists('Ingress', $data) && $data['Ingress'] !== null) { + $object->setIngress($data['Ingress']); + } + elseif (\array_key_exists('Ingress', $data) && $data['Ingress'] === null) { + $object->setIngress(null); + } + if (\array_key_exists('ConfigFrom', $data) && $data['ConfigFrom'] !== null) { + $object->setConfigFrom($this->denormalizer->denormalize($data['ConfigFrom'], \Docker\API\Model\ConfigReference::class, 'json', $context)); + } + elseif (\array_key_exists('ConfigFrom', $data) && $data['ConfigFrom'] === null) { + $object->setConfigFrom(null); } - $data->{'Options'} = $values_1; + if (\array_key_exists('ConfigOnly', $data) && $data['ConfigOnly'] !== null) { + $object->setConfigOnly($data['ConfigOnly']); + } + elseif (\array_key_exists('ConfigOnly', $data) && $data['ConfigOnly'] === null) { + $object->setConfigOnly(null); + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Containers'] as $key => $value) { + $values[$key] = $this->denormalizer->denormalize($value, \Docker\API\Model\NetworkContainer::class, 'json', $context); + } + $object->setContainers($values); + } + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $object->setOptions($values_1); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; + } + $object->setLabels($values_2); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Peers', $data) && $data['Peers'] !== null) { + $values_3 = []; + foreach ($data['Peers'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\PeerInfo::class, 'json', $context); + } + $object->setPeers($values_3); + } + elseif (\array_key_exists('Peers', $data) && $data['Peers'] === null) { + $object->setPeers(null); + } + return $object; } - $value_3 = $object->getLabels(); - if (is_object($object->getLabels())) { - $values_2 = new \stdClass(); - foreach ($object->getLabels() as $key_2 => $value_4) { - $values_2->{$key_2} = $value_4; + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); + } + if ($object->isInitialized('created') && null !== $object->getCreated()) { + $data['Created'] = $object->getCreated(); + } + if ($object->isInitialized('scope') && null !== $object->getScope()) { + $data['Scope'] = $object->getScope(); } - $value_3 = $values_2; + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('enableIPv4') && null !== $object->getEnableIPv4()) { + $data['EnableIPv4'] = $object->getEnableIPv4(); + } + if ($object->isInitialized('enableIPv6') && null !== $object->getEnableIPv6()) { + $data['EnableIPv6'] = $object->getEnableIPv6(); + } + if ($object->isInitialized('iPAM') && null !== $object->getIPAM()) { + $data['IPAM'] = $this->normalizer->normalize($object->getIPAM(), 'json', $context); + } + if ($object->isInitialized('internal') && null !== $object->getInternal()) { + $data['Internal'] = $object->getInternal(); + } + if ($object->isInitialized('attachable') && null !== $object->getAttachable()) { + $data['Attachable'] = $object->getAttachable(); + } + if ($object->isInitialized('ingress') && null !== $object->getIngress()) { + $data['Ingress'] = $object->getIngress(); + } + if ($object->isInitialized('configFrom') && null !== $object->getConfigFrom()) { + $data['ConfigFrom'] = $this->normalizer->normalize($object->getConfigFrom(), 'json', $context); + } + if ($object->isInitialized('configOnly') && null !== $object->getConfigOnly()) { + $data['ConfigOnly'] = $object->getConfigOnly(); + } + if ($object->isInitialized('containers') && null !== $object->getContainers()) { + $values = []; + foreach ($object->getContainers() as $key => $value) { + $values[$key] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Containers'] = $values; + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values_1 = []; + foreach ($object->getOptions() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $data['Options'] = $values_1; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_2 = []; + foreach ($object->getLabels() as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; + } + $data['Labels'] = $values_2; + } + if ($object->isInitialized('peers') && null !== $object->getPeers()) { + $values_3 = []; + foreach ($object->getPeers() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['Peers'] = $values_3; + } + return $data; } - if (is_null($object->getLabels())) { - $value_3 = $object->getLabels(); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Network::class => false]; } - $data->{'Labels'} = $value_3; - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/NetworkSettingsNormalizer.php b/generated/Normalizer/NetworkSettingsNormalizer.php new file mode 100644 index 00000000..2ec0511f --- /dev/null +++ b/generated/Normalizer/NetworkSettingsNormalizer.php @@ -0,0 +1,504 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworkSettings::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworkSettings::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworkSettings(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Bridge', $data) && $data['Bridge'] !== null) { + $object->setBridge($data['Bridge']); + } + elseif (\array_key_exists('Bridge', $data) && $data['Bridge'] === null) { + $object->setBridge(null); + } + if (\array_key_exists('SandboxID', $data) && $data['SandboxID'] !== null) { + $object->setSandboxID($data['SandboxID']); + } + elseif (\array_key_exists('SandboxID', $data) && $data['SandboxID'] === null) { + $object->setSandboxID(null); + } + if (\array_key_exists('HairpinMode', $data) && $data['HairpinMode'] !== null) { + $object->setHairpinMode($data['HairpinMode']); + } + elseif (\array_key_exists('HairpinMode', $data) && $data['HairpinMode'] === null) { + $object->setHairpinMode(null); + } + if (\array_key_exists('LinkLocalIPv6Address', $data) && $data['LinkLocalIPv6Address'] !== null) { + $object->setLinkLocalIPv6Address($data['LinkLocalIPv6Address']); + } + elseif (\array_key_exists('LinkLocalIPv6Address', $data) && $data['LinkLocalIPv6Address'] === null) { + $object->setLinkLocalIPv6Address(null); + } + if (\array_key_exists('LinkLocalIPv6PrefixLen', $data) && $data['LinkLocalIPv6PrefixLen'] !== null) { + $object->setLinkLocalIPv6PrefixLen($data['LinkLocalIPv6PrefixLen']); + } + elseif (\array_key_exists('LinkLocalIPv6PrefixLen', $data) && $data['LinkLocalIPv6PrefixLen'] === null) { + $object->setLinkLocalIPv6PrefixLen(null); + } + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Ports'] as $key => $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\PortBinding::class, 'json', $context); + } + $values[$key] = $values_1; + } + $object->setPorts($values); + } + elseif (\array_key_exists('Ports', $data) && $data['Ports'] === null) { + $object->setPorts(null); + } + if (\array_key_exists('SandboxKey', $data) && $data['SandboxKey'] !== null) { + $object->setSandboxKey($data['SandboxKey']); + } + elseif (\array_key_exists('SandboxKey', $data) && $data['SandboxKey'] === null) { + $object->setSandboxKey(null); + } + if (\array_key_exists('SecondaryIPAddresses', $data) && $data['SecondaryIPAddresses'] !== null) { + $values_2 = []; + foreach ($data['SecondaryIPAddresses'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\Address::class, 'json', $context); + } + $object->setSecondaryIPAddresses($values_2); + } + elseif (\array_key_exists('SecondaryIPAddresses', $data) && $data['SecondaryIPAddresses'] === null) { + $object->setSecondaryIPAddresses(null); + } + if (\array_key_exists('SecondaryIPv6Addresses', $data) && $data['SecondaryIPv6Addresses'] !== null) { + $values_3 = []; + foreach ($data['SecondaryIPv6Addresses'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\Address::class, 'json', $context); + } + $object->setSecondaryIPv6Addresses($values_3); + } + elseif (\array_key_exists('SecondaryIPv6Addresses', $data) && $data['SecondaryIPv6Addresses'] === null) { + $object->setSecondaryIPv6Addresses(null); + } + if (\array_key_exists('EndpointID', $data) && $data['EndpointID'] !== null) { + $object->setEndpointID($data['EndpointID']); + } + elseif (\array_key_exists('EndpointID', $data) && $data['EndpointID'] === null) { + $object->setEndpointID(null); + } + if (\array_key_exists('Gateway', $data) && $data['Gateway'] !== null) { + $object->setGateway($data['Gateway']); + } + elseif (\array_key_exists('Gateway', $data) && $data['Gateway'] === null) { + $object->setGateway(null); + } + if (\array_key_exists('GlobalIPv6Address', $data) && $data['GlobalIPv6Address'] !== null) { + $object->setGlobalIPv6Address($data['GlobalIPv6Address']); + } + elseif (\array_key_exists('GlobalIPv6Address', $data) && $data['GlobalIPv6Address'] === null) { + $object->setGlobalIPv6Address(null); + } + if (\array_key_exists('GlobalIPv6PrefixLen', $data) && $data['GlobalIPv6PrefixLen'] !== null) { + $object->setGlobalIPv6PrefixLen($data['GlobalIPv6PrefixLen']); + } + elseif (\array_key_exists('GlobalIPv6PrefixLen', $data) && $data['GlobalIPv6PrefixLen'] === null) { + $object->setGlobalIPv6PrefixLen(null); + } + if (\array_key_exists('IPAddress', $data) && $data['IPAddress'] !== null) { + $object->setIPAddress($data['IPAddress']); + } + elseif (\array_key_exists('IPAddress', $data) && $data['IPAddress'] === null) { + $object->setIPAddress(null); + } + if (\array_key_exists('IPPrefixLen', $data) && $data['IPPrefixLen'] !== null) { + $object->setIPPrefixLen($data['IPPrefixLen']); + } + elseif (\array_key_exists('IPPrefixLen', $data) && $data['IPPrefixLen'] === null) { + $object->setIPPrefixLen(null); + } + if (\array_key_exists('IPv6Gateway', $data) && $data['IPv6Gateway'] !== null) { + $object->setIPv6Gateway($data['IPv6Gateway']); + } + elseif (\array_key_exists('IPv6Gateway', $data) && $data['IPv6Gateway'] === null) { + $object->setIPv6Gateway(null); + } + if (\array_key_exists('MacAddress', $data) && $data['MacAddress'] !== null) { + $object->setMacAddress($data['MacAddress']); + } + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); + } + if (\array_key_exists('Networks', $data) && $data['Networks'] !== null) { + $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Networks'] as $key_1 => $value_4) { + $values_4[$key_1] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\EndpointSettings::class, 'json', $context); + } + $object->setNetworks($values_4); + } + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('bridge') && null !== $object->getBridge()) { + $data['Bridge'] = $object->getBridge(); + } + if ($object->isInitialized('sandboxID') && null !== $object->getSandboxID()) { + $data['SandboxID'] = $object->getSandboxID(); + } + if ($object->isInitialized('hairpinMode') && null !== $object->getHairpinMode()) { + $data['HairpinMode'] = $object->getHairpinMode(); + } + if ($object->isInitialized('linkLocalIPv6Address') && null !== $object->getLinkLocalIPv6Address()) { + $data['LinkLocalIPv6Address'] = $object->getLinkLocalIPv6Address(); + } + if ($object->isInitialized('linkLocalIPv6PrefixLen') && null !== $object->getLinkLocalIPv6PrefixLen()) { + $data['LinkLocalIPv6PrefixLen'] = $object->getLinkLocalIPv6PrefixLen(); + } + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values = []; + foreach ($object->getPorts() as $key => $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $values[$key] = $values_1; + } + $data['Ports'] = $values; + } + if ($object->isInitialized('sandboxKey') && null !== $object->getSandboxKey()) { + $data['SandboxKey'] = $object->getSandboxKey(); + } + if ($object->isInitialized('secondaryIPAddresses') && null !== $object->getSecondaryIPAddresses()) { + $values_2 = []; + foreach ($object->getSecondaryIPAddresses() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['SecondaryIPAddresses'] = $values_2; + } + if ($object->isInitialized('secondaryIPv6Addresses') && null !== $object->getSecondaryIPv6Addresses()) { + $values_3 = []; + foreach ($object->getSecondaryIPv6Addresses() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['SecondaryIPv6Addresses'] = $values_3; + } + if ($object->isInitialized('endpointID') && null !== $object->getEndpointID()) { + $data['EndpointID'] = $object->getEndpointID(); + } + if ($object->isInitialized('gateway') && null !== $object->getGateway()) { + $data['Gateway'] = $object->getGateway(); + } + if ($object->isInitialized('globalIPv6Address') && null !== $object->getGlobalIPv6Address()) { + $data['GlobalIPv6Address'] = $object->getGlobalIPv6Address(); + } + if ($object->isInitialized('globalIPv6PrefixLen') && null !== $object->getGlobalIPv6PrefixLen()) { + $data['GlobalIPv6PrefixLen'] = $object->getGlobalIPv6PrefixLen(); + } + if ($object->isInitialized('iPAddress') && null !== $object->getIPAddress()) { + $data['IPAddress'] = $object->getIPAddress(); + } + if ($object->isInitialized('iPPrefixLen') && null !== $object->getIPPrefixLen()) { + $data['IPPrefixLen'] = $object->getIPPrefixLen(); + } + if ($object->isInitialized('iPv6Gateway') && null !== $object->getIPv6Gateway()) { + $data['IPv6Gateway'] = $object->getIPv6Gateway(); + } + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); + } + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values_4 = []; + foreach ($object->getNetworks() as $key_1 => $value_4) { + $values_4[$key_1] = $this->normalizer->normalize($value_4, 'json', $context); + } + $data['Networks'] = $values_4; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkSettings::class => false]; + } + } +} else { + class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworkSettings::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworkSettings::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworkSettings(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Bridge', $data) && $data['Bridge'] !== null) { + $object->setBridge($data['Bridge']); + } + elseif (\array_key_exists('Bridge', $data) && $data['Bridge'] === null) { + $object->setBridge(null); + } + if (\array_key_exists('SandboxID', $data) && $data['SandboxID'] !== null) { + $object->setSandboxID($data['SandboxID']); + } + elseif (\array_key_exists('SandboxID', $data) && $data['SandboxID'] === null) { + $object->setSandboxID(null); + } + if (\array_key_exists('HairpinMode', $data) && $data['HairpinMode'] !== null) { + $object->setHairpinMode($data['HairpinMode']); + } + elseif (\array_key_exists('HairpinMode', $data) && $data['HairpinMode'] === null) { + $object->setHairpinMode(null); + } + if (\array_key_exists('LinkLocalIPv6Address', $data) && $data['LinkLocalIPv6Address'] !== null) { + $object->setLinkLocalIPv6Address($data['LinkLocalIPv6Address']); + } + elseif (\array_key_exists('LinkLocalIPv6Address', $data) && $data['LinkLocalIPv6Address'] === null) { + $object->setLinkLocalIPv6Address(null); + } + if (\array_key_exists('LinkLocalIPv6PrefixLen', $data) && $data['LinkLocalIPv6PrefixLen'] !== null) { + $object->setLinkLocalIPv6PrefixLen($data['LinkLocalIPv6PrefixLen']); + } + elseif (\array_key_exists('LinkLocalIPv6PrefixLen', $data) && $data['LinkLocalIPv6PrefixLen'] === null) { + $object->setLinkLocalIPv6PrefixLen(null); + } + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Ports'] as $key => $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\PortBinding::class, 'json', $context); + } + $values[$key] = $values_1; + } + $object->setPorts($values); + } + elseif (\array_key_exists('Ports', $data) && $data['Ports'] === null) { + $object->setPorts(null); + } + if (\array_key_exists('SandboxKey', $data) && $data['SandboxKey'] !== null) { + $object->setSandboxKey($data['SandboxKey']); + } + elseif (\array_key_exists('SandboxKey', $data) && $data['SandboxKey'] === null) { + $object->setSandboxKey(null); + } + if (\array_key_exists('SecondaryIPAddresses', $data) && $data['SecondaryIPAddresses'] !== null) { + $values_2 = []; + foreach ($data['SecondaryIPAddresses'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\Address::class, 'json', $context); + } + $object->setSecondaryIPAddresses($values_2); + } + elseif (\array_key_exists('SecondaryIPAddresses', $data) && $data['SecondaryIPAddresses'] === null) { + $object->setSecondaryIPAddresses(null); + } + if (\array_key_exists('SecondaryIPv6Addresses', $data) && $data['SecondaryIPv6Addresses'] !== null) { + $values_3 = []; + foreach ($data['SecondaryIPv6Addresses'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\Address::class, 'json', $context); + } + $object->setSecondaryIPv6Addresses($values_3); + } + elseif (\array_key_exists('SecondaryIPv6Addresses', $data) && $data['SecondaryIPv6Addresses'] === null) { + $object->setSecondaryIPv6Addresses(null); + } + if (\array_key_exists('EndpointID', $data) && $data['EndpointID'] !== null) { + $object->setEndpointID($data['EndpointID']); + } + elseif (\array_key_exists('EndpointID', $data) && $data['EndpointID'] === null) { + $object->setEndpointID(null); + } + if (\array_key_exists('Gateway', $data) && $data['Gateway'] !== null) { + $object->setGateway($data['Gateway']); + } + elseif (\array_key_exists('Gateway', $data) && $data['Gateway'] === null) { + $object->setGateway(null); + } + if (\array_key_exists('GlobalIPv6Address', $data) && $data['GlobalIPv6Address'] !== null) { + $object->setGlobalIPv6Address($data['GlobalIPv6Address']); + } + elseif (\array_key_exists('GlobalIPv6Address', $data) && $data['GlobalIPv6Address'] === null) { + $object->setGlobalIPv6Address(null); + } + if (\array_key_exists('GlobalIPv6PrefixLen', $data) && $data['GlobalIPv6PrefixLen'] !== null) { + $object->setGlobalIPv6PrefixLen($data['GlobalIPv6PrefixLen']); + } + elseif (\array_key_exists('GlobalIPv6PrefixLen', $data) && $data['GlobalIPv6PrefixLen'] === null) { + $object->setGlobalIPv6PrefixLen(null); + } + if (\array_key_exists('IPAddress', $data) && $data['IPAddress'] !== null) { + $object->setIPAddress($data['IPAddress']); + } + elseif (\array_key_exists('IPAddress', $data) && $data['IPAddress'] === null) { + $object->setIPAddress(null); + } + if (\array_key_exists('IPPrefixLen', $data) && $data['IPPrefixLen'] !== null) { + $object->setIPPrefixLen($data['IPPrefixLen']); + } + elseif (\array_key_exists('IPPrefixLen', $data) && $data['IPPrefixLen'] === null) { + $object->setIPPrefixLen(null); + } + if (\array_key_exists('IPv6Gateway', $data) && $data['IPv6Gateway'] !== null) { + $object->setIPv6Gateway($data['IPv6Gateway']); + } + elseif (\array_key_exists('IPv6Gateway', $data) && $data['IPv6Gateway'] === null) { + $object->setIPv6Gateway(null); + } + if (\array_key_exists('MacAddress', $data) && $data['MacAddress'] !== null) { + $object->setMacAddress($data['MacAddress']); + } + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); + } + if (\array_key_exists('Networks', $data) && $data['Networks'] !== null) { + $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Networks'] as $key_1 => $value_4) { + $values_4[$key_1] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\EndpointSettings::class, 'json', $context); + } + $object->setNetworks($values_4); + } + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('bridge') && null !== $object->getBridge()) { + $data['Bridge'] = $object->getBridge(); + } + if ($object->isInitialized('sandboxID') && null !== $object->getSandboxID()) { + $data['SandboxID'] = $object->getSandboxID(); + } + if ($object->isInitialized('hairpinMode') && null !== $object->getHairpinMode()) { + $data['HairpinMode'] = $object->getHairpinMode(); + } + if ($object->isInitialized('linkLocalIPv6Address') && null !== $object->getLinkLocalIPv6Address()) { + $data['LinkLocalIPv6Address'] = $object->getLinkLocalIPv6Address(); + } + if ($object->isInitialized('linkLocalIPv6PrefixLen') && null !== $object->getLinkLocalIPv6PrefixLen()) { + $data['LinkLocalIPv6PrefixLen'] = $object->getLinkLocalIPv6PrefixLen(); + } + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values = []; + foreach ($object->getPorts() as $key => $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $values[$key] = $values_1; + } + $data['Ports'] = $values; + } + if ($object->isInitialized('sandboxKey') && null !== $object->getSandboxKey()) { + $data['SandboxKey'] = $object->getSandboxKey(); + } + if ($object->isInitialized('secondaryIPAddresses') && null !== $object->getSecondaryIPAddresses()) { + $values_2 = []; + foreach ($object->getSecondaryIPAddresses() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['SecondaryIPAddresses'] = $values_2; + } + if ($object->isInitialized('secondaryIPv6Addresses') && null !== $object->getSecondaryIPv6Addresses()) { + $values_3 = []; + foreach ($object->getSecondaryIPv6Addresses() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['SecondaryIPv6Addresses'] = $values_3; + } + if ($object->isInitialized('endpointID') && null !== $object->getEndpointID()) { + $data['EndpointID'] = $object->getEndpointID(); + } + if ($object->isInitialized('gateway') && null !== $object->getGateway()) { + $data['Gateway'] = $object->getGateway(); + } + if ($object->isInitialized('globalIPv6Address') && null !== $object->getGlobalIPv6Address()) { + $data['GlobalIPv6Address'] = $object->getGlobalIPv6Address(); + } + if ($object->isInitialized('globalIPv6PrefixLen') && null !== $object->getGlobalIPv6PrefixLen()) { + $data['GlobalIPv6PrefixLen'] = $object->getGlobalIPv6PrefixLen(); + } + if ($object->isInitialized('iPAddress') && null !== $object->getIPAddress()) { + $data['IPAddress'] = $object->getIPAddress(); + } + if ($object->isInitialized('iPPrefixLen') && null !== $object->getIPPrefixLen()) { + $data['IPPrefixLen'] = $object->getIPPrefixLen(); + } + if ($object->isInitialized('iPv6Gateway') && null !== $object->getIPv6Gateway()) { + $data['IPv6Gateway'] = $object->getIPv6Gateway(); + } + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); + } + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values_4 = []; + foreach ($object->getNetworks() as $key_1 => $value_4) { + $values_4[$key_1] = $this->normalizer->normalize($value_4, 'json', $context); + } + $data['Networks'] = $values_4; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkSettings::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/NetworkingConfigNormalizer.php b/generated/Normalizer/NetworkingConfigNormalizer.php index d0e94de9..59cdbf7c 100644 --- a/generated/Normalizer/NetworkingConfigNormalizer.php +++ b/generated/Normalizer/NetworkingConfigNormalizer.php @@ -2,64 +2,133 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class NetworkingConfigNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NetworkingConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\NetworkingConfig') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworkingConfig::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\NetworkingConfig) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworkingConfig::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\NetworkingConfig(); - if (property_exists($data, 'EndpointsConfig')) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'EndpointsConfig'} as $key => $value) { - $values[$key] = $this->serializer->denormalize($value, 'Docker\\API\\Model\\EndpointSettings', 'raw', $context); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworkingConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('EndpointsConfig', $data) && $data['EndpointsConfig'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['EndpointsConfig'] as $key => $value) { + $values[$key] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointSettings::class, 'json', $context); + } + $object->setEndpointsConfig($values); } - $object->setEndpointsConfig($values); + elseif (\array_key_exists('EndpointsConfig', $data) && $data['EndpointsConfig'] === null) { + $object->setEndpointsConfig(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('endpointsConfig') && null !== $object->getEndpointsConfig()) { + $values = []; + foreach ($object->getEndpointsConfig() as $key => $value) { + $values[$key] = $this->normalizer->normalize($value, 'json', $context); + } + $data['EndpointsConfig'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkingConfig::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class NetworkingConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getEndpointsConfig()) { - $values = new \stdClass(); - foreach ($object->getEndpointsConfig() as $key => $value) { - $values->{$key} = $value; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworkingConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworkingConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data->{'EndpointsConfig'} = $values; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworkingConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('EndpointsConfig', $data) && $data['EndpointsConfig'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['EndpointsConfig'] as $key => $value) { + $values[$key] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointSettings::class, 'json', $context); + } + $object->setEndpointsConfig($values); + } + elseif (\array_key_exists('EndpointsConfig', $data) && $data['EndpointsConfig'] === null) { + $object->setEndpointsConfig(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('endpointsConfig') && null !== $object->getEndpointsConfig()) { + $values = []; + foreach ($object->getEndpointsConfig() as $key => $value) { + $values[$key] = $this->normalizer->normalize($value, 'json', $context); + } + $data['EndpointsConfig'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkingConfig::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/NetworksCreatePostBodyNormalizer.php b/generated/Normalizer/NetworksCreatePostBodyNormalizer.php new file mode 100644 index 00000000..3ed860f4 --- /dev/null +++ b/generated/Normalizer/NetworksCreatePostBodyNormalizer.php @@ -0,0 +1,362 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NetworksCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworksCreatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworksCreatePostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworksCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Scope', $data) && $data['Scope'] !== null) { + $object->setScope($data['Scope']); + } + elseif (\array_key_exists('Scope', $data) && $data['Scope'] === null) { + $object->setScope(null); + } + if (\array_key_exists('Internal', $data) && $data['Internal'] !== null) { + $object->setInternal($data['Internal']); + } + elseif (\array_key_exists('Internal', $data) && $data['Internal'] === null) { + $object->setInternal(null); + } + if (\array_key_exists('Attachable', $data) && $data['Attachable'] !== null) { + $object->setAttachable($data['Attachable']); + } + elseif (\array_key_exists('Attachable', $data) && $data['Attachable'] === null) { + $object->setAttachable(null); + } + if (\array_key_exists('Ingress', $data) && $data['Ingress'] !== null) { + $object->setIngress($data['Ingress']); + } + elseif (\array_key_exists('Ingress', $data) && $data['Ingress'] === null) { + $object->setIngress(null); + } + if (\array_key_exists('ConfigOnly', $data) && $data['ConfigOnly'] !== null) { + $object->setConfigOnly($data['ConfigOnly']); + } + elseif (\array_key_exists('ConfigOnly', $data) && $data['ConfigOnly'] === null) { + $object->setConfigOnly(null); + } + if (\array_key_exists('ConfigFrom', $data) && $data['ConfigFrom'] !== null) { + $object->setConfigFrom($this->denormalizer->denormalize($data['ConfigFrom'], \Docker\API\Model\ConfigReference::class, 'json', $context)); + } + elseif (\array_key_exists('ConfigFrom', $data) && $data['ConfigFrom'] === null) { + $object->setConfigFrom(null); + } + if (\array_key_exists('IPAM', $data) && $data['IPAM'] !== null) { + $object->setIPAM($this->denormalizer->denormalize($data['IPAM'], \Docker\API\Model\IPAM::class, 'json', $context)); + } + elseif (\array_key_exists('IPAM', $data) && $data['IPAM'] === null) { + $object->setIPAM(null); + } + if (\array_key_exists('EnableIPv4', $data) && $data['EnableIPv4'] !== null) { + $object->setEnableIPv4($data['EnableIPv4']); + } + elseif (\array_key_exists('EnableIPv4', $data) && $data['EnableIPv4'] === null) { + $object->setEnableIPv4(null); + } + if (\array_key_exists('EnableIPv6', $data) && $data['EnableIPv6'] !== null) { + $object->setEnableIPv6($data['EnableIPv6']); + } + elseif (\array_key_exists('EnableIPv6', $data) && $data['EnableIPv6'] === null) { + $object->setEnableIPv6(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { + $values[$key] = $value; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $object->setLabels($values_1); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Name'] = $object->getName(); + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('scope') && null !== $object->getScope()) { + $data['Scope'] = $object->getScope(); + } + if ($object->isInitialized('internal') && null !== $object->getInternal()) { + $data['Internal'] = $object->getInternal(); + } + if ($object->isInitialized('attachable') && null !== $object->getAttachable()) { + $data['Attachable'] = $object->getAttachable(); + } + if ($object->isInitialized('ingress') && null !== $object->getIngress()) { + $data['Ingress'] = $object->getIngress(); + } + if ($object->isInitialized('configOnly') && null !== $object->getConfigOnly()) { + $data['ConfigOnly'] = $object->getConfigOnly(); + } + if ($object->isInitialized('configFrom') && null !== $object->getConfigFrom()) { + $data['ConfigFrom'] = $this->normalizer->normalize($object->getConfigFrom(), 'json', $context); + } + if ($object->isInitialized('iPAM') && null !== $object->getIPAM()) { + $data['IPAM'] = $this->normalizer->normalize($object->getIPAM(), 'json', $context); + } + if ($object->isInitialized('enableIPv4') && null !== $object->getEnableIPv4()) { + $data['EnableIPv4'] = $object->getEnableIPv4(); + } + if ($object->isInitialized('enableIPv6') && null !== $object->getEnableIPv6()) { + $data['EnableIPv6'] = $object->getEnableIPv6(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $key => $value) { + $values[$key] = $value; + } + $data['Options'] = $values; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_1 = []; + foreach ($object->getLabels() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $data['Labels'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksCreatePostBody::class => false]; + } + } +} else { + class NetworksCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworksCreatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworksCreatePostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworksCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Scope', $data) && $data['Scope'] !== null) { + $object->setScope($data['Scope']); + } + elseif (\array_key_exists('Scope', $data) && $data['Scope'] === null) { + $object->setScope(null); + } + if (\array_key_exists('Internal', $data) && $data['Internal'] !== null) { + $object->setInternal($data['Internal']); + } + elseif (\array_key_exists('Internal', $data) && $data['Internal'] === null) { + $object->setInternal(null); + } + if (\array_key_exists('Attachable', $data) && $data['Attachable'] !== null) { + $object->setAttachable($data['Attachable']); + } + elseif (\array_key_exists('Attachable', $data) && $data['Attachable'] === null) { + $object->setAttachable(null); + } + if (\array_key_exists('Ingress', $data) && $data['Ingress'] !== null) { + $object->setIngress($data['Ingress']); + } + elseif (\array_key_exists('Ingress', $data) && $data['Ingress'] === null) { + $object->setIngress(null); + } + if (\array_key_exists('ConfigOnly', $data) && $data['ConfigOnly'] !== null) { + $object->setConfigOnly($data['ConfigOnly']); + } + elseif (\array_key_exists('ConfigOnly', $data) && $data['ConfigOnly'] === null) { + $object->setConfigOnly(null); + } + if (\array_key_exists('ConfigFrom', $data) && $data['ConfigFrom'] !== null) { + $object->setConfigFrom($this->denormalizer->denormalize($data['ConfigFrom'], \Docker\API\Model\ConfigReference::class, 'json', $context)); + } + elseif (\array_key_exists('ConfigFrom', $data) && $data['ConfigFrom'] === null) { + $object->setConfigFrom(null); + } + if (\array_key_exists('IPAM', $data) && $data['IPAM'] !== null) { + $object->setIPAM($this->denormalizer->denormalize($data['IPAM'], \Docker\API\Model\IPAM::class, 'json', $context)); + } + elseif (\array_key_exists('IPAM', $data) && $data['IPAM'] === null) { + $object->setIPAM(null); + } + if (\array_key_exists('EnableIPv4', $data) && $data['EnableIPv4'] !== null) { + $object->setEnableIPv4($data['EnableIPv4']); + } + elseif (\array_key_exists('EnableIPv4', $data) && $data['EnableIPv4'] === null) { + $object->setEnableIPv4(null); + } + if (\array_key_exists('EnableIPv6', $data) && $data['EnableIPv6'] !== null) { + $object->setEnableIPv6($data['EnableIPv6']); + } + elseif (\array_key_exists('EnableIPv6', $data) && $data['EnableIPv6'] === null) { + $object->setEnableIPv6(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { + $values[$key] = $value; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $object->setLabels($values_1); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Name'] = $object->getName(); + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('scope') && null !== $object->getScope()) { + $data['Scope'] = $object->getScope(); + } + if ($object->isInitialized('internal') && null !== $object->getInternal()) { + $data['Internal'] = $object->getInternal(); + } + if ($object->isInitialized('attachable') && null !== $object->getAttachable()) { + $data['Attachable'] = $object->getAttachable(); + } + if ($object->isInitialized('ingress') && null !== $object->getIngress()) { + $data['Ingress'] = $object->getIngress(); + } + if ($object->isInitialized('configOnly') && null !== $object->getConfigOnly()) { + $data['ConfigOnly'] = $object->getConfigOnly(); + } + if ($object->isInitialized('configFrom') && null !== $object->getConfigFrom()) { + $data['ConfigFrom'] = $this->normalizer->normalize($object->getConfigFrom(), 'json', $context); + } + if ($object->isInitialized('iPAM') && null !== $object->getIPAM()) { + $data['IPAM'] = $this->normalizer->normalize($object->getIPAM(), 'json', $context); + } + if ($object->isInitialized('enableIPv4') && null !== $object->getEnableIPv4()) { + $data['EnableIPv4'] = $object->getEnableIPv4(); + } + if ($object->isInitialized('enableIPv6') && null !== $object->getEnableIPv6()) { + $data['EnableIPv6'] = $object->getEnableIPv6(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $key => $value) { + $values[$key] = $value; + } + $data['Options'] = $values; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_1 = []; + foreach ($object->getLabels() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $data['Labels'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksCreatePostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/NetworksIdConnectPostBodyNormalizer.php b/generated/Normalizer/NetworksIdConnectPostBodyNormalizer.php new file mode 100644 index 00000000..6b39290f --- /dev/null +++ b/generated/Normalizer/NetworksIdConnectPostBodyNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NetworksIdConnectPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworksIdConnectPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworksIdConnectPostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworksIdConnectPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Container', $data) && $data['Container'] !== null) { + $object->setContainer($data['Container']); + } + elseif (\array_key_exists('Container', $data) && $data['Container'] === null) { + $object->setContainer(null); + } + if (\array_key_exists('EndpointConfig', $data) && $data['EndpointConfig'] !== null) { + $object->setEndpointConfig($this->denormalizer->denormalize($data['EndpointConfig'], \Docker\API\Model\EndpointSettings::class, 'json', $context)); + } + elseif (\array_key_exists('EndpointConfig', $data) && $data['EndpointConfig'] === null) { + $object->setEndpointConfig(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('container') && null !== $object->getContainer()) { + $data['Container'] = $object->getContainer(); + } + if ($object->isInitialized('endpointConfig') && null !== $object->getEndpointConfig()) { + $data['EndpointConfig'] = $this->normalizer->normalize($object->getEndpointConfig(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksIdConnectPostBody::class => false]; + } + } +} else { + class NetworksIdConnectPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworksIdConnectPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworksIdConnectPostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworksIdConnectPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Container', $data) && $data['Container'] !== null) { + $object->setContainer($data['Container']); + } + elseif (\array_key_exists('Container', $data) && $data['Container'] === null) { + $object->setContainer(null); + } + if (\array_key_exists('EndpointConfig', $data) && $data['EndpointConfig'] !== null) { + $object->setEndpointConfig($this->denormalizer->denormalize($data['EndpointConfig'], \Docker\API\Model\EndpointSettings::class, 'json', $context)); + } + elseif (\array_key_exists('EndpointConfig', $data) && $data['EndpointConfig'] === null) { + $object->setEndpointConfig(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('container') && null !== $object->getContainer()) { + $data['Container'] = $object->getContainer(); + } + if ($object->isInitialized('endpointConfig') && null !== $object->getEndpointConfig()) { + $data['EndpointConfig'] = $this->normalizer->normalize($object->getEndpointConfig(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksIdConnectPostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/NetworksIdDisconnectPostBodyNormalizer.php b/generated/Normalizer/NetworksIdDisconnectPostBodyNormalizer.php new file mode 100644 index 00000000..6f94f91d --- /dev/null +++ b/generated/Normalizer/NetworksIdDisconnectPostBodyNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NetworksIdDisconnectPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworksIdDisconnectPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworksIdDisconnectPostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworksIdDisconnectPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Container', $data) && $data['Container'] !== null) { + $object->setContainer($data['Container']); + } + elseif (\array_key_exists('Container', $data) && $data['Container'] === null) { + $object->setContainer(null); + } + if (\array_key_exists('Force', $data) && $data['Force'] !== null) { + $object->setForce($data['Force']); + } + elseif (\array_key_exists('Force', $data) && $data['Force'] === null) { + $object->setForce(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('container') && null !== $object->getContainer()) { + $data['Container'] = $object->getContainer(); + } + if ($object->isInitialized('force') && null !== $object->getForce()) { + $data['Force'] = $object->getForce(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksIdDisconnectPostBody::class => false]; + } + } +} else { + class NetworksIdDisconnectPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworksIdDisconnectPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworksIdDisconnectPostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworksIdDisconnectPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Container', $data) && $data['Container'] !== null) { + $object->setContainer($data['Container']); + } + elseif (\array_key_exists('Container', $data) && $data['Container'] === null) { + $object->setContainer(null); + } + if (\array_key_exists('Force', $data) && $data['Force'] !== null) { + $object->setForce($data['Force']); + } + elseif (\array_key_exists('Force', $data) && $data['Force'] === null) { + $object->setForce(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('container') && null !== $object->getContainer()) { + $data['Container'] = $object->getContainer(); + } + if ($object->isInitialized('force') && null !== $object->getForce()) { + $data['Force'] = $object->getForce(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksIdDisconnectPostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/NetworksPrunePostResponse200Normalizer.php b/generated/Normalizer/NetworksPrunePostResponse200Normalizer.php new file mode 100644 index 00000000..96d9a5b8 --- /dev/null +++ b/generated/Normalizer/NetworksPrunePostResponse200Normalizer.php @@ -0,0 +1,134 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NetworksPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworksPrunePostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworksPrunePostResponse200::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworksPrunePostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NetworksDeleted', $data) && $data['NetworksDeleted'] !== null) { + $values = []; + foreach ($data['NetworksDeleted'] as $value) { + $values[] = $value; + } + $object->setNetworksDeleted($values); + } + elseif (\array_key_exists('NetworksDeleted', $data) && $data['NetworksDeleted'] === null) { + $object->setNetworksDeleted(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('networksDeleted') && null !== $object->getNetworksDeleted()) { + $values = []; + foreach ($object->getNetworksDeleted() as $value) { + $values[] = $value; + } + $data['NetworksDeleted'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksPrunePostResponse200::class => false]; + } + } +} else { + class NetworksPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NetworksPrunePostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NetworksPrunePostResponse200::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NetworksPrunePostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NetworksDeleted', $data) && $data['NetworksDeleted'] !== null) { + $values = []; + foreach ($data['NetworksDeleted'] as $value) { + $values[] = $value; + } + $object->setNetworksDeleted($values); + } + elseif (\array_key_exists('NetworksDeleted', $data) && $data['NetworksDeleted'] === null) { + $object->setNetworksDeleted(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('networksDeleted') && null !== $object->getNetworksDeleted()) { + $values = []; + foreach ($object->getNetworksDeleted() as $value) { + $values[] = $value; + } + $data['NetworksDeleted'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksPrunePostResponse200::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/NodeDescriptionNormalizer.php b/generated/Normalizer/NodeDescriptionNormalizer.php index 69f3525d..ee047c37 100644 --- a/generated/Normalizer/NodeDescriptionNormalizer.php +++ b/generated/Normalizer/NodeDescriptionNormalizer.php @@ -2,73 +2,189 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class NodeDescriptionNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\NodeDescription') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NodeDescriptionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\NodeDescription) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NodeDescription::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\NodeDescription(); - if (property_exists($data, 'Hostname')) { - $object->setHostname($data->{'Hostname'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NodeDescription::class; } - if (property_exists($data, 'Platform')) { - $object->setPlatform($this->serializer->denormalize($data->{'Platform'}, 'Docker\\API\\Model\\NodePlatform', 'raw', $context)); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NodeDescription(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Hostname', $data) && $data['Hostname'] !== null) { + $object->setHostname($data['Hostname']); + } + elseif (\array_key_exists('Hostname', $data) && $data['Hostname'] === null) { + $object->setHostname(null); + } + if (\array_key_exists('Platform', $data) && $data['Platform'] !== null) { + $object->setPlatform($this->denormalizer->denormalize($data['Platform'], \Docker\API\Model\Platform::class, 'json', $context)); + } + elseif (\array_key_exists('Platform', $data) && $data['Platform'] === null) { + $object->setPlatform(null); + } + if (\array_key_exists('Resources', $data) && $data['Resources'] !== null) { + $object->setResources($this->denormalizer->denormalize($data['Resources'], \Docker\API\Model\ResourceObject::class, 'json', $context)); + } + elseif (\array_key_exists('Resources', $data) && $data['Resources'] === null) { + $object->setResources(null); + } + if (\array_key_exists('Engine', $data) && $data['Engine'] !== null) { + $object->setEngine($this->denormalizer->denormalize($data['Engine'], \Docker\API\Model\EngineDescription::class, 'json', $context)); + } + elseif (\array_key_exists('Engine', $data) && $data['Engine'] === null) { + $object->setEngine(null); + } + if (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] !== null) { + $object->setTLSInfo($this->denormalizer->denormalize($data['TLSInfo'], \Docker\API\Model\TLSInfo::class, 'json', $context)); + } + elseif (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] === null) { + $object->setTLSInfo(null); + } + return $object; } - if (property_exists($data, 'Resources')) { - $object->setResources($this->serializer->denormalize($data->{'Resources'}, 'Docker\\API\\Model\\NodeResources', 'raw', $context)); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); + } + if ($object->isInitialized('platform') && null !== $object->getPlatform()) { + $data['Platform'] = $this->normalizer->normalize($object->getPlatform(), 'json', $context); + } + if ($object->isInitialized('resources') && null !== $object->getResources()) { + $data['Resources'] = $this->normalizer->normalize($object->getResources(), 'json', $context); + } + if ($object->isInitialized('engine') && null !== $object->getEngine()) { + $data['Engine'] = $this->normalizer->normalize($object->getEngine(), 'json', $context); + } + if ($object->isInitialized('tLSInfo') && null !== $object->getTLSInfo()) { + $data['TLSInfo'] = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); + } + return $data; } - if (property_exists($data, 'Engine')) { - $object->setEngine($this->serializer->denormalize($data->{'Engine'}, 'Docker\\API\\Model\\NodeEngine', 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NodeDescription::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class NodeDescriptionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getHostname()) { - $data->{'Hostname'} = $object->getHostname(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NodeDescription::class; } - if (null !== $object->getPlatform()) { - $data->{'Platform'} = json_decode($this->serializer->normalize($object->getPlatform(), 'raw', $context)); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NodeDescription::class; } - if (null !== $object->getResources()) { - $data->{'Resources'} = json_decode($this->serializer->normalize($object->getResources(), 'raw', $context)); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NodeDescription(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Hostname', $data) && $data['Hostname'] !== null) { + $object->setHostname($data['Hostname']); + } + elseif (\array_key_exists('Hostname', $data) && $data['Hostname'] === null) { + $object->setHostname(null); + } + if (\array_key_exists('Platform', $data) && $data['Platform'] !== null) { + $object->setPlatform($this->denormalizer->denormalize($data['Platform'], \Docker\API\Model\Platform::class, 'json', $context)); + } + elseif (\array_key_exists('Platform', $data) && $data['Platform'] === null) { + $object->setPlatform(null); + } + if (\array_key_exists('Resources', $data) && $data['Resources'] !== null) { + $object->setResources($this->denormalizer->denormalize($data['Resources'], \Docker\API\Model\ResourceObject::class, 'json', $context)); + } + elseif (\array_key_exists('Resources', $data) && $data['Resources'] === null) { + $object->setResources(null); + } + if (\array_key_exists('Engine', $data) && $data['Engine'] !== null) { + $object->setEngine($this->denormalizer->denormalize($data['Engine'], \Docker\API\Model\EngineDescription::class, 'json', $context)); + } + elseif (\array_key_exists('Engine', $data) && $data['Engine'] === null) { + $object->setEngine(null); + } + if (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] !== null) { + $object->setTLSInfo($this->denormalizer->denormalize($data['TLSInfo'], \Docker\API\Model\TLSInfo::class, 'json', $context)); + } + elseif (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] === null) { + $object->setTLSInfo(null); + } + return $object; } - if (null !== $object->getEngine()) { - $data->{'Engine'} = json_decode($this->serializer->normalize($object->getEngine(), 'raw', $context)); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); + } + if ($object->isInitialized('platform') && null !== $object->getPlatform()) { + $data['Platform'] = $this->normalizer->normalize($object->getPlatform(), 'json', $context); + } + if ($object->isInitialized('resources') && null !== $object->getResources()) { + $data['Resources'] = $this->normalizer->normalize($object->getResources(), 'json', $context); + } + if ($object->isInitialized('engine') && null !== $object->getEngine()) { + $data['Engine'] = $this->normalizer->normalize($object->getEngine(), 'json', $context); + } + if ($object->isInitialized('tLSInfo') && null !== $object->getTLSInfo()) { + $data['TLSInfo'] = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NodeDescription::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/NodeEngineNormalizer.php b/generated/Normalizer/NodeEngineNormalizer.php deleted file mode 100644 index c56f567b..00000000 --- a/generated/Normalizer/NodeEngineNormalizer.php +++ /dev/null @@ -1,96 +0,0 @@ -setEngineVersion($data->{'EngineVersion'}); - } - if (property_exists($data, 'Labels')) { - $value = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_1) { - $values[$key] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Labels'})) { - $value = $data->{'Labels'}; - } - $object->setLabels($value); - } - if (property_exists($data, 'Plugins')) { - $values_1 = []; - foreach ($data->{'Plugins'} as $value_2) { - $values_1[] = $this->serializer->denormalize($value_2, 'Docker\\API\\Model\\NodePlugin', 'raw', $context); - } - $object->setPlugins($values_1); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getEngineVersion()) { - $data->{'EngineVersion'} = $object->getEngineVersion(); - } - $value = $object->getLabels(); - if (is_object($object->getLabels())) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value_1) { - $values->{$key} = $value_1; - } - $value = $values; - } - if (is_null($object->getLabels())) { - $value = $object->getLabels(); - } - $data->{'Labels'} = $value; - if (null !== $object->getPlugins()) { - $values_1 = []; - foreach ($object->getPlugins() as $value_2) { - $values_1[] = $value_2; - } - $data->{'Plugins'} = $values_1; - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/NodeManagerStatusNormalizer.php b/generated/Normalizer/NodeManagerStatusNormalizer.php deleted file mode 100644 index a1de1acb..00000000 --- a/generated/Normalizer/NodeManagerStatusNormalizer.php +++ /dev/null @@ -1,69 +0,0 @@ -setLeader($data->{'Leader'}); - } - if (property_exists($data, 'Reachability')) { - $object->setReachability($data->{'Reachability'}); - } - if (property_exists($data, 'Addr')) { - $object->setAddr($data->{'Addr'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getLeader()) { - $data->{'Leader'} = $object->getLeader(); - } - if (null !== $object->getReachability()) { - $data->{'Reachability'} = $object->getReachability(); - } - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/NodeNormalizer.php b/generated/Normalizer/NodeNormalizer.php index 7195943b..55f94076 100644 --- a/generated/Normalizer/NodeNormalizer.php +++ b/generated/Normalizer/NodeNormalizer.php @@ -2,98 +2,243 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class NodeNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\Node') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NodeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\Node) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Node::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Node::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Node(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\NodeSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($this->denormalizer->denormalize($data['Description'], \Docker\API\Model\NodeDescription::class, 'json', $context)); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($this->denormalizer->denormalize($data['Status'], \Docker\API\Model\NodeStatus::class, 'json', $context)); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('ManagerStatus', $data) && $data['ManagerStatus'] !== null) { + $object->setManagerStatus($this->denormalizer->denormalize($data['ManagerStatus'], \Docker\API\Model\ManagerStatus::class, 'json', $context)); + } + elseif (\array_key_exists('ManagerStatus', $data) && $data['ManagerStatus'] === null) { + $object->setManagerStatus(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['Description'] = $this->normalizer->normalize($object->getDescription(), 'json', $context); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['Status'] = $this->normalizer->normalize($object->getStatus(), 'json', $context); + } + if ($object->isInitialized('managerStatus') && null !== $object->getManagerStatus()) { + $data['ManagerStatus'] = $this->normalizer->normalize($object->getManagerStatus(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Node::class => false]; } - - return false; } - - public function denormalize($data, $class, $format = null, array $context = []) +} else { + class NodeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\Node(); - if (property_exists($data, 'ID')) { - $object->setID($data->{'ID'}); - } - if (property_exists($data, 'Version')) { - $object->setVersion($this->serializer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\NodeVersion', 'raw', $context)); - } - if (property_exists($data, 'CreatedAt')) { - $object->setCreatedAt(\DateTime::createFromFormat("Y-m-d\TH:i:sP", $data->{'CreatedAt'})); - } - if (property_exists($data, 'UpdatedAt')) { - $object->setUpdatedAt(\DateTime::createFromFormat("Y-m-d\TH:i:sP", $data->{'UpdatedAt'})); - } - if (property_exists($data, 'Spec')) { - $object->setSpec($this->serializer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\NodeSpec', 'raw', $context)); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Node::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Node::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Node(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\NodeSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($this->denormalizer->denormalize($data['Description'], \Docker\API\Model\NodeDescription::class, 'json', $context)); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($this->denormalizer->denormalize($data['Status'], \Docker\API\Model\NodeStatus::class, 'json', $context)); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('ManagerStatus', $data) && $data['ManagerStatus'] !== null) { + $object->setManagerStatus($this->denormalizer->denormalize($data['ManagerStatus'], \Docker\API\Model\ManagerStatus::class, 'json', $context)); + } + elseif (\array_key_exists('ManagerStatus', $data) && $data['ManagerStatus'] === null) { + $object->setManagerStatus(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['Description'] = $this->normalizer->normalize($object->getDescription(), 'json', $context); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['Status'] = $this->normalizer->normalize($object->getStatus(), 'json', $context); + } + if ($object->isInitialized('managerStatus') && null !== $object->getManagerStatus()) { + $data['ManagerStatus'] = $this->normalizer->normalize($object->getManagerStatus(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Node::class => false]; } - if (property_exists($data, 'Description')) { - $object->setDescription($this->serializer->denormalize($data->{'Description'}, 'Docker\\API\\Model\\NodeDescription', 'raw', $context)); - } - if (property_exists($data, 'Status')) { - $object->setStatus($this->serializer->denormalize($data->{'Status'}, 'Docker\\API\\Model\\NodeStatus', 'raw', $context)); - } - if (property_exists($data, 'ManagerStatus')) { - $object->setManagerStatus($this->serializer->denormalize($data->{'ManagerStatus'}, 'Docker\\API\\Model\\NodeManagerStatus', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); - } - if (null !== $object->getVersion()) { - $data->{'Version'} = json_decode($this->serializer->normalize($object->getVersion(), 'raw', $context)); - } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt()->format("Y-m-d\TH:i:sP"); - } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt()->format("Y-m-d\TH:i:sP"); - } - if (null !== $object->getSpec()) { - $data->{'Spec'} = json_decode($this->serializer->normalize($object->getSpec(), 'raw', $context)); - } - if (null !== $object->getDescription()) { - $data->{'Description'} = json_decode($this->serializer->normalize($object->getDescription(), 'raw', $context)); - } - if (null !== $object->getStatus()) { - $data->{'Status'} = json_decode($this->serializer->normalize($object->getStatus(), 'raw', $context)); - } - if (null !== $object->getManagerStatus()) { - $data->{'ManagerStatus'} = json_decode($this->serializer->normalize($object->getManagerStatus(), 'raw', $context)); - } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/NodePlatformNormalizer.php b/generated/Normalizer/NodePlatformNormalizer.php deleted file mode 100644 index ccee50db..00000000 --- a/generated/Normalizer/NodePlatformNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setArchitecture($data->{'Architecture'}); - } - if (property_exists($data, 'OS')) { - $object->setOS($data->{'OS'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getArchitecture()) { - $data->{'Architecture'} = $object->getArchitecture(); - } - if (null !== $object->getOS()) { - $data->{'OS'} = $object->getOS(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/NodePluginNormalizer.php b/generated/Normalizer/NodePluginNormalizer.php deleted file mode 100644 index a29d358c..00000000 --- a/generated/Normalizer/NodePluginNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setType($data->{'Type'}); - } - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); - } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/NodeResourcesNormalizer.php b/generated/Normalizer/NodeResourcesNormalizer.php deleted file mode 100644 index a1f08d97..00000000 --- a/generated/Normalizer/NodeResourcesNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setNanoCPUs($data->{'NanoCPUs'}); - } - if (property_exists($data, 'MemoryBytes')) { - $object->setMemoryBytes($data->{'MemoryBytes'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getNanoCPUs()) { - $data->{'NanoCPUs'} = $object->getNanoCPUs(); - } - if (null !== $object->getMemoryBytes()) { - $data->{'MemoryBytes'} = $object->getMemoryBytes(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/NodeSpecNormalizer.php b/generated/Normalizer/NodeSpecNormalizer.php index c33ffbdd..0416274b 100644 --- a/generated/Normalizer/NodeSpecNormalizer.php +++ b/generated/Normalizer/NodeSpecNormalizer.php @@ -2,94 +2,187 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class NodeSpecNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\NodeSpec') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\NodeSpec) { - return true; - } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NodeSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\NodeSpec(); - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NodeSpec::class; } - if (property_exists($data, 'Role')) { - $object->setRole($data->{'Role'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NodeSpec::class; } - if (property_exists($data, 'Availability')) { - $object->setAvailability($data->{'Availability'}); - } - if (property_exists($data, 'Labels')) { - $value = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NodeSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_1) { - $values[$key] = $value_1; + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; } - $value = $values; + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Role', $data) && $data['Role'] !== null) { + $object->setRole($data['Role']); } - if (is_null($data->{'Labels'})) { - $value = $data->{'Labels'}; + elseif (\array_key_exists('Role', $data) && $data['Role'] === null) { + $object->setRole(null); } - $object->setLabels($value); + if (\array_key_exists('Availability', $data) && $data['Availability'] !== null) { + $object->setAvailability($data['Availability']); + } + elseif (\array_key_exists('Availability', $data) && $data['Availability'] === null) { + $object->setAvailability(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('role') && null !== $object->getRole()) { + $data['Role'] = $object->getRole(); + } + if ($object->isInitialized('availability') && null !== $object->getAvailability()) { + $data['Availability'] = $object->getAvailability(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NodeSpec::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class NodeSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NodeSpec::class; } - if (null !== $object->getRole()) { - $data->{'Role'} = $object->getRole(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NodeSpec::class; } - if (null !== $object->getAvailability()) { - $data->{'Availability'} = $object->getAvailability(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NodeSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Role', $data) && $data['Role'] !== null) { + $object->setRole($data['Role']); + } + elseif (\array_key_exists('Role', $data) && $data['Role'] === null) { + $object->setRole(null); + } + if (\array_key_exists('Availability', $data) && $data['Availability'] !== null) { + $object->setAvailability($data['Availability']); + } + elseif (\array_key_exists('Availability', $data) && $data['Availability'] === null) { + $object->setAvailability(null); + } + return $object; } - $value = $object->getLabels(); - if (is_object($object->getLabels())) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value_1) { - $values->{$key} = $value_1; + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; } - $value = $values; + if ($object->isInitialized('role') && null !== $object->getRole()) { + $data['Role'] = $object->getRole(); + } + if ($object->isInitialized('availability') && null !== $object->getAvailability()) { + $data['Availability'] = $object->getAvailability(); + } + return $data; } - if (is_null($object->getLabels())) { - $value = $object->getLabels(); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NodeSpec::class => false]; } - $data->{'Labels'} = $value; - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/NodeStatusNormalizer.php b/generated/Normalizer/NodeStatusNormalizer.php index 55988587..e3762842 100644 --- a/generated/Normalizer/NodeStatusNormalizer.php +++ b/generated/Normalizer/NodeStatusNormalizer.php @@ -2,55 +2,153 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class NodeStatusNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class NodeStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\NodeStatus') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NodeStatus::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\NodeStatus) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NodeStatus::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\NodeStatus(); - if (property_exists($data, 'State')) { - $object->setState($data->{'State'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NodeStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); + } + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); + } + if (\array_key_exists('Message', $data) && $data['Message'] !== null) { + $object->setMessage($data['Message']); + } + elseif (\array_key_exists('Message', $data) && $data['Message'] === null) { + $object->setMessage(null); + } + if (\array_key_exists('Addr', $data) && $data['Addr'] !== null) { + $object->setAddr($data['Addr']); + } + elseif (\array_key_exists('Addr', $data) && $data['Addr'] === null) { + $object->setAddr(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); + } + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['Message'] = $object->getMessage(); + } + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NodeStatus::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class NodeStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getState()) { - $data->{'State'} = $object->getState(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\NodeStatus::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\NodeStatus::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\NodeStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); + } + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); + } + if (\array_key_exists('Message', $data) && $data['Message'] !== null) { + $object->setMessage($data['Message']); + } + elseif (\array_key_exists('Message', $data) && $data['Message'] === null) { + $object->setMessage(null); + } + if (\array_key_exists('Addr', $data) && $data['Addr'] !== null) { + $object->setAddr($data['Addr']); + } + elseif (\array_key_exists('Addr', $data) && $data['Addr'] === null) { + $object->setAddr(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); + } + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['Message'] = $object->getMessage(); + } + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NodeStatus::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/NodeVersionNormalizer.php b/generated/Normalizer/NodeVersionNormalizer.php deleted file mode 100644 index 25b27760..00000000 --- a/generated/Normalizer/NodeVersionNormalizer.php +++ /dev/null @@ -1,56 +0,0 @@ -setIndex($data->{'Index'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getIndex()) { - $data->{'Index'} = $object->getIndex(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/NormalizerFactory.php b/generated/Normalizer/NormalizerFactory.php deleted file mode 100644 index 1f5749f1..00000000 --- a/generated/Normalizer/NormalizerFactory.php +++ /dev/null @@ -1,127 +0,0 @@ -= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class OCIDescriptorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\OCIDescriptor::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\OCIDescriptor::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\OCIDescriptor(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('mediaType', $data) && $data['mediaType'] !== null) { + $object->setMediaType($data['mediaType']); + } + elseif (\array_key_exists('mediaType', $data) && $data['mediaType'] === null) { + $object->setMediaType(null); + } + if (\array_key_exists('digest', $data) && $data['digest'] !== null) { + $object->setDigest($data['digest']); + } + elseif (\array_key_exists('digest', $data) && $data['digest'] === null) { + $object->setDigest(null); + } + if (\array_key_exists('size', $data) && $data['size'] !== null) { + $object->setSize($data['size']); + } + elseif (\array_key_exists('size', $data) && $data['size'] === null) { + $object->setSize(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('mediaType') && null !== $object->getMediaType()) { + $data['mediaType'] = $object->getMediaType(); + } + if ($object->isInitialized('digest') && null !== $object->getDigest()) { + $data['digest'] = $object->getDigest(); + } + if ($object->isInitialized('size') && null !== $object->getSize()) { + $data['size'] = $object->getSize(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\OCIDescriptor::class => false]; + } + } +} else { + class OCIDescriptorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\OCIDescriptor::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\OCIDescriptor::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\OCIDescriptor(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('mediaType', $data) && $data['mediaType'] !== null) { + $object->setMediaType($data['mediaType']); + } + elseif (\array_key_exists('mediaType', $data) && $data['mediaType'] === null) { + $object->setMediaType(null); + } + if (\array_key_exists('digest', $data) && $data['digest'] !== null) { + $object->setDigest($data['digest']); + } + elseif (\array_key_exists('digest', $data) && $data['digest'] === null) { + $object->setDigest(null); + } + if (\array_key_exists('size', $data) && $data['size'] !== null) { + $object->setSize($data['size']); + } + elseif (\array_key_exists('size', $data) && $data['size'] === null) { + $object->setSize(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('mediaType') && null !== $object->getMediaType()) { + $data['mediaType'] = $object->getMediaType(); + } + if ($object->isInitialized('digest') && null !== $object->getDigest()) { + $data['digest'] = $object->getDigest(); + } + if ($object->isInitialized('size') && null !== $object->getSize()) { + $data['size'] = $object->getSize(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\OCIDescriptor::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/OCIPlatformNormalizer.php b/generated/Normalizer/OCIPlatformNormalizer.php new file mode 100644 index 00000000..0d42d8ef --- /dev/null +++ b/generated/Normalizer/OCIPlatformNormalizer.php @@ -0,0 +1,206 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class OCIPlatformNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\OCIPlatform::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\OCIPlatform::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\OCIPlatform(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('architecture', $data) && $data['architecture'] !== null) { + $object->setArchitecture($data['architecture']); + } + elseif (\array_key_exists('architecture', $data) && $data['architecture'] === null) { + $object->setArchitecture(null); + } + if (\array_key_exists('os', $data) && $data['os'] !== null) { + $object->setOs($data['os']); + } + elseif (\array_key_exists('os', $data) && $data['os'] === null) { + $object->setOs(null); + } + if (\array_key_exists('os.version', $data) && $data['os.version'] !== null) { + $object->setOsVersion($data['os.version']); + } + elseif (\array_key_exists('os.version', $data) && $data['os.version'] === null) { + $object->setOsVersion(null); + } + if (\array_key_exists('os.features', $data) && $data['os.features'] !== null) { + $values = []; + foreach ($data['os.features'] as $value) { + $values[] = $value; + } + $object->setOsFeatures($values); + } + elseif (\array_key_exists('os.features', $data) && $data['os.features'] === null) { + $object->setOsFeatures(null); + } + if (\array_key_exists('variant', $data) && $data['variant'] !== null) { + $object->setVariant($data['variant']); + } + elseif (\array_key_exists('variant', $data) && $data['variant'] === null) { + $object->setVariant(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('architecture') && null !== $object->getArchitecture()) { + $data['architecture'] = $object->getArchitecture(); + } + if ($object->isInitialized('os') && null !== $object->getOs()) { + $data['os'] = $object->getOs(); + } + if ($object->isInitialized('osVersion') && null !== $object->getOsVersion()) { + $data['os.version'] = $object->getOsVersion(); + } + if ($object->isInitialized('osFeatures') && null !== $object->getOsFeatures()) { + $values = []; + foreach ($object->getOsFeatures() as $value) { + $values[] = $value; + } + $data['os.features'] = $values; + } + if ($object->isInitialized('variant') && null !== $object->getVariant()) { + $data['variant'] = $object->getVariant(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\OCIPlatform::class => false]; + } + } +} else { + class OCIPlatformNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\OCIPlatform::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\OCIPlatform::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\OCIPlatform(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('architecture', $data) && $data['architecture'] !== null) { + $object->setArchitecture($data['architecture']); + } + elseif (\array_key_exists('architecture', $data) && $data['architecture'] === null) { + $object->setArchitecture(null); + } + if (\array_key_exists('os', $data) && $data['os'] !== null) { + $object->setOs($data['os']); + } + elseif (\array_key_exists('os', $data) && $data['os'] === null) { + $object->setOs(null); + } + if (\array_key_exists('os.version', $data) && $data['os.version'] !== null) { + $object->setOsVersion($data['os.version']); + } + elseif (\array_key_exists('os.version', $data) && $data['os.version'] === null) { + $object->setOsVersion(null); + } + if (\array_key_exists('os.features', $data) && $data['os.features'] !== null) { + $values = []; + foreach ($data['os.features'] as $value) { + $values[] = $value; + } + $object->setOsFeatures($values); + } + elseif (\array_key_exists('os.features', $data) && $data['os.features'] === null) { + $object->setOsFeatures(null); + } + if (\array_key_exists('variant', $data) && $data['variant'] !== null) { + $object->setVariant($data['variant']); + } + elseif (\array_key_exists('variant', $data) && $data['variant'] === null) { + $object->setVariant(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('architecture') && null !== $object->getArchitecture()) { + $data['architecture'] = $object->getArchitecture(); + } + if ($object->isInitialized('os') && null !== $object->getOs()) { + $data['os'] = $object->getOs(); + } + if ($object->isInitialized('osVersion') && null !== $object->getOsVersion()) { + $data['os.version'] = $object->getOsVersion(); + } + if ($object->isInitialized('osFeatures') && null !== $object->getOsFeatures()) { + $values = []; + foreach ($object->getOsFeatures() as $value) { + $values[] = $value; + } + $data['os.features'] = $values; + } + if ($object->isInitialized('variant') && null !== $object->getVariant()) { + $data['variant'] = $object->getVariant(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\OCIPlatform::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ObjectVersionNormalizer.php b/generated/Normalizer/ObjectVersionNormalizer.php new file mode 100644 index 00000000..38f71ebb --- /dev/null +++ b/generated/Normalizer/ObjectVersionNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ObjectVersionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ObjectVersion::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ObjectVersion::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ObjectVersion(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Index', $data) && $data['Index'] !== null) { + $object->setIndex($data['Index']); + } + elseif (\array_key_exists('Index', $data) && $data['Index'] === null) { + $object->setIndex(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('index') && null !== $object->getIndex()) { + $data['Index'] = $object->getIndex(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ObjectVersion::class => false]; + } + } +} else { + class ObjectVersionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ObjectVersion::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ObjectVersion::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ObjectVersion(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Index', $data) && $data['Index'] !== null) { + $object->setIndex($data['Index']); + } + elseif (\array_key_exists('Index', $data) && $data['Index'] === null) { + $object->setIndex(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('index') && null !== $object->getIndex()) { + $data['Index'] = $object->getIndex(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ObjectVersion::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PeerInfoNormalizer.php b/generated/Normalizer/PeerInfoNormalizer.php new file mode 100644 index 00000000..d6d3e9a0 --- /dev/null +++ b/generated/Normalizer/PeerInfoNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PeerInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PeerInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PeerInfo::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PeerInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('IP', $data) && $data['IP'] !== null) { + $object->setIP($data['IP']); + } + elseif (\array_key_exists('IP', $data) && $data['IP'] === null) { + $object->setIP(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('iP') && null !== $object->getIP()) { + $data['IP'] = $object->getIP(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PeerInfo::class => false]; + } + } +} else { + class PeerInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PeerInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PeerInfo::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PeerInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('IP', $data) && $data['IP'] !== null) { + $object->setIP($data['IP']); + } + elseif (\array_key_exists('IP', $data) && $data['IP'] === null) { + $object->setIP(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('iP') && null !== $object->getIP()) { + $data['IP'] = $object->getIP(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PeerInfo::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PeerNodeNormalizer.php b/generated/Normalizer/PeerNodeNormalizer.php new file mode 100644 index 00000000..b9e0c48f --- /dev/null +++ b/generated/Normalizer/PeerNodeNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PeerNodeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PeerNode::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PeerNode::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PeerNode(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NodeID', $data) && $data['NodeID'] !== null) { + $object->setNodeID($data['NodeID']); + } + elseif (\array_key_exists('NodeID', $data) && $data['NodeID'] === null) { + $object->setNodeID(null); + } + if (\array_key_exists('Addr', $data) && $data['Addr'] !== null) { + $object->setAddr($data['Addr']); + } + elseif (\array_key_exists('Addr', $data) && $data['Addr'] === null) { + $object->setAddr(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('nodeID') && null !== $object->getNodeID()) { + $data['NodeID'] = $object->getNodeID(); + } + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PeerNode::class => false]; + } + } +} else { + class PeerNodeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PeerNode::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PeerNode::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PeerNode(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NodeID', $data) && $data['NodeID'] !== null) { + $object->setNodeID($data['NodeID']); + } + elseif (\array_key_exists('NodeID', $data) && $data['NodeID'] === null) { + $object->setNodeID(null); + } + if (\array_key_exists('Addr', $data) && $data['Addr'] !== null) { + $object->setAddr($data['Addr']); + } + elseif (\array_key_exists('Addr', $data) && $data['Addr'] === null) { + $object->setAddr(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('nodeID') && null !== $object->getNodeID()) { + $data['NodeID'] = $object->getNodeID(); + } + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PeerNode::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PlatformNormalizer.php b/generated/Normalizer/PlatformNormalizer.php new file mode 100644 index 00000000..cfc3551d --- /dev/null +++ b/generated/Normalizer/PlatformNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PlatformNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Platform::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Platform::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Platform(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Architecture', $data) && $data['Architecture'] !== null) { + $object->setArchitecture($data['Architecture']); + } + elseif (\array_key_exists('Architecture', $data) && $data['Architecture'] === null) { + $object->setArchitecture(null); + } + if (\array_key_exists('OS', $data) && $data['OS'] !== null) { + $object->setOS($data['OS']); + } + elseif (\array_key_exists('OS', $data) && $data['OS'] === null) { + $object->setOS(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('architecture') && null !== $object->getArchitecture()) { + $data['Architecture'] = $object->getArchitecture(); + } + if ($object->isInitialized('oS') && null !== $object->getOS()) { + $data['OS'] = $object->getOS(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Platform::class => false]; + } + } +} else { + class PlatformNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Platform::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Platform::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Platform(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Architecture', $data) && $data['Architecture'] !== null) { + $object->setArchitecture($data['Architecture']); + } + elseif (\array_key_exists('Architecture', $data) && $data['Architecture'] === null) { + $object->setArchitecture(null); + } + if (\array_key_exists('OS', $data) && $data['OS'] !== null) { + $object->setOS($data['OS']); + } + elseif (\array_key_exists('OS', $data) && $data['OS'] === null) { + $object->setOS(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('architecture') && null !== $object->getArchitecture()) { + $data['Architecture'] = $object->getArchitecture(); + } + if ($object->isInitialized('oS') && null !== $object->getOS()) { + $data['OS'] = $object->getOS(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Platform::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginConfigArgsNormalizer.php b/generated/Normalizer/PluginConfigArgsNormalizer.php new file mode 100644 index 00000000..6dc52b74 --- /dev/null +++ b/generated/Normalizer/PluginConfigArgsNormalizer.php @@ -0,0 +1,188 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginConfigArgsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfigArgs::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfigArgs::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfigArgs(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Settable', $data) && $data['Settable'] !== null) { + $values = []; + foreach ($data['Settable'] as $value) { + $values[] = $value; + } + $object->setSettable($values); + } + elseif (\array_key_exists('Settable', $data) && $data['Settable'] === null) { + $object->setSettable(null); + } + if (\array_key_exists('Value', $data) && $data['Value'] !== null) { + $values_1 = []; + foreach ($data['Value'] as $value_1) { + $values_1[] = $value_1; + } + $object->setValue($values_1); + } + elseif (\array_key_exists('Value', $data) && $data['Value'] === null) { + $object->setValue(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Name'] = $object->getName(); + $data['Description'] = $object->getDescription(); + $values = []; + foreach ($object->getSettable() as $value) { + $values[] = $value; + } + $data['Settable'] = $values; + $values_1 = []; + foreach ($object->getValue() as $value_1) { + $values_1[] = $value_1; + } + $data['Value'] = $values_1; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigArgs::class => false]; + } + } +} else { + class PluginConfigArgsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfigArgs::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfigArgs::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfigArgs(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Settable', $data) && $data['Settable'] !== null) { + $values = []; + foreach ($data['Settable'] as $value) { + $values[] = $value; + } + $object->setSettable($values); + } + elseif (\array_key_exists('Settable', $data) && $data['Settable'] === null) { + $object->setSettable(null); + } + if (\array_key_exists('Value', $data) && $data['Value'] !== null) { + $values_1 = []; + foreach ($data['Value'] as $value_1) { + $values_1[] = $value_1; + } + $object->setValue($values_1); + } + elseif (\array_key_exists('Value', $data) && $data['Value'] === null) { + $object->setValue(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Name'] = $object->getName(); + $data['Description'] = $object->getDescription(); + $values = []; + foreach ($object->getSettable() as $value) { + $values[] = $value; + } + $data['Settable'] = $values; + $values_1 = []; + foreach ($object->getValue() as $value_1) { + $values_1[] = $value_1; + } + $data['Value'] = $values_1; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigArgs::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginConfigInterfaceNormalizer.php b/generated/Normalizer/PluginConfigInterfaceNormalizer.php new file mode 100644 index 00000000..2f6201e2 --- /dev/null +++ b/generated/Normalizer/PluginConfigInterfaceNormalizer.php @@ -0,0 +1,162 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginConfigInterfaceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfigInterface::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfigInterface::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfigInterface(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Types', $data) && $data['Types'] !== null) { + $values = []; + foreach ($data['Types'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\PluginInterfaceType::class, 'json', $context); + } + $object->setTypes($values); + } + elseif (\array_key_exists('Types', $data) && $data['Types'] === null) { + $object->setTypes(null); + } + if (\array_key_exists('Socket', $data) && $data['Socket'] !== null) { + $object->setSocket($data['Socket']); + } + elseif (\array_key_exists('Socket', $data) && $data['Socket'] === null) { + $object->setSocket(null); + } + if (\array_key_exists('ProtocolScheme', $data) && $data['ProtocolScheme'] !== null) { + $object->setProtocolScheme($data['ProtocolScheme']); + } + elseif (\array_key_exists('ProtocolScheme', $data) && $data['ProtocolScheme'] === null) { + $object->setProtocolScheme(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $values = []; + foreach ($object->getTypes() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Types'] = $values; + $data['Socket'] = $object->getSocket(); + if ($object->isInitialized('protocolScheme') && null !== $object->getProtocolScheme()) { + $data['ProtocolScheme'] = $object->getProtocolScheme(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigInterface::class => false]; + } + } +} else { + class PluginConfigInterfaceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfigInterface::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfigInterface::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfigInterface(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Types', $data) && $data['Types'] !== null) { + $values = []; + foreach ($data['Types'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\PluginInterfaceType::class, 'json', $context); + } + $object->setTypes($values); + } + elseif (\array_key_exists('Types', $data) && $data['Types'] === null) { + $object->setTypes(null); + } + if (\array_key_exists('Socket', $data) && $data['Socket'] !== null) { + $object->setSocket($data['Socket']); + } + elseif (\array_key_exists('Socket', $data) && $data['Socket'] === null) { + $object->setSocket(null); + } + if (\array_key_exists('ProtocolScheme', $data) && $data['ProtocolScheme'] !== null) { + $object->setProtocolScheme($data['ProtocolScheme']); + } + elseif (\array_key_exists('ProtocolScheme', $data) && $data['ProtocolScheme'] === null) { + $object->setProtocolScheme(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getTypes() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Types'] = $values; + $data['Socket'] = $object->getSocket(); + if ($object->isInitialized('protocolScheme') && null !== $object->getProtocolScheme()) { + $data['ProtocolScheme'] = $object->getProtocolScheme(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigInterface::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginConfigLinuxNormalizer.php b/generated/Normalizer/PluginConfigLinuxNormalizer.php new file mode 100644 index 00000000..ded2d105 --- /dev/null +++ b/generated/Normalizer/PluginConfigLinuxNormalizer.php @@ -0,0 +1,174 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginConfigLinuxNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfigLinux::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfigLinux::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfigLinux(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Capabilities', $data) && $data['Capabilities'] !== null) { + $values = []; + foreach ($data['Capabilities'] as $value) { + $values[] = $value; + } + $object->setCapabilities($values); + } + elseif (\array_key_exists('Capabilities', $data) && $data['Capabilities'] === null) { + $object->setCapabilities(null); + } + if (\array_key_exists('AllowAllDevices', $data) && $data['AllowAllDevices'] !== null) { + $object->setAllowAllDevices($data['AllowAllDevices']); + } + elseif (\array_key_exists('AllowAllDevices', $data) && $data['AllowAllDevices'] === null) { + $object->setAllowAllDevices(null); + } + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { + $values_1 = []; + foreach ($data['Devices'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\PluginDevice::class, 'json', $context); + } + $object->setDevices($values_1); + } + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $values = []; + foreach ($object->getCapabilities() as $value) { + $values[] = $value; + } + $data['Capabilities'] = $values; + $data['AllowAllDevices'] = $object->getAllowAllDevices(); + $values_1 = []; + foreach ($object->getDevices() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Devices'] = $values_1; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigLinux::class => false]; + } + } +} else { + class PluginConfigLinuxNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfigLinux::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfigLinux::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfigLinux(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Capabilities', $data) && $data['Capabilities'] !== null) { + $values = []; + foreach ($data['Capabilities'] as $value) { + $values[] = $value; + } + $object->setCapabilities($values); + } + elseif (\array_key_exists('Capabilities', $data) && $data['Capabilities'] === null) { + $object->setCapabilities(null); + } + if (\array_key_exists('AllowAllDevices', $data) && $data['AllowAllDevices'] !== null) { + $object->setAllowAllDevices($data['AllowAllDevices']); + } + elseif (\array_key_exists('AllowAllDevices', $data) && $data['AllowAllDevices'] === null) { + $object->setAllowAllDevices(null); + } + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { + $values_1 = []; + foreach ($data['Devices'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\PluginDevice::class, 'json', $context); + } + $object->setDevices($values_1); + } + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getCapabilities() as $value) { + $values[] = $value; + } + $data['Capabilities'] = $values; + $data['AllowAllDevices'] = $object->getAllowAllDevices(); + $values_1 = []; + foreach ($object->getDevices() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Devices'] = $values_1; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigLinux::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginConfigNetworkNormalizer.php b/generated/Normalizer/PluginConfigNetworkNormalizer.php new file mode 100644 index 00000000..fbc4923d --- /dev/null +++ b/generated/Normalizer/PluginConfigNetworkNormalizer.php @@ -0,0 +1,114 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginConfigNetworkNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfigNetwork::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfigNetwork::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfigNetwork(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Type'] = $object->getType(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigNetwork::class => false]; + } + } +} else { + class PluginConfigNetworkNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfigNetwork::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfigNetwork::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfigNetwork(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Type'] = $object->getType(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigNetwork::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginConfigNormalizer.php b/generated/Normalizer/PluginConfigNormalizer.php new file mode 100644 index 00000000..d2a4a366 --- /dev/null +++ b/generated/Normalizer/PluginConfigNormalizer.php @@ -0,0 +1,384 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('DockerVersion', $data) && $data['DockerVersion'] !== null) { + $object->setDockerVersion($data['DockerVersion']); + } + elseif (\array_key_exists('DockerVersion', $data) && $data['DockerVersion'] === null) { + $object->setDockerVersion(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Documentation', $data) && $data['Documentation'] !== null) { + $object->setDocumentation($data['Documentation']); + } + elseif (\array_key_exists('Documentation', $data) && $data['Documentation'] === null) { + $object->setDocumentation(null); + } + if (\array_key_exists('Interface', $data) && $data['Interface'] !== null) { + $object->setInterface($this->denormalizer->denormalize($data['Interface'], \Docker\API\Model\PluginConfigInterface::class, 'json', $context)); + } + elseif (\array_key_exists('Interface', $data) && $data['Interface'] === null) { + $object->setInterface(null); + } + if (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] !== null) { + $values = []; + foreach ($data['Entrypoint'] as $value) { + $values[] = $value; + } + $object->setEntrypoint($values); + } + elseif (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] === null) { + $object->setEntrypoint(null); + } + if (\array_key_exists('WorkDir', $data) && $data['WorkDir'] !== null) { + $object->setWorkDir($data['WorkDir']); + } + elseif (\array_key_exists('WorkDir', $data) && $data['WorkDir'] === null) { + $object->setWorkDir(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($this->denormalizer->denormalize($data['User'], \Docker\API\Model\PluginConfigUser::class, 'json', $context)); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('Network', $data) && $data['Network'] !== null) { + $object->setNetwork($this->denormalizer->denormalize($data['Network'], \Docker\API\Model\PluginConfigNetwork::class, 'json', $context)); + } + elseif (\array_key_exists('Network', $data) && $data['Network'] === null) { + $object->setNetwork(null); + } + if (\array_key_exists('Linux', $data) && $data['Linux'] !== null) { + $object->setLinux($this->denormalizer->denormalize($data['Linux'], \Docker\API\Model\PluginConfigLinux::class, 'json', $context)); + } + elseif (\array_key_exists('Linux', $data) && $data['Linux'] === null) { + $object->setLinux(null); + } + if (\array_key_exists('PropagatedMount', $data) && $data['PropagatedMount'] !== null) { + $object->setPropagatedMount($data['PropagatedMount']); + } + elseif (\array_key_exists('PropagatedMount', $data) && $data['PropagatedMount'] === null) { + $object->setPropagatedMount(null); + } + if (\array_key_exists('IpcHost', $data) && $data['IpcHost'] !== null) { + $object->setIpcHost($data['IpcHost']); + } + elseif (\array_key_exists('IpcHost', $data) && $data['IpcHost'] === null) { + $object->setIpcHost(null); + } + if (\array_key_exists('PidHost', $data) && $data['PidHost'] !== null) { + $object->setPidHost($data['PidHost']); + } + elseif (\array_key_exists('PidHost', $data) && $data['PidHost'] === null) { + $object->setPidHost(null); + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values_1 = []; + foreach ($data['Mounts'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\PluginMount::class, 'json', $context); + } + $object->setMounts($values_1); + } + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_2 = []; + foreach ($data['Env'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\PluginEnv::class, 'json', $context); + } + $object->setEnv($values_2); + } + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Args', $data) && $data['Args'] !== null) { + $object->setArgs($this->denormalizer->denormalize($data['Args'], \Docker\API\Model\PluginConfigArgs::class, 'json', $context)); + } + elseif (\array_key_exists('Args', $data) && $data['Args'] === null) { + $object->setArgs(null); + } + if (\array_key_exists('rootfs', $data) && $data['rootfs'] !== null) { + $object->setRootfs($this->denormalizer->denormalize($data['rootfs'], \Docker\API\Model\PluginConfigRootfs::class, 'json', $context)); + } + elseif (\array_key_exists('rootfs', $data) && $data['rootfs'] === null) { + $object->setRootfs(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('dockerVersion') && null !== $object->getDockerVersion()) { + $data['DockerVersion'] = $object->getDockerVersion(); + } + $data['Description'] = $object->getDescription(); + $data['Documentation'] = $object->getDocumentation(); + $data['Interface'] = $this->normalizer->normalize($object->getInterface(), 'json', $context); + $values = []; + foreach ($object->getEntrypoint() as $value) { + $values[] = $value; + } + $data['Entrypoint'] = $values; + $data['WorkDir'] = $object->getWorkDir(); + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $this->normalizer->normalize($object->getUser(), 'json', $context); + } + $data['Network'] = $this->normalizer->normalize($object->getNetwork(), 'json', $context); + $data['Linux'] = $this->normalizer->normalize($object->getLinux(), 'json', $context); + $data['PropagatedMount'] = $object->getPropagatedMount(); + $data['IpcHost'] = $object->getIpcHost(); + $data['PidHost'] = $object->getPidHost(); + $values_1 = []; + foreach ($object->getMounts() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Mounts'] = $values_1; + $values_2 = []; + foreach ($object->getEnv() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['Env'] = $values_2; + $data['Args'] = $this->normalizer->normalize($object->getArgs(), 'json', $context); + if ($object->isInitialized('rootfs') && null !== $object->getRootfs()) { + $data['rootfs'] = $this->normalizer->normalize($object->getRootfs(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfig::class => false]; + } + } +} else { + class PluginConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('DockerVersion', $data) && $data['DockerVersion'] !== null) { + $object->setDockerVersion($data['DockerVersion']); + } + elseif (\array_key_exists('DockerVersion', $data) && $data['DockerVersion'] === null) { + $object->setDockerVersion(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Documentation', $data) && $data['Documentation'] !== null) { + $object->setDocumentation($data['Documentation']); + } + elseif (\array_key_exists('Documentation', $data) && $data['Documentation'] === null) { + $object->setDocumentation(null); + } + if (\array_key_exists('Interface', $data) && $data['Interface'] !== null) { + $object->setInterface($this->denormalizer->denormalize($data['Interface'], \Docker\API\Model\PluginConfigInterface::class, 'json', $context)); + } + elseif (\array_key_exists('Interface', $data) && $data['Interface'] === null) { + $object->setInterface(null); + } + if (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] !== null) { + $values = []; + foreach ($data['Entrypoint'] as $value) { + $values[] = $value; + } + $object->setEntrypoint($values); + } + elseif (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] === null) { + $object->setEntrypoint(null); + } + if (\array_key_exists('WorkDir', $data) && $data['WorkDir'] !== null) { + $object->setWorkDir($data['WorkDir']); + } + elseif (\array_key_exists('WorkDir', $data) && $data['WorkDir'] === null) { + $object->setWorkDir(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($this->denormalizer->denormalize($data['User'], \Docker\API\Model\PluginConfigUser::class, 'json', $context)); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('Network', $data) && $data['Network'] !== null) { + $object->setNetwork($this->denormalizer->denormalize($data['Network'], \Docker\API\Model\PluginConfigNetwork::class, 'json', $context)); + } + elseif (\array_key_exists('Network', $data) && $data['Network'] === null) { + $object->setNetwork(null); + } + if (\array_key_exists('Linux', $data) && $data['Linux'] !== null) { + $object->setLinux($this->denormalizer->denormalize($data['Linux'], \Docker\API\Model\PluginConfigLinux::class, 'json', $context)); + } + elseif (\array_key_exists('Linux', $data) && $data['Linux'] === null) { + $object->setLinux(null); + } + if (\array_key_exists('PropagatedMount', $data) && $data['PropagatedMount'] !== null) { + $object->setPropagatedMount($data['PropagatedMount']); + } + elseif (\array_key_exists('PropagatedMount', $data) && $data['PropagatedMount'] === null) { + $object->setPropagatedMount(null); + } + if (\array_key_exists('IpcHost', $data) && $data['IpcHost'] !== null) { + $object->setIpcHost($data['IpcHost']); + } + elseif (\array_key_exists('IpcHost', $data) && $data['IpcHost'] === null) { + $object->setIpcHost(null); + } + if (\array_key_exists('PidHost', $data) && $data['PidHost'] !== null) { + $object->setPidHost($data['PidHost']); + } + elseif (\array_key_exists('PidHost', $data) && $data['PidHost'] === null) { + $object->setPidHost(null); + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values_1 = []; + foreach ($data['Mounts'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\PluginMount::class, 'json', $context); + } + $object->setMounts($values_1); + } + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_2 = []; + foreach ($data['Env'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\PluginEnv::class, 'json', $context); + } + $object->setEnv($values_2); + } + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Args', $data) && $data['Args'] !== null) { + $object->setArgs($this->denormalizer->denormalize($data['Args'], \Docker\API\Model\PluginConfigArgs::class, 'json', $context)); + } + elseif (\array_key_exists('Args', $data) && $data['Args'] === null) { + $object->setArgs(null); + } + if (\array_key_exists('rootfs', $data) && $data['rootfs'] !== null) { + $object->setRootfs($this->denormalizer->denormalize($data['rootfs'], \Docker\API\Model\PluginConfigRootfs::class, 'json', $context)); + } + elseif (\array_key_exists('rootfs', $data) && $data['rootfs'] === null) { + $object->setRootfs(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('dockerVersion') && null !== $object->getDockerVersion()) { + $data['DockerVersion'] = $object->getDockerVersion(); + } + $data['Description'] = $object->getDescription(); + $data['Documentation'] = $object->getDocumentation(); + $data['Interface'] = $this->normalizer->normalize($object->getInterface(), 'json', $context); + $values = []; + foreach ($object->getEntrypoint() as $value) { + $values[] = $value; + } + $data['Entrypoint'] = $values; + $data['WorkDir'] = $object->getWorkDir(); + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $this->normalizer->normalize($object->getUser(), 'json', $context); + } + $data['Network'] = $this->normalizer->normalize($object->getNetwork(), 'json', $context); + $data['Linux'] = $this->normalizer->normalize($object->getLinux(), 'json', $context); + $data['PropagatedMount'] = $object->getPropagatedMount(); + $data['IpcHost'] = $object->getIpcHost(); + $data['PidHost'] = $object->getPidHost(); + $values_1 = []; + foreach ($object->getMounts() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Mounts'] = $values_1; + $values_2 = []; + foreach ($object->getEnv() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['Env'] = $values_2; + $data['Args'] = $this->normalizer->normalize($object->getArgs(), 'json', $context); + if ($object->isInitialized('rootfs') && null !== $object->getRootfs()) { + $data['rootfs'] = $this->normalizer->normalize($object->getRootfs(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginConfigRootfsNormalizer.php b/generated/Normalizer/PluginConfigRootfsNormalizer.php new file mode 100644 index 00000000..0166eb00 --- /dev/null +++ b/generated/Normalizer/PluginConfigRootfsNormalizer.php @@ -0,0 +1,152 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginConfigRootfsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfigRootfs::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfigRootfs::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfigRootfs(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('type', $data) && $data['type'] !== null) { + $object->setType($data['type']); + } + elseif (\array_key_exists('type', $data) && $data['type'] === null) { + $object->setType(null); + } + if (\array_key_exists('diff_ids', $data) && $data['diff_ids'] !== null) { + $values = []; + foreach ($data['diff_ids'] as $value) { + $values[] = $value; + } + $object->setDiffIds($values); + } + elseif (\array_key_exists('diff_ids', $data) && $data['diff_ids'] === null) { + $object->setDiffIds(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['type'] = $object->getType(); + } + if ($object->isInitialized('diffIds') && null !== $object->getDiffIds()) { + $values = []; + foreach ($object->getDiffIds() as $value) { + $values[] = $value; + } + $data['diff_ids'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigRootfs::class => false]; + } + } +} else { + class PluginConfigRootfsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfigRootfs::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfigRootfs::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfigRootfs(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('type', $data) && $data['type'] !== null) { + $object->setType($data['type']); + } + elseif (\array_key_exists('type', $data) && $data['type'] === null) { + $object->setType(null); + } + if (\array_key_exists('diff_ids', $data) && $data['diff_ids'] !== null) { + $values = []; + foreach ($data['diff_ids'] as $value) { + $values[] = $value; + } + $object->setDiffIds($values); + } + elseif (\array_key_exists('diff_ids', $data) && $data['diff_ids'] === null) { + $object->setDiffIds(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['type'] = $object->getType(); + } + if ($object->isInitialized('diffIds') && null !== $object->getDiffIds()) { + $values = []; + foreach ($object->getDiffIds() as $value) { + $values[] = $value; + } + $data['diff_ids'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigRootfs::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginConfigUserNormalizer.php b/generated/Normalizer/PluginConfigUserNormalizer.php new file mode 100644 index 00000000..7b701c76 --- /dev/null +++ b/generated/Normalizer/PluginConfigUserNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginConfigUserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfigUser::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfigUser::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfigUser(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('UID', $data) && $data['UID'] !== null) { + $object->setUID($data['UID']); + } + elseif (\array_key_exists('UID', $data) && $data['UID'] === null) { + $object->setUID(null); + } + if (\array_key_exists('GID', $data) && $data['GID'] !== null) { + $object->setGID($data['GID']); + } + elseif (\array_key_exists('GID', $data) && $data['GID'] === null) { + $object->setGID(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('uID') && null !== $object->getUID()) { + $data['UID'] = $object->getUID(); + } + if ($object->isInitialized('gID') && null !== $object->getGID()) { + $data['GID'] = $object->getGID(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigUser::class => false]; + } + } +} else { + class PluginConfigUserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginConfigUser::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginConfigUser::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginConfigUser(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('UID', $data) && $data['UID'] !== null) { + $object->setUID($data['UID']); + } + elseif (\array_key_exists('UID', $data) && $data['UID'] === null) { + $object->setUID(null); + } + if (\array_key_exists('GID', $data) && $data['GID'] !== null) { + $object->setGID($data['GID']); + } + elseif (\array_key_exists('GID', $data) && $data['GID'] === null) { + $object->setGID(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('uID') && null !== $object->getUID()) { + $data['UID'] = $object->getUID(); + } + if ($object->isInitialized('gID') && null !== $object->getGID()) { + $data['GID'] = $object->getGID(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigUser::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginDeviceNormalizer.php b/generated/Normalizer/PluginDeviceNormalizer.php new file mode 100644 index 00000000..4c9fc2ce --- /dev/null +++ b/generated/Normalizer/PluginDeviceNormalizer.php @@ -0,0 +1,172 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginDeviceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginDevice::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginDevice::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginDevice(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Settable', $data) && $data['Settable'] !== null) { + $values = []; + foreach ($data['Settable'] as $value) { + $values[] = $value; + } + $object->setSettable($values); + } + elseif (\array_key_exists('Settable', $data) && $data['Settable'] === null) { + $object->setSettable(null); + } + if (\array_key_exists('Path', $data) && $data['Path'] !== null) { + $object->setPath($data['Path']); + } + elseif (\array_key_exists('Path', $data) && $data['Path'] === null) { + $object->setPath(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Name'] = $object->getName(); + $data['Description'] = $object->getDescription(); + $values = []; + foreach ($object->getSettable() as $value) { + $values[] = $value; + } + $data['Settable'] = $values; + $data['Path'] = $object->getPath(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginDevice::class => false]; + } + } +} else { + class PluginDeviceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginDevice::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginDevice::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginDevice(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Settable', $data) && $data['Settable'] !== null) { + $values = []; + foreach ($data['Settable'] as $value) { + $values[] = $value; + } + $object->setSettable($values); + } + elseif (\array_key_exists('Settable', $data) && $data['Settable'] === null) { + $object->setSettable(null); + } + if (\array_key_exists('Path', $data) && $data['Path'] !== null) { + $object->setPath($data['Path']); + } + elseif (\array_key_exists('Path', $data) && $data['Path'] === null) { + $object->setPath(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Name'] = $object->getName(); + $data['Description'] = $object->getDescription(); + $values = []; + foreach ($object->getSettable() as $value) { + $values[] = $value; + } + $data['Settable'] = $values; + $data['Path'] = $object->getPath(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginDevice::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginEnvNormalizer.php b/generated/Normalizer/PluginEnvNormalizer.php new file mode 100644 index 00000000..e8c4f493 --- /dev/null +++ b/generated/Normalizer/PluginEnvNormalizer.php @@ -0,0 +1,172 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginEnvNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginEnv::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginEnv::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginEnv(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Settable', $data) && $data['Settable'] !== null) { + $values = []; + foreach ($data['Settable'] as $value) { + $values[] = $value; + } + $object->setSettable($values); + } + elseif (\array_key_exists('Settable', $data) && $data['Settable'] === null) { + $object->setSettable(null); + } + if (\array_key_exists('Value', $data) && $data['Value'] !== null) { + $object->setValue($data['Value']); + } + elseif (\array_key_exists('Value', $data) && $data['Value'] === null) { + $object->setValue(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Name'] = $object->getName(); + $data['Description'] = $object->getDescription(); + $values = []; + foreach ($object->getSettable() as $value) { + $values[] = $value; + } + $data['Settable'] = $values; + $data['Value'] = $object->getValue(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginEnv::class => false]; + } + } +} else { + class PluginEnvNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginEnv::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginEnv::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginEnv(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Settable', $data) && $data['Settable'] !== null) { + $values = []; + foreach ($data['Settable'] as $value) { + $values[] = $value; + } + $object->setSettable($values); + } + elseif (\array_key_exists('Settable', $data) && $data['Settable'] === null) { + $object->setSettable(null); + } + if (\array_key_exists('Value', $data) && $data['Value'] !== null) { + $object->setValue($data['Value']); + } + elseif (\array_key_exists('Value', $data) && $data['Value'] === null) { + $object->setValue(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Name'] = $object->getName(); + $data['Description'] = $object->getDescription(); + $values = []; + foreach ($object->getSettable() as $value) { + $values[] = $value; + } + $data['Settable'] = $values; + $data['Value'] = $object->getValue(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginEnv::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginInterfaceTypeNormalizer.php b/generated/Normalizer/PluginInterfaceTypeNormalizer.php new file mode 100644 index 00000000..05825b23 --- /dev/null +++ b/generated/Normalizer/PluginInterfaceTypeNormalizer.php @@ -0,0 +1,142 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginInterfaceTypeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginInterfaceType::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginInterfaceType::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginInterfaceType(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Prefix', $data) && $data['Prefix'] !== null) { + $object->setPrefix($data['Prefix']); + } + elseif (\array_key_exists('Prefix', $data) && $data['Prefix'] === null) { + $object->setPrefix(null); + } + if (\array_key_exists('Capability', $data) && $data['Capability'] !== null) { + $object->setCapability($data['Capability']); + } + elseif (\array_key_exists('Capability', $data) && $data['Capability'] === null) { + $object->setCapability(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($data['Version']); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Prefix'] = $object->getPrefix(); + $data['Capability'] = $object->getCapability(); + $data['Version'] = $object->getVersion(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginInterfaceType::class => false]; + } + } +} else { + class PluginInterfaceTypeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginInterfaceType::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginInterfaceType::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginInterfaceType(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Prefix', $data) && $data['Prefix'] !== null) { + $object->setPrefix($data['Prefix']); + } + elseif (\array_key_exists('Prefix', $data) && $data['Prefix'] === null) { + $object->setPrefix(null); + } + if (\array_key_exists('Capability', $data) && $data['Capability'] !== null) { + $object->setCapability($data['Capability']); + } + elseif (\array_key_exists('Capability', $data) && $data['Capability'] === null) { + $object->setCapability(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($data['Version']); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Prefix'] = $object->getPrefix(); + $data['Capability'] = $object->getCapability(); + $data['Version'] = $object->getVersion(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginInterfaceType::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginMountNormalizer.php b/generated/Normalizer/PluginMountNormalizer.php new file mode 100644 index 00000000..0538f138 --- /dev/null +++ b/generated/Normalizer/PluginMountNormalizer.php @@ -0,0 +1,230 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginMountNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginMount::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginMount::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginMount(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Settable', $data) && $data['Settable'] !== null) { + $values = []; + foreach ($data['Settable'] as $value) { + $values[] = $value; + } + $object->setSettable($values); + } + elseif (\array_key_exists('Settable', $data) && $data['Settable'] === null) { + $object->setSettable(null); + } + if (\array_key_exists('Source', $data) && $data['Source'] !== null) { + $object->setSource($data['Source']); + } + elseif (\array_key_exists('Source', $data) && $data['Source'] === null) { + $object->setSource(null); + } + if (\array_key_exists('Destination', $data) && $data['Destination'] !== null) { + $object->setDestination($data['Destination']); + } + elseif (\array_key_exists('Destination', $data) && $data['Destination'] === null) { + $object->setDestination(null); + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values_1 = []; + foreach ($data['Options'] as $value_1) { + $values_1[] = $value_1; + } + $object->setOptions($values_1); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Name'] = $object->getName(); + $data['Description'] = $object->getDescription(); + $values = []; + foreach ($object->getSettable() as $value) { + $values[] = $value; + } + $data['Settable'] = $values; + $data['Source'] = $object->getSource(); + $data['Destination'] = $object->getDestination(); + $data['Type'] = $object->getType(); + $values_1 = []; + foreach ($object->getOptions() as $value_1) { + $values_1[] = $value_1; + } + $data['Options'] = $values_1; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginMount::class => false]; + } + } +} else { + class PluginMountNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginMount::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginMount::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginMount(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Settable', $data) && $data['Settable'] !== null) { + $values = []; + foreach ($data['Settable'] as $value) { + $values[] = $value; + } + $object->setSettable($values); + } + elseif (\array_key_exists('Settable', $data) && $data['Settable'] === null) { + $object->setSettable(null); + } + if (\array_key_exists('Source', $data) && $data['Source'] !== null) { + $object->setSource($data['Source']); + } + elseif (\array_key_exists('Source', $data) && $data['Source'] === null) { + $object->setSource(null); + } + if (\array_key_exists('Destination', $data) && $data['Destination'] !== null) { + $object->setDestination($data['Destination']); + } + elseif (\array_key_exists('Destination', $data) && $data['Destination'] === null) { + $object->setDestination(null); + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values_1 = []; + foreach ($data['Options'] as $value_1) { + $values_1[] = $value_1; + } + $object->setOptions($values_1); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Name'] = $object->getName(); + $data['Description'] = $object->getDescription(); + $values = []; + foreach ($object->getSettable() as $value) { + $values[] = $value; + } + $data['Settable'] = $values; + $data['Source'] = $object->getSource(); + $data['Destination'] = $object->getDestination(); + $data['Type'] = $object->getType(); + $values_1 = []; + foreach ($object->getOptions() as $value_1) { + $values_1[] = $value_1; + } + $data['Options'] = $values_1; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginMount::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginNormalizer.php b/generated/Normalizer/PluginNormalizer.php new file mode 100644 index 00000000..524d71cb --- /dev/null +++ b/generated/Normalizer/PluginNormalizer.php @@ -0,0 +1,192 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Plugin::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Plugin::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Plugin(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Enabled', $data) && $data['Enabled'] !== null) { + $object->setEnabled($data['Enabled']); + } + elseif (\array_key_exists('Enabled', $data) && $data['Enabled'] === null) { + $object->setEnabled(null); + } + if (\array_key_exists('Settings', $data) && $data['Settings'] !== null) { + $object->setSettings($this->denormalizer->denormalize($data['Settings'], \Docker\API\Model\PluginSettings::class, 'json', $context)); + } + elseif (\array_key_exists('Settings', $data) && $data['Settings'] === null) { + $object->setSettings(null); + } + if (\array_key_exists('PluginReference', $data) && $data['PluginReference'] !== null) { + $object->setPluginReference($data['PluginReference']); + } + elseif (\array_key_exists('PluginReference', $data) && $data['PluginReference'] === null) { + $object->setPluginReference(null); + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $object->setConfig($this->denormalizer->denormalize($data['Config'], \Docker\API\Model\PluginConfig::class, 'json', $context)); + } + elseif (\array_key_exists('Config', $data) && $data['Config'] === null) { + $object->setConfig(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); + } + $data['Name'] = $object->getName(); + $data['Enabled'] = $object->getEnabled(); + $data['Settings'] = $this->normalizer->normalize($object->getSettings(), 'json', $context); + if ($object->isInitialized('pluginReference') && null !== $object->getPluginReference()) { + $data['PluginReference'] = $object->getPluginReference(); + } + $data['Config'] = $this->normalizer->normalize($object->getConfig(), 'json', $context); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Plugin::class => false]; + } + } +} else { + class PluginNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Plugin::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Plugin::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Plugin(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); + } + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Enabled', $data) && $data['Enabled'] !== null) { + $object->setEnabled($data['Enabled']); + } + elseif (\array_key_exists('Enabled', $data) && $data['Enabled'] === null) { + $object->setEnabled(null); + } + if (\array_key_exists('Settings', $data) && $data['Settings'] !== null) { + $object->setSettings($this->denormalizer->denormalize($data['Settings'], \Docker\API\Model\PluginSettings::class, 'json', $context)); + } + elseif (\array_key_exists('Settings', $data) && $data['Settings'] === null) { + $object->setSettings(null); + } + if (\array_key_exists('PluginReference', $data) && $data['PluginReference'] !== null) { + $object->setPluginReference($data['PluginReference']); + } + elseif (\array_key_exists('PluginReference', $data) && $data['PluginReference'] === null) { + $object->setPluginReference(null); + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $object->setConfig($this->denormalizer->denormalize($data['Config'], \Docker\API\Model\PluginConfig::class, 'json', $context)); + } + elseif (\array_key_exists('Config', $data) && $data['Config'] === null) { + $object->setConfig(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); + } + $data['Name'] = $object->getName(); + $data['Enabled'] = $object->getEnabled(); + $data['Settings'] = $this->normalizer->normalize($object->getSettings(), 'json', $context); + if ($object->isInitialized('pluginReference') && null !== $object->getPluginReference()) { + $data['PluginReference'] = $object->getPluginReference(); + } + $data['Config'] = $this->normalizer->normalize($object->getConfig(), 'json', $context); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Plugin::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginPrivilegeNormalizer.php b/generated/Normalizer/PluginPrivilegeNormalizer.php new file mode 100644 index 00000000..aabcfcb6 --- /dev/null +++ b/generated/Normalizer/PluginPrivilegeNormalizer.php @@ -0,0 +1,170 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginPrivilegeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginPrivilege::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginPrivilege::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginPrivilege(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Value', $data) && $data['Value'] !== null) { + $values = []; + foreach ($data['Value'] as $value) { + $values[] = $value; + } + $object->setValue($values); + } + elseif (\array_key_exists('Value', $data) && $data['Value'] === null) { + $object->setValue(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['Description'] = $object->getDescription(); + } + if ($object->isInitialized('value') && null !== $object->getValue()) { + $values = []; + foreach ($object->getValue() as $value) { + $values[] = $value; + } + $data['Value'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginPrivilege::class => false]; + } + } +} else { + class PluginPrivilegeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginPrivilege::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginPrivilege::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginPrivilege(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); + } + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Value', $data) && $data['Value'] !== null) { + $values = []; + foreach ($data['Value'] as $value) { + $values[] = $value; + } + $object->setValue($values); + } + elseif (\array_key_exists('Value', $data) && $data['Value'] === null) { + $object->setValue(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['Description'] = $object->getDescription(); + } + if ($object->isInitialized('value') && null !== $object->getValue()) { + $values = []; + foreach ($object->getValue() as $value) { + $values[] = $value; + } + $data['Value'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginPrivilege::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginSettingsNormalizer.php b/generated/Normalizer/PluginSettingsNormalizer.php new file mode 100644 index 00000000..be1c6d8b --- /dev/null +++ b/generated/Normalizer/PluginSettingsNormalizer.php @@ -0,0 +1,220 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginSettingsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginSettings::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginSettings::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginSettings(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values = []; + foreach ($data['Mounts'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\PluginMount::class, 'json', $context); + } + $object->setMounts($values); + } + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_1 = []; + foreach ($data['Env'] as $value_1) { + $values_1[] = $value_1; + } + $object->setEnv($values_1); + } + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Args', $data) && $data['Args'] !== null) { + $values_2 = []; + foreach ($data['Args'] as $value_2) { + $values_2[] = $value_2; + } + $object->setArgs($values_2); + } + elseif (\array_key_exists('Args', $data) && $data['Args'] === null) { + $object->setArgs(null); + } + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { + $values_3 = []; + foreach ($data['Devices'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\PluginDevice::class, 'json', $context); + } + $object->setDevices($values_3); + } + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $values = []; + foreach ($object->getMounts() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Mounts'] = $values; + $values_1 = []; + foreach ($object->getEnv() as $value_1) { + $values_1[] = $value_1; + } + $data['Env'] = $values_1; + $values_2 = []; + foreach ($object->getArgs() as $value_2) { + $values_2[] = $value_2; + } + $data['Args'] = $values_2; + $values_3 = []; + foreach ($object->getDevices() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['Devices'] = $values_3; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginSettings::class => false]; + } + } +} else { + class PluginSettingsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginSettings::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginSettings::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginSettings(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values = []; + foreach ($data['Mounts'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\PluginMount::class, 'json', $context); + } + $object->setMounts($values); + } + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_1 = []; + foreach ($data['Env'] as $value_1) { + $values_1[] = $value_1; + } + $object->setEnv($values_1); + } + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Args', $data) && $data['Args'] !== null) { + $values_2 = []; + foreach ($data['Args'] as $value_2) { + $values_2[] = $value_2; + } + $object->setArgs($values_2); + } + elseif (\array_key_exists('Args', $data) && $data['Args'] === null) { + $object->setArgs(null); + } + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { + $values_3 = []; + foreach ($data['Devices'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\PluginDevice::class, 'json', $context); + } + $object->setDevices($values_3); + } + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getMounts() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Mounts'] = $values; + $values_1 = []; + foreach ($object->getEnv() as $value_1) { + $values_1[] = $value_1; + } + $data['Env'] = $values_1; + $values_2 = []; + foreach ($object->getArgs() as $value_2) { + $values_2[] = $value_2; + } + $data['Args'] = $values_2; + $values_3 = []; + foreach ($object->getDevices() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['Devices'] = $values_3; + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginSettings::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PluginsInfoNormalizer.php b/generated/Normalizer/PluginsInfoNormalizer.php new file mode 100644 index 00000000..4d80ebcd --- /dev/null +++ b/generated/Normalizer/PluginsInfoNormalizer.php @@ -0,0 +1,236 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PluginsInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginsInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginsInfo::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginsInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Volume', $data) && $data['Volume'] !== null) { + $values = []; + foreach ($data['Volume'] as $value) { + $values[] = $value; + } + $object->setVolume($values); + } + elseif (\array_key_exists('Volume', $data) && $data['Volume'] === null) { + $object->setVolume(null); + } + if (\array_key_exists('Network', $data) && $data['Network'] !== null) { + $values_1 = []; + foreach ($data['Network'] as $value_1) { + $values_1[] = $value_1; + } + $object->setNetwork($values_1); + } + elseif (\array_key_exists('Network', $data) && $data['Network'] === null) { + $object->setNetwork(null); + } + if (\array_key_exists('Authorization', $data) && $data['Authorization'] !== null) { + $values_2 = []; + foreach ($data['Authorization'] as $value_2) { + $values_2[] = $value_2; + } + $object->setAuthorization($values_2); + } + elseif (\array_key_exists('Authorization', $data) && $data['Authorization'] === null) { + $object->setAuthorization(null); + } + if (\array_key_exists('Log', $data) && $data['Log'] !== null) { + $values_3 = []; + foreach ($data['Log'] as $value_3) { + $values_3[] = $value_3; + } + $object->setLog($values_3); + } + elseif (\array_key_exists('Log', $data) && $data['Log'] === null) { + $object->setLog(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('volume') && null !== $object->getVolume()) { + $values = []; + foreach ($object->getVolume() as $value) { + $values[] = $value; + } + $data['Volume'] = $values; + } + if ($object->isInitialized('network') && null !== $object->getNetwork()) { + $values_1 = []; + foreach ($object->getNetwork() as $value_1) { + $values_1[] = $value_1; + } + $data['Network'] = $values_1; + } + if ($object->isInitialized('authorization') && null !== $object->getAuthorization()) { + $values_2 = []; + foreach ($object->getAuthorization() as $value_2) { + $values_2[] = $value_2; + } + $data['Authorization'] = $values_2; + } + if ($object->isInitialized('log') && null !== $object->getLog()) { + $values_3 = []; + foreach ($object->getLog() as $value_3) { + $values_3[] = $value_3; + } + $data['Log'] = $values_3; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginsInfo::class => false]; + } + } +} else { + class PluginsInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PluginsInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PluginsInfo::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PluginsInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Volume', $data) && $data['Volume'] !== null) { + $values = []; + foreach ($data['Volume'] as $value) { + $values[] = $value; + } + $object->setVolume($values); + } + elseif (\array_key_exists('Volume', $data) && $data['Volume'] === null) { + $object->setVolume(null); + } + if (\array_key_exists('Network', $data) && $data['Network'] !== null) { + $values_1 = []; + foreach ($data['Network'] as $value_1) { + $values_1[] = $value_1; + } + $object->setNetwork($values_1); + } + elseif (\array_key_exists('Network', $data) && $data['Network'] === null) { + $object->setNetwork(null); + } + if (\array_key_exists('Authorization', $data) && $data['Authorization'] !== null) { + $values_2 = []; + foreach ($data['Authorization'] as $value_2) { + $values_2[] = $value_2; + } + $object->setAuthorization($values_2); + } + elseif (\array_key_exists('Authorization', $data) && $data['Authorization'] === null) { + $object->setAuthorization(null); + } + if (\array_key_exists('Log', $data) && $data['Log'] !== null) { + $values_3 = []; + foreach ($data['Log'] as $value_3) { + $values_3[] = $value_3; + } + $object->setLog($values_3); + } + elseif (\array_key_exists('Log', $data) && $data['Log'] === null) { + $object->setLog(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('volume') && null !== $object->getVolume()) { + $values = []; + foreach ($object->getVolume() as $value) { + $values[] = $value; + } + $data['Volume'] = $values; + } + if ($object->isInitialized('network') && null !== $object->getNetwork()) { + $values_1 = []; + foreach ($object->getNetwork() as $value_1) { + $values_1[] = $value_1; + } + $data['Network'] = $values_1; + } + if ($object->isInitialized('authorization') && null !== $object->getAuthorization()) { + $values_2 = []; + foreach ($object->getAuthorization() as $value_2) { + $values_2[] = $value_2; + } + $data['Authorization'] = $values_2; + } + if ($object->isInitialized('log') && null !== $object->getLog()) { + $values_3 = []; + foreach ($object->getLog() as $value_3) { + $values_3[] = $value_3; + } + $data['Log'] = $values_3; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginsInfo::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/PortBindingNormalizer.php b/generated/Normalizer/PortBindingNormalizer.php index 266d6443..0d760316 100644 --- a/generated/Normalizer/PortBindingNormalizer.php +++ b/generated/Normalizer/PortBindingNormalizer.php @@ -2,62 +2,135 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class PortBindingNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PortBindingNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\PortBinding') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PortBinding::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\PortBinding) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PortBinding::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\PortBinding(); - if (property_exists($data, 'HostPort')) { - $object->setHostPort($data->{'HostPort'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PortBinding(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('HostIp', $data) && $data['HostIp'] !== null) { + $object->setHostIp($data['HostIp']); + } + elseif (\array_key_exists('HostIp', $data) && $data['HostIp'] === null) { + $object->setHostIp(null); + } + if (\array_key_exists('HostPort', $data) && $data['HostPort'] !== null) { + $object->setHostPort($data['HostPort']); + } + elseif (\array_key_exists('HostPort', $data) && $data['HostPort'] === null) { + $object->setHostPort(null); + } + return $object; } - if (property_exists($data, 'HostIp')) { - $object->setHostIp($data->{'HostIp'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('hostIp') && null !== $object->getHostIp()) { + $data['HostIp'] = $object->getHostIp(); + } + if ($object->isInitialized('hostPort') && null !== $object->getHostPort()) { + $data['HostPort'] = $object->getHostPort(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PortBinding::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class PortBindingNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getHostPort()) { - $data->{'HostPort'} = $object->getHostPort(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PortBinding::class; } - if (null !== $object->getHostIp()) { - $data->{'HostIp'} = $object->getHostIp(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PortBinding::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PortBinding(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('HostIp', $data) && $data['HostIp'] !== null) { + $object->setHostIp($data['HostIp']); + } + elseif (\array_key_exists('HostIp', $data) && $data['HostIp'] === null) { + $object->setHostIp(null); + } + if (\array_key_exists('HostPort', $data) && $data['HostPort'] !== null) { + $object->setHostPort($data['HostPort']); + } + elseif (\array_key_exists('HostPort', $data) && $data['HostPort'] === null) { + $object->setHostPort(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('hostIp') && null !== $object->getHostIp()) { + $data['HostIp'] = $object->getHostIp(); + } + if ($object->isInitialized('hostPort') && null !== $object->getHostPort()) { + $data['HostPort'] = $object->getHostPort(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PortBinding::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/PortConfigNormalizer.php b/generated/Normalizer/PortConfigNormalizer.php deleted file mode 100644 index c8132d19..00000000 --- a/generated/Normalizer/PortConfigNormalizer.php +++ /dev/null @@ -1,74 +0,0 @@ -setName($data->{'Name'}); - } - if (property_exists($data, 'Protocol')) { - $object->setProtocol($data->{'Protocol'}); - } - if (property_exists($data, 'TargetPort')) { - $object->setTargetPort($data->{'TargetPort'}); - } - if (property_exists($data, 'PublishedPort')) { - $object->setPublishedPort($data->{'PublishedPort'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getProtocol()) { - $data->{'Protocol'} = $object->getProtocol(); - } - if (null !== $object->getTargetPort()) { - $data->{'TargetPort'} = $object->getTargetPort(); - } - if (null !== $object->getPublishedPort()) { - $data->{'PublishedPort'} = $object->getPublishedPort(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/PortNormalizer.php b/generated/Normalizer/PortNormalizer.php index 6fbba695..4c840a07 100644 --- a/generated/Normalizer/PortNormalizer.php +++ b/generated/Normalizer/PortNormalizer.php @@ -2,67 +2,163 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class PortNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PortNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\Port') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Port::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\Port) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Port::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\Port(); - if (property_exists($data, 'PrivatePort')) { - $object->setPrivatePort($data->{'PrivatePort'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Port(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('IP', $data) && $data['IP'] !== null) { + $object->setIP($data['IP']); + } + elseif (\array_key_exists('IP', $data) && $data['IP'] === null) { + $object->setIP(null); + } + if (\array_key_exists('PrivatePort', $data) && $data['PrivatePort'] !== null) { + $object->setPrivatePort($data['PrivatePort']); + } + elseif (\array_key_exists('PrivatePort', $data) && $data['PrivatePort'] === null) { + $object->setPrivatePort(null); + } + if (\array_key_exists('PublicPort', $data) && $data['PublicPort'] !== null) { + $object->setPublicPort($data['PublicPort']); + } + elseif (\array_key_exists('PublicPort', $data) && $data['PublicPort'] === null) { + $object->setPublicPort(null); + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + return $object; } - if (property_exists($data, 'PublicPort')) { - $object->setPublicPort($data->{'PublicPort'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iP') && null !== $object->getIP()) { + $data['IP'] = $object->getIP(); + } + $data['PrivatePort'] = $object->getPrivatePort(); + if ($object->isInitialized('publicPort') && null !== $object->getPublicPort()) { + $data['PublicPort'] = $object->getPublicPort(); + } + $data['Type'] = $object->getType(); + return $data; } - if (property_exists($data, 'Type')) { - $object->setType($data->{'Type'}); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Port::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class PortNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getPrivatePort()) { - $data->{'PrivatePort'} = $object->getPrivatePort(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Port::class; } - if (null !== $object->getPublicPort()) { - $data->{'PublicPort'} = $object->getPublicPort(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Port::class; } - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Port(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('IP', $data) && $data['IP'] !== null) { + $object->setIP($data['IP']); + } + elseif (\array_key_exists('IP', $data) && $data['IP'] === null) { + $object->setIP(null); + } + if (\array_key_exists('PrivatePort', $data) && $data['PrivatePort'] !== null) { + $object->setPrivatePort($data['PrivatePort']); + } + elseif (\array_key_exists('PrivatePort', $data) && $data['PrivatePort'] === null) { + $object->setPrivatePort(null); + } + if (\array_key_exists('PublicPort', $data) && $data['PublicPort'] !== null) { + $object->setPublicPort($data['PublicPort']); + } + elseif (\array_key_exists('PublicPort', $data) && $data['PublicPort'] === null) { + $object->setPublicPort(null); + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iP') && null !== $object->getIP()) { + $data['IP'] = $object->getIP(); + } + $data['PrivatePort'] = $object->getPrivatePort(); + if ($object->isInitialized('publicPort') && null !== $object->getPublicPort()) { + $data['PublicPort'] = $object->getPublicPort(); + } + $data['Type'] = $object->getType(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Port::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/PortStatusNormalizer.php b/generated/Normalizer/PortStatusNormalizer.php new file mode 100644 index 00000000..1efbef44 --- /dev/null +++ b/generated/Normalizer/PortStatusNormalizer.php @@ -0,0 +1,134 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PortStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PortStatus::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PortStatus::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PortStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { + $values = []; + foreach ($data['Ports'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointPortConfig::class, 'json', $context); + } + $object->setPorts($values); + } + elseif (\array_key_exists('Ports', $data) && $data['Ports'] === null) { + $object->setPorts(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values = []; + foreach ($object->getPorts() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Ports'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PortStatus::class => false]; + } + } +} else { + class PortStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PortStatus::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PortStatus::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PortStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { + $values = []; + foreach ($data['Ports'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointPortConfig::class, 'json', $context); + } + $object->setPorts($values); + } + elseif (\array_key_exists('Ports', $data) && $data['Ports'] === null) { + $object->setPorts(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values = []; + foreach ($object->getPorts() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Ports'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PortStatus::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ProcessConfigNormalizer.php b/generated/Normalizer/ProcessConfigNormalizer.php index e15e3880..dbfb2b6c 100644 --- a/generated/Normalizer/ProcessConfigNormalizer.php +++ b/generated/Normalizer/ProcessConfigNormalizer.php @@ -2,100 +2,205 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class ProcessConfigNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\ProcessConfig') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\ProcessConfig) { - return true; - } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ProcessConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\ProcessConfig(); - if (property_exists($data, 'privileged')) { - $object->setPrivileged($data->{'privileged'}); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ProcessConfig::class; } - if (property_exists($data, 'user')) { - $object->setUser($data->{'user'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ProcessConfig::class; } - if (property_exists($data, 'tty')) { - $object->setTty($data->{'tty'}); - } - if (property_exists($data, 'entrypoint')) { - $object->setEntrypoint($data->{'entrypoint'}); - } - if (property_exists($data, 'arguments')) { - $value = $data->{'arguments'}; - if (is_array($data->{'arguments'})) { + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ProcessConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('privileged', $data) && $data['privileged'] !== null) { + $object->setPrivileged($data['privileged']); + } + elseif (\array_key_exists('privileged', $data) && $data['privileged'] === null) { + $object->setPrivileged(null); + } + if (\array_key_exists('user', $data) && $data['user'] !== null) { + $object->setUser($data['user']); + } + elseif (\array_key_exists('user', $data) && $data['user'] === null) { + $object->setUser(null); + } + if (\array_key_exists('tty', $data) && $data['tty'] !== null) { + $object->setTty($data['tty']); + } + elseif (\array_key_exists('tty', $data) && $data['tty'] === null) { + $object->setTty(null); + } + if (\array_key_exists('entrypoint', $data) && $data['entrypoint'] !== null) { + $object->setEntrypoint($data['entrypoint']); + } + elseif (\array_key_exists('entrypoint', $data) && $data['entrypoint'] === null) { + $object->setEntrypoint(null); + } + if (\array_key_exists('arguments', $data) && $data['arguments'] !== null) { $values = []; - foreach ($data->{'arguments'} as $value_1) { - $values[] = $value_1; + foreach ($data['arguments'] as $value) { + $values[] = $value; } - $value = $values; + $object->setArguments($values); } - if (is_null($data->{'arguments'})) { - $value = $data->{'arguments'}; + elseif (\array_key_exists('arguments', $data) && $data['arguments'] === null) { + $object->setArguments(null); } - $object->setArguments($value); + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('privileged') && null !== $object->getPrivileged()) { + $data['privileged'] = $object->getPrivileged(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['user'] = $object->getUser(); + } + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['tty'] = $object->getTty(); + } + if ($object->isInitialized('entrypoint') && null !== $object->getEntrypoint()) { + $data['entrypoint'] = $object->getEntrypoint(); + } + if ($object->isInitialized('arguments') && null !== $object->getArguments()) { + $values = []; + foreach ($object->getArguments() as $value) { + $values[] = $value; + } + $data['arguments'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ProcessConfig::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class ProcessConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getPrivileged()) { - $data->{'privileged'} = $object->getPrivileged(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ProcessConfig::class; } - if (null !== $object->getUser()) { - $data->{'user'} = $object->getUser(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ProcessConfig::class; } - if (null !== $object->getTty()) { - $data->{'tty'} = $object->getTty(); - } - if (null !== $object->getEntrypoint()) { - $data->{'entrypoint'} = $object->getEntrypoint(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ProcessConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('privileged', $data) && $data['privileged'] !== null) { + $object->setPrivileged($data['privileged']); + } + elseif (\array_key_exists('privileged', $data) && $data['privileged'] === null) { + $object->setPrivileged(null); + } + if (\array_key_exists('user', $data) && $data['user'] !== null) { + $object->setUser($data['user']); + } + elseif (\array_key_exists('user', $data) && $data['user'] === null) { + $object->setUser(null); + } + if (\array_key_exists('tty', $data) && $data['tty'] !== null) { + $object->setTty($data['tty']); + } + elseif (\array_key_exists('tty', $data) && $data['tty'] === null) { + $object->setTty(null); + } + if (\array_key_exists('entrypoint', $data) && $data['entrypoint'] !== null) { + $object->setEntrypoint($data['entrypoint']); + } + elseif (\array_key_exists('entrypoint', $data) && $data['entrypoint'] === null) { + $object->setEntrypoint(null); + } + if (\array_key_exists('arguments', $data) && $data['arguments'] !== null) { + $values = []; + foreach ($data['arguments'] as $value) { + $values[] = $value; + } + $object->setArguments($values); + } + elseif (\array_key_exists('arguments', $data) && $data['arguments'] === null) { + $object->setArguments(null); + } + return $object; } - $value = $object->getArguments(); - if (is_array($object->getArguments())) { - $values = []; - foreach ($object->getArguments() as $value_1) { - $values[] = $value_1; + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('privileged') && null !== $object->getPrivileged()) { + $data['privileged'] = $object->getPrivileged(); } - $value = $values; + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['user'] = $object->getUser(); + } + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['tty'] = $object->getTty(); + } + if ($object->isInitialized('entrypoint') && null !== $object->getEntrypoint()) { + $data['entrypoint'] = $object->getEntrypoint(); + } + if ($object->isInitialized('arguments') && null !== $object->getArguments()) { + $values = []; + foreach ($object->getArguments() as $value) { + $values[] = $value; + } + $data['arguments'] = $values; + } + return $data; } - if (is_null($object->getArguments())) { - $value = $object->getArguments(); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ProcessConfig::class => false]; } - $data->{'arguments'} = $value; - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/ProgressDetailNormalizer.php b/generated/Normalizer/ProgressDetailNormalizer.php index 4af6af2e..6125f884 100644 --- a/generated/Normalizer/ProgressDetailNormalizer.php +++ b/generated/Normalizer/ProgressDetailNormalizer.php @@ -2,74 +2,135 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class ProgressDetailNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\ProgressDetail') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ProgressDetailNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\ProgressDetail) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ProgressDetail::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\ProgressDetail(); - if (property_exists($data, 'code')) { - $object->setCode($data->{'code'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ProgressDetail::class; } - if (property_exists($data, 'message')) { - $object->setMessage($data->{'message'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ProgressDetail(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('current', $data) && $data['current'] !== null) { + $object->setCurrent($data['current']); + } + elseif (\array_key_exists('current', $data) && $data['current'] === null) { + $object->setCurrent(null); + } + if (\array_key_exists('total', $data) && $data['total'] !== null) { + $object->setTotal($data['total']); + } + elseif (\array_key_exists('total', $data) && $data['total'] === null) { + $object->setTotal(null); + } + return $object; } - if (property_exists($data, 'current')) { - $object->setCurrent($data->{'current'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('current') && null !== $object->getCurrent()) { + $data['current'] = $object->getCurrent(); + } + if ($object->isInitialized('total') && null !== $object->getTotal()) { + $data['total'] = $object->getTotal(); + } + return $data; } - if (property_exists($data, 'total')) { - $object->setTotal($data->{'total'}); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ProgressDetail::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class ProgressDetailNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getCode()) { - $data->{'code'} = $object->getCode(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ProgressDetail::class; } - if (null !== $object->getMessage()) { - $data->{'message'} = $object->getMessage(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ProgressDetail::class; } - if (null !== $object->getCurrent()) { - $data->{'current'} = $object->getCurrent(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ProgressDetail(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('current', $data) && $data['current'] !== null) { + $object->setCurrent($data['current']); + } + elseif (\array_key_exists('current', $data) && $data['current'] === null) { + $object->setCurrent(null); + } + if (\array_key_exists('total', $data) && $data['total'] !== null) { + $object->setTotal($data['total']); + } + elseif (\array_key_exists('total', $data) && $data['total'] === null) { + $object->setTotal(null); + } + return $object; } - if (null !== $object->getTotal()) { - $data->{'total'} = $object->getTotal(); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('current') && null !== $object->getCurrent()) { + $data['current'] = $object->getCurrent(); + } + if ($object->isInitialized('total') && null !== $object->getTotal()) { + $data['total'] = $object->getTotal(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ProgressDetail::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/PushImageInfoNormalizer.php b/generated/Normalizer/PushImageInfoNormalizer.php index f5213e14..0de17182 100644 --- a/generated/Normalizer/PushImageInfoNormalizer.php +++ b/generated/Normalizer/PushImageInfoNormalizer.php @@ -2,74 +2,171 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class PushImageInfoNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\PushImageInfo') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PushImageInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\PushImageInfo) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PushImageInfo::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\PushImageInfo(); - if (property_exists($data, 'error')) { - $object->setError($data->{'error'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PushImageInfo::class; } - if (property_exists($data, 'status')) { - $object->setStatus($data->{'status'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PushImageInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('error', $data) && $data['error'] !== null) { + $object->setError($data['error']); + } + elseif (\array_key_exists('error', $data) && $data['error'] === null) { + $object->setError(null); + } + if (\array_key_exists('status', $data) && $data['status'] !== null) { + $object->setStatus($data['status']); + } + elseif (\array_key_exists('status', $data) && $data['status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('progress', $data) && $data['progress'] !== null) { + $object->setProgress($data['progress']); + } + elseif (\array_key_exists('progress', $data) && $data['progress'] === null) { + $object->setProgress(null); + } + if (\array_key_exists('progressDetail', $data) && $data['progressDetail'] !== null) { + $object->setProgressDetail($this->denormalizer->denormalize($data['progressDetail'], \Docker\API\Model\ProgressDetail::class, 'json', $context)); + } + elseif (\array_key_exists('progressDetail', $data) && $data['progressDetail'] === null) { + $object->setProgressDetail(null); + } + return $object; } - if (property_exists($data, 'progress')) { - $object->setProgress($data->{'progress'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['error'] = $object->getError(); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['status'] = $object->getStatus(); + } + if ($object->isInitialized('progress') && null !== $object->getProgress()) { + $data['progress'] = $object->getProgress(); + } + if ($object->isInitialized('progressDetail') && null !== $object->getProgressDetail()) { + $data['progressDetail'] = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); + } + return $data; } - if (property_exists($data, 'progressDetail')) { - $object->setProgressDetail($this->serializer->denormalize($data->{'progressDetail'}, 'Docker\\API\\Model\\ProgressDetail', 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PushImageInfo::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class PushImageInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getError()) { - $data->{'error'} = $object->getError(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\PushImageInfo::class; } - if (null !== $object->getStatus()) { - $data->{'status'} = $object->getStatus(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\PushImageInfo::class; } - if (null !== $object->getProgress()) { - $data->{'progress'} = $object->getProgress(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\PushImageInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('error', $data) && $data['error'] !== null) { + $object->setError($data['error']); + } + elseif (\array_key_exists('error', $data) && $data['error'] === null) { + $object->setError(null); + } + if (\array_key_exists('status', $data) && $data['status'] !== null) { + $object->setStatus($data['status']); + } + elseif (\array_key_exists('status', $data) && $data['status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('progress', $data) && $data['progress'] !== null) { + $object->setProgress($data['progress']); + } + elseif (\array_key_exists('progress', $data) && $data['progress'] === null) { + $object->setProgress(null); + } + if (\array_key_exists('progressDetail', $data) && $data['progressDetail'] !== null) { + $object->setProgressDetail($this->denormalizer->denormalize($data['progressDetail'], \Docker\API\Model\ProgressDetail::class, 'json', $context)); + } + elseif (\array_key_exists('progressDetail', $data) && $data['progressDetail'] === null) { + $object->setProgressDetail(null); + } + return $object; } - if (null !== $object->getProgressDetail()) { - $data->{'progressDetail'} = json_decode($this->serializer->normalize($object->getProgressDetail(), 'raw', $context)); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['error'] = $object->getError(); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['status'] = $object->getStatus(); + } + if ($object->isInitialized('progress') && null !== $object->getProgress()) { + $data['progress'] = $object->getProgress(); + } + if ($object->isInitialized('progressDetail') && null !== $object->getProgressDetail()) { + $data['progressDetail'] = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PushImageInfo::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/RegistryConfigNormalizer.php b/generated/Normalizer/RegistryConfigNormalizer.php deleted file mode 100644 index 7808b91f..00000000 --- a/generated/Normalizer/RegistryConfigNormalizer.php +++ /dev/null @@ -1,90 +0,0 @@ -{'IndexConfigs'} as $key => $value) { - $values[$key] = $this->serializer->denormalize($value, 'Docker\\API\\Model\\Registry', 'raw', $context); - } - $object->setIndexConfigs($values); - } - if (property_exists($data, 'InsecureRegistryCIDRs')) { - $value_1 = $data->{'InsecureRegistryCIDRs'}; - if (is_array($data->{'InsecureRegistryCIDRs'})) { - $values_1 = []; - foreach ($data->{'InsecureRegistryCIDRs'} as $value_2) { - $values_1[] = $value_2; - } - $value_1 = $values_1; - } - if (is_null($data->{'InsecureRegistryCIDRs'})) { - $value_1 = $data->{'InsecureRegistryCIDRs'}; - } - $object->setInsecureRegistryCIDRs($value_1); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getIndexConfigs()) { - $values = new \stdClass(); - foreach ($object->getIndexConfigs() as $key => $value) { - $values->{$key} = $value; - } - $data->{'IndexConfigs'} = $values; - } - $value_1 = $object->getInsecureRegistryCIDRs(); - if (is_array($object->getInsecureRegistryCIDRs())) { - $values_1 = []; - foreach ($object->getInsecureRegistryCIDRs() as $value_2) { - $values_1[] = $value_2; - } - $value_1 = $values_1; - } - if (is_null($object->getInsecureRegistryCIDRs())) { - $value_1 = $object->getInsecureRegistryCIDRs(); - } - $data->{'InsecureRegistryCIDRs'} = $value_1; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/RegistryNormalizer.php b/generated/Normalizer/RegistryNormalizer.php deleted file mode 100644 index ed77ebe6..00000000 --- a/generated/Normalizer/RegistryNormalizer.php +++ /dev/null @@ -1,94 +0,0 @@ -{'Mirrors'}; - if (is_array($data->{'Mirrors'})) { - $values = []; - foreach ($data->{'Mirrors'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Mirrors'})) { - $value = $data->{'Mirrors'}; - } - $object->setMirrors($value); - } - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Official')) { - $object->setOfficial($data->{'Official'}); - } - if (property_exists($data, 'Secure')) { - $object->setSecure($data->{'Secure'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - $value = $object->getMirrors(); - if (is_array($object->getMirrors())) { - $values = []; - foreach ($object->getMirrors() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getMirrors())) { - $value = $object->getMirrors(); - } - $data->{'Mirrors'} = $value; - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getOfficial()) { - $data->{'Official'} = $object->getOfficial(); - } - if (null !== $object->getSecure()) { - $data->{'Secure'} = $object->getSecure(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/RegistryServiceConfigNormalizer.php b/generated/Normalizer/RegistryServiceConfigNormalizer.php new file mode 100644 index 00000000..65697d7d --- /dev/null +++ b/generated/Normalizer/RegistryServiceConfigNormalizer.php @@ -0,0 +1,270 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class RegistryServiceConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\RegistryServiceConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\RegistryServiceConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\RegistryServiceConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AllowNondistributableArtifactsCIDRs', $data) && $data['AllowNondistributableArtifactsCIDRs'] !== null) { + $values = []; + foreach ($data['AllowNondistributableArtifactsCIDRs'] as $value) { + $values[] = $value; + } + $object->setAllowNondistributableArtifactsCIDRs($values); + } + elseif (\array_key_exists('AllowNondistributableArtifactsCIDRs', $data) && $data['AllowNondistributableArtifactsCIDRs'] === null) { + $object->setAllowNondistributableArtifactsCIDRs(null); + } + if (\array_key_exists('AllowNondistributableArtifactsHostnames', $data) && $data['AllowNondistributableArtifactsHostnames'] !== null) { + $values_1 = []; + foreach ($data['AllowNondistributableArtifactsHostnames'] as $value_1) { + $values_1[] = $value_1; + } + $object->setAllowNondistributableArtifactsHostnames($values_1); + } + elseif (\array_key_exists('AllowNondistributableArtifactsHostnames', $data) && $data['AllowNondistributableArtifactsHostnames'] === null) { + $object->setAllowNondistributableArtifactsHostnames(null); + } + if (\array_key_exists('InsecureRegistryCIDRs', $data) && $data['InsecureRegistryCIDRs'] !== null) { + $values_2 = []; + foreach ($data['InsecureRegistryCIDRs'] as $value_2) { + $values_2[] = $value_2; + } + $object->setInsecureRegistryCIDRs($values_2); + } + elseif (\array_key_exists('InsecureRegistryCIDRs', $data) && $data['InsecureRegistryCIDRs'] === null) { + $object->setInsecureRegistryCIDRs(null); + } + if (\array_key_exists('IndexConfigs', $data) && $data['IndexConfigs'] !== null) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['IndexConfigs'] as $key => $value_3) { + $values_3[$key] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\IndexInfo::class, 'json', $context); + } + $object->setIndexConfigs($values_3); + } + elseif (\array_key_exists('IndexConfigs', $data) && $data['IndexConfigs'] === null) { + $object->setIndexConfigs(null); + } + if (\array_key_exists('Mirrors', $data) && $data['Mirrors'] !== null) { + $values_4 = []; + foreach ($data['Mirrors'] as $value_4) { + $values_4[] = $value_4; + } + $object->setMirrors($values_4); + } + elseif (\array_key_exists('Mirrors', $data) && $data['Mirrors'] === null) { + $object->setMirrors(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('allowNondistributableArtifactsCIDRs') && null !== $object->getAllowNondistributableArtifactsCIDRs()) { + $values = []; + foreach ($object->getAllowNondistributableArtifactsCIDRs() as $value) { + $values[] = $value; + } + $data['AllowNondistributableArtifactsCIDRs'] = $values; + } + if ($object->isInitialized('allowNondistributableArtifactsHostnames') && null !== $object->getAllowNondistributableArtifactsHostnames()) { + $values_1 = []; + foreach ($object->getAllowNondistributableArtifactsHostnames() as $value_1) { + $values_1[] = $value_1; + } + $data['AllowNondistributableArtifactsHostnames'] = $values_1; + } + if ($object->isInitialized('insecureRegistryCIDRs') && null !== $object->getInsecureRegistryCIDRs()) { + $values_2 = []; + foreach ($object->getInsecureRegistryCIDRs() as $value_2) { + $values_2[] = $value_2; + } + $data['InsecureRegistryCIDRs'] = $values_2; + } + if ($object->isInitialized('indexConfigs') && null !== $object->getIndexConfigs()) { + $values_3 = []; + foreach ($object->getIndexConfigs() as $key => $value_3) { + $values_3[$key] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['IndexConfigs'] = $values_3; + } + if ($object->isInitialized('mirrors') && null !== $object->getMirrors()) { + $values_4 = []; + foreach ($object->getMirrors() as $value_4) { + $values_4[] = $value_4; + } + $data['Mirrors'] = $values_4; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\RegistryServiceConfig::class => false]; + } + } +} else { + class RegistryServiceConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\RegistryServiceConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\RegistryServiceConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\RegistryServiceConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AllowNondistributableArtifactsCIDRs', $data) && $data['AllowNondistributableArtifactsCIDRs'] !== null) { + $values = []; + foreach ($data['AllowNondistributableArtifactsCIDRs'] as $value) { + $values[] = $value; + } + $object->setAllowNondistributableArtifactsCIDRs($values); + } + elseif (\array_key_exists('AllowNondistributableArtifactsCIDRs', $data) && $data['AllowNondistributableArtifactsCIDRs'] === null) { + $object->setAllowNondistributableArtifactsCIDRs(null); + } + if (\array_key_exists('AllowNondistributableArtifactsHostnames', $data) && $data['AllowNondistributableArtifactsHostnames'] !== null) { + $values_1 = []; + foreach ($data['AllowNondistributableArtifactsHostnames'] as $value_1) { + $values_1[] = $value_1; + } + $object->setAllowNondistributableArtifactsHostnames($values_1); + } + elseif (\array_key_exists('AllowNondistributableArtifactsHostnames', $data) && $data['AllowNondistributableArtifactsHostnames'] === null) { + $object->setAllowNondistributableArtifactsHostnames(null); + } + if (\array_key_exists('InsecureRegistryCIDRs', $data) && $data['InsecureRegistryCIDRs'] !== null) { + $values_2 = []; + foreach ($data['InsecureRegistryCIDRs'] as $value_2) { + $values_2[] = $value_2; + } + $object->setInsecureRegistryCIDRs($values_2); + } + elseif (\array_key_exists('InsecureRegistryCIDRs', $data) && $data['InsecureRegistryCIDRs'] === null) { + $object->setInsecureRegistryCIDRs(null); + } + if (\array_key_exists('IndexConfigs', $data) && $data['IndexConfigs'] !== null) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['IndexConfigs'] as $key => $value_3) { + $values_3[$key] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\IndexInfo::class, 'json', $context); + } + $object->setIndexConfigs($values_3); + } + elseif (\array_key_exists('IndexConfigs', $data) && $data['IndexConfigs'] === null) { + $object->setIndexConfigs(null); + } + if (\array_key_exists('Mirrors', $data) && $data['Mirrors'] !== null) { + $values_4 = []; + foreach ($data['Mirrors'] as $value_4) { + $values_4[] = $value_4; + } + $object->setMirrors($values_4); + } + elseif (\array_key_exists('Mirrors', $data) && $data['Mirrors'] === null) { + $object->setMirrors(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('allowNondistributableArtifactsCIDRs') && null !== $object->getAllowNondistributableArtifactsCIDRs()) { + $values = []; + foreach ($object->getAllowNondistributableArtifactsCIDRs() as $value) { + $values[] = $value; + } + $data['AllowNondistributableArtifactsCIDRs'] = $values; + } + if ($object->isInitialized('allowNondistributableArtifactsHostnames') && null !== $object->getAllowNondistributableArtifactsHostnames()) { + $values_1 = []; + foreach ($object->getAllowNondistributableArtifactsHostnames() as $value_1) { + $values_1[] = $value_1; + } + $data['AllowNondistributableArtifactsHostnames'] = $values_1; + } + if ($object->isInitialized('insecureRegistryCIDRs') && null !== $object->getInsecureRegistryCIDRs()) { + $values_2 = []; + foreach ($object->getInsecureRegistryCIDRs() as $value_2) { + $values_2[] = $value_2; + } + $data['InsecureRegistryCIDRs'] = $values_2; + } + if ($object->isInitialized('indexConfigs') && null !== $object->getIndexConfigs()) { + $values_3 = []; + foreach ($object->getIndexConfigs() as $key => $value_3) { + $values_3[$key] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['IndexConfigs'] = $values_3; + } + if ($object->isInitialized('mirrors') && null !== $object->getMirrors()) { + $values_4 = []; + foreach ($object->getMirrors() as $value_4) { + $values_4[] = $value_4; + } + $data['Mirrors'] = $values_4; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\RegistryServiceConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ReplicatedServiceNormalizer.php b/generated/Normalizer/ReplicatedServiceNormalizer.php deleted file mode 100644 index a21a3d3d..00000000 --- a/generated/Normalizer/ReplicatedServiceNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -setReplicas($data->{'Replicas'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getReplicas()) { - $data->{'Replicas'} = $object->getReplicas(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ResourceObjectNormalizer.php b/generated/Normalizer/ResourceObjectNormalizer.php new file mode 100644 index 00000000..f9050170 --- /dev/null +++ b/generated/Normalizer/ResourceObjectNormalizer.php @@ -0,0 +1,170 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ResourceObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ResourceObject::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ResourceObject::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ResourceObject(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NanoCPUs', $data) && $data['NanoCPUs'] !== null) { + $object->setNanoCPUs($data['NanoCPUs']); + } + elseif (\array_key_exists('NanoCPUs', $data) && $data['NanoCPUs'] === null) { + $object->setNanoCPUs(null); + } + if (\array_key_exists('MemoryBytes', $data) && $data['MemoryBytes'] !== null) { + $object->setMemoryBytes($data['MemoryBytes']); + } + elseif (\array_key_exists('MemoryBytes', $data) && $data['MemoryBytes'] === null) { + $object->setMemoryBytes(null); + } + if (\array_key_exists('GenericResources', $data) && $data['GenericResources'] !== null) { + $values = []; + foreach ($data['GenericResources'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\GenericResourcesItem::class, 'json', $context); + } + $object->setGenericResources($values); + } + elseif (\array_key_exists('GenericResources', $data) && $data['GenericResources'] === null) { + $object->setGenericResources(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('nanoCPUs') && null !== $object->getNanoCPUs()) { + $data['NanoCPUs'] = $object->getNanoCPUs(); + } + if ($object->isInitialized('memoryBytes') && null !== $object->getMemoryBytes()) { + $data['MemoryBytes'] = $object->getMemoryBytes(); + } + if ($object->isInitialized('genericResources') && null !== $object->getGenericResources()) { + $values = []; + foreach ($object->getGenericResources() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['GenericResources'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ResourceObject::class => false]; + } + } +} else { + class ResourceObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ResourceObject::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ResourceObject::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ResourceObject(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NanoCPUs', $data) && $data['NanoCPUs'] !== null) { + $object->setNanoCPUs($data['NanoCPUs']); + } + elseif (\array_key_exists('NanoCPUs', $data) && $data['NanoCPUs'] === null) { + $object->setNanoCPUs(null); + } + if (\array_key_exists('MemoryBytes', $data) && $data['MemoryBytes'] !== null) { + $object->setMemoryBytes($data['MemoryBytes']); + } + elseif (\array_key_exists('MemoryBytes', $data) && $data['MemoryBytes'] === null) { + $object->setMemoryBytes(null); + } + if (\array_key_exists('GenericResources', $data) && $data['GenericResources'] !== null) { + $values = []; + foreach ($data['GenericResources'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\GenericResourcesItem::class, 'json', $context); + } + $object->setGenericResources($values); + } + elseif (\array_key_exists('GenericResources', $data) && $data['GenericResources'] === null) { + $object->setGenericResources(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('nanoCPUs') && null !== $object->getNanoCPUs()) { + $data['NanoCPUs'] = $object->getNanoCPUs(); + } + if ($object->isInitialized('memoryBytes') && null !== $object->getMemoryBytes()) { + $data['MemoryBytes'] = $object->getMemoryBytes(); + } + if ($object->isInitialized('genericResources') && null !== $object->getGenericResources()) { + $values = []; + foreach ($object->getGenericResources() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['GenericResources'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ResourceObject::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ResourceUpdateNormalizer.php b/generated/Normalizer/ResourceUpdateNormalizer.php deleted file mode 100644 index cf7cbe81..00000000 --- a/generated/Normalizer/ResourceUpdateNormalizer.php +++ /dev/null @@ -1,117 +0,0 @@ -setBlkioWeight($data->{'BlkioWeight'}); - } - if (property_exists($data, 'CpuShares')) { - $object->setCpuShares($data->{'CpuShares'}); - } - if (property_exists($data, 'CpuPeriod')) { - $object->setCpuPeriod($data->{'CpuPeriod'}); - } - if (property_exists($data, 'CpuQuota')) { - $object->setCpuQuota($data->{'CpuQuota'}); - } - if (property_exists($data, 'CpusetCpus')) { - $object->setCpusetCpus($data->{'CpusetCpus'}); - } - if (property_exists($data, 'CpusetMems')) { - $object->setCpusetMems($data->{'CpusetMems'}); - } - if (property_exists($data, 'Memory')) { - $object->setMemory($data->{'Memory'}); - } - if (property_exists($data, 'MemorySwap')) { - $object->setMemorySwap($data->{'MemorySwap'}); - } - if (property_exists($data, 'MemoryReservation')) { - $object->setMemoryReservation($data->{'MemoryReservation'}); - } - if (property_exists($data, 'KernelMemory')) { - $object->setKernelMemory($data->{'KernelMemory'}); - } - if (property_exists($data, 'RestartPolicy')) { - $object->setRestartPolicy($this->serializer->denormalize($data->{'RestartPolicy'}, 'Docker\\API\\Model\\RestartPolicy', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getBlkioWeight()) { - $data->{'BlkioWeight'} = $object->getBlkioWeight(); - } - if (null !== $object->getCpuShares()) { - $data->{'CpuShares'} = $object->getCpuShares(); - } - if (null !== $object->getCpuPeriod()) { - $data->{'CpuPeriod'} = $object->getCpuPeriod(); - } - if (null !== $object->getCpuQuota()) { - $data->{'CpuQuota'} = $object->getCpuQuota(); - } - if (null !== $object->getCpusetCpus()) { - $data->{'CpusetCpus'} = $object->getCpusetCpus(); - } - if (null !== $object->getCpusetMems()) { - $data->{'CpusetMems'} = $object->getCpusetMems(); - } - if (null !== $object->getMemory()) { - $data->{'Memory'} = $object->getMemory(); - } - if (null !== $object->getMemorySwap()) { - $data->{'MemorySwap'} = $object->getMemorySwap(); - } - if (null !== $object->getMemoryReservation()) { - $data->{'MemoryReservation'} = $object->getMemoryReservation(); - } - if (null !== $object->getKernelMemory()) { - $data->{'KernelMemory'} = $object->getKernelMemory(); - } - if (null !== $object->getRestartPolicy()) { - $data->{'RestartPolicy'} = json_decode($this->serializer->normalize($object->getRestartPolicy(), 'raw', $context)); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/ResourcesBlkioWeightDeviceItemNormalizer.php b/generated/Normalizer/ResourcesBlkioWeightDeviceItemNormalizer.php new file mode 100644 index 00000000..f902544c --- /dev/null +++ b/generated/Normalizer/ResourcesBlkioWeightDeviceItemNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ResourcesBlkioWeightDeviceItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ResourcesBlkioWeightDeviceItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Path', $data) && $data['Path'] !== null) { + $object->setPath($data['Path']); + } + elseif (\array_key_exists('Path', $data) && $data['Path'] === null) { + $object->setPath(null); + } + if (\array_key_exists('Weight', $data) && $data['Weight'] !== null) { + $object->setWeight($data['Weight']); + } + elseif (\array_key_exists('Weight', $data) && $data['Weight'] === null) { + $object->setWeight(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('path') && null !== $object->getPath()) { + $data['Path'] = $object->getPath(); + } + if ($object->isInitialized('weight') && null !== $object->getWeight()) { + $data['Weight'] = $object->getWeight(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ResourcesBlkioWeightDeviceItem::class => false]; + } + } +} else { + class ResourcesBlkioWeightDeviceItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ResourcesBlkioWeightDeviceItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Path', $data) && $data['Path'] !== null) { + $object->setPath($data['Path']); + } + elseif (\array_key_exists('Path', $data) && $data['Path'] === null) { + $object->setPath(null); + } + if (\array_key_exists('Weight', $data) && $data['Weight'] !== null) { + $object->setWeight($data['Weight']); + } + elseif (\array_key_exists('Weight', $data) && $data['Weight'] === null) { + $object->setWeight(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('path') && null !== $object->getPath()) { + $data['Path'] = $object->getPath(); + } + if ($object->isInitialized('weight') && null !== $object->getWeight()) { + $data['Weight'] = $object->getWeight(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ResourcesBlkioWeightDeviceItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ResourcesNormalizer.php b/generated/Normalizer/ResourcesNormalizer.php new file mode 100644 index 00000000..eafa1eba --- /dev/null +++ b/generated/Normalizer/ResourcesNormalizer.php @@ -0,0 +1,802 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ResourcesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Resources::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Resources::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Resources(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CpuShares', $data) && $data['CpuShares'] !== null) { + $object->setCpuShares($data['CpuShares']); + } + elseif (\array_key_exists('CpuShares', $data) && $data['CpuShares'] === null) { + $object->setCpuShares(null); + } + if (\array_key_exists('Memory', $data) && $data['Memory'] !== null) { + $object->setMemory($data['Memory']); + } + elseif (\array_key_exists('Memory', $data) && $data['Memory'] === null) { + $object->setMemory(null); + } + if (\array_key_exists('CgroupParent', $data) && $data['CgroupParent'] !== null) { + $object->setCgroupParent($data['CgroupParent']); + } + elseif (\array_key_exists('CgroupParent', $data) && $data['CgroupParent'] === null) { + $object->setCgroupParent(null); + } + if (\array_key_exists('BlkioWeight', $data) && $data['BlkioWeight'] !== null) { + $object->setBlkioWeight($data['BlkioWeight']); + } + elseif (\array_key_exists('BlkioWeight', $data) && $data['BlkioWeight'] === null) { + $object->setBlkioWeight(null); + } + if (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] !== null) { + $values = []; + foreach ($data['BlkioWeightDevice'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class, 'json', $context); + } + $object->setBlkioWeightDevice($values); + } + elseif (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] === null) { + $object->setBlkioWeightDevice(null); + } + if (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] !== null) { + $values_1 = []; + foreach ($data['BlkioDeviceReadBps'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceReadBps($values_1); + } + elseif (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] === null) { + $object->setBlkioDeviceReadBps(null); + } + if (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] !== null) { + $values_2 = []; + foreach ($data['BlkioDeviceWriteBps'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceWriteBps($values_2); + } + elseif (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] === null) { + $object->setBlkioDeviceWriteBps(null); + } + if (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] !== null) { + $values_3 = []; + foreach ($data['BlkioDeviceReadIOps'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceReadIOps($values_3); + } + elseif (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] === null) { + $object->setBlkioDeviceReadIOps(null); + } + if (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] !== null) { + $values_4 = []; + foreach ($data['BlkioDeviceWriteIOps'] as $value_4) { + $values_4[] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceWriteIOps($values_4); + } + elseif (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] === null) { + $object->setBlkioDeviceWriteIOps(null); + } + if (\array_key_exists('CpuPeriod', $data) && $data['CpuPeriod'] !== null) { + $object->setCpuPeriod($data['CpuPeriod']); + } + elseif (\array_key_exists('CpuPeriod', $data) && $data['CpuPeriod'] === null) { + $object->setCpuPeriod(null); + } + if (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] !== null) { + $object->setCpuQuota($data['CpuQuota']); + } + elseif (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] === null) { + $object->setCpuQuota(null); + } + if (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] !== null) { + $object->setCpuRealtimePeriod($data['CpuRealtimePeriod']); + } + elseif (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] === null) { + $object->setCpuRealtimePeriod(null); + } + if (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] !== null) { + $object->setCpuRealtimeRuntime($data['CpuRealtimeRuntime']); + } + elseif (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] === null) { + $object->setCpuRealtimeRuntime(null); + } + if (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] !== null) { + $object->setCpusetCpus($data['CpusetCpus']); + } + elseif (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] === null) { + $object->setCpusetCpus(null); + } + if (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] !== null) { + $object->setCpusetMems($data['CpusetMems']); + } + elseif (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] === null) { + $object->setCpusetMems(null); + } + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { + $values_5 = []; + foreach ($data['Devices'] as $value_5) { + $values_5[] = $this->denormalizer->denormalize($value_5, \Docker\API\Model\DeviceMapping::class, 'json', $context); + } + $object->setDevices($values_5); + } + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } + if (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] !== null) { + $values_6 = []; + foreach ($data['DeviceCgroupRules'] as $value_6) { + $values_6[] = $value_6; + } + $object->setDeviceCgroupRules($values_6); + } + elseif (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] === null) { + $object->setDeviceCgroupRules(null); + } + if (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] !== null) { + $values_7 = []; + foreach ($data['DeviceRequests'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, \Docker\API\Model\DeviceRequest::class, 'json', $context); + } + $object->setDeviceRequests($values_7); + } + elseif (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] === null) { + $object->setDeviceRequests(null); + } + if (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] !== null) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); + } + elseif (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] === null) { + $object->setKernelMemoryTCP(null); + } + if (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] !== null) { + $object->setMemoryReservation($data['MemoryReservation']); + } + elseif (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] === null) { + $object->setMemoryReservation(null); + } + if (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] !== null) { + $object->setMemorySwap($data['MemorySwap']); + } + elseif (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] === null) { + $object->setMemorySwap(null); + } + if (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] !== null) { + $object->setMemorySwappiness($data['MemorySwappiness']); + } + elseif (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] === null) { + $object->setMemorySwappiness(null); + } + if (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] !== null) { + $object->setNanoCpus($data['NanoCpus']); + } + elseif (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] === null) { + $object->setNanoCpus(null); + } + if (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] !== null) { + $object->setOomKillDisable($data['OomKillDisable']); + } + elseif (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] === null) { + $object->setOomKillDisable(null); + } + if (\array_key_exists('Init', $data) && $data['Init'] !== null) { + $object->setInit($data['Init']); + } + elseif (\array_key_exists('Init', $data) && $data['Init'] === null) { + $object->setInit(null); + } + if (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] !== null) { + $object->setPidsLimit($data['PidsLimit']); + } + elseif (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] === null) { + $object->setPidsLimit(null); + } + if (\array_key_exists('Ulimits', $data) && $data['Ulimits'] !== null) { + $values_8 = []; + foreach ($data['Ulimits'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, \Docker\API\Model\ResourcesUlimitsItem::class, 'json', $context); + } + $object->setUlimits($values_8); + } + elseif (\array_key_exists('Ulimits', $data) && $data['Ulimits'] === null) { + $object->setUlimits(null); + } + if (\array_key_exists('CpuCount', $data) && $data['CpuCount'] !== null) { + $object->setCpuCount($data['CpuCount']); + } + elseif (\array_key_exists('CpuCount', $data) && $data['CpuCount'] === null) { + $object->setCpuCount(null); + } + if (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] !== null) { + $object->setCpuPercent($data['CpuPercent']); + } + elseif (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] === null) { + $object->setCpuPercent(null); + } + if (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] !== null) { + $object->setIOMaximumIOps($data['IOMaximumIOps']); + } + elseif (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] === null) { + $object->setIOMaximumIOps(null); + } + if (\array_key_exists('IOMaximumBandwidth', $data) && $data['IOMaximumBandwidth'] !== null) { + $object->setIOMaximumBandwidth($data['IOMaximumBandwidth']); + } + elseif (\array_key_exists('IOMaximumBandwidth', $data) && $data['IOMaximumBandwidth'] === null) { + $object->setIOMaximumBandwidth(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('cpuShares') && null !== $object->getCpuShares()) { + $data['CpuShares'] = $object->getCpuShares(); + } + if ($object->isInitialized('memory') && null !== $object->getMemory()) { + $data['Memory'] = $object->getMemory(); + } + if ($object->isInitialized('cgroupParent') && null !== $object->getCgroupParent()) { + $data['CgroupParent'] = $object->getCgroupParent(); + } + if ($object->isInitialized('blkioWeight') && null !== $object->getBlkioWeight()) { + $data['BlkioWeight'] = $object->getBlkioWeight(); + } + if ($object->isInitialized('blkioWeightDevice') && null !== $object->getBlkioWeightDevice()) { + $values = []; + foreach ($object->getBlkioWeightDevice() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['BlkioWeightDevice'] = $values; + } + if ($object->isInitialized('blkioDeviceReadBps') && null !== $object->getBlkioDeviceReadBps()) { + $values_1 = []; + foreach ($object->getBlkioDeviceReadBps() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['BlkioDeviceReadBps'] = $values_1; + } + if ($object->isInitialized('blkioDeviceWriteBps') && null !== $object->getBlkioDeviceWriteBps()) { + $values_2 = []; + foreach ($object->getBlkioDeviceWriteBps() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['BlkioDeviceWriteBps'] = $values_2; + } + if ($object->isInitialized('blkioDeviceReadIOps') && null !== $object->getBlkioDeviceReadIOps()) { + $values_3 = []; + foreach ($object->getBlkioDeviceReadIOps() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['BlkioDeviceReadIOps'] = $values_3; + } + if ($object->isInitialized('blkioDeviceWriteIOps') && null !== $object->getBlkioDeviceWriteIOps()) { + $values_4 = []; + foreach ($object->getBlkioDeviceWriteIOps() as $value_4) { + $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); + } + $data['BlkioDeviceWriteIOps'] = $values_4; + } + if ($object->isInitialized('cpuPeriod') && null !== $object->getCpuPeriod()) { + $data['CpuPeriod'] = $object->getCpuPeriod(); + } + if ($object->isInitialized('cpuQuota') && null !== $object->getCpuQuota()) { + $data['CpuQuota'] = $object->getCpuQuota(); + } + if ($object->isInitialized('cpuRealtimePeriod') && null !== $object->getCpuRealtimePeriod()) { + $data['CpuRealtimePeriod'] = $object->getCpuRealtimePeriod(); + } + if ($object->isInitialized('cpuRealtimeRuntime') && null !== $object->getCpuRealtimeRuntime()) { + $data['CpuRealtimeRuntime'] = $object->getCpuRealtimeRuntime(); + } + if ($object->isInitialized('cpusetCpus') && null !== $object->getCpusetCpus()) { + $data['CpusetCpus'] = $object->getCpusetCpus(); + } + if ($object->isInitialized('cpusetMems') && null !== $object->getCpusetMems()) { + $data['CpusetMems'] = $object->getCpusetMems(); + } + if ($object->isInitialized('devices') && null !== $object->getDevices()) { + $values_5 = []; + foreach ($object->getDevices() as $value_5) { + $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); + } + $data['Devices'] = $values_5; + } + if ($object->isInitialized('deviceCgroupRules') && null !== $object->getDeviceCgroupRules()) { + $values_6 = []; + foreach ($object->getDeviceCgroupRules() as $value_6) { + $values_6[] = $value_6; + } + $data['DeviceCgroupRules'] = $values_6; + } + if ($object->isInitialized('deviceRequests') && null !== $object->getDeviceRequests()) { + $values_7 = []; + foreach ($object->getDeviceRequests() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $data['DeviceRequests'] = $values_7; + } + if ($object->isInitialized('kernelMemoryTCP') && null !== $object->getKernelMemoryTCP()) { + $data['KernelMemoryTCP'] = $object->getKernelMemoryTCP(); + } + if ($object->isInitialized('memoryReservation') && null !== $object->getMemoryReservation()) { + $data['MemoryReservation'] = $object->getMemoryReservation(); + } + if ($object->isInitialized('memorySwap') && null !== $object->getMemorySwap()) { + $data['MemorySwap'] = $object->getMemorySwap(); + } + if ($object->isInitialized('memorySwappiness') && null !== $object->getMemorySwappiness()) { + $data['MemorySwappiness'] = $object->getMemorySwappiness(); + } + if ($object->isInitialized('nanoCpus') && null !== $object->getNanoCpus()) { + $data['NanoCpus'] = $object->getNanoCpus(); + } + if ($object->isInitialized('oomKillDisable') && null !== $object->getOomKillDisable()) { + $data['OomKillDisable'] = $object->getOomKillDisable(); + } + if ($object->isInitialized('init') && null !== $object->getInit()) { + $data['Init'] = $object->getInit(); + } + if ($object->isInitialized('pidsLimit') && null !== $object->getPidsLimit()) { + $data['PidsLimit'] = $object->getPidsLimit(); + } + if ($object->isInitialized('ulimits') && null !== $object->getUlimits()) { + $values_8 = []; + foreach ($object->getUlimits() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); + } + $data['Ulimits'] = $values_8; + } + if ($object->isInitialized('cpuCount') && null !== $object->getCpuCount()) { + $data['CpuCount'] = $object->getCpuCount(); + } + if ($object->isInitialized('cpuPercent') && null !== $object->getCpuPercent()) { + $data['CpuPercent'] = $object->getCpuPercent(); + } + if ($object->isInitialized('iOMaximumIOps') && null !== $object->getIOMaximumIOps()) { + $data['IOMaximumIOps'] = $object->getIOMaximumIOps(); + } + if ($object->isInitialized('iOMaximumBandwidth') && null !== $object->getIOMaximumBandwidth()) { + $data['IOMaximumBandwidth'] = $object->getIOMaximumBandwidth(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Resources::class => false]; + } + } +} else { + class ResourcesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Resources::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Resources::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Resources(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CpuShares', $data) && $data['CpuShares'] !== null) { + $object->setCpuShares($data['CpuShares']); + } + elseif (\array_key_exists('CpuShares', $data) && $data['CpuShares'] === null) { + $object->setCpuShares(null); + } + if (\array_key_exists('Memory', $data) && $data['Memory'] !== null) { + $object->setMemory($data['Memory']); + } + elseif (\array_key_exists('Memory', $data) && $data['Memory'] === null) { + $object->setMemory(null); + } + if (\array_key_exists('CgroupParent', $data) && $data['CgroupParent'] !== null) { + $object->setCgroupParent($data['CgroupParent']); + } + elseif (\array_key_exists('CgroupParent', $data) && $data['CgroupParent'] === null) { + $object->setCgroupParent(null); + } + if (\array_key_exists('BlkioWeight', $data) && $data['BlkioWeight'] !== null) { + $object->setBlkioWeight($data['BlkioWeight']); + } + elseif (\array_key_exists('BlkioWeight', $data) && $data['BlkioWeight'] === null) { + $object->setBlkioWeight(null); + } + if (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] !== null) { + $values = []; + foreach ($data['BlkioWeightDevice'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class, 'json', $context); + } + $object->setBlkioWeightDevice($values); + } + elseif (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] === null) { + $object->setBlkioWeightDevice(null); + } + if (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] !== null) { + $values_1 = []; + foreach ($data['BlkioDeviceReadBps'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceReadBps($values_1); + } + elseif (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] === null) { + $object->setBlkioDeviceReadBps(null); + } + if (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] !== null) { + $values_2 = []; + foreach ($data['BlkioDeviceWriteBps'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceWriteBps($values_2); + } + elseif (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] === null) { + $object->setBlkioDeviceWriteBps(null); + } + if (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] !== null) { + $values_3 = []; + foreach ($data['BlkioDeviceReadIOps'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceReadIOps($values_3); + } + elseif (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] === null) { + $object->setBlkioDeviceReadIOps(null); + } + if (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] !== null) { + $values_4 = []; + foreach ($data['BlkioDeviceWriteIOps'] as $value_4) { + $values_4[] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\ThrottleDevice::class, 'json', $context); + } + $object->setBlkioDeviceWriteIOps($values_4); + } + elseif (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] === null) { + $object->setBlkioDeviceWriteIOps(null); + } + if (\array_key_exists('CpuPeriod', $data) && $data['CpuPeriod'] !== null) { + $object->setCpuPeriod($data['CpuPeriod']); + } + elseif (\array_key_exists('CpuPeriod', $data) && $data['CpuPeriod'] === null) { + $object->setCpuPeriod(null); + } + if (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] !== null) { + $object->setCpuQuota($data['CpuQuota']); + } + elseif (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] === null) { + $object->setCpuQuota(null); + } + if (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] !== null) { + $object->setCpuRealtimePeriod($data['CpuRealtimePeriod']); + } + elseif (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] === null) { + $object->setCpuRealtimePeriod(null); + } + if (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] !== null) { + $object->setCpuRealtimeRuntime($data['CpuRealtimeRuntime']); + } + elseif (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] === null) { + $object->setCpuRealtimeRuntime(null); + } + if (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] !== null) { + $object->setCpusetCpus($data['CpusetCpus']); + } + elseif (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] === null) { + $object->setCpusetCpus(null); + } + if (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] !== null) { + $object->setCpusetMems($data['CpusetMems']); + } + elseif (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] === null) { + $object->setCpusetMems(null); + } + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { + $values_5 = []; + foreach ($data['Devices'] as $value_5) { + $values_5[] = $this->denormalizer->denormalize($value_5, \Docker\API\Model\DeviceMapping::class, 'json', $context); + } + $object->setDevices($values_5); + } + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } + if (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] !== null) { + $values_6 = []; + foreach ($data['DeviceCgroupRules'] as $value_6) { + $values_6[] = $value_6; + } + $object->setDeviceCgroupRules($values_6); + } + elseif (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] === null) { + $object->setDeviceCgroupRules(null); + } + if (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] !== null) { + $values_7 = []; + foreach ($data['DeviceRequests'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, \Docker\API\Model\DeviceRequest::class, 'json', $context); + } + $object->setDeviceRequests($values_7); + } + elseif (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] === null) { + $object->setDeviceRequests(null); + } + if (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] !== null) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); + } + elseif (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] === null) { + $object->setKernelMemoryTCP(null); + } + if (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] !== null) { + $object->setMemoryReservation($data['MemoryReservation']); + } + elseif (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] === null) { + $object->setMemoryReservation(null); + } + if (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] !== null) { + $object->setMemorySwap($data['MemorySwap']); + } + elseif (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] === null) { + $object->setMemorySwap(null); + } + if (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] !== null) { + $object->setMemorySwappiness($data['MemorySwappiness']); + } + elseif (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] === null) { + $object->setMemorySwappiness(null); + } + if (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] !== null) { + $object->setNanoCpus($data['NanoCpus']); + } + elseif (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] === null) { + $object->setNanoCpus(null); + } + if (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] !== null) { + $object->setOomKillDisable($data['OomKillDisable']); + } + elseif (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] === null) { + $object->setOomKillDisable(null); + } + if (\array_key_exists('Init', $data) && $data['Init'] !== null) { + $object->setInit($data['Init']); + } + elseif (\array_key_exists('Init', $data) && $data['Init'] === null) { + $object->setInit(null); + } + if (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] !== null) { + $object->setPidsLimit($data['PidsLimit']); + } + elseif (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] === null) { + $object->setPidsLimit(null); + } + if (\array_key_exists('Ulimits', $data) && $data['Ulimits'] !== null) { + $values_8 = []; + foreach ($data['Ulimits'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, \Docker\API\Model\ResourcesUlimitsItem::class, 'json', $context); + } + $object->setUlimits($values_8); + } + elseif (\array_key_exists('Ulimits', $data) && $data['Ulimits'] === null) { + $object->setUlimits(null); + } + if (\array_key_exists('CpuCount', $data) && $data['CpuCount'] !== null) { + $object->setCpuCount($data['CpuCount']); + } + elseif (\array_key_exists('CpuCount', $data) && $data['CpuCount'] === null) { + $object->setCpuCount(null); + } + if (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] !== null) { + $object->setCpuPercent($data['CpuPercent']); + } + elseif (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] === null) { + $object->setCpuPercent(null); + } + if (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] !== null) { + $object->setIOMaximumIOps($data['IOMaximumIOps']); + } + elseif (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] === null) { + $object->setIOMaximumIOps(null); + } + if (\array_key_exists('IOMaximumBandwidth', $data) && $data['IOMaximumBandwidth'] !== null) { + $object->setIOMaximumBandwidth($data['IOMaximumBandwidth']); + } + elseif (\array_key_exists('IOMaximumBandwidth', $data) && $data['IOMaximumBandwidth'] === null) { + $object->setIOMaximumBandwidth(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('cpuShares') && null !== $object->getCpuShares()) { + $data['CpuShares'] = $object->getCpuShares(); + } + if ($object->isInitialized('memory') && null !== $object->getMemory()) { + $data['Memory'] = $object->getMemory(); + } + if ($object->isInitialized('cgroupParent') && null !== $object->getCgroupParent()) { + $data['CgroupParent'] = $object->getCgroupParent(); + } + if ($object->isInitialized('blkioWeight') && null !== $object->getBlkioWeight()) { + $data['BlkioWeight'] = $object->getBlkioWeight(); + } + if ($object->isInitialized('blkioWeightDevice') && null !== $object->getBlkioWeightDevice()) { + $values = []; + foreach ($object->getBlkioWeightDevice() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['BlkioWeightDevice'] = $values; + } + if ($object->isInitialized('blkioDeviceReadBps') && null !== $object->getBlkioDeviceReadBps()) { + $values_1 = []; + foreach ($object->getBlkioDeviceReadBps() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['BlkioDeviceReadBps'] = $values_1; + } + if ($object->isInitialized('blkioDeviceWriteBps') && null !== $object->getBlkioDeviceWriteBps()) { + $values_2 = []; + foreach ($object->getBlkioDeviceWriteBps() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['BlkioDeviceWriteBps'] = $values_2; + } + if ($object->isInitialized('blkioDeviceReadIOps') && null !== $object->getBlkioDeviceReadIOps()) { + $values_3 = []; + foreach ($object->getBlkioDeviceReadIOps() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['BlkioDeviceReadIOps'] = $values_3; + } + if ($object->isInitialized('blkioDeviceWriteIOps') && null !== $object->getBlkioDeviceWriteIOps()) { + $values_4 = []; + foreach ($object->getBlkioDeviceWriteIOps() as $value_4) { + $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); + } + $data['BlkioDeviceWriteIOps'] = $values_4; + } + if ($object->isInitialized('cpuPeriod') && null !== $object->getCpuPeriod()) { + $data['CpuPeriod'] = $object->getCpuPeriod(); + } + if ($object->isInitialized('cpuQuota') && null !== $object->getCpuQuota()) { + $data['CpuQuota'] = $object->getCpuQuota(); + } + if ($object->isInitialized('cpuRealtimePeriod') && null !== $object->getCpuRealtimePeriod()) { + $data['CpuRealtimePeriod'] = $object->getCpuRealtimePeriod(); + } + if ($object->isInitialized('cpuRealtimeRuntime') && null !== $object->getCpuRealtimeRuntime()) { + $data['CpuRealtimeRuntime'] = $object->getCpuRealtimeRuntime(); + } + if ($object->isInitialized('cpusetCpus') && null !== $object->getCpusetCpus()) { + $data['CpusetCpus'] = $object->getCpusetCpus(); + } + if ($object->isInitialized('cpusetMems') && null !== $object->getCpusetMems()) { + $data['CpusetMems'] = $object->getCpusetMems(); + } + if ($object->isInitialized('devices') && null !== $object->getDevices()) { + $values_5 = []; + foreach ($object->getDevices() as $value_5) { + $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); + } + $data['Devices'] = $values_5; + } + if ($object->isInitialized('deviceCgroupRules') && null !== $object->getDeviceCgroupRules()) { + $values_6 = []; + foreach ($object->getDeviceCgroupRules() as $value_6) { + $values_6[] = $value_6; + } + $data['DeviceCgroupRules'] = $values_6; + } + if ($object->isInitialized('deviceRequests') && null !== $object->getDeviceRequests()) { + $values_7 = []; + foreach ($object->getDeviceRequests() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $data['DeviceRequests'] = $values_7; + } + if ($object->isInitialized('kernelMemoryTCP') && null !== $object->getKernelMemoryTCP()) { + $data['KernelMemoryTCP'] = $object->getKernelMemoryTCP(); + } + if ($object->isInitialized('memoryReservation') && null !== $object->getMemoryReservation()) { + $data['MemoryReservation'] = $object->getMemoryReservation(); + } + if ($object->isInitialized('memorySwap') && null !== $object->getMemorySwap()) { + $data['MemorySwap'] = $object->getMemorySwap(); + } + if ($object->isInitialized('memorySwappiness') && null !== $object->getMemorySwappiness()) { + $data['MemorySwappiness'] = $object->getMemorySwappiness(); + } + if ($object->isInitialized('nanoCpus') && null !== $object->getNanoCpus()) { + $data['NanoCpus'] = $object->getNanoCpus(); + } + if ($object->isInitialized('oomKillDisable') && null !== $object->getOomKillDisable()) { + $data['OomKillDisable'] = $object->getOomKillDisable(); + } + if ($object->isInitialized('init') && null !== $object->getInit()) { + $data['Init'] = $object->getInit(); + } + if ($object->isInitialized('pidsLimit') && null !== $object->getPidsLimit()) { + $data['PidsLimit'] = $object->getPidsLimit(); + } + if ($object->isInitialized('ulimits') && null !== $object->getUlimits()) { + $values_8 = []; + foreach ($object->getUlimits() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); + } + $data['Ulimits'] = $values_8; + } + if ($object->isInitialized('cpuCount') && null !== $object->getCpuCount()) { + $data['CpuCount'] = $object->getCpuCount(); + } + if ($object->isInitialized('cpuPercent') && null !== $object->getCpuPercent()) { + $data['CpuPercent'] = $object->getCpuPercent(); + } + if ($object->isInitialized('iOMaximumIOps') && null !== $object->getIOMaximumIOps()) { + $data['IOMaximumIOps'] = $object->getIOMaximumIOps(); + } + if ($object->isInitialized('iOMaximumBandwidth') && null !== $object->getIOMaximumBandwidth()) { + $data['IOMaximumBandwidth'] = $object->getIOMaximumBandwidth(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Resources::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ResourcesUlimitsItemNormalizer.php b/generated/Normalizer/ResourcesUlimitsItemNormalizer.php new file mode 100644 index 00000000..8f311b66 --- /dev/null +++ b/generated/Normalizer/ResourcesUlimitsItemNormalizer.php @@ -0,0 +1,154 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ResourcesUlimitsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ResourcesUlimitsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ResourcesUlimitsItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ResourcesUlimitsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Soft', $data) && $data['Soft'] !== null) { + $object->setSoft($data['Soft']); + } + elseif (\array_key_exists('Soft', $data) && $data['Soft'] === null) { + $object->setSoft(null); + } + if (\array_key_exists('Hard', $data) && $data['Hard'] !== null) { + $object->setHard($data['Hard']); + } + elseif (\array_key_exists('Hard', $data) && $data['Hard'] === null) { + $object->setHard(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('soft') && null !== $object->getSoft()) { + $data['Soft'] = $object->getSoft(); + } + if ($object->isInitialized('hard') && null !== $object->getHard()) { + $data['Hard'] = $object->getHard(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ResourcesUlimitsItem::class => false]; + } + } +} else { + class ResourcesUlimitsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ResourcesUlimitsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ResourcesUlimitsItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ResourcesUlimitsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Soft', $data) && $data['Soft'] !== null) { + $object->setSoft($data['Soft']); + } + elseif (\array_key_exists('Soft', $data) && $data['Soft'] === null) { + $object->setSoft(null); + } + if (\array_key_exists('Hard', $data) && $data['Hard'] !== null) { + $object->setHard($data['Hard']); + } + elseif (\array_key_exists('Hard', $data) && $data['Hard'] === null) { + $object->setHard(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('soft') && null !== $object->getSoft()) { + $data['Soft'] = $object->getSoft(); + } + if ($object->isInitialized('hard') && null !== $object->getHard()) { + $data['Hard'] = $object->getHard(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ResourcesUlimitsItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/RestartPolicyNormalizer.php b/generated/Normalizer/RestartPolicyNormalizer.php index 6b13bf72..60047097 100644 --- a/generated/Normalizer/RestartPolicyNormalizer.php +++ b/generated/Normalizer/RestartPolicyNormalizer.php @@ -2,61 +2,135 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class RestartPolicyNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class RestartPolicyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\RestartPolicy') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\RestartPolicy::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\RestartPolicy) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\RestartPolicy::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\RestartPolicy(); - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\RestartPolicy(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('MaximumRetryCount', $data) && $data['MaximumRetryCount'] !== null) { + $object->setMaximumRetryCount($data['MaximumRetryCount']); + } + elseif (\array_key_exists('MaximumRetryCount', $data) && $data['MaximumRetryCount'] === null) { + $object->setMaximumRetryCount(null); + } + return $object; } - if (property_exists($data, 'MaximumRetryCount')) { - $object->setMaximumRetryCount($data->{'MaximumRetryCount'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('maximumRetryCount') && null !== $object->getMaximumRetryCount()) { + $data['MaximumRetryCount'] = $object->getMaximumRetryCount(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\RestartPolicy::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class RestartPolicyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\RestartPolicy::class; } - if (null !== $object->getMaximumRetryCount()) { - $data->{'MaximumRetryCount'} = $object->getMaximumRetryCount(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\RestartPolicy::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\RestartPolicy(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('MaximumRetryCount', $data) && $data['MaximumRetryCount'] !== null) { + $object->setMaximumRetryCount($data['MaximumRetryCount']); + } + elseif (\array_key_exists('MaximumRetryCount', $data) && $data['MaximumRetryCount'] === null) { + $object->setMaximumRetryCount(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('maximumRetryCount') && null !== $object->getMaximumRetryCount()) { + $data['MaximumRetryCount'] = $object->getMaximumRetryCount(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\RestartPolicy::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/RuntimeNormalizer.php b/generated/Normalizer/RuntimeNormalizer.php new file mode 100644 index 00000000..03dbd911 --- /dev/null +++ b/generated/Normalizer/RuntimeNormalizer.php @@ -0,0 +1,186 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class RuntimeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Runtime::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Runtime::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Runtime(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('path', $data) && $data['path'] !== null) { + $object->setPath($data['path']); + } + elseif (\array_key_exists('path', $data) && $data['path'] === null) { + $object->setPath(null); + } + if (\array_key_exists('runtimeArgs', $data) && $data['runtimeArgs'] !== null) { + $values = []; + foreach ($data['runtimeArgs'] as $value) { + $values[] = $value; + } + $object->setRuntimeArgs($values); + } + elseif (\array_key_exists('runtimeArgs', $data) && $data['runtimeArgs'] === null) { + $object->setRuntimeArgs(null); + } + if (\array_key_exists('status', $data) && $data['status'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['status'] as $key => $value_1) { + $values_1[$key] = $value_1; + } + $object->setStatus($values_1); + } + elseif (\array_key_exists('status', $data) && $data['status'] === null) { + $object->setStatus(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('path') && null !== $object->getPath()) { + $data['path'] = $object->getPath(); + } + if ($object->isInitialized('runtimeArgs') && null !== $object->getRuntimeArgs()) { + $values = []; + foreach ($object->getRuntimeArgs() as $value) { + $values[] = $value; + } + $data['runtimeArgs'] = $values; + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $values_1 = []; + foreach ($object->getStatus() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $data['status'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Runtime::class => false]; + } + } +} else { + class RuntimeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Runtime::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Runtime::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Runtime(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('path', $data) && $data['path'] !== null) { + $object->setPath($data['path']); + } + elseif (\array_key_exists('path', $data) && $data['path'] === null) { + $object->setPath(null); + } + if (\array_key_exists('runtimeArgs', $data) && $data['runtimeArgs'] !== null) { + $values = []; + foreach ($data['runtimeArgs'] as $value) { + $values[] = $value; + } + $object->setRuntimeArgs($values); + } + elseif (\array_key_exists('runtimeArgs', $data) && $data['runtimeArgs'] === null) { + $object->setRuntimeArgs(null); + } + if (\array_key_exists('status', $data) && $data['status'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['status'] as $key => $value_1) { + $values_1[$key] = $value_1; + } + $object->setStatus($values_1); + } + elseif (\array_key_exists('status', $data) && $data['status'] === null) { + $object->setStatus(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('path') && null !== $object->getPath()) { + $data['path'] = $object->getPath(); + } + if ($object->isInitialized('runtimeArgs') && null !== $object->getRuntimeArgs()) { + $values = []; + foreach ($object->getRuntimeArgs() as $value) { + $values[] = $value; + } + $data['runtimeArgs'] = $values; + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $values_1 = []; + foreach ($object->getStatus() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $data['status'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Runtime::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SecretNormalizer.php b/generated/Normalizer/SecretNormalizer.php new file mode 100644 index 00000000..5400beda --- /dev/null +++ b/generated/Normalizer/SecretNormalizer.php @@ -0,0 +1,190 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SecretNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Secret::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Secret::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Secret(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\SecretSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Secret::class => false]; + } + } +} else { + class SecretNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Secret::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Secret::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Secret(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\SecretSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Secret::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SecretSpecNormalizer.php b/generated/Normalizer/SecretSpecNormalizer.php new file mode 100644 index 00000000..28a8ab80 --- /dev/null +++ b/generated/Normalizer/SecretSpecNormalizer.php @@ -0,0 +1,206 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SecretSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SecretSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SecretSpec::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SecretSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Data', $data) && $data['Data'] !== null) { + $object->setData($data['Data']); + } + elseif (\array_key_exists('Data', $data) && $data['Data'] === null) { + $object->setData(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($this->denormalizer->denormalize($data['Driver'], \Docker\API\Model\Driver::class, 'json', $context)); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Templating', $data) && $data['Templating'] !== null) { + $object->setTemplating($this->denormalizer->denormalize($data['Templating'], \Docker\API\Model\Driver::class, 'json', $context)); + } + elseif (\array_key_exists('Templating', $data) && $data['Templating'] === null) { + $object->setTemplating(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('data') && null !== $object->getData()) { + $data['Data'] = $object->getData(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $this->normalizer->normalize($object->getDriver(), 'json', $context); + } + if ($object->isInitialized('templating') && null !== $object->getTemplating()) { + $data['Templating'] = $this->normalizer->normalize($object->getTemplating(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SecretSpec::class => false]; + } + } +} else { + class SecretSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SecretSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SecretSpec::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SecretSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Data', $data) && $data['Data'] !== null) { + $object->setData($data['Data']); + } + elseif (\array_key_exists('Data', $data) && $data['Data'] === null) { + $object->setData(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($this->denormalizer->denormalize($data['Driver'], \Docker\API\Model\Driver::class, 'json', $context)); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Templating', $data) && $data['Templating'] !== null) { + $object->setTemplating($this->denormalizer->denormalize($data['Templating'], \Docker\API\Model\Driver::class, 'json', $context)); + } + elseif (\array_key_exists('Templating', $data) && $data['Templating'] === null) { + $object->setTemplating(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('data') && null !== $object->getData()) { + $data['Data'] = $object->getData(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $this->normalizer->normalize($object->getDriver(), 'json', $context); + } + if ($object->isInitialized('templating') && null !== $object->getTemplating()) { + $data['Templating'] = $this->normalizer->normalize($object->getTemplating(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SecretSpec::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SecretsCreatePostBodyNormalizer.php b/generated/Normalizer/SecretsCreatePostBodyNormalizer.php new file mode 100644 index 00000000..c3cd4659 --- /dev/null +++ b/generated/Normalizer/SecretsCreatePostBodyNormalizer.php @@ -0,0 +1,206 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SecretsCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SecretsCreatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SecretsCreatePostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SecretsCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Data', $data) && $data['Data'] !== null) { + $object->setData($data['Data']); + } + elseif (\array_key_exists('Data', $data) && $data['Data'] === null) { + $object->setData(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($this->denormalizer->denormalize($data['Driver'], \Docker\API\Model\Driver::class, 'json', $context)); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Templating', $data) && $data['Templating'] !== null) { + $object->setTemplating($this->denormalizer->denormalize($data['Templating'], \Docker\API\Model\Driver::class, 'json', $context)); + } + elseif (\array_key_exists('Templating', $data) && $data['Templating'] === null) { + $object->setTemplating(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('data') && null !== $object->getData()) { + $data['Data'] = $object->getData(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $this->normalizer->normalize($object->getDriver(), 'json', $context); + } + if ($object->isInitialized('templating') && null !== $object->getTemplating()) { + $data['Templating'] = $this->normalizer->normalize($object->getTemplating(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SecretsCreatePostBody::class => false]; + } + } +} else { + class SecretsCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SecretsCreatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SecretsCreatePostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SecretsCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Data', $data) && $data['Data'] !== null) { + $object->setData($data['Data']); + } + elseif (\array_key_exists('Data', $data) && $data['Data'] === null) { + $object->setData(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($this->denormalizer->denormalize($data['Driver'], \Docker\API\Model\Driver::class, 'json', $context)); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Templating', $data) && $data['Templating'] !== null) { + $object->setTemplating($this->denormalizer->denormalize($data['Templating'], \Docker\API\Model\Driver::class, 'json', $context)); + } + elseif (\array_key_exists('Templating', $data) && $data['Templating'] === null) { + $object->setTemplating(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('data') && null !== $object->getData()) { + $data['Data'] = $object->getData(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $this->normalizer->normalize($object->getDriver(), 'json', $context); + } + if ($object->isInitialized('templating') && null !== $object->getTemplating()) { + $data['Templating'] = $this->normalizer->normalize($object->getTemplating(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SecretsCreatePostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceCreateResponseNormalizer.php b/generated/Normalizer/ServiceCreateResponseNormalizer.php index bf348d84..3a3304ac 100644 --- a/generated/Normalizer/ServiceCreateResponseNormalizer.php +++ b/generated/Normalizer/ServiceCreateResponseNormalizer.php @@ -2,56 +2,151 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class ServiceCreateResponseNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceCreateResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\ServiceCreateResponse') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceCreateResponse::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\ServiceCreateResponse) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceCreateResponse::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\ServiceCreateResponse(); - if (property_exists($data, 'Id')) { - $object->setId($data->{'Id'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceCreateResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values = []; + foreach ($data['Warnings'] as $value) { + $values[] = $value; + } + $object->setWarnings($values); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values = []; + foreach ($object->getWarnings() as $value) { + $values[] = $value; + } + $data['Warnings'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceCreateResponse::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class ServiceCreateResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceCreateResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceCreateResponse::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceCreateResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values = []; + foreach ($data['Warnings'] as $value) { + $values[] = $value; + } + $object->setWarnings($values); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values = []; + foreach ($object->getWarnings() as $value) { + $values[] = $value; + } + $data['Warnings'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceCreateResponse::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceEndpointNormalizer.php b/generated/Normalizer/ServiceEndpointNormalizer.php new file mode 100644 index 00000000..dbc6a52e --- /dev/null +++ b/generated/Normalizer/ServiceEndpointNormalizer.php @@ -0,0 +1,186 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceEndpointNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceEndpoint::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceEndpoint::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceEndpoint(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\EndpointSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { + $values = []; + foreach ($data['Ports'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointPortConfig::class, 'json', $context); + } + $object->setPorts($values); + } + elseif (\array_key_exists('Ports', $data) && $data['Ports'] === null) { + $object->setPorts(null); + } + if (\array_key_exists('VirtualIPs', $data) && $data['VirtualIPs'] !== null) { + $values_1 = []; + foreach ($data['VirtualIPs'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ServiceEndpointVirtualIPsItem::class, 'json', $context); + } + $object->setVirtualIPs($values_1); + } + elseif (\array_key_exists('VirtualIPs', $data) && $data['VirtualIPs'] === null) { + $object->setVirtualIPs(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values = []; + foreach ($object->getPorts() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Ports'] = $values; + } + if ($object->isInitialized('virtualIPs') && null !== $object->getVirtualIPs()) { + $values_1 = []; + foreach ($object->getVirtualIPs() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['VirtualIPs'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceEndpoint::class => false]; + } + } +} else { + class ServiceEndpointNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceEndpoint::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceEndpoint::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceEndpoint(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\EndpointSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { + $values = []; + foreach ($data['Ports'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointPortConfig::class, 'json', $context); + } + $object->setPorts($values); + } + elseif (\array_key_exists('Ports', $data) && $data['Ports'] === null) { + $object->setPorts(null); + } + if (\array_key_exists('VirtualIPs', $data) && $data['VirtualIPs'] !== null) { + $values_1 = []; + foreach ($data['VirtualIPs'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ServiceEndpointVirtualIPsItem::class, 'json', $context); + } + $object->setVirtualIPs($values_1); + } + elseif (\array_key_exists('VirtualIPs', $data) && $data['VirtualIPs'] === null) { + $object->setVirtualIPs(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values = []; + foreach ($object->getPorts() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Ports'] = $values; + } + if ($object->isInitialized('virtualIPs') && null !== $object->getVirtualIPs()) { + $values_1 = []; + foreach ($object->getVirtualIPs() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['VirtualIPs'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceEndpoint::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceEndpointVirtualIPsItemNormalizer.php b/generated/Normalizer/ServiceEndpointVirtualIPsItemNormalizer.php new file mode 100644 index 00000000..48138978 --- /dev/null +++ b/generated/Normalizer/ServiceEndpointVirtualIPsItemNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceEndpointVirtualIPsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceEndpointVirtualIPsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceEndpointVirtualIPsItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceEndpointVirtualIPsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NetworkID', $data) && $data['NetworkID'] !== null) { + $object->setNetworkID($data['NetworkID']); + } + elseif (\array_key_exists('NetworkID', $data) && $data['NetworkID'] === null) { + $object->setNetworkID(null); + } + if (\array_key_exists('Addr', $data) && $data['Addr'] !== null) { + $object->setAddr($data['Addr']); + } + elseif (\array_key_exists('Addr', $data) && $data['Addr'] === null) { + $object->setAddr(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('networkID') && null !== $object->getNetworkID()) { + $data['NetworkID'] = $object->getNetworkID(); + } + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceEndpointVirtualIPsItem::class => false]; + } + } +} else { + class ServiceEndpointVirtualIPsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceEndpointVirtualIPsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceEndpointVirtualIPsItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceEndpointVirtualIPsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NetworkID', $data) && $data['NetworkID'] !== null) { + $object->setNetworkID($data['NetworkID']); + } + elseif (\array_key_exists('NetworkID', $data) && $data['NetworkID'] === null) { + $object->setNetworkID(null); + } + if (\array_key_exists('Addr', $data) && $data['Addr'] !== null) { + $object->setAddr($data['Addr']); + } + elseif (\array_key_exists('Addr', $data) && $data['Addr'] === null) { + $object->setAddr(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('networkID') && null !== $object->getNetworkID()) { + $data['NetworkID'] = $object->getNetworkID(); + } + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceEndpointVirtualIPsItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceJobStatusNormalizer.php b/generated/Normalizer/ServiceJobStatusNormalizer.php new file mode 100644 index 00000000..aa8fa5ae --- /dev/null +++ b/generated/Normalizer/ServiceJobStatusNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceJobStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceJobStatus::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceJobStatus::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceJobStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('JobIteration', $data) && $data['JobIteration'] !== null) { + $object->setJobIteration($this->denormalizer->denormalize($data['JobIteration'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('JobIteration', $data) && $data['JobIteration'] === null) { + $object->setJobIteration(null); + } + if (\array_key_exists('LastExecution', $data) && $data['LastExecution'] !== null) { + $object->setLastExecution($data['LastExecution']); + } + elseif (\array_key_exists('LastExecution', $data) && $data['LastExecution'] === null) { + $object->setLastExecution(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('jobIteration') && null !== $object->getJobIteration()) { + $data['JobIteration'] = $this->normalizer->normalize($object->getJobIteration(), 'json', $context); + } + if ($object->isInitialized('lastExecution') && null !== $object->getLastExecution()) { + $data['LastExecution'] = $object->getLastExecution(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceJobStatus::class => false]; + } + } +} else { + class ServiceJobStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceJobStatus::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceJobStatus::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceJobStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('JobIteration', $data) && $data['JobIteration'] !== null) { + $object->setJobIteration($this->denormalizer->denormalize($data['JobIteration'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('JobIteration', $data) && $data['JobIteration'] === null) { + $object->setJobIteration(null); + } + if (\array_key_exists('LastExecution', $data) && $data['LastExecution'] !== null) { + $object->setLastExecution($data['LastExecution']); + } + elseif (\array_key_exists('LastExecution', $data) && $data['LastExecution'] === null) { + $object->setLastExecution(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('jobIteration') && null !== $object->getJobIteration()) { + $data['JobIteration'] = $this->normalizer->normalize($object->getJobIteration(), 'json', $context); + } + if ($object->isInitialized('lastExecution') && null !== $object->getLastExecution()) { + $data['LastExecution'] = $object->getLastExecution(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceJobStatus::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceNormalizer.php b/generated/Normalizer/ServiceNormalizer.php index c2175249..4a3215c7 100644 --- a/generated/Normalizer/ServiceNormalizer.php +++ b/generated/Normalizer/ServiceNormalizer.php @@ -2,92 +2,261 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class ServiceNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\Service') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\Service) { - return true; - } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\Service(); - if (property_exists($data, 'ID')) { - $object->setID($data->{'ID'}); - } - if (property_exists($data, 'Version')) { - $object->setVersion($this->serializer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\NodeVersion', 'raw', $context)); - } - if (property_exists($data, 'CreatedAt')) { - $object->setCreatedAt(\DateTime::createFromFormat("Y-m-d\TH:i:sP", $data->{'CreatedAt'})); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Service::class; } - if (property_exists($data, 'UpdatedAt')) { - $object->setUpdatedAt(\DateTime::createFromFormat("Y-m-d\TH:i:sP", $data->{'UpdatedAt'})); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Service::class; } - if (property_exists($data, 'Spec')) { - $object->setSpec($this->serializer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\ServiceSpec', 'raw', $context)); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Service(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\ServiceSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('Endpoint', $data) && $data['Endpoint'] !== null) { + $object->setEndpoint($this->denormalizer->denormalize($data['Endpoint'], \Docker\API\Model\ServiceEndpoint::class, 'json', $context)); + } + elseif (\array_key_exists('Endpoint', $data) && $data['Endpoint'] === null) { + $object->setEndpoint(null); + } + if (\array_key_exists('UpdateStatus', $data) && $data['UpdateStatus'] !== null) { + $object->setUpdateStatus($this->denormalizer->denormalize($data['UpdateStatus'], \Docker\API\Model\ServiceUpdateStatus::class, 'json', $context)); + } + elseif (\array_key_exists('UpdateStatus', $data) && $data['UpdateStatus'] === null) { + $object->setUpdateStatus(null); + } + if (\array_key_exists('ServiceStatus', $data) && $data['ServiceStatus'] !== null) { + $object->setServiceStatus($this->denormalizer->denormalize($data['ServiceStatus'], \Docker\API\Model\ServiceServiceStatus::class, 'json', $context)); + } + elseif (\array_key_exists('ServiceStatus', $data) && $data['ServiceStatus'] === null) { + $object->setServiceStatus(null); + } + if (\array_key_exists('JobStatus', $data) && $data['JobStatus'] !== null) { + $object->setJobStatus($this->denormalizer->denormalize($data['JobStatus'], \Docker\API\Model\ServiceJobStatus::class, 'json', $context)); + } + elseif (\array_key_exists('JobStatus', $data) && $data['JobStatus'] === null) { + $object->setJobStatus(null); + } + return $object; } - if (property_exists($data, 'Endpoint')) { - $object->setEndpoint($this->serializer->denormalize($data->{'Endpoint'}, 'Docker\\API\\Model\\Endpoint', 'raw', $context)); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('endpoint') && null !== $object->getEndpoint()) { + $data['Endpoint'] = $this->normalizer->normalize($object->getEndpoint(), 'json', $context); + } + if ($object->isInitialized('updateStatus') && null !== $object->getUpdateStatus()) { + $data['UpdateStatus'] = $this->normalizer->normalize($object->getUpdateStatus(), 'json', $context); + } + if ($object->isInitialized('serviceStatus') && null !== $object->getServiceStatus()) { + $data['ServiceStatus'] = $this->normalizer->normalize($object->getServiceStatus(), 'json', $context); + } + if ($object->isInitialized('jobStatus') && null !== $object->getJobStatus()) { + $data['JobStatus'] = $this->normalizer->normalize($object->getJobStatus(), 'json', $context); + } + return $data; } - if (property_exists($data, 'UpdateStatus')) { - $object->setUpdateStatus($this->serializer->denormalize($data->{'UpdateStatus'}, 'Docker\\API\\Model\\UpdateStatus', 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Service::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class ServiceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); - } - if (null !== $object->getVersion()) { - $data->{'Version'} = json_decode($this->serializer->normalize($object->getVersion(), 'raw', $context)); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Service::class; } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt()->format("Y-m-d\TH:i:sP"); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Service::class; } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt()->format("Y-m-d\TH:i:sP"); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Service(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\ServiceSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('Endpoint', $data) && $data['Endpoint'] !== null) { + $object->setEndpoint($this->denormalizer->denormalize($data['Endpoint'], \Docker\API\Model\ServiceEndpoint::class, 'json', $context)); + } + elseif (\array_key_exists('Endpoint', $data) && $data['Endpoint'] === null) { + $object->setEndpoint(null); + } + if (\array_key_exists('UpdateStatus', $data) && $data['UpdateStatus'] !== null) { + $object->setUpdateStatus($this->denormalizer->denormalize($data['UpdateStatus'], \Docker\API\Model\ServiceUpdateStatus::class, 'json', $context)); + } + elseif (\array_key_exists('UpdateStatus', $data) && $data['UpdateStatus'] === null) { + $object->setUpdateStatus(null); + } + if (\array_key_exists('ServiceStatus', $data) && $data['ServiceStatus'] !== null) { + $object->setServiceStatus($this->denormalizer->denormalize($data['ServiceStatus'], \Docker\API\Model\ServiceServiceStatus::class, 'json', $context)); + } + elseif (\array_key_exists('ServiceStatus', $data) && $data['ServiceStatus'] === null) { + $object->setServiceStatus(null); + } + if (\array_key_exists('JobStatus', $data) && $data['JobStatus'] !== null) { + $object->setJobStatus($this->denormalizer->denormalize($data['JobStatus'], \Docker\API\Model\ServiceJobStatus::class, 'json', $context)); + } + elseif (\array_key_exists('JobStatus', $data) && $data['JobStatus'] === null) { + $object->setJobStatus(null); + } + return $object; } - if (null !== $object->getSpec()) { - $data->{'Spec'} = json_decode($this->serializer->normalize($object->getSpec(), 'raw', $context)); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('endpoint') && null !== $object->getEndpoint()) { + $data['Endpoint'] = $this->normalizer->normalize($object->getEndpoint(), 'json', $context); + } + if ($object->isInitialized('updateStatus') && null !== $object->getUpdateStatus()) { + $data['UpdateStatus'] = $this->normalizer->normalize($object->getUpdateStatus(), 'json', $context); + } + if ($object->isInitialized('serviceStatus') && null !== $object->getServiceStatus()) { + $data['ServiceStatus'] = $this->normalizer->normalize($object->getServiceStatus(), 'json', $context); + } + if ($object->isInitialized('jobStatus') && null !== $object->getJobStatus()) { + $data['JobStatus'] = $this->normalizer->normalize($object->getJobStatus(), 'json', $context); + } + return $data; } - if (null !== $object->getEndpoint()) { - $data->{'Endpoint'} = json_decode($this->serializer->normalize($object->getEndpoint(), 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Service::class => false]; } - if (null !== $object->getUpdateStatus()) { - $data->{'UpdateStatus'} = json_decode($this->serializer->normalize($object->getUpdateStatus(), 'raw', $context)); - } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceServiceStatusNormalizer.php b/generated/Normalizer/ServiceServiceStatusNormalizer.php new file mode 100644 index 00000000..924740ce --- /dev/null +++ b/generated/Normalizer/ServiceServiceStatusNormalizer.php @@ -0,0 +1,154 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceServiceStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceServiceStatus::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceServiceStatus::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceServiceStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('RunningTasks', $data) && $data['RunningTasks'] !== null) { + $object->setRunningTasks($data['RunningTasks']); + } + elseif (\array_key_exists('RunningTasks', $data) && $data['RunningTasks'] === null) { + $object->setRunningTasks(null); + } + if (\array_key_exists('DesiredTasks', $data) && $data['DesiredTasks'] !== null) { + $object->setDesiredTasks($data['DesiredTasks']); + } + elseif (\array_key_exists('DesiredTasks', $data) && $data['DesiredTasks'] === null) { + $object->setDesiredTasks(null); + } + if (\array_key_exists('CompletedTasks', $data) && $data['CompletedTasks'] !== null) { + $object->setCompletedTasks($data['CompletedTasks']); + } + elseif (\array_key_exists('CompletedTasks', $data) && $data['CompletedTasks'] === null) { + $object->setCompletedTasks(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('runningTasks') && null !== $object->getRunningTasks()) { + $data['RunningTasks'] = $object->getRunningTasks(); + } + if ($object->isInitialized('desiredTasks') && null !== $object->getDesiredTasks()) { + $data['DesiredTasks'] = $object->getDesiredTasks(); + } + if ($object->isInitialized('completedTasks') && null !== $object->getCompletedTasks()) { + $data['CompletedTasks'] = $object->getCompletedTasks(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceServiceStatus::class => false]; + } + } +} else { + class ServiceServiceStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceServiceStatus::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceServiceStatus::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceServiceStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('RunningTasks', $data) && $data['RunningTasks'] !== null) { + $object->setRunningTasks($data['RunningTasks']); + } + elseif (\array_key_exists('RunningTasks', $data) && $data['RunningTasks'] === null) { + $object->setRunningTasks(null); + } + if (\array_key_exists('DesiredTasks', $data) && $data['DesiredTasks'] !== null) { + $object->setDesiredTasks($data['DesiredTasks']); + } + elseif (\array_key_exists('DesiredTasks', $data) && $data['DesiredTasks'] === null) { + $object->setDesiredTasks(null); + } + if (\array_key_exists('CompletedTasks', $data) && $data['CompletedTasks'] !== null) { + $object->setCompletedTasks($data['CompletedTasks']); + } + elseif (\array_key_exists('CompletedTasks', $data) && $data['CompletedTasks'] === null) { + $object->setCompletedTasks(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('runningTasks') && null !== $object->getRunningTasks()) { + $data['RunningTasks'] = $object->getRunningTasks(); + } + if ($object->isInitialized('desiredTasks') && null !== $object->getDesiredTasks()) { + $data['DesiredTasks'] = $object->getDesiredTasks(); + } + if ($object->isInitialized('completedTasks') && null !== $object->getCompletedTasks()) { + $data['CompletedTasks'] = $object->getCompletedTasks(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceServiceStatus::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceSpecModeNormalizer.php b/generated/Normalizer/ServiceSpecModeNormalizer.php index 9a0ac892..9305be29 100644 --- a/generated/Normalizer/ServiceSpecModeNormalizer.php +++ b/generated/Normalizer/ServiceSpecModeNormalizer.php @@ -2,62 +2,171 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class ServiceSpecModeNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceSpecModeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\ServiceSpecMode') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceSpecMode::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\ServiceSpecMode) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceSpecMode::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\ServiceSpecMode(); - if (property_exists($data, 'Replicated')) { - $object->setReplicated($this->serializer->denormalize($data->{'Replicated'}, 'Docker\\API\\Model\\ReplicatedService', 'raw', $context)); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceSpecMode(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Replicated', $data) && $data['Replicated'] !== null) { + $object->setReplicated($this->denormalizer->denormalize($data['Replicated'], \Docker\API\Model\ServiceSpecModeReplicated::class, 'json', $context)); + } + elseif (\array_key_exists('Replicated', $data) && $data['Replicated'] === null) { + $object->setReplicated(null); + } + if (\array_key_exists('Global', $data) && $data['Global'] !== null) { + $object->setGlobal($data['Global']); + } + elseif (\array_key_exists('Global', $data) && $data['Global'] === null) { + $object->setGlobal(null); + } + if (\array_key_exists('ReplicatedJob', $data) && $data['ReplicatedJob'] !== null) { + $object->setReplicatedJob($this->denormalizer->denormalize($data['ReplicatedJob'], \Docker\API\Model\ServiceSpecModeReplicatedJob::class, 'json', $context)); + } + elseif (\array_key_exists('ReplicatedJob', $data) && $data['ReplicatedJob'] === null) { + $object->setReplicatedJob(null); + } + if (\array_key_exists('GlobalJob', $data) && $data['GlobalJob'] !== null) { + $object->setGlobalJob($data['GlobalJob']); + } + elseif (\array_key_exists('GlobalJob', $data) && $data['GlobalJob'] === null) { + $object->setGlobalJob(null); + } + return $object; } - if (property_exists($data, 'Global')) { - $object->setGlobal($this->serializer->denormalize($data->{'Global'}, 'Docker\\API\\Model\\GlobalService', 'raw', $context)); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('replicated') && null !== $object->getReplicated()) { + $data['Replicated'] = $this->normalizer->normalize($object->getReplicated(), 'json', $context); + } + if ($object->isInitialized('global') && null !== $object->getGlobal()) { + $data['Global'] = $object->getGlobal(); + } + if ($object->isInitialized('replicatedJob') && null !== $object->getReplicatedJob()) { + $data['ReplicatedJob'] = $this->normalizer->normalize($object->getReplicatedJob(), 'json', $context); + } + if ($object->isInitialized('globalJob') && null !== $object->getGlobalJob()) { + $data['GlobalJob'] = $object->getGlobalJob(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecMode::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class ServiceSpecModeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getReplicated()) { - $data->{'Replicated'} = json_decode($this->serializer->normalize($object->getReplicated(), 'raw', $context)); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceSpecMode::class; } - if (null !== $object->getGlobal()) { - $data->{'Global'} = json_decode($this->serializer->normalize($object->getGlobal(), 'raw', $context)); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceSpecMode::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceSpecMode(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Replicated', $data) && $data['Replicated'] !== null) { + $object->setReplicated($this->denormalizer->denormalize($data['Replicated'], \Docker\API\Model\ServiceSpecModeReplicated::class, 'json', $context)); + } + elseif (\array_key_exists('Replicated', $data) && $data['Replicated'] === null) { + $object->setReplicated(null); + } + if (\array_key_exists('Global', $data) && $data['Global'] !== null) { + $object->setGlobal($data['Global']); + } + elseif (\array_key_exists('Global', $data) && $data['Global'] === null) { + $object->setGlobal(null); + } + if (\array_key_exists('ReplicatedJob', $data) && $data['ReplicatedJob'] !== null) { + $object->setReplicatedJob($this->denormalizer->denormalize($data['ReplicatedJob'], \Docker\API\Model\ServiceSpecModeReplicatedJob::class, 'json', $context)); + } + elseif (\array_key_exists('ReplicatedJob', $data) && $data['ReplicatedJob'] === null) { + $object->setReplicatedJob(null); + } + if (\array_key_exists('GlobalJob', $data) && $data['GlobalJob'] !== null) { + $object->setGlobalJob($data['GlobalJob']); + } + elseif (\array_key_exists('GlobalJob', $data) && $data['GlobalJob'] === null) { + $object->setGlobalJob(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('replicated') && null !== $object->getReplicated()) { + $data['Replicated'] = $this->normalizer->normalize($object->getReplicated(), 'json', $context); + } + if ($object->isInitialized('global') && null !== $object->getGlobal()) { + $data['Global'] = $object->getGlobal(); + } + if ($object->isInitialized('replicatedJob') && null !== $object->getReplicatedJob()) { + $data['ReplicatedJob'] = $this->normalizer->normalize($object->getReplicatedJob(), 'json', $context); + } + if ($object->isInitialized('globalJob') && null !== $object->getGlobalJob()) { + $data['GlobalJob'] = $object->getGlobalJob(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecMode::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceSpecModeReplicatedJobNormalizer.php b/generated/Normalizer/ServiceSpecModeReplicatedJobNormalizer.php new file mode 100644 index 00000000..2d77e71c --- /dev/null +++ b/generated/Normalizer/ServiceSpecModeReplicatedJobNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceSpecModeReplicatedJobNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceSpecModeReplicatedJob::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceSpecModeReplicatedJob::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceSpecModeReplicatedJob(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('MaxConcurrent', $data) && $data['MaxConcurrent'] !== null) { + $object->setMaxConcurrent($data['MaxConcurrent']); + } + elseif (\array_key_exists('MaxConcurrent', $data) && $data['MaxConcurrent'] === null) { + $object->setMaxConcurrent(null); + } + if (\array_key_exists('TotalCompletions', $data) && $data['TotalCompletions'] !== null) { + $object->setTotalCompletions($data['TotalCompletions']); + } + elseif (\array_key_exists('TotalCompletions', $data) && $data['TotalCompletions'] === null) { + $object->setTotalCompletions(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('maxConcurrent') && null !== $object->getMaxConcurrent()) { + $data['MaxConcurrent'] = $object->getMaxConcurrent(); + } + if ($object->isInitialized('totalCompletions') && null !== $object->getTotalCompletions()) { + $data['TotalCompletions'] = $object->getTotalCompletions(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecModeReplicatedJob::class => false]; + } + } +} else { + class ServiceSpecModeReplicatedJobNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceSpecModeReplicatedJob::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceSpecModeReplicatedJob::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceSpecModeReplicatedJob(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('MaxConcurrent', $data) && $data['MaxConcurrent'] !== null) { + $object->setMaxConcurrent($data['MaxConcurrent']); + } + elseif (\array_key_exists('MaxConcurrent', $data) && $data['MaxConcurrent'] === null) { + $object->setMaxConcurrent(null); + } + if (\array_key_exists('TotalCompletions', $data) && $data['TotalCompletions'] !== null) { + $object->setTotalCompletions($data['TotalCompletions']); + } + elseif (\array_key_exists('TotalCompletions', $data) && $data['TotalCompletions'] === null) { + $object->setTotalCompletions(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('maxConcurrent') && null !== $object->getMaxConcurrent()) { + $data['MaxConcurrent'] = $object->getMaxConcurrent(); + } + if ($object->isInitialized('totalCompletions') && null !== $object->getTotalCompletions()) { + $data['TotalCompletions'] = $object->getTotalCompletions(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecModeReplicatedJob::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceSpecModeReplicatedNormalizer.php b/generated/Normalizer/ServiceSpecModeReplicatedNormalizer.php new file mode 100644 index 00000000..8c1c2133 --- /dev/null +++ b/generated/Normalizer/ServiceSpecModeReplicatedNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceSpecModeReplicatedNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceSpecModeReplicated::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceSpecModeReplicated::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceSpecModeReplicated(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Replicas', $data) && $data['Replicas'] !== null) { + $object->setReplicas($data['Replicas']); + } + elseif (\array_key_exists('Replicas', $data) && $data['Replicas'] === null) { + $object->setReplicas(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('replicas') && null !== $object->getReplicas()) { + $data['Replicas'] = $object->getReplicas(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecModeReplicated::class => false]; + } + } +} else { + class ServiceSpecModeReplicatedNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceSpecModeReplicated::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceSpecModeReplicated::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceSpecModeReplicated(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Replicas', $data) && $data['Replicas'] !== null) { + $object->setReplicas($data['Replicas']); + } + elseif (\array_key_exists('Replicas', $data) && $data['Replicas'] === null) { + $object->setReplicas(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('replicas') && null !== $object->getReplicas()) { + $data['Replicas'] = $object->getReplicas(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecModeReplicated::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceSpecNormalizer.php b/generated/Normalizer/ServiceSpecNormalizer.php index 0673e0f7..9a4bcc32 100644 --- a/generated/Normalizer/ServiceSpecNormalizer.php +++ b/generated/Normalizer/ServiceSpecNormalizer.php @@ -2,131 +2,275 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class ServiceSpecNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\ServiceSpec') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceSpec::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\ServiceSpec) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceSpec::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\ServiceSpec(); - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Labels')) { - $value = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_1) { - $values[$key] = $value_1; + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; } - $value = $values; + $object->setLabels($values); } - if (is_null($data->{'Labels'})) { - $value = $data->{'Labels'}; + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); } - $object->setLabels($value); - } - if (property_exists($data, 'TaskTemplate')) { - $object->setTaskTemplate($this->serializer->denormalize($data->{'TaskTemplate'}, 'Docker\\API\\Model\\TaskSpec', 'raw', $context)); - } - if (property_exists($data, 'Mode')) { - $object->setMode($this->serializer->denormalize($data->{'Mode'}, 'Docker\\API\\Model\\ServiceSpecMode', 'raw', $context)); - } - if (property_exists($data, 'UpdateConfig')) { - $object->setUpdateConfig($this->serializer->denormalize($data->{'UpdateConfig'}, 'Docker\\API\\Model\\UpdateConfig', 'raw', $context)); + if (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] !== null) { + $object->setTaskTemplate($this->denormalizer->denormalize($data['TaskTemplate'], \Docker\API\Model\TaskSpec::class, 'json', $context)); + } + elseif (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] === null) { + $object->setTaskTemplate(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($this->denormalizer->denormalize($data['Mode'], \Docker\API\Model\ServiceSpecMode::class, 'json', $context)); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] !== null) { + $object->setUpdateConfig($this->denormalizer->denormalize($data['UpdateConfig'], \Docker\API\Model\ServiceSpecUpdateConfig::class, 'json', $context)); + } + elseif (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] === null) { + $object->setUpdateConfig(null); + } + if (\array_key_exists('RollbackConfig', $data) && $data['RollbackConfig'] !== null) { + $object->setRollbackConfig($this->denormalizer->denormalize($data['RollbackConfig'], \Docker\API\Model\ServiceSpecRollbackConfig::class, 'json', $context)); + } + elseif (\array_key_exists('RollbackConfig', $data) && $data['RollbackConfig'] === null) { + $object->setRollbackConfig(null); + } + if (\array_key_exists('Networks', $data) && $data['Networks'] !== null) { + $values_1 = []; + foreach ($data['Networks'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\NetworkAttachmentConfig::class, 'json', $context); + } + $object->setNetworks($values_1); + } + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } + if (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] !== null) { + $object->setEndpointSpec($this->denormalizer->denormalize($data['EndpointSpec'], \Docker\API\Model\EndpointSpec::class, 'json', $context)); + } + elseif (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] === null) { + $object->setEndpointSpec(null); + } + return $object; } - if (property_exists($data, 'Networks')) { - $value_2 = $data->{'Networks'}; - if (is_array($data->{'Networks'})) { + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('taskTemplate') && null !== $object->getTaskTemplate()) { + $data['TaskTemplate'] = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $this->normalizer->normalize($object->getMode(), 'json', $context); + } + if ($object->isInitialized('updateConfig') && null !== $object->getUpdateConfig()) { + $data['UpdateConfig'] = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); + } + if ($object->isInitialized('rollbackConfig') && null !== $object->getRollbackConfig()) { + $data['RollbackConfig'] = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); + } + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { $values_1 = []; - foreach ($data->{'Networks'} as $value_3) { - $values_1[] = $this->serializer->denormalize($value_3, 'Docker\\API\\Model\\NetworkAttachmentConfig', 'raw', $context); + foreach ($object->getNetworks() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $value_2 = $values_1; + $data['Networks'] = $values_1; } - if (is_null($data->{'Networks'})) { - $value_2 = $data->{'Networks'}; + if ($object->isInitialized('endpointSpec') && null !== $object->getEndpointSpec()) { + $data['EndpointSpec'] = $this->normalizer->normalize($object->getEndpointSpec(), 'json', $context); } - $object->setNetworks($value_2); + return $data; } - if (property_exists($data, 'EndpointSpec')) { - $object->setEndpointSpec($data->{'EndpointSpec'}); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpec::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class ServiceSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - $value = $object->getLabels(); - if (is_object($object->getLabels())) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value_1) { - $values->{$key} = $value_1; - } - $value = $values; - } - if (is_null($object->getLabels())) { - $value = $object->getLabels(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceSpec::class; } - $data->{'Labels'} = $value; - if (null !== $object->getTaskTemplate()) { - $data->{'TaskTemplate'} = json_decode($this->serializer->normalize($object->getTaskTemplate(), 'raw', $context)); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceSpec::class; } - if (null !== $object->getMode()) { - $data->{'Mode'} = json_decode($this->serializer->normalize($object->getMode(), 'raw', $context)); - } - if (null !== $object->getUpdateConfig()) { - $data->{'UpdateConfig'} = json_decode($this->serializer->normalize($object->getUpdateConfig(), 'raw', $context)); - } - $value_2 = $object->getNetworks(); - if (is_array($object->getNetworks())) { - $values_1 = []; - foreach ($object->getNetworks() as $value_3) { - $values_1[] = $value_3; + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] !== null) { + $object->setTaskTemplate($this->denormalizer->denormalize($data['TaskTemplate'], \Docker\API\Model\TaskSpec::class, 'json', $context)); + } + elseif (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] === null) { + $object->setTaskTemplate(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($this->denormalizer->denormalize($data['Mode'], \Docker\API\Model\ServiceSpecMode::class, 'json', $context)); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] !== null) { + $object->setUpdateConfig($this->denormalizer->denormalize($data['UpdateConfig'], \Docker\API\Model\ServiceSpecUpdateConfig::class, 'json', $context)); } - $value_2 = $values_1; + elseif (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] === null) { + $object->setUpdateConfig(null); + } + if (\array_key_exists('RollbackConfig', $data) && $data['RollbackConfig'] !== null) { + $object->setRollbackConfig($this->denormalizer->denormalize($data['RollbackConfig'], \Docker\API\Model\ServiceSpecRollbackConfig::class, 'json', $context)); + } + elseif (\array_key_exists('RollbackConfig', $data) && $data['RollbackConfig'] === null) { + $object->setRollbackConfig(null); + } + if (\array_key_exists('Networks', $data) && $data['Networks'] !== null) { + $values_1 = []; + foreach ($data['Networks'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\NetworkAttachmentConfig::class, 'json', $context); + } + $object->setNetworks($values_1); + } + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } + if (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] !== null) { + $object->setEndpointSpec($this->denormalizer->denormalize($data['EndpointSpec'], \Docker\API\Model\EndpointSpec::class, 'json', $context)); + } + elseif (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] === null) { + $object->setEndpointSpec(null); + } + return $object; } - if (is_null($object->getNetworks())) { - $value_2 = $object->getNetworks(); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('taskTemplate') && null !== $object->getTaskTemplate()) { + $data['TaskTemplate'] = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $this->normalizer->normalize($object->getMode(), 'json', $context); + } + if ($object->isInitialized('updateConfig') && null !== $object->getUpdateConfig()) { + $data['UpdateConfig'] = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); + } + if ($object->isInitialized('rollbackConfig') && null !== $object->getRollbackConfig()) { + $data['RollbackConfig'] = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); + } + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values_1 = []; + foreach ($object->getNetworks() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Networks'] = $values_1; + } + if ($object->isInitialized('endpointSpec') && null !== $object->getEndpointSpec()) { + $data['EndpointSpec'] = $this->normalizer->normalize($object->getEndpointSpec(), 'json', $context); + } + return $data; } - $data->{'Networks'} = $value_2; - if (null !== $object->getEndpointSpec()) { - $data->{'EndpointSpec'} = $object->getEndpointSpec(); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpec::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceSpecRollbackConfigNormalizer.php b/generated/Normalizer/ServiceSpecRollbackConfigNormalizer.php new file mode 100644 index 00000000..6295d5f5 --- /dev/null +++ b/generated/Normalizer/ServiceSpecRollbackConfigNormalizer.php @@ -0,0 +1,214 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceSpecRollbackConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceSpecRollbackConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceSpecRollbackConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceSpecRollbackConfig(); + if (\array_key_exists('MaxFailureRatio', $data) && \is_int($data['MaxFailureRatio'])) { + $data['MaxFailureRatio'] = (double) $data['MaxFailureRatio']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Parallelism', $data) && $data['Parallelism'] !== null) { + $object->setParallelism($data['Parallelism']); + } + elseif (\array_key_exists('Parallelism', $data) && $data['Parallelism'] === null) { + $object->setParallelism(null); + } + if (\array_key_exists('Delay', $data) && $data['Delay'] !== null) { + $object->setDelay($data['Delay']); + } + elseif (\array_key_exists('Delay', $data) && $data['Delay'] === null) { + $object->setDelay(null); + } + if (\array_key_exists('FailureAction', $data) && $data['FailureAction'] !== null) { + $object->setFailureAction($data['FailureAction']); + } + elseif (\array_key_exists('FailureAction', $data) && $data['FailureAction'] === null) { + $object->setFailureAction(null); + } + if (\array_key_exists('Monitor', $data) && $data['Monitor'] !== null) { + $object->setMonitor($data['Monitor']); + } + elseif (\array_key_exists('Monitor', $data) && $data['Monitor'] === null) { + $object->setMonitor(null); + } + if (\array_key_exists('MaxFailureRatio', $data) && $data['MaxFailureRatio'] !== null) { + $object->setMaxFailureRatio($data['MaxFailureRatio']); + } + elseif (\array_key_exists('MaxFailureRatio', $data) && $data['MaxFailureRatio'] === null) { + $object->setMaxFailureRatio(null); + } + if (\array_key_exists('Order', $data) && $data['Order'] !== null) { + $object->setOrder($data['Order']); + } + elseif (\array_key_exists('Order', $data) && $data['Order'] === null) { + $object->setOrder(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('parallelism') && null !== $object->getParallelism()) { + $data['Parallelism'] = $object->getParallelism(); + } + if ($object->isInitialized('delay') && null !== $object->getDelay()) { + $data['Delay'] = $object->getDelay(); + } + if ($object->isInitialized('failureAction') && null !== $object->getFailureAction()) { + $data['FailureAction'] = $object->getFailureAction(); + } + if ($object->isInitialized('monitor') && null !== $object->getMonitor()) { + $data['Monitor'] = $object->getMonitor(); + } + if ($object->isInitialized('maxFailureRatio') && null !== $object->getMaxFailureRatio()) { + $data['MaxFailureRatio'] = $object->getMaxFailureRatio(); + } + if ($object->isInitialized('order') && null !== $object->getOrder()) { + $data['Order'] = $object->getOrder(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecRollbackConfig::class => false]; + } + } +} else { + class ServiceSpecRollbackConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceSpecRollbackConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceSpecRollbackConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceSpecRollbackConfig(); + if (\array_key_exists('MaxFailureRatio', $data) && \is_int($data['MaxFailureRatio'])) { + $data['MaxFailureRatio'] = (double) $data['MaxFailureRatio']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Parallelism', $data) && $data['Parallelism'] !== null) { + $object->setParallelism($data['Parallelism']); + } + elseif (\array_key_exists('Parallelism', $data) && $data['Parallelism'] === null) { + $object->setParallelism(null); + } + if (\array_key_exists('Delay', $data) && $data['Delay'] !== null) { + $object->setDelay($data['Delay']); + } + elseif (\array_key_exists('Delay', $data) && $data['Delay'] === null) { + $object->setDelay(null); + } + if (\array_key_exists('FailureAction', $data) && $data['FailureAction'] !== null) { + $object->setFailureAction($data['FailureAction']); + } + elseif (\array_key_exists('FailureAction', $data) && $data['FailureAction'] === null) { + $object->setFailureAction(null); + } + if (\array_key_exists('Monitor', $data) && $data['Monitor'] !== null) { + $object->setMonitor($data['Monitor']); + } + elseif (\array_key_exists('Monitor', $data) && $data['Monitor'] === null) { + $object->setMonitor(null); + } + if (\array_key_exists('MaxFailureRatio', $data) && $data['MaxFailureRatio'] !== null) { + $object->setMaxFailureRatio($data['MaxFailureRatio']); + } + elseif (\array_key_exists('MaxFailureRatio', $data) && $data['MaxFailureRatio'] === null) { + $object->setMaxFailureRatio(null); + } + if (\array_key_exists('Order', $data) && $data['Order'] !== null) { + $object->setOrder($data['Order']); + } + elseif (\array_key_exists('Order', $data) && $data['Order'] === null) { + $object->setOrder(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('parallelism') && null !== $object->getParallelism()) { + $data['Parallelism'] = $object->getParallelism(); + } + if ($object->isInitialized('delay') && null !== $object->getDelay()) { + $data['Delay'] = $object->getDelay(); + } + if ($object->isInitialized('failureAction') && null !== $object->getFailureAction()) { + $data['FailureAction'] = $object->getFailureAction(); + } + if ($object->isInitialized('monitor') && null !== $object->getMonitor()) { + $data['Monitor'] = $object->getMonitor(); + } + if ($object->isInitialized('maxFailureRatio') && null !== $object->getMaxFailureRatio()) { + $data['MaxFailureRatio'] = $object->getMaxFailureRatio(); + } + if ($object->isInitialized('order') && null !== $object->getOrder()) { + $data['Order'] = $object->getOrder(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecRollbackConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceSpecUpdateConfigNormalizer.php b/generated/Normalizer/ServiceSpecUpdateConfigNormalizer.php new file mode 100644 index 00000000..51a57192 --- /dev/null +++ b/generated/Normalizer/ServiceSpecUpdateConfigNormalizer.php @@ -0,0 +1,214 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceSpecUpdateConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceSpecUpdateConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceSpecUpdateConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceSpecUpdateConfig(); + if (\array_key_exists('MaxFailureRatio', $data) && \is_int($data['MaxFailureRatio'])) { + $data['MaxFailureRatio'] = (double) $data['MaxFailureRatio']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Parallelism', $data) && $data['Parallelism'] !== null) { + $object->setParallelism($data['Parallelism']); + } + elseif (\array_key_exists('Parallelism', $data) && $data['Parallelism'] === null) { + $object->setParallelism(null); + } + if (\array_key_exists('Delay', $data) && $data['Delay'] !== null) { + $object->setDelay($data['Delay']); + } + elseif (\array_key_exists('Delay', $data) && $data['Delay'] === null) { + $object->setDelay(null); + } + if (\array_key_exists('FailureAction', $data) && $data['FailureAction'] !== null) { + $object->setFailureAction($data['FailureAction']); + } + elseif (\array_key_exists('FailureAction', $data) && $data['FailureAction'] === null) { + $object->setFailureAction(null); + } + if (\array_key_exists('Monitor', $data) && $data['Monitor'] !== null) { + $object->setMonitor($data['Monitor']); + } + elseif (\array_key_exists('Monitor', $data) && $data['Monitor'] === null) { + $object->setMonitor(null); + } + if (\array_key_exists('MaxFailureRatio', $data) && $data['MaxFailureRatio'] !== null) { + $object->setMaxFailureRatio($data['MaxFailureRatio']); + } + elseif (\array_key_exists('MaxFailureRatio', $data) && $data['MaxFailureRatio'] === null) { + $object->setMaxFailureRatio(null); + } + if (\array_key_exists('Order', $data) && $data['Order'] !== null) { + $object->setOrder($data['Order']); + } + elseif (\array_key_exists('Order', $data) && $data['Order'] === null) { + $object->setOrder(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('parallelism') && null !== $object->getParallelism()) { + $data['Parallelism'] = $object->getParallelism(); + } + if ($object->isInitialized('delay') && null !== $object->getDelay()) { + $data['Delay'] = $object->getDelay(); + } + if ($object->isInitialized('failureAction') && null !== $object->getFailureAction()) { + $data['FailureAction'] = $object->getFailureAction(); + } + if ($object->isInitialized('monitor') && null !== $object->getMonitor()) { + $data['Monitor'] = $object->getMonitor(); + } + if ($object->isInitialized('maxFailureRatio') && null !== $object->getMaxFailureRatio()) { + $data['MaxFailureRatio'] = $object->getMaxFailureRatio(); + } + if ($object->isInitialized('order') && null !== $object->getOrder()) { + $data['Order'] = $object->getOrder(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecUpdateConfig::class => false]; + } + } +} else { + class ServiceSpecUpdateConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceSpecUpdateConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceSpecUpdateConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceSpecUpdateConfig(); + if (\array_key_exists('MaxFailureRatio', $data) && \is_int($data['MaxFailureRatio'])) { + $data['MaxFailureRatio'] = (double) $data['MaxFailureRatio']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Parallelism', $data) && $data['Parallelism'] !== null) { + $object->setParallelism($data['Parallelism']); + } + elseif (\array_key_exists('Parallelism', $data) && $data['Parallelism'] === null) { + $object->setParallelism(null); + } + if (\array_key_exists('Delay', $data) && $data['Delay'] !== null) { + $object->setDelay($data['Delay']); + } + elseif (\array_key_exists('Delay', $data) && $data['Delay'] === null) { + $object->setDelay(null); + } + if (\array_key_exists('FailureAction', $data) && $data['FailureAction'] !== null) { + $object->setFailureAction($data['FailureAction']); + } + elseif (\array_key_exists('FailureAction', $data) && $data['FailureAction'] === null) { + $object->setFailureAction(null); + } + if (\array_key_exists('Monitor', $data) && $data['Monitor'] !== null) { + $object->setMonitor($data['Monitor']); + } + elseif (\array_key_exists('Monitor', $data) && $data['Monitor'] === null) { + $object->setMonitor(null); + } + if (\array_key_exists('MaxFailureRatio', $data) && $data['MaxFailureRatio'] !== null) { + $object->setMaxFailureRatio($data['MaxFailureRatio']); + } + elseif (\array_key_exists('MaxFailureRatio', $data) && $data['MaxFailureRatio'] === null) { + $object->setMaxFailureRatio(null); + } + if (\array_key_exists('Order', $data) && $data['Order'] !== null) { + $object->setOrder($data['Order']); + } + elseif (\array_key_exists('Order', $data) && $data['Order'] === null) { + $object->setOrder(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('parallelism') && null !== $object->getParallelism()) { + $data['Parallelism'] = $object->getParallelism(); + } + if ($object->isInitialized('delay') && null !== $object->getDelay()) { + $data['Delay'] = $object->getDelay(); + } + if ($object->isInitialized('failureAction') && null !== $object->getFailureAction()) { + $data['FailureAction'] = $object->getFailureAction(); + } + if ($object->isInitialized('monitor') && null !== $object->getMonitor()) { + $data['Monitor'] = $object->getMonitor(); + } + if ($object->isInitialized('maxFailureRatio') && null !== $object->getMaxFailureRatio()) { + $data['MaxFailureRatio'] = $object->getMaxFailureRatio(); + } + if ($object->isInitialized('order') && null !== $object->getOrder()) { + $data['Order'] = $object->getOrder(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecUpdateConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceUpdateResponseNormalizer.php b/generated/Normalizer/ServiceUpdateResponseNormalizer.php new file mode 100644 index 00000000..4556fe17 --- /dev/null +++ b/generated/Normalizer/ServiceUpdateResponseNormalizer.php @@ -0,0 +1,134 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceUpdateResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceUpdateResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceUpdateResponse::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceUpdateResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values = []; + foreach ($data['Warnings'] as $value) { + $values[] = $value; + } + $object->setWarnings($values); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values = []; + foreach ($object->getWarnings() as $value) { + $values[] = $value; + } + $data['Warnings'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceUpdateResponse::class => false]; + } + } +} else { + class ServiceUpdateResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceUpdateResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceUpdateResponse::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceUpdateResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values = []; + foreach ($data['Warnings'] as $value) { + $values[] = $value; + } + $object->setWarnings($values); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values = []; + foreach ($object->getWarnings() as $value) { + $values[] = $value; + } + $data['Warnings'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceUpdateResponse::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ServiceUpdateStatusNormalizer.php b/generated/Normalizer/ServiceUpdateStatusNormalizer.php new file mode 100644 index 00000000..375e699f --- /dev/null +++ b/generated/Normalizer/ServiceUpdateStatusNormalizer.php @@ -0,0 +1,172 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServiceUpdateStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceUpdateStatus::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceUpdateStatus::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceUpdateStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); + } + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); + } + if (\array_key_exists('StartedAt', $data) && $data['StartedAt'] !== null) { + $object->setStartedAt($data['StartedAt']); + } + elseif (\array_key_exists('StartedAt', $data) && $data['StartedAt'] === null) { + $object->setStartedAt(null); + } + if (\array_key_exists('CompletedAt', $data) && $data['CompletedAt'] !== null) { + $object->setCompletedAt($data['CompletedAt']); + } + elseif (\array_key_exists('CompletedAt', $data) && $data['CompletedAt'] === null) { + $object->setCompletedAt(null); + } + if (\array_key_exists('Message', $data) && $data['Message'] !== null) { + $object->setMessage($data['Message']); + } + elseif (\array_key_exists('Message', $data) && $data['Message'] === null) { + $object->setMessage(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); + } + if ($object->isInitialized('startedAt') && null !== $object->getStartedAt()) { + $data['StartedAt'] = $object->getStartedAt(); + } + if ($object->isInitialized('completedAt') && null !== $object->getCompletedAt()) { + $data['CompletedAt'] = $object->getCompletedAt(); + } + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['Message'] = $object->getMessage(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceUpdateStatus::class => false]; + } + } +} else { + class ServiceUpdateStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServiceUpdateStatus::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServiceUpdateStatus::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServiceUpdateStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); + } + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); + } + if (\array_key_exists('StartedAt', $data) && $data['StartedAt'] !== null) { + $object->setStartedAt($data['StartedAt']); + } + elseif (\array_key_exists('StartedAt', $data) && $data['StartedAt'] === null) { + $object->setStartedAt(null); + } + if (\array_key_exists('CompletedAt', $data) && $data['CompletedAt'] !== null) { + $object->setCompletedAt($data['CompletedAt']); + } + elseif (\array_key_exists('CompletedAt', $data) && $data['CompletedAt'] === null) { + $object->setCompletedAt(null); + } + if (\array_key_exists('Message', $data) && $data['Message'] !== null) { + $object->setMessage($data['Message']); + } + elseif (\array_key_exists('Message', $data) && $data['Message'] === null) { + $object->setMessage(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); + } + if ($object->isInitialized('startedAt') && null !== $object->getStartedAt()) { + $data['StartedAt'] = $object->getStartedAt(); + } + if ($object->isInitialized('completedAt') && null !== $object->getCompletedAt()) { + $data['CompletedAt'] = $object->getCompletedAt(); + } + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['Message'] = $object->getMessage(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceUpdateStatus::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ServicesCreatePostBodyNormalizer.php b/generated/Normalizer/ServicesCreatePostBodyNormalizer.php new file mode 100644 index 00000000..b0818185 --- /dev/null +++ b/generated/Normalizer/ServicesCreatePostBodyNormalizer.php @@ -0,0 +1,276 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServicesCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServicesCreatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServicesCreatePostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServicesCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] !== null) { + $object->setTaskTemplate($this->denormalizer->denormalize($data['TaskTemplate'], \Docker\API\Model\TaskSpec::class, 'json', $context)); + } + elseif (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] === null) { + $object->setTaskTemplate(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($this->denormalizer->denormalize($data['Mode'], \Docker\API\Model\ServiceSpecMode::class, 'json', $context)); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] !== null) { + $object->setUpdateConfig($this->denormalizer->denormalize($data['UpdateConfig'], \Docker\API\Model\ServiceSpecUpdateConfig::class, 'json', $context)); + } + elseif (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] === null) { + $object->setUpdateConfig(null); + } + if (\array_key_exists('RollbackConfig', $data) && $data['RollbackConfig'] !== null) { + $object->setRollbackConfig($this->denormalizer->denormalize($data['RollbackConfig'], \Docker\API\Model\ServiceSpecRollbackConfig::class, 'json', $context)); + } + elseif (\array_key_exists('RollbackConfig', $data) && $data['RollbackConfig'] === null) { + $object->setRollbackConfig(null); + } + if (\array_key_exists('Networks', $data) && $data['Networks'] !== null) { + $values_1 = []; + foreach ($data['Networks'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\NetworkAttachmentConfig::class, 'json', $context); + } + $object->setNetworks($values_1); + } + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } + if (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] !== null) { + $object->setEndpointSpec($this->denormalizer->denormalize($data['EndpointSpec'], \Docker\API\Model\EndpointSpec::class, 'json', $context)); + } + elseif (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] === null) { + $object->setEndpointSpec(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('taskTemplate') && null !== $object->getTaskTemplate()) { + $data['TaskTemplate'] = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $this->normalizer->normalize($object->getMode(), 'json', $context); + } + if ($object->isInitialized('updateConfig') && null !== $object->getUpdateConfig()) { + $data['UpdateConfig'] = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); + } + if ($object->isInitialized('rollbackConfig') && null !== $object->getRollbackConfig()) { + $data['RollbackConfig'] = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); + } + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values_1 = []; + foreach ($object->getNetworks() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Networks'] = $values_1; + } + if ($object->isInitialized('endpointSpec') && null !== $object->getEndpointSpec()) { + $data['EndpointSpec'] = $this->normalizer->normalize($object->getEndpointSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServicesCreatePostBody::class => false]; + } + } +} else { + class ServicesCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServicesCreatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServicesCreatePostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServicesCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] !== null) { + $object->setTaskTemplate($this->denormalizer->denormalize($data['TaskTemplate'], \Docker\API\Model\TaskSpec::class, 'json', $context)); + } + elseif (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] === null) { + $object->setTaskTemplate(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($this->denormalizer->denormalize($data['Mode'], \Docker\API\Model\ServiceSpecMode::class, 'json', $context)); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] !== null) { + $object->setUpdateConfig($this->denormalizer->denormalize($data['UpdateConfig'], \Docker\API\Model\ServiceSpecUpdateConfig::class, 'json', $context)); + } + elseif (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] === null) { + $object->setUpdateConfig(null); + } + if (\array_key_exists('RollbackConfig', $data) && $data['RollbackConfig'] !== null) { + $object->setRollbackConfig($this->denormalizer->denormalize($data['RollbackConfig'], \Docker\API\Model\ServiceSpecRollbackConfig::class, 'json', $context)); + } + elseif (\array_key_exists('RollbackConfig', $data) && $data['RollbackConfig'] === null) { + $object->setRollbackConfig(null); + } + if (\array_key_exists('Networks', $data) && $data['Networks'] !== null) { + $values_1 = []; + foreach ($data['Networks'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\NetworkAttachmentConfig::class, 'json', $context); + } + $object->setNetworks($values_1); + } + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } + if (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] !== null) { + $object->setEndpointSpec($this->denormalizer->denormalize($data['EndpointSpec'], \Docker\API\Model\EndpointSpec::class, 'json', $context)); + } + elseif (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] === null) { + $object->setEndpointSpec(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('taskTemplate') && null !== $object->getTaskTemplate()) { + $data['TaskTemplate'] = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $this->normalizer->normalize($object->getMode(), 'json', $context); + } + if ($object->isInitialized('updateConfig') && null !== $object->getUpdateConfig()) { + $data['UpdateConfig'] = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); + } + if ($object->isInitialized('rollbackConfig') && null !== $object->getRollbackConfig()) { + $data['RollbackConfig'] = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); + } + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values_1 = []; + foreach ($object->getNetworks() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Networks'] = $values_1; + } + if ($object->isInitialized('endpointSpec') && null !== $object->getEndpointSpec()) { + $data['EndpointSpec'] = $this->normalizer->normalize($object->getEndpointSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServicesCreatePostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/ServicesIdUpdatePostBodyNormalizer.php b/generated/Normalizer/ServicesIdUpdatePostBodyNormalizer.php new file mode 100644 index 00000000..775ba486 --- /dev/null +++ b/generated/Normalizer/ServicesIdUpdatePostBodyNormalizer.php @@ -0,0 +1,276 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ServicesIdUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServicesIdUpdatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServicesIdUpdatePostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServicesIdUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] !== null) { + $object->setTaskTemplate($this->denormalizer->denormalize($data['TaskTemplate'], \Docker\API\Model\TaskSpec::class, 'json', $context)); + } + elseif (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] === null) { + $object->setTaskTemplate(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($this->denormalizer->denormalize($data['Mode'], \Docker\API\Model\ServiceSpecMode::class, 'json', $context)); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] !== null) { + $object->setUpdateConfig($this->denormalizer->denormalize($data['UpdateConfig'], \Docker\API\Model\ServiceSpecUpdateConfig::class, 'json', $context)); + } + elseif (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] === null) { + $object->setUpdateConfig(null); + } + if (\array_key_exists('RollbackConfig', $data) && $data['RollbackConfig'] !== null) { + $object->setRollbackConfig($this->denormalizer->denormalize($data['RollbackConfig'], \Docker\API\Model\ServiceSpecRollbackConfig::class, 'json', $context)); + } + elseif (\array_key_exists('RollbackConfig', $data) && $data['RollbackConfig'] === null) { + $object->setRollbackConfig(null); + } + if (\array_key_exists('Networks', $data) && $data['Networks'] !== null) { + $values_1 = []; + foreach ($data['Networks'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\NetworkAttachmentConfig::class, 'json', $context); + } + $object->setNetworks($values_1); + } + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } + if (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] !== null) { + $object->setEndpointSpec($this->denormalizer->denormalize($data['EndpointSpec'], \Docker\API\Model\EndpointSpec::class, 'json', $context)); + } + elseif (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] === null) { + $object->setEndpointSpec(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('taskTemplate') && null !== $object->getTaskTemplate()) { + $data['TaskTemplate'] = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $this->normalizer->normalize($object->getMode(), 'json', $context); + } + if ($object->isInitialized('updateConfig') && null !== $object->getUpdateConfig()) { + $data['UpdateConfig'] = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); + } + if ($object->isInitialized('rollbackConfig') && null !== $object->getRollbackConfig()) { + $data['RollbackConfig'] = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); + } + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values_1 = []; + foreach ($object->getNetworks() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Networks'] = $values_1; + } + if ($object->isInitialized('endpointSpec') && null !== $object->getEndpointSpec()) { + $data['EndpointSpec'] = $this->normalizer->normalize($object->getEndpointSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServicesIdUpdatePostBody::class => false]; + } + } +} else { + class ServicesIdUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ServicesIdUpdatePostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ServicesIdUpdatePostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ServicesIdUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] !== null) { + $object->setTaskTemplate($this->denormalizer->denormalize($data['TaskTemplate'], \Docker\API\Model\TaskSpec::class, 'json', $context)); + } + elseif (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] === null) { + $object->setTaskTemplate(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($this->denormalizer->denormalize($data['Mode'], \Docker\API\Model\ServiceSpecMode::class, 'json', $context)); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] !== null) { + $object->setUpdateConfig($this->denormalizer->denormalize($data['UpdateConfig'], \Docker\API\Model\ServiceSpecUpdateConfig::class, 'json', $context)); + } + elseif (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] === null) { + $object->setUpdateConfig(null); + } + if (\array_key_exists('RollbackConfig', $data) && $data['RollbackConfig'] !== null) { + $object->setRollbackConfig($this->denormalizer->denormalize($data['RollbackConfig'], \Docker\API\Model\ServiceSpecRollbackConfig::class, 'json', $context)); + } + elseif (\array_key_exists('RollbackConfig', $data) && $data['RollbackConfig'] === null) { + $object->setRollbackConfig(null); + } + if (\array_key_exists('Networks', $data) && $data['Networks'] !== null) { + $values_1 = []; + foreach ($data['Networks'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\NetworkAttachmentConfig::class, 'json', $context); + } + $object->setNetworks($values_1); + } + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } + if (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] !== null) { + $object->setEndpointSpec($this->denormalizer->denormalize($data['EndpointSpec'], \Docker\API\Model\EndpointSpec::class, 'json', $context)); + } + elseif (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] === null) { + $object->setEndpointSpec(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('taskTemplate') && null !== $object->getTaskTemplate()) { + $data['TaskTemplate'] = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $this->normalizer->normalize($object->getMode(), 'json', $context); + } + if ($object->isInitialized('updateConfig') && null !== $object->getUpdateConfig()) { + $data['UpdateConfig'] = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); + } + if ($object->isInitialized('rollbackConfig') && null !== $object->getRollbackConfig()) { + $data['RollbackConfig'] = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); + } + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values_1 = []; + foreach ($object->getNetworks() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Networks'] = $values_1; + } + if ($object->isInitialized('endpointSpec') && null !== $object->getEndpointSpec()) { + $data['EndpointSpec'] = $this->normalizer->normalize($object->getEndpointSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServicesIdUpdatePostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmConfigNormalizer.php b/generated/Normalizer/SwarmConfigNormalizer.php deleted file mode 100644 index 2e39c88b..00000000 --- a/generated/Normalizer/SwarmConfigNormalizer.php +++ /dev/null @@ -1,75 +0,0 @@ -setListenAddr($data->{'ListenAddr'}); - } - if (property_exists($data, 'AdvertiseAddr')) { - $object->setAdvertiseAddr($data->{'AdvertiseAddr'}); - } - if (property_exists($data, 'ForceNewCluster')) { - $object->setForceNewCluster($data->{'ForceNewCluster'}); - } - if (property_exists($data, 'Spec')) { - $object->setSpec($this->serializer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\SwarmConfigSpec', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getListenAddr()) { - $data->{'ListenAddr'} = $object->getListenAddr(); - } - if (null !== $object->getAdvertiseAddr()) { - $data->{'AdvertiseAddr'} = $object->getAdvertiseAddr(); - } - if (null !== $object->getForceNewCluster()) { - $data->{'ForceNewCluster'} = $object->getForceNewCluster(); - } - if (null !== $object->getSpec()) { - $data->{'Spec'} = json_decode($this->serializer->normalize($object->getSpec(), 'raw', $context)); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SwarmConfigSpecCAConfigExternalCANormalizer.php b/generated/Normalizer/SwarmConfigSpecCAConfigExternalCANormalizer.php deleted file mode 100644 index c9812870..00000000 --- a/generated/Normalizer/SwarmConfigSpecCAConfigExternalCANormalizer.php +++ /dev/null @@ -1,89 +0,0 @@ -setProtocol($data->{'Protocol'}); - } - if (property_exists($data, 'URL')) { - $object->setURL($data->{'URL'}); - } - if (property_exists($data, 'Options')) { - $value = $data->{'Options'}; - if (is_object($data->{'Options'})) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value_1) { - $values[$key] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Options'})) { - $value = $data->{'Options'}; - } - $object->setOptions($value); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getProtocol()) { - $data->{'Protocol'} = $object->getProtocol(); - } - if (null !== $object->getURL()) { - $data->{'URL'} = $object->getURL(); - } - $value = $object->getOptions(); - if (is_object($object->getOptions())) { - $values = new \stdClass(); - foreach ($object->getOptions() as $key => $value_1) { - $values->{$key} = $value_1; - } - $value = $values; - } - if (is_null($object->getOptions())) { - $value = $object->getOptions(); - } - $data->{'Options'} = $value; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SwarmConfigSpecCAConfigNormalizer.php b/generated/Normalizer/SwarmConfigSpecCAConfigNormalizer.php deleted file mode 100644 index 3fd94947..00000000 --- a/generated/Normalizer/SwarmConfigSpecCAConfigNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setNodeCertExpiry($data->{'NodeCertExpiry'}); - } - if (property_exists($data, 'ExternalCA')) { - $object->setExternalCA($this->serializer->denormalize($data->{'ExternalCA'}, 'Docker\\API\\Model\\SwarmConfigSpecCAConfigExternalCA', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getNodeCertExpiry()) { - $data->{'NodeCertExpiry'} = $object->getNodeCertExpiry(); - } - if (null !== $object->getExternalCA()) { - $data->{'ExternalCA'} = json_decode($this->serializer->normalize($object->getExternalCA(), 'raw', $context)); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SwarmConfigSpecDispatcherNormalizer.php b/generated/Normalizer/SwarmConfigSpecDispatcherNormalizer.php deleted file mode 100644 index 523c5c30..00000000 --- a/generated/Normalizer/SwarmConfigSpecDispatcherNormalizer.php +++ /dev/null @@ -1,56 +0,0 @@ -setHeartbeatPeriod($data->{'HeartbeatPeriod'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getHeartbeatPeriod()) { - $data->{'HeartbeatPeriod'} = $object->getHeartbeatPeriod(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SwarmConfigSpecNormalizer.php b/generated/Normalizer/SwarmConfigSpecNormalizer.php deleted file mode 100644 index 119444c4..00000000 --- a/generated/Normalizer/SwarmConfigSpecNormalizer.php +++ /dev/null @@ -1,75 +0,0 @@ -setOrchestration($this->serializer->denormalize($data->{'Orchestration'}, 'Docker\\API\\Model\\SwarmConfigSpecOrchestration', 'raw', $context)); - } - if (property_exists($data, 'Raft')) { - $object->setRaft($this->serializer->denormalize($data->{'Raft'}, 'Docker\\API\\Model\\SwarmConfigSpecRaft', 'raw', $context)); - } - if (property_exists($data, 'Dispatcher')) { - $object->setDispatcher($this->serializer->denormalize($data->{'Dispatcher'}, 'Docker\\API\\Model\\SwarmConfigSpecDispatcher', 'raw', $context)); - } - if (property_exists($data, 'CAConfig')) { - $object->setCAConfig($this->serializer->denormalize($data->{'CAConfig'}, 'Docker\\API\\Model\\SwarmConfigSpecCAConfig', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getOrchestration()) { - $data->{'Orchestration'} = json_decode($this->serializer->normalize($object->getOrchestration(), 'raw', $context)); - } - if (null !== $object->getRaft()) { - $data->{'Raft'} = json_decode($this->serializer->normalize($object->getRaft(), 'raw', $context)); - } - if (null !== $object->getDispatcher()) { - $data->{'Dispatcher'} = json_decode($this->serializer->normalize($object->getDispatcher(), 'raw', $context)); - } - if (null !== $object->getCAConfig()) { - $data->{'CAConfig'} = json_decode($this->serializer->normalize($object->getCAConfig(), 'raw', $context)); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SwarmConfigSpecOrchestrationNormalizer.php b/generated/Normalizer/SwarmConfigSpecOrchestrationNormalizer.php deleted file mode 100644 index 9190f211..00000000 --- a/generated/Normalizer/SwarmConfigSpecOrchestrationNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -setTaskHistoryRetentionLimit($data->{'TaskHistoryRetentionLimit'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getTaskHistoryRetentionLimit()) { - $data->{'TaskHistoryRetentionLimit'} = $object->getTaskHistoryRetentionLimit(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SwarmConfigSpecRaftNormalizer.php b/generated/Normalizer/SwarmConfigSpecRaftNormalizer.php deleted file mode 100644 index 6fd8bf18..00000000 --- a/generated/Normalizer/SwarmConfigSpecRaftNormalizer.php +++ /dev/null @@ -1,81 +0,0 @@ -setSnapshotInterval($data->{'SnapshotInterval'}); - } - if (property_exists($data, 'KeepOldSnapshots')) { - $object->setKeepOldSnapshots($data->{'KeepOldSnapshots'}); - } - if (property_exists($data, 'LogEntriesForSlowFollowers')) { - $object->setLogEntriesForSlowFollowers($data->{'LogEntriesForSlowFollowers'}); - } - if (property_exists($data, 'HeartbeatTick')) { - $object->setHeartbeatTick($data->{'HeartbeatTick'}); - } - if (property_exists($data, 'ElectionTick')) { - $object->setElectionTick($data->{'ElectionTick'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getSnapshotInterval()) { - $data->{'SnapshotInterval'} = $object->getSnapshotInterval(); - } - if (null !== $object->getKeepOldSnapshots()) { - $data->{'KeepOldSnapshots'} = $object->getKeepOldSnapshots(); - } - if (null !== $object->getLogEntriesForSlowFollowers()) { - $data->{'LogEntriesForSlowFollowers'} = $object->getLogEntriesForSlowFollowers(); - } - if (null !== $object->getHeartbeatTick()) { - $data->{'HeartbeatTick'} = $object->getHeartbeatTick(); - } - if (null !== $object->getElectionTick()) { - $data->{'ElectionTick'} = $object->getElectionTick(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SwarmIPAMOptionsNormalizer.php b/generated/Normalizer/SwarmIPAMOptionsNormalizer.php deleted file mode 100644 index 87f7d748..00000000 --- a/generated/Normalizer/SwarmIPAMOptionsNormalizer.php +++ /dev/null @@ -1,83 +0,0 @@ -setDriver($this->serializer->denormalize($data->{'Driver'}, 'Docker\\API\\Model\\Driver', 'raw', $context)); - } - if (property_exists($data, 'Configs')) { - $value = $data->{'Configs'}; - if (is_array($data->{'Configs'})) { - $values = []; - foreach ($data->{'Configs'} as $value_1) { - $values[] = $this->serializer->denormalize($value_1, 'Docker\\API\\Model\\IPAMConfig', 'raw', $context); - } - $value = $values; - } - if (is_null($data->{'Configs'})) { - $value = $data->{'Configs'}; - } - $object->setConfigs($value); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getDriver()) { - $data->{'Driver'} = json_decode($this->serializer->normalize($object->getDriver(), 'raw', $context)); - } - $value = $object->getConfigs(); - if (is_array($object->getConfigs())) { - $values = []; - foreach ($object->getConfigs() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getConfigs())) { - $value = $object->getConfigs(); - } - $data->{'Configs'} = $value; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SwarmInfoNormalizer.php b/generated/Normalizer/SwarmInfoNormalizer.php new file mode 100644 index 00000000..8dc91f8d --- /dev/null +++ b/generated/Normalizer/SwarmInfoNormalizer.php @@ -0,0 +1,278 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmInfo::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NodeID', $data) && $data['NodeID'] !== null) { + $object->setNodeID($data['NodeID']); + } + elseif (\array_key_exists('NodeID', $data) && $data['NodeID'] === null) { + $object->setNodeID(null); + } + if (\array_key_exists('NodeAddr', $data) && $data['NodeAddr'] !== null) { + $object->setNodeAddr($data['NodeAddr']); + } + elseif (\array_key_exists('NodeAddr', $data) && $data['NodeAddr'] === null) { + $object->setNodeAddr(null); + } + if (\array_key_exists('LocalNodeState', $data) && $data['LocalNodeState'] !== null) { + $object->setLocalNodeState($data['LocalNodeState']); + } + elseif (\array_key_exists('LocalNodeState', $data) && $data['LocalNodeState'] === null) { + $object->setLocalNodeState(null); + } + if (\array_key_exists('ControlAvailable', $data) && $data['ControlAvailable'] !== null) { + $object->setControlAvailable($data['ControlAvailable']); + } + elseif (\array_key_exists('ControlAvailable', $data) && $data['ControlAvailable'] === null) { + $object->setControlAvailable(null); + } + if (\array_key_exists('Error', $data) && $data['Error'] !== null) { + $object->setError($data['Error']); + } + elseif (\array_key_exists('Error', $data) && $data['Error'] === null) { + $object->setError(null); + } + if (\array_key_exists('RemoteManagers', $data) && $data['RemoteManagers'] !== null) { + $values = []; + foreach ($data['RemoteManagers'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\PeerNode::class, 'json', $context); + } + $object->setRemoteManagers($values); + } + elseif (\array_key_exists('RemoteManagers', $data) && $data['RemoteManagers'] === null) { + $object->setRemoteManagers(null); + } + if (\array_key_exists('Nodes', $data) && $data['Nodes'] !== null) { + $object->setNodes($data['Nodes']); + } + elseif (\array_key_exists('Nodes', $data) && $data['Nodes'] === null) { + $object->setNodes(null); + } + if (\array_key_exists('Managers', $data) && $data['Managers'] !== null) { + $object->setManagers($data['Managers']); + } + elseif (\array_key_exists('Managers', $data) && $data['Managers'] === null) { + $object->setManagers(null); + } + if (\array_key_exists('Cluster', $data) && $data['Cluster'] !== null) { + $object->setCluster($this->denormalizer->denormalize($data['Cluster'], \Docker\API\Model\ClusterInfo::class, 'json', $context)); + } + elseif (\array_key_exists('Cluster', $data) && $data['Cluster'] === null) { + $object->setCluster(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('nodeID') && null !== $object->getNodeID()) { + $data['NodeID'] = $object->getNodeID(); + } + if ($object->isInitialized('nodeAddr') && null !== $object->getNodeAddr()) { + $data['NodeAddr'] = $object->getNodeAddr(); + } + if ($object->isInitialized('localNodeState') && null !== $object->getLocalNodeState()) { + $data['LocalNodeState'] = $object->getLocalNodeState(); + } + if ($object->isInitialized('controlAvailable') && null !== $object->getControlAvailable()) { + $data['ControlAvailable'] = $object->getControlAvailable(); + } + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['Error'] = $object->getError(); + } + if ($object->isInitialized('remoteManagers') && null !== $object->getRemoteManagers()) { + $values = []; + foreach ($object->getRemoteManagers() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['RemoteManagers'] = $values; + } + if ($object->isInitialized('nodes') && null !== $object->getNodes()) { + $data['Nodes'] = $object->getNodes(); + } + if ($object->isInitialized('managers') && null !== $object->getManagers()) { + $data['Managers'] = $object->getManagers(); + } + if ($object->isInitialized('cluster') && null !== $object->getCluster()) { + $data['Cluster'] = $this->normalizer->normalize($object->getCluster(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmInfo::class => false]; + } + } +} else { + class SwarmInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmInfo::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NodeID', $data) && $data['NodeID'] !== null) { + $object->setNodeID($data['NodeID']); + } + elseif (\array_key_exists('NodeID', $data) && $data['NodeID'] === null) { + $object->setNodeID(null); + } + if (\array_key_exists('NodeAddr', $data) && $data['NodeAddr'] !== null) { + $object->setNodeAddr($data['NodeAddr']); + } + elseif (\array_key_exists('NodeAddr', $data) && $data['NodeAddr'] === null) { + $object->setNodeAddr(null); + } + if (\array_key_exists('LocalNodeState', $data) && $data['LocalNodeState'] !== null) { + $object->setLocalNodeState($data['LocalNodeState']); + } + elseif (\array_key_exists('LocalNodeState', $data) && $data['LocalNodeState'] === null) { + $object->setLocalNodeState(null); + } + if (\array_key_exists('ControlAvailable', $data) && $data['ControlAvailable'] !== null) { + $object->setControlAvailable($data['ControlAvailable']); + } + elseif (\array_key_exists('ControlAvailable', $data) && $data['ControlAvailable'] === null) { + $object->setControlAvailable(null); + } + if (\array_key_exists('Error', $data) && $data['Error'] !== null) { + $object->setError($data['Error']); + } + elseif (\array_key_exists('Error', $data) && $data['Error'] === null) { + $object->setError(null); + } + if (\array_key_exists('RemoteManagers', $data) && $data['RemoteManagers'] !== null) { + $values = []; + foreach ($data['RemoteManagers'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\PeerNode::class, 'json', $context); + } + $object->setRemoteManagers($values); + } + elseif (\array_key_exists('RemoteManagers', $data) && $data['RemoteManagers'] === null) { + $object->setRemoteManagers(null); + } + if (\array_key_exists('Nodes', $data) && $data['Nodes'] !== null) { + $object->setNodes($data['Nodes']); + } + elseif (\array_key_exists('Nodes', $data) && $data['Nodes'] === null) { + $object->setNodes(null); + } + if (\array_key_exists('Managers', $data) && $data['Managers'] !== null) { + $object->setManagers($data['Managers']); + } + elseif (\array_key_exists('Managers', $data) && $data['Managers'] === null) { + $object->setManagers(null); + } + if (\array_key_exists('Cluster', $data) && $data['Cluster'] !== null) { + $object->setCluster($this->denormalizer->denormalize($data['Cluster'], \Docker\API\Model\ClusterInfo::class, 'json', $context)); + } + elseif (\array_key_exists('Cluster', $data) && $data['Cluster'] === null) { + $object->setCluster(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('nodeID') && null !== $object->getNodeID()) { + $data['NodeID'] = $object->getNodeID(); + } + if ($object->isInitialized('nodeAddr') && null !== $object->getNodeAddr()) { + $data['NodeAddr'] = $object->getNodeAddr(); + } + if ($object->isInitialized('localNodeState') && null !== $object->getLocalNodeState()) { + $data['LocalNodeState'] = $object->getLocalNodeState(); + } + if ($object->isInitialized('controlAvailable') && null !== $object->getControlAvailable()) { + $data['ControlAvailable'] = $object->getControlAvailable(); + } + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['Error'] = $object->getError(); + } + if ($object->isInitialized('remoteManagers') && null !== $object->getRemoteManagers()) { + $values = []; + foreach ($object->getRemoteManagers() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['RemoteManagers'] = $values; + } + if ($object->isInitialized('nodes') && null !== $object->getNodes()) { + $data['Nodes'] = $object->getNodes(); + } + if ($object->isInitialized('managers') && null !== $object->getManagers()) { + $data['Managers'] = $object->getManagers(); + } + if ($object->isInitialized('cluster') && null !== $object->getCluster()) { + $data['Cluster'] = $this->normalizer->normalize($object->getCluster(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmInfo::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmInitPostBodyNormalizer.php b/generated/Normalizer/SwarmInitPostBodyNormalizer.php new file mode 100644 index 00000000..9dd9d7ac --- /dev/null +++ b/generated/Normalizer/SwarmInitPostBodyNormalizer.php @@ -0,0 +1,260 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmInitPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmInitPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmInitPostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmInitPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ListenAddr', $data) && $data['ListenAddr'] !== null) { + $object->setListenAddr($data['ListenAddr']); + } + elseif (\array_key_exists('ListenAddr', $data) && $data['ListenAddr'] === null) { + $object->setListenAddr(null); + } + if (\array_key_exists('AdvertiseAddr', $data) && $data['AdvertiseAddr'] !== null) { + $object->setAdvertiseAddr($data['AdvertiseAddr']); + } + elseif (\array_key_exists('AdvertiseAddr', $data) && $data['AdvertiseAddr'] === null) { + $object->setAdvertiseAddr(null); + } + if (\array_key_exists('DataPathAddr', $data) && $data['DataPathAddr'] !== null) { + $object->setDataPathAddr($data['DataPathAddr']); + } + elseif (\array_key_exists('DataPathAddr', $data) && $data['DataPathAddr'] === null) { + $object->setDataPathAddr(null); + } + if (\array_key_exists('DataPathPort', $data) && $data['DataPathPort'] !== null) { + $object->setDataPathPort($data['DataPathPort']); + } + elseif (\array_key_exists('DataPathPort', $data) && $data['DataPathPort'] === null) { + $object->setDataPathPort(null); + } + if (\array_key_exists('DefaultAddrPool', $data) && $data['DefaultAddrPool'] !== null) { + $values = []; + foreach ($data['DefaultAddrPool'] as $value) { + $values[] = $value; + } + $object->setDefaultAddrPool($values); + } + elseif (\array_key_exists('DefaultAddrPool', $data) && $data['DefaultAddrPool'] === null) { + $object->setDefaultAddrPool(null); + } + if (\array_key_exists('ForceNewCluster', $data) && $data['ForceNewCluster'] !== null) { + $object->setForceNewCluster($data['ForceNewCluster']); + } + elseif (\array_key_exists('ForceNewCluster', $data) && $data['ForceNewCluster'] === null) { + $object->setForceNewCluster(null); + } + if (\array_key_exists('SubnetSize', $data) && $data['SubnetSize'] !== null) { + $object->setSubnetSize($data['SubnetSize']); + } + elseif (\array_key_exists('SubnetSize', $data) && $data['SubnetSize'] === null) { + $object->setSubnetSize(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\SwarmSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('listenAddr') && null !== $object->getListenAddr()) { + $data['ListenAddr'] = $object->getListenAddr(); + } + if ($object->isInitialized('advertiseAddr') && null !== $object->getAdvertiseAddr()) { + $data['AdvertiseAddr'] = $object->getAdvertiseAddr(); + } + if ($object->isInitialized('dataPathAddr') && null !== $object->getDataPathAddr()) { + $data['DataPathAddr'] = $object->getDataPathAddr(); + } + if ($object->isInitialized('dataPathPort') && null !== $object->getDataPathPort()) { + $data['DataPathPort'] = $object->getDataPathPort(); + } + if ($object->isInitialized('defaultAddrPool') && null !== $object->getDefaultAddrPool()) { + $values = []; + foreach ($object->getDefaultAddrPool() as $value) { + $values[] = $value; + } + $data['DefaultAddrPool'] = $values; + } + if ($object->isInitialized('forceNewCluster') && null !== $object->getForceNewCluster()) { + $data['ForceNewCluster'] = $object->getForceNewCluster(); + } + if ($object->isInitialized('subnetSize') && null !== $object->getSubnetSize()) { + $data['SubnetSize'] = $object->getSubnetSize(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmInitPostBody::class => false]; + } + } +} else { + class SwarmInitPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmInitPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmInitPostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmInitPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ListenAddr', $data) && $data['ListenAddr'] !== null) { + $object->setListenAddr($data['ListenAddr']); + } + elseif (\array_key_exists('ListenAddr', $data) && $data['ListenAddr'] === null) { + $object->setListenAddr(null); + } + if (\array_key_exists('AdvertiseAddr', $data) && $data['AdvertiseAddr'] !== null) { + $object->setAdvertiseAddr($data['AdvertiseAddr']); + } + elseif (\array_key_exists('AdvertiseAddr', $data) && $data['AdvertiseAddr'] === null) { + $object->setAdvertiseAddr(null); + } + if (\array_key_exists('DataPathAddr', $data) && $data['DataPathAddr'] !== null) { + $object->setDataPathAddr($data['DataPathAddr']); + } + elseif (\array_key_exists('DataPathAddr', $data) && $data['DataPathAddr'] === null) { + $object->setDataPathAddr(null); + } + if (\array_key_exists('DataPathPort', $data) && $data['DataPathPort'] !== null) { + $object->setDataPathPort($data['DataPathPort']); + } + elseif (\array_key_exists('DataPathPort', $data) && $data['DataPathPort'] === null) { + $object->setDataPathPort(null); + } + if (\array_key_exists('DefaultAddrPool', $data) && $data['DefaultAddrPool'] !== null) { + $values = []; + foreach ($data['DefaultAddrPool'] as $value) { + $values[] = $value; + } + $object->setDefaultAddrPool($values); + } + elseif (\array_key_exists('DefaultAddrPool', $data) && $data['DefaultAddrPool'] === null) { + $object->setDefaultAddrPool(null); + } + if (\array_key_exists('ForceNewCluster', $data) && $data['ForceNewCluster'] !== null) { + $object->setForceNewCluster($data['ForceNewCluster']); + } + elseif (\array_key_exists('ForceNewCluster', $data) && $data['ForceNewCluster'] === null) { + $object->setForceNewCluster(null); + } + if (\array_key_exists('SubnetSize', $data) && $data['SubnetSize'] !== null) { + $object->setSubnetSize($data['SubnetSize']); + } + elseif (\array_key_exists('SubnetSize', $data) && $data['SubnetSize'] === null) { + $object->setSubnetSize(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\SwarmSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('listenAddr') && null !== $object->getListenAddr()) { + $data['ListenAddr'] = $object->getListenAddr(); + } + if ($object->isInitialized('advertiseAddr') && null !== $object->getAdvertiseAddr()) { + $data['AdvertiseAddr'] = $object->getAdvertiseAddr(); + } + if ($object->isInitialized('dataPathAddr') && null !== $object->getDataPathAddr()) { + $data['DataPathAddr'] = $object->getDataPathAddr(); + } + if ($object->isInitialized('dataPathPort') && null !== $object->getDataPathPort()) { + $data['DataPathPort'] = $object->getDataPathPort(); + } + if ($object->isInitialized('defaultAddrPool') && null !== $object->getDefaultAddrPool()) { + $values = []; + foreach ($object->getDefaultAddrPool() as $value) { + $values[] = $value; + } + $data['DefaultAddrPool'] = $values; + } + if ($object->isInitialized('forceNewCluster') && null !== $object->getForceNewCluster()) { + $data['ForceNewCluster'] = $object->getForceNewCluster(); + } + if ($object->isInitialized('subnetSize') && null !== $object->getSubnetSize()) { + $data['SubnetSize'] = $object->getSubnetSize(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmInitPostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmJoinConfigNormalizer.php b/generated/Normalizer/SwarmJoinConfigNormalizer.php deleted file mode 100644 index 7580659e..00000000 --- a/generated/Normalizer/SwarmJoinConfigNormalizer.php +++ /dev/null @@ -1,95 +0,0 @@ -setListenAddr($data->{'ListenAddr'}); - } - if (property_exists($data, 'AdvertiseAddr')) { - $object->setAdvertiseAddr($data->{'AdvertiseAddr'}); - } - if (property_exists($data, 'RemoteAddrs')) { - $value = $data->{'RemoteAddrs'}; - if (is_array($data->{'RemoteAddrs'})) { - $values = []; - foreach ($data->{'RemoteAddrs'} as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($data->{'RemoteAddrs'})) { - $value = $data->{'RemoteAddrs'}; - } - $object->setRemoteAddrs($value); - } - if (property_exists($data, 'JoinToken')) { - $object->setJoinToken($data->{'JoinToken'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getListenAddr()) { - $data->{'ListenAddr'} = $object->getListenAddr(); - } - if (null !== $object->getAdvertiseAddr()) { - $data->{'AdvertiseAddr'} = $object->getAdvertiseAddr(); - } - $value = $object->getRemoteAddrs(); - if (is_array($object->getRemoteAddrs())) { - $values = []; - foreach ($object->getRemoteAddrs() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getRemoteAddrs())) { - $value = $object->getRemoteAddrs(); - } - $data->{'RemoteAddrs'} = $value; - if (null !== $object->getJoinToken()) { - $data->{'JoinToken'} = $object->getJoinToken(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SwarmJoinPostBodyNormalizer.php b/generated/Normalizer/SwarmJoinPostBodyNormalizer.php new file mode 100644 index 00000000..8e788f25 --- /dev/null +++ b/generated/Normalizer/SwarmJoinPostBodyNormalizer.php @@ -0,0 +1,206 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmJoinPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmJoinPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmJoinPostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmJoinPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ListenAddr', $data) && $data['ListenAddr'] !== null) { + $object->setListenAddr($data['ListenAddr']); + } + elseif (\array_key_exists('ListenAddr', $data) && $data['ListenAddr'] === null) { + $object->setListenAddr(null); + } + if (\array_key_exists('AdvertiseAddr', $data) && $data['AdvertiseAddr'] !== null) { + $object->setAdvertiseAddr($data['AdvertiseAddr']); + } + elseif (\array_key_exists('AdvertiseAddr', $data) && $data['AdvertiseAddr'] === null) { + $object->setAdvertiseAddr(null); + } + if (\array_key_exists('DataPathAddr', $data) && $data['DataPathAddr'] !== null) { + $object->setDataPathAddr($data['DataPathAddr']); + } + elseif (\array_key_exists('DataPathAddr', $data) && $data['DataPathAddr'] === null) { + $object->setDataPathAddr(null); + } + if (\array_key_exists('RemoteAddrs', $data) && $data['RemoteAddrs'] !== null) { + $values = []; + foreach ($data['RemoteAddrs'] as $value) { + $values[] = $value; + } + $object->setRemoteAddrs($values); + } + elseif (\array_key_exists('RemoteAddrs', $data) && $data['RemoteAddrs'] === null) { + $object->setRemoteAddrs(null); + } + if (\array_key_exists('JoinToken', $data) && $data['JoinToken'] !== null) { + $object->setJoinToken($data['JoinToken']); + } + elseif (\array_key_exists('JoinToken', $data) && $data['JoinToken'] === null) { + $object->setJoinToken(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('listenAddr') && null !== $object->getListenAddr()) { + $data['ListenAddr'] = $object->getListenAddr(); + } + if ($object->isInitialized('advertiseAddr') && null !== $object->getAdvertiseAddr()) { + $data['AdvertiseAddr'] = $object->getAdvertiseAddr(); + } + if ($object->isInitialized('dataPathAddr') && null !== $object->getDataPathAddr()) { + $data['DataPathAddr'] = $object->getDataPathAddr(); + } + if ($object->isInitialized('remoteAddrs') && null !== $object->getRemoteAddrs()) { + $values = []; + foreach ($object->getRemoteAddrs() as $value) { + $values[] = $value; + } + $data['RemoteAddrs'] = $values; + } + if ($object->isInitialized('joinToken') && null !== $object->getJoinToken()) { + $data['JoinToken'] = $object->getJoinToken(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmJoinPostBody::class => false]; + } + } +} else { + class SwarmJoinPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmJoinPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmJoinPostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmJoinPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ListenAddr', $data) && $data['ListenAddr'] !== null) { + $object->setListenAddr($data['ListenAddr']); + } + elseif (\array_key_exists('ListenAddr', $data) && $data['ListenAddr'] === null) { + $object->setListenAddr(null); + } + if (\array_key_exists('AdvertiseAddr', $data) && $data['AdvertiseAddr'] !== null) { + $object->setAdvertiseAddr($data['AdvertiseAddr']); + } + elseif (\array_key_exists('AdvertiseAddr', $data) && $data['AdvertiseAddr'] === null) { + $object->setAdvertiseAddr(null); + } + if (\array_key_exists('DataPathAddr', $data) && $data['DataPathAddr'] !== null) { + $object->setDataPathAddr($data['DataPathAddr']); + } + elseif (\array_key_exists('DataPathAddr', $data) && $data['DataPathAddr'] === null) { + $object->setDataPathAddr(null); + } + if (\array_key_exists('RemoteAddrs', $data) && $data['RemoteAddrs'] !== null) { + $values = []; + foreach ($data['RemoteAddrs'] as $value) { + $values[] = $value; + } + $object->setRemoteAddrs($values); + } + elseif (\array_key_exists('RemoteAddrs', $data) && $data['RemoteAddrs'] === null) { + $object->setRemoteAddrs(null); + } + if (\array_key_exists('JoinToken', $data) && $data['JoinToken'] !== null) { + $object->setJoinToken($data['JoinToken']); + } + elseif (\array_key_exists('JoinToken', $data) && $data['JoinToken'] === null) { + $object->setJoinToken(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('listenAddr') && null !== $object->getListenAddr()) { + $data['ListenAddr'] = $object->getListenAddr(); + } + if ($object->isInitialized('advertiseAddr') && null !== $object->getAdvertiseAddr()) { + $data['AdvertiseAddr'] = $object->getAdvertiseAddr(); + } + if ($object->isInitialized('dataPathAddr') && null !== $object->getDataPathAddr()) { + $data['DataPathAddr'] = $object->getDataPathAddr(); + } + if ($object->isInitialized('remoteAddrs') && null !== $object->getRemoteAddrs()) { + $values = []; + foreach ($object->getRemoteAddrs() as $value) { + $values[] = $value; + } + $data['RemoteAddrs'] = $values; + } + if ($object->isInitialized('joinToken') && null !== $object->getJoinToken()) { + $data['JoinToken'] = $object->getJoinToken(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmJoinPostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmJoinTokensNormalizer.php b/generated/Normalizer/SwarmJoinTokensNormalizer.php deleted file mode 100644 index 0fe29d18..00000000 --- a/generated/Normalizer/SwarmJoinTokensNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setWorker($data->{'Worker'}); - } - if (property_exists($data, 'Manager')) { - $object->setManager($data->{'Manager'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getWorker()) { - $data->{'Worker'} = $object->getWorker(); - } - if (null !== $object->getManager()) { - $data->{'Manager'} = $object->getManager(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SwarmNetworkNormalizer.php b/generated/Normalizer/SwarmNetworkNormalizer.php deleted file mode 100644 index a5f2f57f..00000000 --- a/generated/Normalizer/SwarmNetworkNormalizer.php +++ /dev/null @@ -1,93 +0,0 @@ -setID($data->{'ID'}); - } - if (property_exists($data, 'Version')) { - $object->setVersion($this->serializer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\NodeVersion', 'raw', $context)); - } - if (property_exists($data, 'CreatedAt')) { - $object->setCreatedAt(\DateTime::createFromFormat("Y-m-d\TH:i:sP", $data->{'CreatedAt'})); - } - if (property_exists($data, 'UpdatedAt')) { - $object->setUpdatedAt(\DateTime::createFromFormat("Y-m-d\TH:i:sP", $data->{'UpdatedAt'})); - } - if (property_exists($data, 'Spec')) { - $object->setSpec($this->serializer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\SwarmNetworkSpec', 'raw', $context)); - } - if (property_exists($data, 'DriverState')) { - $object->setDriverState($this->serializer->denormalize($data->{'DriverState'}, 'Docker\\API\\Model\\Driver', 'raw', $context)); - } - if (property_exists($data, 'IPAM')) { - $object->setIPAM($this->serializer->denormalize($data->{'IPAM'}, 'Docker\\API\\Model\\SwarmIPAMOptions', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); - } - if (null !== $object->getVersion()) { - $data->{'Version'} = json_decode($this->serializer->normalize($object->getVersion(), 'raw', $context)); - } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt()->format("Y-m-d\TH:i:sP"); - } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt()->format("Y-m-d\TH:i:sP"); - } - if (null !== $object->getSpec()) { - $data->{'Spec'} = json_decode($this->serializer->normalize($object->getSpec(), 'raw', $context)); - } - if (null !== $object->getDriverState()) { - $data->{'DriverState'} = json_decode($this->serializer->normalize($object->getDriverState(), 'raw', $context)); - } - if (null !== $object->getIPAM()) { - $data->{'IPAM'} = json_decode($this->serializer->normalize($object->getIPAM(), 'raw', $context)); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SwarmNetworkSpecNormalizer.php b/generated/Normalizer/SwarmNetworkSpecNormalizer.php deleted file mode 100644 index 0c18cf94..00000000 --- a/generated/Normalizer/SwarmNetworkSpecNormalizer.php +++ /dev/null @@ -1,107 +0,0 @@ -setName($data->{'Name'}); - } - if (property_exists($data, 'Labels')) { - $value = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_1) { - $values[$key] = $value_1; - } - $value = $values; - } - if (is_null($data->{'Labels'})) { - $value = $data->{'Labels'}; - } - $object->setLabels($value); - } - if (property_exists($data, 'DriverConfiguration')) { - $object->setDriverConfiguration($this->serializer->denormalize($data->{'DriverConfiguration'}, 'Docker\\API\\Model\\Driver', 'raw', $context)); - } - if (property_exists($data, 'IPv6Enabled')) { - $object->setIPv6Enabled($data->{'IPv6Enabled'}); - } - if (property_exists($data, 'Internal')) { - $object->setInternal($data->{'Internal'}); - } - if (property_exists($data, 'IPAM')) { - $object->setIPAM($this->serializer->denormalize($data->{'IPAM'}, 'Docker\\API\\Model\\SwarmIPAMOptions', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - $value = $object->getLabels(); - if (is_object($object->getLabels())) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value_1) { - $values->{$key} = $value_1; - } - $value = $values; - } - if (is_null($object->getLabels())) { - $value = $object->getLabels(); - } - $data->{'Labels'} = $value; - if (null !== $object->getDriverConfiguration()) { - $data->{'DriverConfiguration'} = json_decode($this->serializer->normalize($object->getDriverConfiguration(), 'raw', $context)); - } - if (null !== $object->getIPv6Enabled()) { - $data->{'IPv6Enabled'} = $object->getIPv6Enabled(); - } - if (null !== $object->getInternal()) { - $data->{'Internal'} = $object->getInternal(); - } - if (null !== $object->getIPAM()) { - $data->{'IPAM'} = json_decode($this->serializer->normalize($object->getIPAM(), 'raw', $context)); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SwarmNormalizer.php b/generated/Normalizer/SwarmNormalizer.php new file mode 100644 index 00000000..48d24fe7 --- /dev/null +++ b/generated/Normalizer/SwarmNormalizer.php @@ -0,0 +1,314 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Swarm::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Swarm::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Swarm(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\SwarmSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] !== null) { + $object->setTLSInfo($this->denormalizer->denormalize($data['TLSInfo'], \Docker\API\Model\TLSInfo::class, 'json', $context)); + } + elseif (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] === null) { + $object->setTLSInfo(null); + } + if (\array_key_exists('RootRotationInProgress', $data) && $data['RootRotationInProgress'] !== null) { + $object->setRootRotationInProgress($data['RootRotationInProgress']); + } + elseif (\array_key_exists('RootRotationInProgress', $data) && $data['RootRotationInProgress'] === null) { + $object->setRootRotationInProgress(null); + } + if (\array_key_exists('DataPathPort', $data) && $data['DataPathPort'] !== null) { + $object->setDataPathPort($data['DataPathPort']); + } + elseif (\array_key_exists('DataPathPort', $data) && $data['DataPathPort'] === null) { + $object->setDataPathPort(null); + } + if (\array_key_exists('DefaultAddrPool', $data) && $data['DefaultAddrPool'] !== null) { + $values = []; + foreach ($data['DefaultAddrPool'] as $value) { + $values[] = $value; + } + $object->setDefaultAddrPool($values); + } + elseif (\array_key_exists('DefaultAddrPool', $data) && $data['DefaultAddrPool'] === null) { + $object->setDefaultAddrPool(null); + } + if (\array_key_exists('SubnetSize', $data) && $data['SubnetSize'] !== null) { + $object->setSubnetSize($data['SubnetSize']); + } + elseif (\array_key_exists('SubnetSize', $data) && $data['SubnetSize'] === null) { + $object->setSubnetSize(null); + } + if (\array_key_exists('JoinTokens', $data) && $data['JoinTokens'] !== null) { + $object->setJoinTokens($this->denormalizer->denormalize($data['JoinTokens'], \Docker\API\Model\JoinTokens::class, 'json', $context)); + } + elseif (\array_key_exists('JoinTokens', $data) && $data['JoinTokens'] === null) { + $object->setJoinTokens(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('tLSInfo') && null !== $object->getTLSInfo()) { + $data['TLSInfo'] = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); + } + if ($object->isInitialized('rootRotationInProgress') && null !== $object->getRootRotationInProgress()) { + $data['RootRotationInProgress'] = $object->getRootRotationInProgress(); + } + if ($object->isInitialized('dataPathPort') && null !== $object->getDataPathPort()) { + $data['DataPathPort'] = $object->getDataPathPort(); + } + if ($object->isInitialized('defaultAddrPool') && null !== $object->getDefaultAddrPool()) { + $values = []; + foreach ($object->getDefaultAddrPool() as $value) { + $values[] = $value; + } + $data['DefaultAddrPool'] = $values; + } + if ($object->isInitialized('subnetSize') && null !== $object->getSubnetSize()) { + $data['SubnetSize'] = $object->getSubnetSize(); + } + if ($object->isInitialized('joinTokens') && null !== $object->getJoinTokens()) { + $data['JoinTokens'] = $this->normalizer->normalize($object->getJoinTokens(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Swarm::class => false]; + } + } +} else { + class SwarmNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Swarm::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Swarm::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Swarm(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\SwarmSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] !== null) { + $object->setTLSInfo($this->denormalizer->denormalize($data['TLSInfo'], \Docker\API\Model\TLSInfo::class, 'json', $context)); + } + elseif (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] === null) { + $object->setTLSInfo(null); + } + if (\array_key_exists('RootRotationInProgress', $data) && $data['RootRotationInProgress'] !== null) { + $object->setRootRotationInProgress($data['RootRotationInProgress']); + } + elseif (\array_key_exists('RootRotationInProgress', $data) && $data['RootRotationInProgress'] === null) { + $object->setRootRotationInProgress(null); + } + if (\array_key_exists('DataPathPort', $data) && $data['DataPathPort'] !== null) { + $object->setDataPathPort($data['DataPathPort']); + } + elseif (\array_key_exists('DataPathPort', $data) && $data['DataPathPort'] === null) { + $object->setDataPathPort(null); + } + if (\array_key_exists('DefaultAddrPool', $data) && $data['DefaultAddrPool'] !== null) { + $values = []; + foreach ($data['DefaultAddrPool'] as $value) { + $values[] = $value; + } + $object->setDefaultAddrPool($values); + } + elseif (\array_key_exists('DefaultAddrPool', $data) && $data['DefaultAddrPool'] === null) { + $object->setDefaultAddrPool(null); + } + if (\array_key_exists('SubnetSize', $data) && $data['SubnetSize'] !== null) { + $object->setSubnetSize($data['SubnetSize']); + } + elseif (\array_key_exists('SubnetSize', $data) && $data['SubnetSize'] === null) { + $object->setSubnetSize(null); + } + if (\array_key_exists('JoinTokens', $data) && $data['JoinTokens'] !== null) { + $object->setJoinTokens($this->denormalizer->denormalize($data['JoinTokens'], \Docker\API\Model\JoinTokens::class, 'json', $context)); + } + elseif (\array_key_exists('JoinTokens', $data) && $data['JoinTokens'] === null) { + $object->setJoinTokens(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('tLSInfo') && null !== $object->getTLSInfo()) { + $data['TLSInfo'] = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); + } + if ($object->isInitialized('rootRotationInProgress') && null !== $object->getRootRotationInProgress()) { + $data['RootRotationInProgress'] = $object->getRootRotationInProgress(); + } + if ($object->isInitialized('dataPathPort') && null !== $object->getDataPathPort()) { + $data['DataPathPort'] = $object->getDataPathPort(); + } + if ($object->isInitialized('defaultAddrPool') && null !== $object->getDefaultAddrPool()) { + $values = []; + foreach ($object->getDefaultAddrPool() as $value) { + $values[] = $value; + } + $data['DefaultAddrPool'] = $values; + } + if ($object->isInitialized('subnetSize') && null !== $object->getSubnetSize()) { + $data['SubnetSize'] = $object->getSubnetSize(); + } + if ($object->isInitialized('joinTokens') && null !== $object->getJoinTokens()) { + $data['JoinTokens'] = $this->normalizer->normalize($object->getJoinTokens(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Swarm::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmSpecCAConfigExternalCAsItemNormalizer.php b/generated/Normalizer/SwarmSpecCAConfigExternalCAsItemNormalizer.php new file mode 100644 index 00000000..58d609fc --- /dev/null +++ b/generated/Normalizer/SwarmSpecCAConfigExternalCAsItemNormalizer.php @@ -0,0 +1,188 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmSpecCAConfigExternalCAsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Protocol', $data) && $data['Protocol'] !== null) { + $object->setProtocol($data['Protocol']); + } + elseif (\array_key_exists('Protocol', $data) && $data['Protocol'] === null) { + $object->setProtocol(null); + } + if (\array_key_exists('URL', $data) && $data['URL'] !== null) { + $object->setURL($data['URL']); + } + elseif (\array_key_exists('URL', $data) && $data['URL'] === null) { + $object->setURL(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { + $values[$key] = $value; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + if (\array_key_exists('CACert', $data) && $data['CACert'] !== null) { + $object->setCACert($data['CACert']); + } + elseif (\array_key_exists('CACert', $data) && $data['CACert'] === null) { + $object->setCACert(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('protocol') && null !== $object->getProtocol()) { + $data['Protocol'] = $object->getProtocol(); + } + if ($object->isInitialized('uRL') && null !== $object->getURL()) { + $data['URL'] = $object->getURL(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $key => $value) { + $values[$key] = $value; + } + $data['Options'] = $values; + } + if ($object->isInitialized('cACert') && null !== $object->getCACert()) { + $data['CACert'] = $object->getCACert(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class => false]; + } + } +} else { + class SwarmSpecCAConfigExternalCAsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Protocol', $data) && $data['Protocol'] !== null) { + $object->setProtocol($data['Protocol']); + } + elseif (\array_key_exists('Protocol', $data) && $data['Protocol'] === null) { + $object->setProtocol(null); + } + if (\array_key_exists('URL', $data) && $data['URL'] !== null) { + $object->setURL($data['URL']); + } + elseif (\array_key_exists('URL', $data) && $data['URL'] === null) { + $object->setURL(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { + $values[$key] = $value; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + if (\array_key_exists('CACert', $data) && $data['CACert'] !== null) { + $object->setCACert($data['CACert']); + } + elseif (\array_key_exists('CACert', $data) && $data['CACert'] === null) { + $object->setCACert(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('protocol') && null !== $object->getProtocol()) { + $data['Protocol'] = $object->getProtocol(); + } + if ($object->isInitialized('uRL') && null !== $object->getURL()) { + $data['URL'] = $object->getURL(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $key => $value) { + $values[$key] = $value; + } + $data['Options'] = $values; + } + if ($object->isInitialized('cACert') && null !== $object->getCACert()) { + $data['CACert'] = $object->getCACert(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmSpecCAConfigNormalizer.php b/generated/Normalizer/SwarmSpecCAConfigNormalizer.php new file mode 100644 index 00000000..9eafffb6 --- /dev/null +++ b/generated/Normalizer/SwarmSpecCAConfigNormalizer.php @@ -0,0 +1,206 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmSpecCAConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecCAConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecCAConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecCAConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NodeCertExpiry', $data) && $data['NodeCertExpiry'] !== null) { + $object->setNodeCertExpiry($data['NodeCertExpiry']); + } + elseif (\array_key_exists('NodeCertExpiry', $data) && $data['NodeCertExpiry'] === null) { + $object->setNodeCertExpiry(null); + } + if (\array_key_exists('ExternalCAs', $data) && $data['ExternalCAs'] !== null) { + $values = []; + foreach ($data['ExternalCAs'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class, 'json', $context); + } + $object->setExternalCAs($values); + } + elseif (\array_key_exists('ExternalCAs', $data) && $data['ExternalCAs'] === null) { + $object->setExternalCAs(null); + } + if (\array_key_exists('SigningCACert', $data) && $data['SigningCACert'] !== null) { + $object->setSigningCACert($data['SigningCACert']); + } + elseif (\array_key_exists('SigningCACert', $data) && $data['SigningCACert'] === null) { + $object->setSigningCACert(null); + } + if (\array_key_exists('SigningCAKey', $data) && $data['SigningCAKey'] !== null) { + $object->setSigningCAKey($data['SigningCAKey']); + } + elseif (\array_key_exists('SigningCAKey', $data) && $data['SigningCAKey'] === null) { + $object->setSigningCAKey(null); + } + if (\array_key_exists('ForceRotate', $data) && $data['ForceRotate'] !== null) { + $object->setForceRotate($data['ForceRotate']); + } + elseif (\array_key_exists('ForceRotate', $data) && $data['ForceRotate'] === null) { + $object->setForceRotate(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('nodeCertExpiry') && null !== $object->getNodeCertExpiry()) { + $data['NodeCertExpiry'] = $object->getNodeCertExpiry(); + } + if ($object->isInitialized('externalCAs') && null !== $object->getExternalCAs()) { + $values = []; + foreach ($object->getExternalCAs() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['ExternalCAs'] = $values; + } + if ($object->isInitialized('signingCACert') && null !== $object->getSigningCACert()) { + $data['SigningCACert'] = $object->getSigningCACert(); + } + if ($object->isInitialized('signingCAKey') && null !== $object->getSigningCAKey()) { + $data['SigningCAKey'] = $object->getSigningCAKey(); + } + if ($object->isInitialized('forceRotate') && null !== $object->getForceRotate()) { + $data['ForceRotate'] = $object->getForceRotate(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecCAConfig::class => false]; + } + } +} else { + class SwarmSpecCAConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecCAConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecCAConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecCAConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NodeCertExpiry', $data) && $data['NodeCertExpiry'] !== null) { + $object->setNodeCertExpiry($data['NodeCertExpiry']); + } + elseif (\array_key_exists('NodeCertExpiry', $data) && $data['NodeCertExpiry'] === null) { + $object->setNodeCertExpiry(null); + } + if (\array_key_exists('ExternalCAs', $data) && $data['ExternalCAs'] !== null) { + $values = []; + foreach ($data['ExternalCAs'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class, 'json', $context); + } + $object->setExternalCAs($values); + } + elseif (\array_key_exists('ExternalCAs', $data) && $data['ExternalCAs'] === null) { + $object->setExternalCAs(null); + } + if (\array_key_exists('SigningCACert', $data) && $data['SigningCACert'] !== null) { + $object->setSigningCACert($data['SigningCACert']); + } + elseif (\array_key_exists('SigningCACert', $data) && $data['SigningCACert'] === null) { + $object->setSigningCACert(null); + } + if (\array_key_exists('SigningCAKey', $data) && $data['SigningCAKey'] !== null) { + $object->setSigningCAKey($data['SigningCAKey']); + } + elseif (\array_key_exists('SigningCAKey', $data) && $data['SigningCAKey'] === null) { + $object->setSigningCAKey(null); + } + if (\array_key_exists('ForceRotate', $data) && $data['ForceRotate'] !== null) { + $object->setForceRotate($data['ForceRotate']); + } + elseif (\array_key_exists('ForceRotate', $data) && $data['ForceRotate'] === null) { + $object->setForceRotate(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('nodeCertExpiry') && null !== $object->getNodeCertExpiry()) { + $data['NodeCertExpiry'] = $object->getNodeCertExpiry(); + } + if ($object->isInitialized('externalCAs') && null !== $object->getExternalCAs()) { + $values = []; + foreach ($object->getExternalCAs() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['ExternalCAs'] = $values; + } + if ($object->isInitialized('signingCACert') && null !== $object->getSigningCACert()) { + $data['SigningCACert'] = $object->getSigningCACert(); + } + if ($object->isInitialized('signingCAKey') && null !== $object->getSigningCAKey()) { + $data['SigningCAKey'] = $object->getSigningCAKey(); + } + if ($object->isInitialized('forceRotate') && null !== $object->getForceRotate()) { + $data['ForceRotate'] = $object->getForceRotate(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecCAConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmSpecDispatcherNormalizer.php b/generated/Normalizer/SwarmSpecDispatcherNormalizer.php new file mode 100644 index 00000000..868e7b8e --- /dev/null +++ b/generated/Normalizer/SwarmSpecDispatcherNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmSpecDispatcherNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecDispatcher::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecDispatcher::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecDispatcher(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('HeartbeatPeriod', $data) && $data['HeartbeatPeriod'] !== null) { + $object->setHeartbeatPeriod($data['HeartbeatPeriod']); + } + elseif (\array_key_exists('HeartbeatPeriod', $data) && $data['HeartbeatPeriod'] === null) { + $object->setHeartbeatPeriod(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('heartbeatPeriod') && null !== $object->getHeartbeatPeriod()) { + $data['HeartbeatPeriod'] = $object->getHeartbeatPeriod(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecDispatcher::class => false]; + } + } +} else { + class SwarmSpecDispatcherNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecDispatcher::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecDispatcher::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecDispatcher(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('HeartbeatPeriod', $data) && $data['HeartbeatPeriod'] !== null) { + $object->setHeartbeatPeriod($data['HeartbeatPeriod']); + } + elseif (\array_key_exists('HeartbeatPeriod', $data) && $data['HeartbeatPeriod'] === null) { + $object->setHeartbeatPeriod(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('heartbeatPeriod') && null !== $object->getHeartbeatPeriod()) { + $data['HeartbeatPeriod'] = $object->getHeartbeatPeriod(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecDispatcher::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmSpecEncryptionConfigNormalizer.php b/generated/Normalizer/SwarmSpecEncryptionConfigNormalizer.php new file mode 100644 index 00000000..34ed5c98 --- /dev/null +++ b/generated/Normalizer/SwarmSpecEncryptionConfigNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmSpecEncryptionConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecEncryptionConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecEncryptionConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecEncryptionConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AutoLockManagers', $data) && $data['AutoLockManagers'] !== null) { + $object->setAutoLockManagers($data['AutoLockManagers']); + } + elseif (\array_key_exists('AutoLockManagers', $data) && $data['AutoLockManagers'] === null) { + $object->setAutoLockManagers(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('autoLockManagers') && null !== $object->getAutoLockManagers()) { + $data['AutoLockManagers'] = $object->getAutoLockManagers(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecEncryptionConfig::class => false]; + } + } +} else { + class SwarmSpecEncryptionConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecEncryptionConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecEncryptionConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecEncryptionConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AutoLockManagers', $data) && $data['AutoLockManagers'] !== null) { + $object->setAutoLockManagers($data['AutoLockManagers']); + } + elseif (\array_key_exists('AutoLockManagers', $data) && $data['AutoLockManagers'] === null) { + $object->setAutoLockManagers(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('autoLockManagers') && null !== $object->getAutoLockManagers()) { + $data['AutoLockManagers'] = $object->getAutoLockManagers(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecEncryptionConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmSpecNormalizer.php b/generated/Normalizer/SwarmSpecNormalizer.php new file mode 100644 index 00000000..b37a2c98 --- /dev/null +++ b/generated/Normalizer/SwarmSpecNormalizer.php @@ -0,0 +1,260 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpec::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Orchestration', $data) && $data['Orchestration'] !== null) { + $object->setOrchestration($this->denormalizer->denormalize($data['Orchestration'], \Docker\API\Model\SwarmSpecOrchestration::class, 'json', $context)); + } + elseif (\array_key_exists('Orchestration', $data) && $data['Orchestration'] === null) { + $object->setOrchestration(null); + } + if (\array_key_exists('Raft', $data) && $data['Raft'] !== null) { + $object->setRaft($this->denormalizer->denormalize($data['Raft'], \Docker\API\Model\SwarmSpecRaft::class, 'json', $context)); + } + elseif (\array_key_exists('Raft', $data) && $data['Raft'] === null) { + $object->setRaft(null); + } + if (\array_key_exists('Dispatcher', $data) && $data['Dispatcher'] !== null) { + $object->setDispatcher($this->denormalizer->denormalize($data['Dispatcher'], \Docker\API\Model\SwarmSpecDispatcher::class, 'json', $context)); + } + elseif (\array_key_exists('Dispatcher', $data) && $data['Dispatcher'] === null) { + $object->setDispatcher(null); + } + if (\array_key_exists('CAConfig', $data) && $data['CAConfig'] !== null) { + $object->setCAConfig($this->denormalizer->denormalize($data['CAConfig'], \Docker\API\Model\SwarmSpecCAConfig::class, 'json', $context)); + } + elseif (\array_key_exists('CAConfig', $data) && $data['CAConfig'] === null) { + $object->setCAConfig(null); + } + if (\array_key_exists('EncryptionConfig', $data) && $data['EncryptionConfig'] !== null) { + $object->setEncryptionConfig($this->denormalizer->denormalize($data['EncryptionConfig'], \Docker\API\Model\SwarmSpecEncryptionConfig::class, 'json', $context)); + } + elseif (\array_key_exists('EncryptionConfig', $data) && $data['EncryptionConfig'] === null) { + $object->setEncryptionConfig(null); + } + if (\array_key_exists('TaskDefaults', $data) && $data['TaskDefaults'] !== null) { + $object->setTaskDefaults($this->denormalizer->denormalize($data['TaskDefaults'], \Docker\API\Model\SwarmSpecTaskDefaults::class, 'json', $context)); + } + elseif (\array_key_exists('TaskDefaults', $data) && $data['TaskDefaults'] === null) { + $object->setTaskDefaults(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('orchestration') && null !== $object->getOrchestration()) { + $data['Orchestration'] = $this->normalizer->normalize($object->getOrchestration(), 'json', $context); + } + if ($object->isInitialized('raft') && null !== $object->getRaft()) { + $data['Raft'] = $this->normalizer->normalize($object->getRaft(), 'json', $context); + } + if ($object->isInitialized('dispatcher') && null !== $object->getDispatcher()) { + $data['Dispatcher'] = $this->normalizer->normalize($object->getDispatcher(), 'json', $context); + } + if ($object->isInitialized('cAConfig') && null !== $object->getCAConfig()) { + $data['CAConfig'] = $this->normalizer->normalize($object->getCAConfig(), 'json', $context); + } + if ($object->isInitialized('encryptionConfig') && null !== $object->getEncryptionConfig()) { + $data['EncryptionConfig'] = $this->normalizer->normalize($object->getEncryptionConfig(), 'json', $context); + } + if ($object->isInitialized('taskDefaults') && null !== $object->getTaskDefaults()) { + $data['TaskDefaults'] = $this->normalizer->normalize($object->getTaskDefaults(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpec::class => false]; + } + } +} else { + class SwarmSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpec::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Orchestration', $data) && $data['Orchestration'] !== null) { + $object->setOrchestration($this->denormalizer->denormalize($data['Orchestration'], \Docker\API\Model\SwarmSpecOrchestration::class, 'json', $context)); + } + elseif (\array_key_exists('Orchestration', $data) && $data['Orchestration'] === null) { + $object->setOrchestration(null); + } + if (\array_key_exists('Raft', $data) && $data['Raft'] !== null) { + $object->setRaft($this->denormalizer->denormalize($data['Raft'], \Docker\API\Model\SwarmSpecRaft::class, 'json', $context)); + } + elseif (\array_key_exists('Raft', $data) && $data['Raft'] === null) { + $object->setRaft(null); + } + if (\array_key_exists('Dispatcher', $data) && $data['Dispatcher'] !== null) { + $object->setDispatcher($this->denormalizer->denormalize($data['Dispatcher'], \Docker\API\Model\SwarmSpecDispatcher::class, 'json', $context)); + } + elseif (\array_key_exists('Dispatcher', $data) && $data['Dispatcher'] === null) { + $object->setDispatcher(null); + } + if (\array_key_exists('CAConfig', $data) && $data['CAConfig'] !== null) { + $object->setCAConfig($this->denormalizer->denormalize($data['CAConfig'], \Docker\API\Model\SwarmSpecCAConfig::class, 'json', $context)); + } + elseif (\array_key_exists('CAConfig', $data) && $data['CAConfig'] === null) { + $object->setCAConfig(null); + } + if (\array_key_exists('EncryptionConfig', $data) && $data['EncryptionConfig'] !== null) { + $object->setEncryptionConfig($this->denormalizer->denormalize($data['EncryptionConfig'], \Docker\API\Model\SwarmSpecEncryptionConfig::class, 'json', $context)); + } + elseif (\array_key_exists('EncryptionConfig', $data) && $data['EncryptionConfig'] === null) { + $object->setEncryptionConfig(null); + } + if (\array_key_exists('TaskDefaults', $data) && $data['TaskDefaults'] !== null) { + $object->setTaskDefaults($this->denormalizer->denormalize($data['TaskDefaults'], \Docker\API\Model\SwarmSpecTaskDefaults::class, 'json', $context)); + } + elseif (\array_key_exists('TaskDefaults', $data) && $data['TaskDefaults'] === null) { + $object->setTaskDefaults(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('orchestration') && null !== $object->getOrchestration()) { + $data['Orchestration'] = $this->normalizer->normalize($object->getOrchestration(), 'json', $context); + } + if ($object->isInitialized('raft') && null !== $object->getRaft()) { + $data['Raft'] = $this->normalizer->normalize($object->getRaft(), 'json', $context); + } + if ($object->isInitialized('dispatcher') && null !== $object->getDispatcher()) { + $data['Dispatcher'] = $this->normalizer->normalize($object->getDispatcher(), 'json', $context); + } + if ($object->isInitialized('cAConfig') && null !== $object->getCAConfig()) { + $data['CAConfig'] = $this->normalizer->normalize($object->getCAConfig(), 'json', $context); + } + if ($object->isInitialized('encryptionConfig') && null !== $object->getEncryptionConfig()) { + $data['EncryptionConfig'] = $this->normalizer->normalize($object->getEncryptionConfig(), 'json', $context); + } + if ($object->isInitialized('taskDefaults') && null !== $object->getTaskDefaults()) { + $data['TaskDefaults'] = $this->normalizer->normalize($object->getTaskDefaults(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpec::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmSpecOrchestrationNormalizer.php b/generated/Normalizer/SwarmSpecOrchestrationNormalizer.php new file mode 100644 index 00000000..7182a9f4 --- /dev/null +++ b/generated/Normalizer/SwarmSpecOrchestrationNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmSpecOrchestrationNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecOrchestration::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecOrchestration::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecOrchestration(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('TaskHistoryRetentionLimit', $data) && $data['TaskHistoryRetentionLimit'] !== null) { + $object->setTaskHistoryRetentionLimit($data['TaskHistoryRetentionLimit']); + } + elseif (\array_key_exists('TaskHistoryRetentionLimit', $data) && $data['TaskHistoryRetentionLimit'] === null) { + $object->setTaskHistoryRetentionLimit(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('taskHistoryRetentionLimit') && null !== $object->getTaskHistoryRetentionLimit()) { + $data['TaskHistoryRetentionLimit'] = $object->getTaskHistoryRetentionLimit(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecOrchestration::class => false]; + } + } +} else { + class SwarmSpecOrchestrationNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecOrchestration::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecOrchestration::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecOrchestration(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('TaskHistoryRetentionLimit', $data) && $data['TaskHistoryRetentionLimit'] !== null) { + $object->setTaskHistoryRetentionLimit($data['TaskHistoryRetentionLimit']); + } + elseif (\array_key_exists('TaskHistoryRetentionLimit', $data) && $data['TaskHistoryRetentionLimit'] === null) { + $object->setTaskHistoryRetentionLimit(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('taskHistoryRetentionLimit') && null !== $object->getTaskHistoryRetentionLimit()) { + $data['TaskHistoryRetentionLimit'] = $object->getTaskHistoryRetentionLimit(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecOrchestration::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmSpecRaftNormalizer.php b/generated/Normalizer/SwarmSpecRaftNormalizer.php new file mode 100644 index 00000000..69705592 --- /dev/null +++ b/generated/Normalizer/SwarmSpecRaftNormalizer.php @@ -0,0 +1,190 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmSpecRaftNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecRaft::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecRaft::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecRaft(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('SnapshotInterval', $data) && $data['SnapshotInterval'] !== null) { + $object->setSnapshotInterval($data['SnapshotInterval']); + } + elseif (\array_key_exists('SnapshotInterval', $data) && $data['SnapshotInterval'] === null) { + $object->setSnapshotInterval(null); + } + if (\array_key_exists('KeepOldSnapshots', $data) && $data['KeepOldSnapshots'] !== null) { + $object->setKeepOldSnapshots($data['KeepOldSnapshots']); + } + elseif (\array_key_exists('KeepOldSnapshots', $data) && $data['KeepOldSnapshots'] === null) { + $object->setKeepOldSnapshots(null); + } + if (\array_key_exists('LogEntriesForSlowFollowers', $data) && $data['LogEntriesForSlowFollowers'] !== null) { + $object->setLogEntriesForSlowFollowers($data['LogEntriesForSlowFollowers']); + } + elseif (\array_key_exists('LogEntriesForSlowFollowers', $data) && $data['LogEntriesForSlowFollowers'] === null) { + $object->setLogEntriesForSlowFollowers(null); + } + if (\array_key_exists('ElectionTick', $data) && $data['ElectionTick'] !== null) { + $object->setElectionTick($data['ElectionTick']); + } + elseif (\array_key_exists('ElectionTick', $data) && $data['ElectionTick'] === null) { + $object->setElectionTick(null); + } + if (\array_key_exists('HeartbeatTick', $data) && $data['HeartbeatTick'] !== null) { + $object->setHeartbeatTick($data['HeartbeatTick']); + } + elseif (\array_key_exists('HeartbeatTick', $data) && $data['HeartbeatTick'] === null) { + $object->setHeartbeatTick(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('snapshotInterval') && null !== $object->getSnapshotInterval()) { + $data['SnapshotInterval'] = $object->getSnapshotInterval(); + } + if ($object->isInitialized('keepOldSnapshots') && null !== $object->getKeepOldSnapshots()) { + $data['KeepOldSnapshots'] = $object->getKeepOldSnapshots(); + } + if ($object->isInitialized('logEntriesForSlowFollowers') && null !== $object->getLogEntriesForSlowFollowers()) { + $data['LogEntriesForSlowFollowers'] = $object->getLogEntriesForSlowFollowers(); + } + if ($object->isInitialized('electionTick') && null !== $object->getElectionTick()) { + $data['ElectionTick'] = $object->getElectionTick(); + } + if ($object->isInitialized('heartbeatTick') && null !== $object->getHeartbeatTick()) { + $data['HeartbeatTick'] = $object->getHeartbeatTick(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecRaft::class => false]; + } + } +} else { + class SwarmSpecRaftNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecRaft::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecRaft::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecRaft(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('SnapshotInterval', $data) && $data['SnapshotInterval'] !== null) { + $object->setSnapshotInterval($data['SnapshotInterval']); + } + elseif (\array_key_exists('SnapshotInterval', $data) && $data['SnapshotInterval'] === null) { + $object->setSnapshotInterval(null); + } + if (\array_key_exists('KeepOldSnapshots', $data) && $data['KeepOldSnapshots'] !== null) { + $object->setKeepOldSnapshots($data['KeepOldSnapshots']); + } + elseif (\array_key_exists('KeepOldSnapshots', $data) && $data['KeepOldSnapshots'] === null) { + $object->setKeepOldSnapshots(null); + } + if (\array_key_exists('LogEntriesForSlowFollowers', $data) && $data['LogEntriesForSlowFollowers'] !== null) { + $object->setLogEntriesForSlowFollowers($data['LogEntriesForSlowFollowers']); + } + elseif (\array_key_exists('LogEntriesForSlowFollowers', $data) && $data['LogEntriesForSlowFollowers'] === null) { + $object->setLogEntriesForSlowFollowers(null); + } + if (\array_key_exists('ElectionTick', $data) && $data['ElectionTick'] !== null) { + $object->setElectionTick($data['ElectionTick']); + } + elseif (\array_key_exists('ElectionTick', $data) && $data['ElectionTick'] === null) { + $object->setElectionTick(null); + } + if (\array_key_exists('HeartbeatTick', $data) && $data['HeartbeatTick'] !== null) { + $object->setHeartbeatTick($data['HeartbeatTick']); + } + elseif (\array_key_exists('HeartbeatTick', $data) && $data['HeartbeatTick'] === null) { + $object->setHeartbeatTick(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('snapshotInterval') && null !== $object->getSnapshotInterval()) { + $data['SnapshotInterval'] = $object->getSnapshotInterval(); + } + if ($object->isInitialized('keepOldSnapshots') && null !== $object->getKeepOldSnapshots()) { + $data['KeepOldSnapshots'] = $object->getKeepOldSnapshots(); + } + if ($object->isInitialized('logEntriesForSlowFollowers') && null !== $object->getLogEntriesForSlowFollowers()) { + $data['LogEntriesForSlowFollowers'] = $object->getLogEntriesForSlowFollowers(); + } + if ($object->isInitialized('electionTick') && null !== $object->getElectionTick()) { + $data['ElectionTick'] = $object->getElectionTick(); + } + if ($object->isInitialized('heartbeatTick') && null !== $object->getHeartbeatTick()) { + $data['HeartbeatTick'] = $object->getHeartbeatTick(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecRaft::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmSpecTaskDefaultsLogDriverNormalizer.php b/generated/Normalizer/SwarmSpecTaskDefaultsLogDriverNormalizer.php new file mode 100644 index 00000000..eb2968a5 --- /dev/null +++ b/generated/Normalizer/SwarmSpecTaskDefaultsLogDriverNormalizer.php @@ -0,0 +1,152 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmSpecTaskDefaultsLogDriverNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { + $values[$key] = $value; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $key => $value) { + $values[$key] = $value; + } + $data['Options'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class => false]; + } + } +} else { + class SwarmSpecTaskDefaultsLogDriverNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { + $values[$key] = $value; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $key => $value) { + $values[$key] = $value; + } + $data['Options'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmSpecTaskDefaultsNormalizer.php b/generated/Normalizer/SwarmSpecTaskDefaultsNormalizer.php new file mode 100644 index 00000000..d73a467c --- /dev/null +++ b/generated/Normalizer/SwarmSpecTaskDefaultsNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmSpecTaskDefaultsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecTaskDefaults::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecTaskDefaults::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecTaskDefaults(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('LogDriver', $data) && $data['LogDriver'] !== null) { + $object->setLogDriver($this->denormalizer->denormalize($data['LogDriver'], \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class, 'json', $context)); + } + elseif (\array_key_exists('LogDriver', $data) && $data['LogDriver'] === null) { + $object->setLogDriver(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('logDriver') && null !== $object->getLogDriver()) { + $data['LogDriver'] = $this->normalizer->normalize($object->getLogDriver(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecTaskDefaults::class => false]; + } + } +} else { + class SwarmSpecTaskDefaultsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmSpecTaskDefaults::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmSpecTaskDefaults::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmSpecTaskDefaults(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('LogDriver', $data) && $data['LogDriver'] !== null) { + $object->setLogDriver($this->denormalizer->denormalize($data['LogDriver'], \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class, 'json', $context)); + } + elseif (\array_key_exists('LogDriver', $data) && $data['LogDriver'] === null) { + $object->setLogDriver(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('logDriver') && null !== $object->getLogDriver()) { + $data['LogDriver'] = $this->normalizer->normalize($object->getLogDriver(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecTaskDefaults::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmUnlockPostBodyNormalizer.php b/generated/Normalizer/SwarmUnlockPostBodyNormalizer.php new file mode 100644 index 00000000..ec8777d8 --- /dev/null +++ b/generated/Normalizer/SwarmUnlockPostBodyNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmUnlockPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmUnlockPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmUnlockPostBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmUnlockPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('UnlockKey', $data) && $data['UnlockKey'] !== null) { + $object->setUnlockKey($data['UnlockKey']); + } + elseif (\array_key_exists('UnlockKey', $data) && $data['UnlockKey'] === null) { + $object->setUnlockKey(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('unlockKey') && null !== $object->getUnlockKey()) { + $data['UnlockKey'] = $object->getUnlockKey(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmUnlockPostBody::class => false]; + } + } +} else { + class SwarmUnlockPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmUnlockPostBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmUnlockPostBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmUnlockPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('UnlockKey', $data) && $data['UnlockKey'] !== null) { + $object->setUnlockKey($data['UnlockKey']); + } + elseif (\array_key_exists('UnlockKey', $data) && $data['UnlockKey'] === null) { + $object->setUnlockKey(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('unlockKey') && null !== $object->getUnlockKey()) { + $data['UnlockKey'] = $object->getUnlockKey(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmUnlockPostBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmUnlockkeyGetResponse200Normalizer.php b/generated/Normalizer/SwarmUnlockkeyGetResponse200Normalizer.php new file mode 100644 index 00000000..159192b9 --- /dev/null +++ b/generated/Normalizer/SwarmUnlockkeyGetResponse200Normalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SwarmUnlockkeyGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmUnlockkeyGetResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmUnlockkeyGetResponse200::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmUnlockkeyGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('UnlockKey', $data) && $data['UnlockKey'] !== null) { + $object->setUnlockKey($data['UnlockKey']); + } + elseif (\array_key_exists('UnlockKey', $data) && $data['UnlockKey'] === null) { + $object->setUnlockKey(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('unlockKey') && null !== $object->getUnlockKey()) { + $data['UnlockKey'] = $object->getUnlockKey(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmUnlockkeyGetResponse200::class => false]; + } + } +} else { + class SwarmUnlockkeyGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SwarmUnlockkeyGetResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SwarmUnlockkeyGetResponse200::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SwarmUnlockkeyGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('UnlockKey', $data) && $data['UnlockKey'] !== null) { + $object->setUnlockKey($data['UnlockKey']); + } + elseif (\array_key_exists('UnlockKey', $data) && $data['UnlockKey'] === null) { + $object->setUnlockKey(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('unlockKey') && null !== $object->getUnlockKey()) { + $data['UnlockKey'] = $object->getUnlockKey(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmUnlockkeyGetResponse200::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SwarmUpdateConfigNormalizer.php b/generated/Normalizer/SwarmUpdateConfigNormalizer.php deleted file mode 100644 index 774f909d..00000000 --- a/generated/Normalizer/SwarmUpdateConfigNormalizer.php +++ /dev/null @@ -1,87 +0,0 @@ -setName($data->{'Name'}); - } - if (property_exists($data, 'Orchestration')) { - $object->setOrchestration($this->serializer->denormalize($data->{'Orchestration'}, 'Docker\\API\\Model\\SwarmConfigSpecOrchestration', 'raw', $context)); - } - if (property_exists($data, 'Raft')) { - $object->setRaft($this->serializer->denormalize($data->{'Raft'}, 'Docker\\API\\Model\\SwarmConfigSpecRaft', 'raw', $context)); - } - if (property_exists($data, 'Dispatcher')) { - $object->setDispatcher($this->serializer->denormalize($data->{'Dispatcher'}, 'Docker\\API\\Model\\SwarmConfigSpecDispatcher', 'raw', $context)); - } - if (property_exists($data, 'CAConfig')) { - $object->setCAConfig($this->serializer->denormalize($data->{'CAConfig'}, 'Docker\\API\\Model\\SwarmConfigSpecCAConfig', 'raw', $context)); - } - if (property_exists($data, 'JoinTokens')) { - $object->setJoinTokens($this->serializer->denormalize($data->{'JoinTokens'}, 'Docker\\API\\Model\\SwarmJoinTokens', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getOrchestration()) { - $data->{'Orchestration'} = json_decode($this->serializer->normalize($object->getOrchestration(), 'raw', $context)); - } - if (null !== $object->getRaft()) { - $data->{'Raft'} = json_decode($this->serializer->normalize($object->getRaft(), 'raw', $context)); - } - if (null !== $object->getDispatcher()) { - $data->{'Dispatcher'} = json_decode($this->serializer->normalize($object->getDispatcher(), 'raw', $context)); - } - if (null !== $object->getCAConfig()) { - $data->{'CAConfig'} = json_decode($this->serializer->normalize($object->getCAConfig(), 'raw', $context)); - } - if (null !== $object->getJoinTokens()) { - $data->{'JoinTokens'} = json_decode($this->serializer->normalize($object->getJoinTokens(), 'raw', $context)); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SystemDfGetResponse200Normalizer.php b/generated/Normalizer/SystemDfGetResponse200Normalizer.php new file mode 100644 index 00000000..61a90503 --- /dev/null +++ b/generated/Normalizer/SystemDfGetResponse200Normalizer.php @@ -0,0 +1,254 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SystemDfGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SystemDfGetResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SystemDfGetResponse200::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SystemDfGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('LayersSize', $data) && $data['LayersSize'] !== null) { + $object->setLayersSize($data['LayersSize']); + } + elseif (\array_key_exists('LayersSize', $data) && $data['LayersSize'] === null) { + $object->setLayersSize(null); + } + if (\array_key_exists('Images', $data) && $data['Images'] !== null) { + $values = []; + foreach ($data['Images'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ImageSummary::class, 'json', $context); + } + $object->setImages($values); + } + elseif (\array_key_exists('Images', $data) && $data['Images'] === null) { + $object->setImages(null); + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $values_1 = []; + foreach ($data['Containers'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ContainerSummary::class, 'json', $context); + } + $object->setContainers($values_1); + } + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); + } + if (\array_key_exists('Volumes', $data) && $data['Volumes'] !== null) { + $values_2 = []; + foreach ($data['Volumes'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\Volume::class, 'json', $context); + } + $object->setVolumes($values_2); + } + elseif (\array_key_exists('Volumes', $data) && $data['Volumes'] === null) { + $object->setVolumes(null); + } + if (\array_key_exists('BuildCache', $data) && $data['BuildCache'] !== null) { + $values_3 = []; + foreach ($data['BuildCache'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\BuildCache::class, 'json', $context); + } + $object->setBuildCache($values_3); + } + elseif (\array_key_exists('BuildCache', $data) && $data['BuildCache'] === null) { + $object->setBuildCache(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('layersSize') && null !== $object->getLayersSize()) { + $data['LayersSize'] = $object->getLayersSize(); + } + if ($object->isInitialized('images') && null !== $object->getImages()) { + $values = []; + foreach ($object->getImages() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Images'] = $values; + } + if ($object->isInitialized('containers') && null !== $object->getContainers()) { + $values_1 = []; + foreach ($object->getContainers() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Containers'] = $values_1; + } + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values_2 = []; + foreach ($object->getVolumes() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['Volumes'] = $values_2; + } + if ($object->isInitialized('buildCache') && null !== $object->getBuildCache()) { + $values_3 = []; + foreach ($object->getBuildCache() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['BuildCache'] = $values_3; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemDfGetResponse200::class => false]; + } + } +} else { + class SystemDfGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SystemDfGetResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SystemDfGetResponse200::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SystemDfGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('LayersSize', $data) && $data['LayersSize'] !== null) { + $object->setLayersSize($data['LayersSize']); + } + elseif (\array_key_exists('LayersSize', $data) && $data['LayersSize'] === null) { + $object->setLayersSize(null); + } + if (\array_key_exists('Images', $data) && $data['Images'] !== null) { + $values = []; + foreach ($data['Images'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ImageSummary::class, 'json', $context); + } + $object->setImages($values); + } + elseif (\array_key_exists('Images', $data) && $data['Images'] === null) { + $object->setImages(null); + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $values_1 = []; + foreach ($data['Containers'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ContainerSummary::class, 'json', $context); + } + $object->setContainers($values_1); + } + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); + } + if (\array_key_exists('Volumes', $data) && $data['Volumes'] !== null) { + $values_2 = []; + foreach ($data['Volumes'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\Volume::class, 'json', $context); + } + $object->setVolumes($values_2); + } + elseif (\array_key_exists('Volumes', $data) && $data['Volumes'] === null) { + $object->setVolumes(null); + } + if (\array_key_exists('BuildCache', $data) && $data['BuildCache'] !== null) { + $values_3 = []; + foreach ($data['BuildCache'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\BuildCache::class, 'json', $context); + } + $object->setBuildCache($values_3); + } + elseif (\array_key_exists('BuildCache', $data) && $data['BuildCache'] === null) { + $object->setBuildCache(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('layersSize') && null !== $object->getLayersSize()) { + $data['LayersSize'] = $object->getLayersSize(); + } + if ($object->isInitialized('images') && null !== $object->getImages()) { + $values = []; + foreach ($object->getImages() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Images'] = $values; + } + if ($object->isInitialized('containers') && null !== $object->getContainers()) { + $values_1 = []; + foreach ($object->getContainers() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Containers'] = $values_1; + } + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values_2 = []; + foreach ($object->getVolumes() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['Volumes'] = $values_2; + } + if ($object->isInitialized('buildCache') && null !== $object->getBuildCache()) { + $values_3 = []; + foreach ($object->getBuildCache() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $data['BuildCache'] = $values_3; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemDfGetResponse200::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SystemInfoDefaultAddressPoolsItemNormalizer.php b/generated/Normalizer/SystemInfoDefaultAddressPoolsItemNormalizer.php new file mode 100644 index 00000000..f3b4344e --- /dev/null +++ b/generated/Normalizer/SystemInfoDefaultAddressPoolsItemNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SystemInfoDefaultAddressPoolsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SystemInfoDefaultAddressPoolsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Base', $data) && $data['Base'] !== null) { + $object->setBase($data['Base']); + } + elseif (\array_key_exists('Base', $data) && $data['Base'] === null) { + $object->setBase(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('base') && null !== $object->getBase()) { + $data['Base'] = $object->getBase(); + } + if ($object->isInitialized('size') && null !== $object->getSize()) { + $data['Size'] = $object->getSize(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class => false]; + } + } +} else { + class SystemInfoDefaultAddressPoolsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SystemInfoDefaultAddressPoolsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Base', $data) && $data['Base'] !== null) { + $object->setBase($data['Base']); + } + elseif (\array_key_exists('Base', $data) && $data['Base'] === null) { + $object->setBase(null); + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('base') && null !== $object->getBase()) { + $data['Base'] = $object->getBase(); + } + if ($object->isInitialized('size') && null !== $object->getSize()) { + $data['Size'] = $object->getSize(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SystemInfoNormalizer.php b/generated/Normalizer/SystemInfoNormalizer.php new file mode 100644 index 00000000..bef663c5 --- /dev/null +++ b/generated/Normalizer/SystemInfoNormalizer.php @@ -0,0 +1,1360 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SystemInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SystemInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SystemInfo::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SystemInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $object->setContainers($data['Containers']); + } + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); + } + if (\array_key_exists('ContainersRunning', $data) && $data['ContainersRunning'] !== null) { + $object->setContainersRunning($data['ContainersRunning']); + } + elseif (\array_key_exists('ContainersRunning', $data) && $data['ContainersRunning'] === null) { + $object->setContainersRunning(null); + } + if (\array_key_exists('ContainersPaused', $data) && $data['ContainersPaused'] !== null) { + $object->setContainersPaused($data['ContainersPaused']); + } + elseif (\array_key_exists('ContainersPaused', $data) && $data['ContainersPaused'] === null) { + $object->setContainersPaused(null); + } + if (\array_key_exists('ContainersStopped', $data) && $data['ContainersStopped'] !== null) { + $object->setContainersStopped($data['ContainersStopped']); + } + elseif (\array_key_exists('ContainersStopped', $data) && $data['ContainersStopped'] === null) { + $object->setContainersStopped(null); + } + if (\array_key_exists('Images', $data) && $data['Images'] !== null) { + $object->setImages($data['Images']); + } + elseif (\array_key_exists('Images', $data) && $data['Images'] === null) { + $object->setImages(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('DriverStatus', $data) && $data['DriverStatus'] !== null) { + $values = []; + foreach ($data['DriverStatus'] as $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $value_1; + } + $values[] = $values_1; + } + $object->setDriverStatus($values); + } + elseif (\array_key_exists('DriverStatus', $data) && $data['DriverStatus'] === null) { + $object->setDriverStatus(null); + } + if (\array_key_exists('DockerRootDir', $data) && $data['DockerRootDir'] !== null) { + $object->setDockerRootDir($data['DockerRootDir']); + } + elseif (\array_key_exists('DockerRootDir', $data) && $data['DockerRootDir'] === null) { + $object->setDockerRootDir(null); + } + if (\array_key_exists('Plugins', $data) && $data['Plugins'] !== null) { + $object->setPlugins($this->denormalizer->denormalize($data['Plugins'], \Docker\API\Model\PluginsInfo::class, 'json', $context)); + } + elseif (\array_key_exists('Plugins', $data) && $data['Plugins'] === null) { + $object->setPlugins(null); + } + if (\array_key_exists('MemoryLimit', $data) && $data['MemoryLimit'] !== null) { + $object->setMemoryLimit($data['MemoryLimit']); + } + elseif (\array_key_exists('MemoryLimit', $data) && $data['MemoryLimit'] === null) { + $object->setMemoryLimit(null); + } + if (\array_key_exists('SwapLimit', $data) && $data['SwapLimit'] !== null) { + $object->setSwapLimit($data['SwapLimit']); + } + elseif (\array_key_exists('SwapLimit', $data) && $data['SwapLimit'] === null) { + $object->setSwapLimit(null); + } + if (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] !== null) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); + } + elseif (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] === null) { + $object->setKernelMemoryTCP(null); + } + if (\array_key_exists('CpuCfsPeriod', $data) && $data['CpuCfsPeriod'] !== null) { + $object->setCpuCfsPeriod($data['CpuCfsPeriod']); + } + elseif (\array_key_exists('CpuCfsPeriod', $data) && $data['CpuCfsPeriod'] === null) { + $object->setCpuCfsPeriod(null); + } + if (\array_key_exists('CpuCfsQuota', $data) && $data['CpuCfsQuota'] !== null) { + $object->setCpuCfsQuota($data['CpuCfsQuota']); + } + elseif (\array_key_exists('CpuCfsQuota', $data) && $data['CpuCfsQuota'] === null) { + $object->setCpuCfsQuota(null); + } + if (\array_key_exists('CPUShares', $data) && $data['CPUShares'] !== null) { + $object->setCPUShares($data['CPUShares']); + } + elseif (\array_key_exists('CPUShares', $data) && $data['CPUShares'] === null) { + $object->setCPUShares(null); + } + if (\array_key_exists('CPUSet', $data) && $data['CPUSet'] !== null) { + $object->setCPUSet($data['CPUSet']); + } + elseif (\array_key_exists('CPUSet', $data) && $data['CPUSet'] === null) { + $object->setCPUSet(null); + } + if (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] !== null) { + $object->setPidsLimit($data['PidsLimit']); + } + elseif (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] === null) { + $object->setPidsLimit(null); + } + if (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] !== null) { + $object->setOomKillDisable($data['OomKillDisable']); + } + elseif (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] === null) { + $object->setOomKillDisable(null); + } + if (\array_key_exists('IPv4Forwarding', $data) && $data['IPv4Forwarding'] !== null) { + $object->setIPv4Forwarding($data['IPv4Forwarding']); + } + elseif (\array_key_exists('IPv4Forwarding', $data) && $data['IPv4Forwarding'] === null) { + $object->setIPv4Forwarding(null); + } + if (\array_key_exists('BridgeNfIptables', $data) && $data['BridgeNfIptables'] !== null) { + $object->setBridgeNfIptables($data['BridgeNfIptables']); + } + elseif (\array_key_exists('BridgeNfIptables', $data) && $data['BridgeNfIptables'] === null) { + $object->setBridgeNfIptables(null); + } + if (\array_key_exists('BridgeNfIp6tables', $data) && $data['BridgeNfIp6tables'] !== null) { + $object->setBridgeNfIp6tables($data['BridgeNfIp6tables']); + } + elseif (\array_key_exists('BridgeNfIp6tables', $data) && $data['BridgeNfIp6tables'] === null) { + $object->setBridgeNfIp6tables(null); + } + if (\array_key_exists('Debug', $data) && $data['Debug'] !== null) { + $object->setDebug($data['Debug']); + } + elseif (\array_key_exists('Debug', $data) && $data['Debug'] === null) { + $object->setDebug(null); + } + if (\array_key_exists('NFd', $data) && $data['NFd'] !== null) { + $object->setNFd($data['NFd']); + } + elseif (\array_key_exists('NFd', $data) && $data['NFd'] === null) { + $object->setNFd(null); + } + if (\array_key_exists('NGoroutines', $data) && $data['NGoroutines'] !== null) { + $object->setNGoroutines($data['NGoroutines']); + } + elseif (\array_key_exists('NGoroutines', $data) && $data['NGoroutines'] === null) { + $object->setNGoroutines(null); + } + if (\array_key_exists('SystemTime', $data) && $data['SystemTime'] !== null) { + $object->setSystemTime($data['SystemTime']); + } + elseif (\array_key_exists('SystemTime', $data) && $data['SystemTime'] === null) { + $object->setSystemTime(null); + } + if (\array_key_exists('LoggingDriver', $data) && $data['LoggingDriver'] !== null) { + $object->setLoggingDriver($data['LoggingDriver']); + } + elseif (\array_key_exists('LoggingDriver', $data) && $data['LoggingDriver'] === null) { + $object->setLoggingDriver(null); + } + if (\array_key_exists('CgroupDriver', $data) && $data['CgroupDriver'] !== null) { + $object->setCgroupDriver($data['CgroupDriver']); + } + elseif (\array_key_exists('CgroupDriver', $data) && $data['CgroupDriver'] === null) { + $object->setCgroupDriver(null); + } + if (\array_key_exists('CgroupVersion', $data) && $data['CgroupVersion'] !== null) { + $object->setCgroupVersion($data['CgroupVersion']); + } + elseif (\array_key_exists('CgroupVersion', $data) && $data['CgroupVersion'] === null) { + $object->setCgroupVersion(null); + } + if (\array_key_exists('NEventsListener', $data) && $data['NEventsListener'] !== null) { + $object->setNEventsListener($data['NEventsListener']); + } + elseif (\array_key_exists('NEventsListener', $data) && $data['NEventsListener'] === null) { + $object->setNEventsListener(null); + } + if (\array_key_exists('KernelVersion', $data) && $data['KernelVersion'] !== null) { + $object->setKernelVersion($data['KernelVersion']); + } + elseif (\array_key_exists('KernelVersion', $data) && $data['KernelVersion'] === null) { + $object->setKernelVersion(null); + } + if (\array_key_exists('OperatingSystem', $data) && $data['OperatingSystem'] !== null) { + $object->setOperatingSystem($data['OperatingSystem']); + } + elseif (\array_key_exists('OperatingSystem', $data) && $data['OperatingSystem'] === null) { + $object->setOperatingSystem(null); + } + if (\array_key_exists('OSVersion', $data) && $data['OSVersion'] !== null) { + $object->setOSVersion($data['OSVersion']); + } + elseif (\array_key_exists('OSVersion', $data) && $data['OSVersion'] === null) { + $object->setOSVersion(null); + } + if (\array_key_exists('OSType', $data) && $data['OSType'] !== null) { + $object->setOSType($data['OSType']); + } + elseif (\array_key_exists('OSType', $data) && $data['OSType'] === null) { + $object->setOSType(null); + } + if (\array_key_exists('Architecture', $data) && $data['Architecture'] !== null) { + $object->setArchitecture($data['Architecture']); + } + elseif (\array_key_exists('Architecture', $data) && $data['Architecture'] === null) { + $object->setArchitecture(null); + } + if (\array_key_exists('NCPU', $data) && $data['NCPU'] !== null) { + $object->setNCPU($data['NCPU']); + } + elseif (\array_key_exists('NCPU', $data) && $data['NCPU'] === null) { + $object->setNCPU(null); + } + if (\array_key_exists('MemTotal', $data) && $data['MemTotal'] !== null) { + $object->setMemTotal($data['MemTotal']); + } + elseif (\array_key_exists('MemTotal', $data) && $data['MemTotal'] === null) { + $object->setMemTotal(null); + } + if (\array_key_exists('IndexServerAddress', $data) && $data['IndexServerAddress'] !== null) { + $object->setIndexServerAddress($data['IndexServerAddress']); + } + elseif (\array_key_exists('IndexServerAddress', $data) && $data['IndexServerAddress'] === null) { + $object->setIndexServerAddress(null); + } + if (\array_key_exists('RegistryConfig', $data) && $data['RegistryConfig'] !== null) { + $object->setRegistryConfig($this->denormalizer->denormalize($data['RegistryConfig'], \Docker\API\Model\RegistryServiceConfig::class, 'json', $context)); + } + elseif (\array_key_exists('RegistryConfig', $data) && $data['RegistryConfig'] === null) { + $object->setRegistryConfig(null); + } + if (\array_key_exists('GenericResources', $data) && $data['GenericResources'] !== null) { + $values_2 = []; + foreach ($data['GenericResources'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\GenericResourcesItem::class, 'json', $context); + } + $object->setGenericResources($values_2); + } + elseif (\array_key_exists('GenericResources', $data) && $data['GenericResources'] === null) { + $object->setGenericResources(null); + } + if (\array_key_exists('HttpProxy', $data) && $data['HttpProxy'] !== null) { + $object->setHttpProxy($data['HttpProxy']); + } + elseif (\array_key_exists('HttpProxy', $data) && $data['HttpProxy'] === null) { + $object->setHttpProxy(null); + } + if (\array_key_exists('HttpsProxy', $data) && $data['HttpsProxy'] !== null) { + $object->setHttpsProxy($data['HttpsProxy']); + } + elseif (\array_key_exists('HttpsProxy', $data) && $data['HttpsProxy'] === null) { + $object->setHttpsProxy(null); + } + if (\array_key_exists('NoProxy', $data) && $data['NoProxy'] !== null) { + $object->setNoProxy($data['NoProxy']); + } + elseif (\array_key_exists('NoProxy', $data) && $data['NoProxy'] === null) { + $object->setNoProxy(null); + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_3 = []; + foreach ($data['Labels'] as $value_3) { + $values_3[] = $value_3; + } + $object->setLabels($values_3); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('ExperimentalBuild', $data) && $data['ExperimentalBuild'] !== null) { + $object->setExperimentalBuild($data['ExperimentalBuild']); + } + elseif (\array_key_exists('ExperimentalBuild', $data) && $data['ExperimentalBuild'] === null) { + $object->setExperimentalBuild(null); + } + if (\array_key_exists('ServerVersion', $data) && $data['ServerVersion'] !== null) { + $object->setServerVersion($data['ServerVersion']); + } + elseif (\array_key_exists('ServerVersion', $data) && $data['ServerVersion'] === null) { + $object->setServerVersion(null); + } + if (\array_key_exists('Runtimes', $data) && $data['Runtimes'] !== null) { + $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Runtimes'] as $key => $value_4) { + $values_4[$key] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\Runtime::class, 'json', $context); + } + $object->setRuntimes($values_4); + } + elseif (\array_key_exists('Runtimes', $data) && $data['Runtimes'] === null) { + $object->setRuntimes(null); + } + if (\array_key_exists('DefaultRuntime', $data) && $data['DefaultRuntime'] !== null) { + $object->setDefaultRuntime($data['DefaultRuntime']); + } + elseif (\array_key_exists('DefaultRuntime', $data) && $data['DefaultRuntime'] === null) { + $object->setDefaultRuntime(null); + } + if (\array_key_exists('Swarm', $data) && $data['Swarm'] !== null) { + $object->setSwarm($this->denormalizer->denormalize($data['Swarm'], \Docker\API\Model\SwarmInfo::class, 'json', $context)); + } + elseif (\array_key_exists('Swarm', $data) && $data['Swarm'] === null) { + $object->setSwarm(null); + } + if (\array_key_exists('LiveRestoreEnabled', $data) && $data['LiveRestoreEnabled'] !== null) { + $object->setLiveRestoreEnabled($data['LiveRestoreEnabled']); + } + elseif (\array_key_exists('LiveRestoreEnabled', $data) && $data['LiveRestoreEnabled'] === null) { + $object->setLiveRestoreEnabled(null); + } + if (\array_key_exists('Isolation', $data) && $data['Isolation'] !== null) { + $object->setIsolation($data['Isolation']); + } + elseif (\array_key_exists('Isolation', $data) && $data['Isolation'] === null) { + $object->setIsolation(null); + } + if (\array_key_exists('InitBinary', $data) && $data['InitBinary'] !== null) { + $object->setInitBinary($data['InitBinary']); + } + elseif (\array_key_exists('InitBinary', $data) && $data['InitBinary'] === null) { + $object->setInitBinary(null); + } + if (\array_key_exists('ContainerdCommit', $data) && $data['ContainerdCommit'] !== null) { + $object->setContainerdCommit($this->denormalizer->denormalize($data['ContainerdCommit'], \Docker\API\Model\Commit::class, 'json', $context)); + } + elseif (\array_key_exists('ContainerdCommit', $data) && $data['ContainerdCommit'] === null) { + $object->setContainerdCommit(null); + } + if (\array_key_exists('RuncCommit', $data) && $data['RuncCommit'] !== null) { + $object->setRuncCommit($this->denormalizer->denormalize($data['RuncCommit'], \Docker\API\Model\Commit::class, 'json', $context)); + } + elseif (\array_key_exists('RuncCommit', $data) && $data['RuncCommit'] === null) { + $object->setRuncCommit(null); + } + if (\array_key_exists('InitCommit', $data) && $data['InitCommit'] !== null) { + $object->setInitCommit($this->denormalizer->denormalize($data['InitCommit'], \Docker\API\Model\Commit::class, 'json', $context)); + } + elseif (\array_key_exists('InitCommit', $data) && $data['InitCommit'] === null) { + $object->setInitCommit(null); + } + if (\array_key_exists('SecurityOptions', $data) && $data['SecurityOptions'] !== null) { + $values_5 = []; + foreach ($data['SecurityOptions'] as $value_5) { + $values_5[] = $value_5; + } + $object->setSecurityOptions($values_5); + } + elseif (\array_key_exists('SecurityOptions', $data) && $data['SecurityOptions'] === null) { + $object->setSecurityOptions(null); + } + if (\array_key_exists('ProductLicense', $data) && $data['ProductLicense'] !== null) { + $object->setProductLicense($data['ProductLicense']); + } + elseif (\array_key_exists('ProductLicense', $data) && $data['ProductLicense'] === null) { + $object->setProductLicense(null); + } + if (\array_key_exists('DefaultAddressPools', $data) && $data['DefaultAddressPools'] !== null) { + $values_6 = []; + foreach ($data['DefaultAddressPools'] as $value_6) { + $values_6[] = $this->denormalizer->denormalize($value_6, \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class, 'json', $context); + } + $object->setDefaultAddressPools($values_6); + } + elseif (\array_key_exists('DefaultAddressPools', $data) && $data['DefaultAddressPools'] === null) { + $object->setDefaultAddressPools(null); + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values_7 = []; + foreach ($data['Warnings'] as $value_7) { + $values_7[] = $value_7; + } + $object->setWarnings($values_7); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); + } + if (\array_key_exists('CDISpecDirs', $data) && $data['CDISpecDirs'] !== null) { + $values_8 = []; + foreach ($data['CDISpecDirs'] as $value_8) { + $values_8[] = $value_8; + } + $object->setCDISpecDirs($values_8); + } + elseif (\array_key_exists('CDISpecDirs', $data) && $data['CDISpecDirs'] === null) { + $object->setCDISpecDirs(null); + } + if (\array_key_exists('Containerd', $data) && $data['Containerd'] !== null) { + $object->setContainerd($this->denormalizer->denormalize($data['Containerd'], \Docker\API\Model\ContainerdInfo::class, 'json', $context)); + } + elseif (\array_key_exists('Containerd', $data) && $data['Containerd'] === null) { + $object->setContainerd(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('containers') && null !== $object->getContainers()) { + $data['Containers'] = $object->getContainers(); + } + if ($object->isInitialized('containersRunning') && null !== $object->getContainersRunning()) { + $data['ContainersRunning'] = $object->getContainersRunning(); + } + if ($object->isInitialized('containersPaused') && null !== $object->getContainersPaused()) { + $data['ContainersPaused'] = $object->getContainersPaused(); + } + if ($object->isInitialized('containersStopped') && null !== $object->getContainersStopped()) { + $data['ContainersStopped'] = $object->getContainersStopped(); + } + if ($object->isInitialized('images') && null !== $object->getImages()) { + $data['Images'] = $object->getImages(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('driverStatus') && null !== $object->getDriverStatus()) { + $values = []; + foreach ($object->getDriverStatus() as $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $value_1; + } + $values[] = $values_1; + } + $data['DriverStatus'] = $values; + } + if ($object->isInitialized('dockerRootDir') && null !== $object->getDockerRootDir()) { + $data['DockerRootDir'] = $object->getDockerRootDir(); + } + if ($object->isInitialized('plugins') && null !== $object->getPlugins()) { + $data['Plugins'] = $this->normalizer->normalize($object->getPlugins(), 'json', $context); + } + if ($object->isInitialized('memoryLimit') && null !== $object->getMemoryLimit()) { + $data['MemoryLimit'] = $object->getMemoryLimit(); + } + if ($object->isInitialized('swapLimit') && null !== $object->getSwapLimit()) { + $data['SwapLimit'] = $object->getSwapLimit(); + } + if ($object->isInitialized('kernelMemoryTCP') && null !== $object->getKernelMemoryTCP()) { + $data['KernelMemoryTCP'] = $object->getKernelMemoryTCP(); + } + if ($object->isInitialized('cpuCfsPeriod') && null !== $object->getCpuCfsPeriod()) { + $data['CpuCfsPeriod'] = $object->getCpuCfsPeriod(); + } + if ($object->isInitialized('cpuCfsQuota') && null !== $object->getCpuCfsQuota()) { + $data['CpuCfsQuota'] = $object->getCpuCfsQuota(); + } + if ($object->isInitialized('cPUShares') && null !== $object->getCPUShares()) { + $data['CPUShares'] = $object->getCPUShares(); + } + if ($object->isInitialized('cPUSet') && null !== $object->getCPUSet()) { + $data['CPUSet'] = $object->getCPUSet(); + } + if ($object->isInitialized('pidsLimit') && null !== $object->getPidsLimit()) { + $data['PidsLimit'] = $object->getPidsLimit(); + } + if ($object->isInitialized('oomKillDisable') && null !== $object->getOomKillDisable()) { + $data['OomKillDisable'] = $object->getOomKillDisable(); + } + if ($object->isInitialized('iPv4Forwarding') && null !== $object->getIPv4Forwarding()) { + $data['IPv4Forwarding'] = $object->getIPv4Forwarding(); + } + if ($object->isInitialized('bridgeNfIptables') && null !== $object->getBridgeNfIptables()) { + $data['BridgeNfIptables'] = $object->getBridgeNfIptables(); + } + if ($object->isInitialized('bridgeNfIp6tables') && null !== $object->getBridgeNfIp6tables()) { + $data['BridgeNfIp6tables'] = $object->getBridgeNfIp6tables(); + } + if ($object->isInitialized('debug') && null !== $object->getDebug()) { + $data['Debug'] = $object->getDebug(); + } + if ($object->isInitialized('nFd') && null !== $object->getNFd()) { + $data['NFd'] = $object->getNFd(); + } + if ($object->isInitialized('nGoroutines') && null !== $object->getNGoroutines()) { + $data['NGoroutines'] = $object->getNGoroutines(); + } + if ($object->isInitialized('systemTime') && null !== $object->getSystemTime()) { + $data['SystemTime'] = $object->getSystemTime(); + } + if ($object->isInitialized('loggingDriver') && null !== $object->getLoggingDriver()) { + $data['LoggingDriver'] = $object->getLoggingDriver(); + } + if ($object->isInitialized('cgroupDriver') && null !== $object->getCgroupDriver()) { + $data['CgroupDriver'] = $object->getCgroupDriver(); + } + if ($object->isInitialized('cgroupVersion') && null !== $object->getCgroupVersion()) { + $data['CgroupVersion'] = $object->getCgroupVersion(); + } + if ($object->isInitialized('nEventsListener') && null !== $object->getNEventsListener()) { + $data['NEventsListener'] = $object->getNEventsListener(); + } + if ($object->isInitialized('kernelVersion') && null !== $object->getKernelVersion()) { + $data['KernelVersion'] = $object->getKernelVersion(); + } + if ($object->isInitialized('operatingSystem') && null !== $object->getOperatingSystem()) { + $data['OperatingSystem'] = $object->getOperatingSystem(); + } + if ($object->isInitialized('oSVersion') && null !== $object->getOSVersion()) { + $data['OSVersion'] = $object->getOSVersion(); + } + if ($object->isInitialized('oSType') && null !== $object->getOSType()) { + $data['OSType'] = $object->getOSType(); + } + if ($object->isInitialized('architecture') && null !== $object->getArchitecture()) { + $data['Architecture'] = $object->getArchitecture(); + } + if ($object->isInitialized('nCPU') && null !== $object->getNCPU()) { + $data['NCPU'] = $object->getNCPU(); + } + if ($object->isInitialized('memTotal') && null !== $object->getMemTotal()) { + $data['MemTotal'] = $object->getMemTotal(); + } + if ($object->isInitialized('indexServerAddress') && null !== $object->getIndexServerAddress()) { + $data['IndexServerAddress'] = $object->getIndexServerAddress(); + } + if ($object->isInitialized('registryConfig') && null !== $object->getRegistryConfig()) { + $data['RegistryConfig'] = $this->normalizer->normalize($object->getRegistryConfig(), 'json', $context); + } + if ($object->isInitialized('genericResources') && null !== $object->getGenericResources()) { + $values_2 = []; + foreach ($object->getGenericResources() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['GenericResources'] = $values_2; + } + if ($object->isInitialized('httpProxy') && null !== $object->getHttpProxy()) { + $data['HttpProxy'] = $object->getHttpProxy(); + } + if ($object->isInitialized('httpsProxy') && null !== $object->getHttpsProxy()) { + $data['HttpsProxy'] = $object->getHttpsProxy(); + } + if ($object->isInitialized('noProxy') && null !== $object->getNoProxy()) { + $data['NoProxy'] = $object->getNoProxy(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_3 = []; + foreach ($object->getLabels() as $value_3) { + $values_3[] = $value_3; + } + $data['Labels'] = $values_3; + } + if ($object->isInitialized('experimentalBuild') && null !== $object->getExperimentalBuild()) { + $data['ExperimentalBuild'] = $object->getExperimentalBuild(); + } + if ($object->isInitialized('serverVersion') && null !== $object->getServerVersion()) { + $data['ServerVersion'] = $object->getServerVersion(); + } + if ($object->isInitialized('runtimes') && null !== $object->getRuntimes()) { + $values_4 = []; + foreach ($object->getRuntimes() as $key => $value_4) { + $values_4[$key] = $this->normalizer->normalize($value_4, 'json', $context); + } + $data['Runtimes'] = $values_4; + } + if ($object->isInitialized('defaultRuntime') && null !== $object->getDefaultRuntime()) { + $data['DefaultRuntime'] = $object->getDefaultRuntime(); + } + if ($object->isInitialized('swarm') && null !== $object->getSwarm()) { + $data['Swarm'] = $this->normalizer->normalize($object->getSwarm(), 'json', $context); + } + if ($object->isInitialized('liveRestoreEnabled') && null !== $object->getLiveRestoreEnabled()) { + $data['LiveRestoreEnabled'] = $object->getLiveRestoreEnabled(); + } + if ($object->isInitialized('isolation') && null !== $object->getIsolation()) { + $data['Isolation'] = $object->getIsolation(); + } + if ($object->isInitialized('initBinary') && null !== $object->getInitBinary()) { + $data['InitBinary'] = $object->getInitBinary(); + } + if ($object->isInitialized('containerdCommit') && null !== $object->getContainerdCommit()) { + $data['ContainerdCommit'] = $this->normalizer->normalize($object->getContainerdCommit(), 'json', $context); + } + if ($object->isInitialized('runcCommit') && null !== $object->getRuncCommit()) { + $data['RuncCommit'] = $this->normalizer->normalize($object->getRuncCommit(), 'json', $context); + } + if ($object->isInitialized('initCommit') && null !== $object->getInitCommit()) { + $data['InitCommit'] = $this->normalizer->normalize($object->getInitCommit(), 'json', $context); + } + if ($object->isInitialized('securityOptions') && null !== $object->getSecurityOptions()) { + $values_5 = []; + foreach ($object->getSecurityOptions() as $value_5) { + $values_5[] = $value_5; + } + $data['SecurityOptions'] = $values_5; + } + if ($object->isInitialized('productLicense') && null !== $object->getProductLicense()) { + $data['ProductLicense'] = $object->getProductLicense(); + } + if ($object->isInitialized('defaultAddressPools') && null !== $object->getDefaultAddressPools()) { + $values_6 = []; + foreach ($object->getDefaultAddressPools() as $value_6) { + $values_6[] = $this->normalizer->normalize($value_6, 'json', $context); + } + $data['DefaultAddressPools'] = $values_6; + } + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values_7 = []; + foreach ($object->getWarnings() as $value_7) { + $values_7[] = $value_7; + } + $data['Warnings'] = $values_7; + } + if ($object->isInitialized('cDISpecDirs') && null !== $object->getCDISpecDirs()) { + $values_8 = []; + foreach ($object->getCDISpecDirs() as $value_8) { + $values_8[] = $value_8; + } + $data['CDISpecDirs'] = $values_8; + } + if ($object->isInitialized('containerd') && null !== $object->getContainerd()) { + $data['Containerd'] = $this->normalizer->normalize($object->getContainerd(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemInfo::class => false]; + } + } +} else { + class SystemInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SystemInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SystemInfo::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SystemInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $object->setContainers($data['Containers']); + } + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); + } + if (\array_key_exists('ContainersRunning', $data) && $data['ContainersRunning'] !== null) { + $object->setContainersRunning($data['ContainersRunning']); + } + elseif (\array_key_exists('ContainersRunning', $data) && $data['ContainersRunning'] === null) { + $object->setContainersRunning(null); + } + if (\array_key_exists('ContainersPaused', $data) && $data['ContainersPaused'] !== null) { + $object->setContainersPaused($data['ContainersPaused']); + } + elseif (\array_key_exists('ContainersPaused', $data) && $data['ContainersPaused'] === null) { + $object->setContainersPaused(null); + } + if (\array_key_exists('ContainersStopped', $data) && $data['ContainersStopped'] !== null) { + $object->setContainersStopped($data['ContainersStopped']); + } + elseif (\array_key_exists('ContainersStopped', $data) && $data['ContainersStopped'] === null) { + $object->setContainersStopped(null); + } + if (\array_key_exists('Images', $data) && $data['Images'] !== null) { + $object->setImages($data['Images']); + } + elseif (\array_key_exists('Images', $data) && $data['Images'] === null) { + $object->setImages(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('DriverStatus', $data) && $data['DriverStatus'] !== null) { + $values = []; + foreach ($data['DriverStatus'] as $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $value_1; + } + $values[] = $values_1; + } + $object->setDriverStatus($values); + } + elseif (\array_key_exists('DriverStatus', $data) && $data['DriverStatus'] === null) { + $object->setDriverStatus(null); + } + if (\array_key_exists('DockerRootDir', $data) && $data['DockerRootDir'] !== null) { + $object->setDockerRootDir($data['DockerRootDir']); + } + elseif (\array_key_exists('DockerRootDir', $data) && $data['DockerRootDir'] === null) { + $object->setDockerRootDir(null); + } + if (\array_key_exists('Plugins', $data) && $data['Plugins'] !== null) { + $object->setPlugins($this->denormalizer->denormalize($data['Plugins'], \Docker\API\Model\PluginsInfo::class, 'json', $context)); + } + elseif (\array_key_exists('Plugins', $data) && $data['Plugins'] === null) { + $object->setPlugins(null); + } + if (\array_key_exists('MemoryLimit', $data) && $data['MemoryLimit'] !== null) { + $object->setMemoryLimit($data['MemoryLimit']); + } + elseif (\array_key_exists('MemoryLimit', $data) && $data['MemoryLimit'] === null) { + $object->setMemoryLimit(null); + } + if (\array_key_exists('SwapLimit', $data) && $data['SwapLimit'] !== null) { + $object->setSwapLimit($data['SwapLimit']); + } + elseif (\array_key_exists('SwapLimit', $data) && $data['SwapLimit'] === null) { + $object->setSwapLimit(null); + } + if (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] !== null) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); + } + elseif (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] === null) { + $object->setKernelMemoryTCP(null); + } + if (\array_key_exists('CpuCfsPeriod', $data) && $data['CpuCfsPeriod'] !== null) { + $object->setCpuCfsPeriod($data['CpuCfsPeriod']); + } + elseif (\array_key_exists('CpuCfsPeriod', $data) && $data['CpuCfsPeriod'] === null) { + $object->setCpuCfsPeriod(null); + } + if (\array_key_exists('CpuCfsQuota', $data) && $data['CpuCfsQuota'] !== null) { + $object->setCpuCfsQuota($data['CpuCfsQuota']); + } + elseif (\array_key_exists('CpuCfsQuota', $data) && $data['CpuCfsQuota'] === null) { + $object->setCpuCfsQuota(null); + } + if (\array_key_exists('CPUShares', $data) && $data['CPUShares'] !== null) { + $object->setCPUShares($data['CPUShares']); + } + elseif (\array_key_exists('CPUShares', $data) && $data['CPUShares'] === null) { + $object->setCPUShares(null); + } + if (\array_key_exists('CPUSet', $data) && $data['CPUSet'] !== null) { + $object->setCPUSet($data['CPUSet']); + } + elseif (\array_key_exists('CPUSet', $data) && $data['CPUSet'] === null) { + $object->setCPUSet(null); + } + if (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] !== null) { + $object->setPidsLimit($data['PidsLimit']); + } + elseif (\array_key_exists('PidsLimit', $data) && $data['PidsLimit'] === null) { + $object->setPidsLimit(null); + } + if (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] !== null) { + $object->setOomKillDisable($data['OomKillDisable']); + } + elseif (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] === null) { + $object->setOomKillDisable(null); + } + if (\array_key_exists('IPv4Forwarding', $data) && $data['IPv4Forwarding'] !== null) { + $object->setIPv4Forwarding($data['IPv4Forwarding']); + } + elseif (\array_key_exists('IPv4Forwarding', $data) && $data['IPv4Forwarding'] === null) { + $object->setIPv4Forwarding(null); + } + if (\array_key_exists('BridgeNfIptables', $data) && $data['BridgeNfIptables'] !== null) { + $object->setBridgeNfIptables($data['BridgeNfIptables']); + } + elseif (\array_key_exists('BridgeNfIptables', $data) && $data['BridgeNfIptables'] === null) { + $object->setBridgeNfIptables(null); + } + if (\array_key_exists('BridgeNfIp6tables', $data) && $data['BridgeNfIp6tables'] !== null) { + $object->setBridgeNfIp6tables($data['BridgeNfIp6tables']); + } + elseif (\array_key_exists('BridgeNfIp6tables', $data) && $data['BridgeNfIp6tables'] === null) { + $object->setBridgeNfIp6tables(null); + } + if (\array_key_exists('Debug', $data) && $data['Debug'] !== null) { + $object->setDebug($data['Debug']); + } + elseif (\array_key_exists('Debug', $data) && $data['Debug'] === null) { + $object->setDebug(null); + } + if (\array_key_exists('NFd', $data) && $data['NFd'] !== null) { + $object->setNFd($data['NFd']); + } + elseif (\array_key_exists('NFd', $data) && $data['NFd'] === null) { + $object->setNFd(null); + } + if (\array_key_exists('NGoroutines', $data) && $data['NGoroutines'] !== null) { + $object->setNGoroutines($data['NGoroutines']); + } + elseif (\array_key_exists('NGoroutines', $data) && $data['NGoroutines'] === null) { + $object->setNGoroutines(null); + } + if (\array_key_exists('SystemTime', $data) && $data['SystemTime'] !== null) { + $object->setSystemTime($data['SystemTime']); + } + elseif (\array_key_exists('SystemTime', $data) && $data['SystemTime'] === null) { + $object->setSystemTime(null); + } + if (\array_key_exists('LoggingDriver', $data) && $data['LoggingDriver'] !== null) { + $object->setLoggingDriver($data['LoggingDriver']); + } + elseif (\array_key_exists('LoggingDriver', $data) && $data['LoggingDriver'] === null) { + $object->setLoggingDriver(null); + } + if (\array_key_exists('CgroupDriver', $data) && $data['CgroupDriver'] !== null) { + $object->setCgroupDriver($data['CgroupDriver']); + } + elseif (\array_key_exists('CgroupDriver', $data) && $data['CgroupDriver'] === null) { + $object->setCgroupDriver(null); + } + if (\array_key_exists('CgroupVersion', $data) && $data['CgroupVersion'] !== null) { + $object->setCgroupVersion($data['CgroupVersion']); + } + elseif (\array_key_exists('CgroupVersion', $data) && $data['CgroupVersion'] === null) { + $object->setCgroupVersion(null); + } + if (\array_key_exists('NEventsListener', $data) && $data['NEventsListener'] !== null) { + $object->setNEventsListener($data['NEventsListener']); + } + elseif (\array_key_exists('NEventsListener', $data) && $data['NEventsListener'] === null) { + $object->setNEventsListener(null); + } + if (\array_key_exists('KernelVersion', $data) && $data['KernelVersion'] !== null) { + $object->setKernelVersion($data['KernelVersion']); + } + elseif (\array_key_exists('KernelVersion', $data) && $data['KernelVersion'] === null) { + $object->setKernelVersion(null); + } + if (\array_key_exists('OperatingSystem', $data) && $data['OperatingSystem'] !== null) { + $object->setOperatingSystem($data['OperatingSystem']); + } + elseif (\array_key_exists('OperatingSystem', $data) && $data['OperatingSystem'] === null) { + $object->setOperatingSystem(null); + } + if (\array_key_exists('OSVersion', $data) && $data['OSVersion'] !== null) { + $object->setOSVersion($data['OSVersion']); + } + elseif (\array_key_exists('OSVersion', $data) && $data['OSVersion'] === null) { + $object->setOSVersion(null); + } + if (\array_key_exists('OSType', $data) && $data['OSType'] !== null) { + $object->setOSType($data['OSType']); + } + elseif (\array_key_exists('OSType', $data) && $data['OSType'] === null) { + $object->setOSType(null); + } + if (\array_key_exists('Architecture', $data) && $data['Architecture'] !== null) { + $object->setArchitecture($data['Architecture']); + } + elseif (\array_key_exists('Architecture', $data) && $data['Architecture'] === null) { + $object->setArchitecture(null); + } + if (\array_key_exists('NCPU', $data) && $data['NCPU'] !== null) { + $object->setNCPU($data['NCPU']); + } + elseif (\array_key_exists('NCPU', $data) && $data['NCPU'] === null) { + $object->setNCPU(null); + } + if (\array_key_exists('MemTotal', $data) && $data['MemTotal'] !== null) { + $object->setMemTotal($data['MemTotal']); + } + elseif (\array_key_exists('MemTotal', $data) && $data['MemTotal'] === null) { + $object->setMemTotal(null); + } + if (\array_key_exists('IndexServerAddress', $data) && $data['IndexServerAddress'] !== null) { + $object->setIndexServerAddress($data['IndexServerAddress']); + } + elseif (\array_key_exists('IndexServerAddress', $data) && $data['IndexServerAddress'] === null) { + $object->setIndexServerAddress(null); + } + if (\array_key_exists('RegistryConfig', $data) && $data['RegistryConfig'] !== null) { + $object->setRegistryConfig($this->denormalizer->denormalize($data['RegistryConfig'], \Docker\API\Model\RegistryServiceConfig::class, 'json', $context)); + } + elseif (\array_key_exists('RegistryConfig', $data) && $data['RegistryConfig'] === null) { + $object->setRegistryConfig(null); + } + if (\array_key_exists('GenericResources', $data) && $data['GenericResources'] !== null) { + $values_2 = []; + foreach ($data['GenericResources'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\GenericResourcesItem::class, 'json', $context); + } + $object->setGenericResources($values_2); + } + elseif (\array_key_exists('GenericResources', $data) && $data['GenericResources'] === null) { + $object->setGenericResources(null); + } + if (\array_key_exists('HttpProxy', $data) && $data['HttpProxy'] !== null) { + $object->setHttpProxy($data['HttpProxy']); + } + elseif (\array_key_exists('HttpProxy', $data) && $data['HttpProxy'] === null) { + $object->setHttpProxy(null); + } + if (\array_key_exists('HttpsProxy', $data) && $data['HttpsProxy'] !== null) { + $object->setHttpsProxy($data['HttpsProxy']); + } + elseif (\array_key_exists('HttpsProxy', $data) && $data['HttpsProxy'] === null) { + $object->setHttpsProxy(null); + } + if (\array_key_exists('NoProxy', $data) && $data['NoProxy'] !== null) { + $object->setNoProxy($data['NoProxy']); + } + elseif (\array_key_exists('NoProxy', $data) && $data['NoProxy'] === null) { + $object->setNoProxy(null); + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_3 = []; + foreach ($data['Labels'] as $value_3) { + $values_3[] = $value_3; + } + $object->setLabels($values_3); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('ExperimentalBuild', $data) && $data['ExperimentalBuild'] !== null) { + $object->setExperimentalBuild($data['ExperimentalBuild']); + } + elseif (\array_key_exists('ExperimentalBuild', $data) && $data['ExperimentalBuild'] === null) { + $object->setExperimentalBuild(null); + } + if (\array_key_exists('ServerVersion', $data) && $data['ServerVersion'] !== null) { + $object->setServerVersion($data['ServerVersion']); + } + elseif (\array_key_exists('ServerVersion', $data) && $data['ServerVersion'] === null) { + $object->setServerVersion(null); + } + if (\array_key_exists('Runtimes', $data) && $data['Runtimes'] !== null) { + $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Runtimes'] as $key => $value_4) { + $values_4[$key] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\Runtime::class, 'json', $context); + } + $object->setRuntimes($values_4); + } + elseif (\array_key_exists('Runtimes', $data) && $data['Runtimes'] === null) { + $object->setRuntimes(null); + } + if (\array_key_exists('DefaultRuntime', $data) && $data['DefaultRuntime'] !== null) { + $object->setDefaultRuntime($data['DefaultRuntime']); + } + elseif (\array_key_exists('DefaultRuntime', $data) && $data['DefaultRuntime'] === null) { + $object->setDefaultRuntime(null); + } + if (\array_key_exists('Swarm', $data) && $data['Swarm'] !== null) { + $object->setSwarm($this->denormalizer->denormalize($data['Swarm'], \Docker\API\Model\SwarmInfo::class, 'json', $context)); + } + elseif (\array_key_exists('Swarm', $data) && $data['Swarm'] === null) { + $object->setSwarm(null); + } + if (\array_key_exists('LiveRestoreEnabled', $data) && $data['LiveRestoreEnabled'] !== null) { + $object->setLiveRestoreEnabled($data['LiveRestoreEnabled']); + } + elseif (\array_key_exists('LiveRestoreEnabled', $data) && $data['LiveRestoreEnabled'] === null) { + $object->setLiveRestoreEnabled(null); + } + if (\array_key_exists('Isolation', $data) && $data['Isolation'] !== null) { + $object->setIsolation($data['Isolation']); + } + elseif (\array_key_exists('Isolation', $data) && $data['Isolation'] === null) { + $object->setIsolation(null); + } + if (\array_key_exists('InitBinary', $data) && $data['InitBinary'] !== null) { + $object->setInitBinary($data['InitBinary']); + } + elseif (\array_key_exists('InitBinary', $data) && $data['InitBinary'] === null) { + $object->setInitBinary(null); + } + if (\array_key_exists('ContainerdCommit', $data) && $data['ContainerdCommit'] !== null) { + $object->setContainerdCommit($this->denormalizer->denormalize($data['ContainerdCommit'], \Docker\API\Model\Commit::class, 'json', $context)); + } + elseif (\array_key_exists('ContainerdCommit', $data) && $data['ContainerdCommit'] === null) { + $object->setContainerdCommit(null); + } + if (\array_key_exists('RuncCommit', $data) && $data['RuncCommit'] !== null) { + $object->setRuncCommit($this->denormalizer->denormalize($data['RuncCommit'], \Docker\API\Model\Commit::class, 'json', $context)); + } + elseif (\array_key_exists('RuncCommit', $data) && $data['RuncCommit'] === null) { + $object->setRuncCommit(null); + } + if (\array_key_exists('InitCommit', $data) && $data['InitCommit'] !== null) { + $object->setInitCommit($this->denormalizer->denormalize($data['InitCommit'], \Docker\API\Model\Commit::class, 'json', $context)); + } + elseif (\array_key_exists('InitCommit', $data) && $data['InitCommit'] === null) { + $object->setInitCommit(null); + } + if (\array_key_exists('SecurityOptions', $data) && $data['SecurityOptions'] !== null) { + $values_5 = []; + foreach ($data['SecurityOptions'] as $value_5) { + $values_5[] = $value_5; + } + $object->setSecurityOptions($values_5); + } + elseif (\array_key_exists('SecurityOptions', $data) && $data['SecurityOptions'] === null) { + $object->setSecurityOptions(null); + } + if (\array_key_exists('ProductLicense', $data) && $data['ProductLicense'] !== null) { + $object->setProductLicense($data['ProductLicense']); + } + elseif (\array_key_exists('ProductLicense', $data) && $data['ProductLicense'] === null) { + $object->setProductLicense(null); + } + if (\array_key_exists('DefaultAddressPools', $data) && $data['DefaultAddressPools'] !== null) { + $values_6 = []; + foreach ($data['DefaultAddressPools'] as $value_6) { + $values_6[] = $this->denormalizer->denormalize($value_6, \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class, 'json', $context); + } + $object->setDefaultAddressPools($values_6); + } + elseif (\array_key_exists('DefaultAddressPools', $data) && $data['DefaultAddressPools'] === null) { + $object->setDefaultAddressPools(null); + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values_7 = []; + foreach ($data['Warnings'] as $value_7) { + $values_7[] = $value_7; + } + $object->setWarnings($values_7); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); + } + if (\array_key_exists('CDISpecDirs', $data) && $data['CDISpecDirs'] !== null) { + $values_8 = []; + foreach ($data['CDISpecDirs'] as $value_8) { + $values_8[] = $value_8; + } + $object->setCDISpecDirs($values_8); + } + elseif (\array_key_exists('CDISpecDirs', $data) && $data['CDISpecDirs'] === null) { + $object->setCDISpecDirs(null); + } + if (\array_key_exists('Containerd', $data) && $data['Containerd'] !== null) { + $object->setContainerd($this->denormalizer->denormalize($data['Containerd'], \Docker\API\Model\ContainerdInfo::class, 'json', $context)); + } + elseif (\array_key_exists('Containerd', $data) && $data['Containerd'] === null) { + $object->setContainerd(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('containers') && null !== $object->getContainers()) { + $data['Containers'] = $object->getContainers(); + } + if ($object->isInitialized('containersRunning') && null !== $object->getContainersRunning()) { + $data['ContainersRunning'] = $object->getContainersRunning(); + } + if ($object->isInitialized('containersPaused') && null !== $object->getContainersPaused()) { + $data['ContainersPaused'] = $object->getContainersPaused(); + } + if ($object->isInitialized('containersStopped') && null !== $object->getContainersStopped()) { + $data['ContainersStopped'] = $object->getContainersStopped(); + } + if ($object->isInitialized('images') && null !== $object->getImages()) { + $data['Images'] = $object->getImages(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('driverStatus') && null !== $object->getDriverStatus()) { + $values = []; + foreach ($object->getDriverStatus() as $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $value_1; + } + $values[] = $values_1; + } + $data['DriverStatus'] = $values; + } + if ($object->isInitialized('dockerRootDir') && null !== $object->getDockerRootDir()) { + $data['DockerRootDir'] = $object->getDockerRootDir(); + } + if ($object->isInitialized('plugins') && null !== $object->getPlugins()) { + $data['Plugins'] = $this->normalizer->normalize($object->getPlugins(), 'json', $context); + } + if ($object->isInitialized('memoryLimit') && null !== $object->getMemoryLimit()) { + $data['MemoryLimit'] = $object->getMemoryLimit(); + } + if ($object->isInitialized('swapLimit') && null !== $object->getSwapLimit()) { + $data['SwapLimit'] = $object->getSwapLimit(); + } + if ($object->isInitialized('kernelMemoryTCP') && null !== $object->getKernelMemoryTCP()) { + $data['KernelMemoryTCP'] = $object->getKernelMemoryTCP(); + } + if ($object->isInitialized('cpuCfsPeriod') && null !== $object->getCpuCfsPeriod()) { + $data['CpuCfsPeriod'] = $object->getCpuCfsPeriod(); + } + if ($object->isInitialized('cpuCfsQuota') && null !== $object->getCpuCfsQuota()) { + $data['CpuCfsQuota'] = $object->getCpuCfsQuota(); + } + if ($object->isInitialized('cPUShares') && null !== $object->getCPUShares()) { + $data['CPUShares'] = $object->getCPUShares(); + } + if ($object->isInitialized('cPUSet') && null !== $object->getCPUSet()) { + $data['CPUSet'] = $object->getCPUSet(); + } + if ($object->isInitialized('pidsLimit') && null !== $object->getPidsLimit()) { + $data['PidsLimit'] = $object->getPidsLimit(); + } + if ($object->isInitialized('oomKillDisable') && null !== $object->getOomKillDisable()) { + $data['OomKillDisable'] = $object->getOomKillDisable(); + } + if ($object->isInitialized('iPv4Forwarding') && null !== $object->getIPv4Forwarding()) { + $data['IPv4Forwarding'] = $object->getIPv4Forwarding(); + } + if ($object->isInitialized('bridgeNfIptables') && null !== $object->getBridgeNfIptables()) { + $data['BridgeNfIptables'] = $object->getBridgeNfIptables(); + } + if ($object->isInitialized('bridgeNfIp6tables') && null !== $object->getBridgeNfIp6tables()) { + $data['BridgeNfIp6tables'] = $object->getBridgeNfIp6tables(); + } + if ($object->isInitialized('debug') && null !== $object->getDebug()) { + $data['Debug'] = $object->getDebug(); + } + if ($object->isInitialized('nFd') && null !== $object->getNFd()) { + $data['NFd'] = $object->getNFd(); + } + if ($object->isInitialized('nGoroutines') && null !== $object->getNGoroutines()) { + $data['NGoroutines'] = $object->getNGoroutines(); + } + if ($object->isInitialized('systemTime') && null !== $object->getSystemTime()) { + $data['SystemTime'] = $object->getSystemTime(); + } + if ($object->isInitialized('loggingDriver') && null !== $object->getLoggingDriver()) { + $data['LoggingDriver'] = $object->getLoggingDriver(); + } + if ($object->isInitialized('cgroupDriver') && null !== $object->getCgroupDriver()) { + $data['CgroupDriver'] = $object->getCgroupDriver(); + } + if ($object->isInitialized('cgroupVersion') && null !== $object->getCgroupVersion()) { + $data['CgroupVersion'] = $object->getCgroupVersion(); + } + if ($object->isInitialized('nEventsListener') && null !== $object->getNEventsListener()) { + $data['NEventsListener'] = $object->getNEventsListener(); + } + if ($object->isInitialized('kernelVersion') && null !== $object->getKernelVersion()) { + $data['KernelVersion'] = $object->getKernelVersion(); + } + if ($object->isInitialized('operatingSystem') && null !== $object->getOperatingSystem()) { + $data['OperatingSystem'] = $object->getOperatingSystem(); + } + if ($object->isInitialized('oSVersion') && null !== $object->getOSVersion()) { + $data['OSVersion'] = $object->getOSVersion(); + } + if ($object->isInitialized('oSType') && null !== $object->getOSType()) { + $data['OSType'] = $object->getOSType(); + } + if ($object->isInitialized('architecture') && null !== $object->getArchitecture()) { + $data['Architecture'] = $object->getArchitecture(); + } + if ($object->isInitialized('nCPU') && null !== $object->getNCPU()) { + $data['NCPU'] = $object->getNCPU(); + } + if ($object->isInitialized('memTotal') && null !== $object->getMemTotal()) { + $data['MemTotal'] = $object->getMemTotal(); + } + if ($object->isInitialized('indexServerAddress') && null !== $object->getIndexServerAddress()) { + $data['IndexServerAddress'] = $object->getIndexServerAddress(); + } + if ($object->isInitialized('registryConfig') && null !== $object->getRegistryConfig()) { + $data['RegistryConfig'] = $this->normalizer->normalize($object->getRegistryConfig(), 'json', $context); + } + if ($object->isInitialized('genericResources') && null !== $object->getGenericResources()) { + $values_2 = []; + foreach ($object->getGenericResources() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['GenericResources'] = $values_2; + } + if ($object->isInitialized('httpProxy') && null !== $object->getHttpProxy()) { + $data['HttpProxy'] = $object->getHttpProxy(); + } + if ($object->isInitialized('httpsProxy') && null !== $object->getHttpsProxy()) { + $data['HttpsProxy'] = $object->getHttpsProxy(); + } + if ($object->isInitialized('noProxy') && null !== $object->getNoProxy()) { + $data['NoProxy'] = $object->getNoProxy(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_3 = []; + foreach ($object->getLabels() as $value_3) { + $values_3[] = $value_3; + } + $data['Labels'] = $values_3; + } + if ($object->isInitialized('experimentalBuild') && null !== $object->getExperimentalBuild()) { + $data['ExperimentalBuild'] = $object->getExperimentalBuild(); + } + if ($object->isInitialized('serverVersion') && null !== $object->getServerVersion()) { + $data['ServerVersion'] = $object->getServerVersion(); + } + if ($object->isInitialized('runtimes') && null !== $object->getRuntimes()) { + $values_4 = []; + foreach ($object->getRuntimes() as $key => $value_4) { + $values_4[$key] = $this->normalizer->normalize($value_4, 'json', $context); + } + $data['Runtimes'] = $values_4; + } + if ($object->isInitialized('defaultRuntime') && null !== $object->getDefaultRuntime()) { + $data['DefaultRuntime'] = $object->getDefaultRuntime(); + } + if ($object->isInitialized('swarm') && null !== $object->getSwarm()) { + $data['Swarm'] = $this->normalizer->normalize($object->getSwarm(), 'json', $context); + } + if ($object->isInitialized('liveRestoreEnabled') && null !== $object->getLiveRestoreEnabled()) { + $data['LiveRestoreEnabled'] = $object->getLiveRestoreEnabled(); + } + if ($object->isInitialized('isolation') && null !== $object->getIsolation()) { + $data['Isolation'] = $object->getIsolation(); + } + if ($object->isInitialized('initBinary') && null !== $object->getInitBinary()) { + $data['InitBinary'] = $object->getInitBinary(); + } + if ($object->isInitialized('containerdCommit') && null !== $object->getContainerdCommit()) { + $data['ContainerdCommit'] = $this->normalizer->normalize($object->getContainerdCommit(), 'json', $context); + } + if ($object->isInitialized('runcCommit') && null !== $object->getRuncCommit()) { + $data['RuncCommit'] = $this->normalizer->normalize($object->getRuncCommit(), 'json', $context); + } + if ($object->isInitialized('initCommit') && null !== $object->getInitCommit()) { + $data['InitCommit'] = $this->normalizer->normalize($object->getInitCommit(), 'json', $context); + } + if ($object->isInitialized('securityOptions') && null !== $object->getSecurityOptions()) { + $values_5 = []; + foreach ($object->getSecurityOptions() as $value_5) { + $values_5[] = $value_5; + } + $data['SecurityOptions'] = $values_5; + } + if ($object->isInitialized('productLicense') && null !== $object->getProductLicense()) { + $data['ProductLicense'] = $object->getProductLicense(); + } + if ($object->isInitialized('defaultAddressPools') && null !== $object->getDefaultAddressPools()) { + $values_6 = []; + foreach ($object->getDefaultAddressPools() as $value_6) { + $values_6[] = $this->normalizer->normalize($value_6, 'json', $context); + } + $data['DefaultAddressPools'] = $values_6; + } + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values_7 = []; + foreach ($object->getWarnings() as $value_7) { + $values_7[] = $value_7; + } + $data['Warnings'] = $values_7; + } + if ($object->isInitialized('cDISpecDirs') && null !== $object->getCDISpecDirs()) { + $values_8 = []; + foreach ($object->getCDISpecDirs() as $value_8) { + $values_8[] = $value_8; + } + $data['CDISpecDirs'] = $values_8; + } + if ($object->isInitialized('containerd') && null !== $object->getContainerd()) { + $data['Containerd'] = $this->normalizer->normalize($object->getContainerd(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemInfo::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SystemInformationNormalizer.php b/generated/Normalizer/SystemInformationNormalizer.php deleted file mode 100644 index c7064cf5..00000000 --- a/generated/Normalizer/SystemInformationNormalizer.php +++ /dev/null @@ -1,432 +0,0 @@ -setArchitecture($data->{'Architecture'}); - } - if (property_exists($data, 'ClusterStore')) { - $object->setClusterStore($data->{'ClusterStore'}); - } - if (property_exists($data, 'CgroupDriver')) { - $object->setCgroupDriver($data->{'CgroupDriver'}); - } - if (property_exists($data, 'Containers')) { - $object->setContainers($data->{'Containers'}); - } - if (property_exists($data, 'ContainersRunning')) { - $object->setContainersRunning($data->{'ContainersRunning'}); - } - if (property_exists($data, 'ContainersStopped')) { - $object->setContainersStopped($data->{'ContainersStopped'}); - } - if (property_exists($data, 'ContainersPaused')) { - $object->setContainersPaused($data->{'ContainersPaused'}); - } - if (property_exists($data, 'CpuCfsPeriod')) { - $object->setCpuCfsPeriod($data->{'CpuCfsPeriod'}); - } - if (property_exists($data, 'CpuCfsQuota')) { - $object->setCpuCfsQuota($data->{'CpuCfsQuota'}); - } - if (property_exists($data, 'Debug')) { - $object->setDebug($data->{'Debug'}); - } - if (property_exists($data, 'DiscoveryBackend')) { - $object->setDiscoveryBackend($data->{'DiscoveryBackend'}); - } - if (property_exists($data, 'DockerRootDir')) { - $object->setDockerRootDir($data->{'DockerRootDir'}); - } - if (property_exists($data, 'Driver')) { - $object->setDriver($data->{'Driver'}); - } - if (property_exists($data, 'DriverStatus')) { - $value = $data->{'DriverStatus'}; - if (is_array($data->{'DriverStatus'})) { - $values = []; - foreach ($data->{'DriverStatus'} as $value_1) { - $value_2 = $value_1; - if (is_array($value_1)) { - $values_1 = []; - foreach ($value_1 as $value_3) { - $values_1[] = $value_3; - } - $value_2 = $values_1; - } - if (is_null($value_1)) { - $value_2 = $value_1; - } - $values[] = $value_2; - } - $value = $values; - } - if (is_null($data->{'DriverStatus'})) { - $value = $data->{'DriverStatus'}; - } - $object->setDriverStatus($value); - } - if (property_exists($data, 'SystemStatus')) { - $value_4 = $data->{'SystemStatus'}; - if (is_array($data->{'SystemStatus'})) { - $values_2 = []; - foreach ($data->{'SystemStatus'} as $value_5) { - $value_6 = $value_5; - if (is_array($value_5)) { - $values_3 = []; - foreach ($value_5 as $value_7) { - $values_3[] = $value_7; - } - $value_6 = $values_3; - } - if (is_null($value_5)) { - $value_6 = $value_5; - } - $values_2[] = $value_6; - } - $value_4 = $values_2; - } - if (is_null($data->{'SystemStatus'})) { - $value_4 = $data->{'SystemStatus'}; - } - $object->setSystemStatus($value_4); - } - if (property_exists($data, 'ExperimentalBuild')) { - $object->setExperimentalBuild($data->{'ExperimentalBuild'}); - } - if (property_exists($data, 'HttpProxy')) { - $object->setHttpProxy($data->{'HttpProxy'}); - } - if (property_exists($data, 'HttpsProxy')) { - $object->setHttpsProxy($data->{'HttpsProxy'}); - } - if (property_exists($data, 'ID')) { - $object->setID($data->{'ID'}); - } - if (property_exists($data, 'IPv4Forwarding')) { - $object->setIPv4Forwarding($data->{'IPv4Forwarding'}); - } - if (property_exists($data, 'Images')) { - $object->setImages($data->{'Images'}); - } - if (property_exists($data, 'IndexServerAddress')) { - $object->setIndexServerAddress($data->{'IndexServerAddress'}); - } - if (property_exists($data, 'InitPath')) { - $object->setInitPath($data->{'InitPath'}); - } - if (property_exists($data, 'InitSha1')) { - $object->setInitSha1($data->{'InitSha1'}); - } - if (property_exists($data, 'KernelMemory')) { - $object->setKernelMemory($data->{'KernelMemory'}); - } - if (property_exists($data, 'KernelVersion')) { - $object->setKernelVersion($data->{'KernelVersion'}); - } - if (property_exists($data, 'Labels')) { - $value_8 = $data->{'Labels'}; - if (is_object($data->{'Labels'})) { - $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_9) { - $values_4[$key] = $value_9; - } - $value_8 = $values_4; - } - if (is_null($data->{'Labels'})) { - $value_8 = $data->{'Labels'}; - } - $object->setLabels($value_8); - } - if (property_exists($data, 'MemTotal')) { - $object->setMemTotal($data->{'MemTotal'}); - } - if (property_exists($data, 'MemoryLimit')) { - $object->setMemoryLimit($data->{'MemoryLimit'}); - } - if (property_exists($data, 'NCPU')) { - $object->setNCPU($data->{'NCPU'}); - } - if (property_exists($data, 'NEventsListener')) { - $object->setNEventsListener($data->{'NEventsListener'}); - } - if (property_exists($data, 'NFd')) { - $object->setNFd($data->{'NFd'}); - } - if (property_exists($data, 'NGoroutines')) { - $object->setNGoroutines($data->{'NGoroutines'}); - } - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'NoProxy')) { - $object->setNoProxy($data->{'NoProxy'}); - } - if (property_exists($data, 'OomKillDisable')) { - $object->setOomKillDisable($data->{'OomKillDisable'}); - } - if (property_exists($data, 'OSType')) { - $object->setOSType($data->{'OSType'}); - } - if (property_exists($data, 'OperatingSystem')) { - $object->setOperatingSystem($data->{'OperatingSystem'}); - } - if (property_exists($data, 'RegistryConfig')) { - $object->setRegistryConfig($this->serializer->denormalize($data->{'RegistryConfig'}, 'Docker\\API\\Model\\RegistryConfig', 'raw', $context)); - } - if (property_exists($data, 'SecurityOptions')) { - $value_10 = $data->{'SecurityOptions'}; - if (is_array($data->{'SecurityOptions'})) { - $values_5 = []; - foreach ($data->{'SecurityOptions'} as $value_11) { - $values_5[] = $value_11; - } - $value_10 = $values_5; - } - if (is_null($data->{'SecurityOptions'})) { - $value_10 = $data->{'SecurityOptions'}; - } - $object->setSecurityOptions($value_10); - } - if (property_exists($data, 'SwapLimit')) { - $object->setSwapLimit($data->{'SwapLimit'}); - } - if (property_exists($data, 'SystemTime')) { - $object->setSystemTime($data->{'SystemTime'}); - } - if (property_exists($data, 'ServerVersion')) { - $object->setServerVersion($data->{'ServerVersion'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getArchitecture()) { - $data->{'Architecture'} = $object->getArchitecture(); - } - if (null !== $object->getClusterStore()) { - $data->{'ClusterStore'} = $object->getClusterStore(); - } - if (null !== $object->getCgroupDriver()) { - $data->{'CgroupDriver'} = $object->getCgroupDriver(); - } - if (null !== $object->getContainers()) { - $data->{'Containers'} = $object->getContainers(); - } - if (null !== $object->getContainersRunning()) { - $data->{'ContainersRunning'} = $object->getContainersRunning(); - } - if (null !== $object->getContainersStopped()) { - $data->{'ContainersStopped'} = $object->getContainersStopped(); - } - if (null !== $object->getContainersPaused()) { - $data->{'ContainersPaused'} = $object->getContainersPaused(); - } - if (null !== $object->getCpuCfsPeriod()) { - $data->{'CpuCfsPeriod'} = $object->getCpuCfsPeriod(); - } - if (null !== $object->getCpuCfsQuota()) { - $data->{'CpuCfsQuota'} = $object->getCpuCfsQuota(); - } - if (null !== $object->getDebug()) { - $data->{'Debug'} = $object->getDebug(); - } - if (null !== $object->getDiscoveryBackend()) { - $data->{'DiscoveryBackend'} = $object->getDiscoveryBackend(); - } - if (null !== $object->getDockerRootDir()) { - $data->{'DockerRootDir'} = $object->getDockerRootDir(); - } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); - } - $value = $object->getDriverStatus(); - if (is_array($object->getDriverStatus())) { - $values = []; - foreach ($object->getDriverStatus() as $value_1) { - $value_2 = $value_1; - if (is_array($value_1)) { - $values_1 = []; - foreach ($value_1 as $value_3) { - $values_1[] = $value_3; - } - $value_2 = $values_1; - } - if (is_null($value_1)) { - $value_2 = $value_1; - } - $values[] = $value_2; - } - $value = $values; - } - if (is_null($object->getDriverStatus())) { - $value = $object->getDriverStatus(); - } - $data->{'DriverStatus'} = $value; - $value_4 = $object->getSystemStatus(); - if (is_array($object->getSystemStatus())) { - $values_2 = []; - foreach ($object->getSystemStatus() as $value_5) { - $value_6 = $value_5; - if (is_array($value_5)) { - $values_3 = []; - foreach ($value_5 as $value_7) { - $values_3[] = $value_7; - } - $value_6 = $values_3; - } - if (is_null($value_5)) { - $value_6 = $value_5; - } - $values_2[] = $value_6; - } - $value_4 = $values_2; - } - if (is_null($object->getSystemStatus())) { - $value_4 = $object->getSystemStatus(); - } - $data->{'SystemStatus'} = $value_4; - if (null !== $object->getExperimentalBuild()) { - $data->{'ExperimentalBuild'} = $object->getExperimentalBuild(); - } - if (null !== $object->getHttpProxy()) { - $data->{'HttpProxy'} = $object->getHttpProxy(); - } - if (null !== $object->getHttpsProxy()) { - $data->{'HttpsProxy'} = $object->getHttpsProxy(); - } - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); - } - if (null !== $object->getIPv4Forwarding()) { - $data->{'IPv4Forwarding'} = $object->getIPv4Forwarding(); - } - if (null !== $object->getImages()) { - $data->{'Images'} = $object->getImages(); - } - if (null !== $object->getIndexServerAddress()) { - $data->{'IndexServerAddress'} = $object->getIndexServerAddress(); - } - if (null !== $object->getInitPath()) { - $data->{'InitPath'} = $object->getInitPath(); - } - if (null !== $object->getInitSha1()) { - $data->{'InitSha1'} = $object->getInitSha1(); - } - if (null !== $object->getKernelMemory()) { - $data->{'KernelMemory'} = $object->getKernelMemory(); - } - if (null !== $object->getKernelVersion()) { - $data->{'KernelVersion'} = $object->getKernelVersion(); - } - $value_8 = $object->getLabels(); - if (is_object($object->getLabels())) { - $values_4 = new \stdClass(); - foreach ($object->getLabels() as $key => $value_9) { - $values_4->{$key} = $value_9; - } - $value_8 = $values_4; - } - if (is_null($object->getLabels())) { - $value_8 = $object->getLabels(); - } - $data->{'Labels'} = $value_8; - if (null !== $object->getMemTotal()) { - $data->{'MemTotal'} = $object->getMemTotal(); - } - if (null !== $object->getMemoryLimit()) { - $data->{'MemoryLimit'} = $object->getMemoryLimit(); - } - if (null !== $object->getNCPU()) { - $data->{'NCPU'} = $object->getNCPU(); - } - if (null !== $object->getNEventsListener()) { - $data->{'NEventsListener'} = $object->getNEventsListener(); - } - if (null !== $object->getNFd()) { - $data->{'NFd'} = $object->getNFd(); - } - if (null !== $object->getNGoroutines()) { - $data->{'NGoroutines'} = $object->getNGoroutines(); - } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getNoProxy()) { - $data->{'NoProxy'} = $object->getNoProxy(); - } - if (null !== $object->getOomKillDisable()) { - $data->{'OomKillDisable'} = $object->getOomKillDisable(); - } - if (null !== $object->getOSType()) { - $data->{'OSType'} = $object->getOSType(); - } - if (null !== $object->getOperatingSystem()) { - $data->{'OperatingSystem'} = $object->getOperatingSystem(); - } - if (null !== $object->getRegistryConfig()) { - $data->{'RegistryConfig'} = json_decode($this->serializer->normalize($object->getRegistryConfig(), 'raw', $context)); - } - $value_10 = $object->getSecurityOptions(); - if (is_array($object->getSecurityOptions())) { - $values_5 = []; - foreach ($object->getSecurityOptions() as $value_11) { - $values_5[] = $value_11; - } - $value_10 = $values_5; - } - if (is_null($object->getSecurityOptions())) { - $value_10 = $object->getSecurityOptions(); - } - $data->{'SecurityOptions'} = $value_10; - if (null !== $object->getSwapLimit()) { - $data->{'SwapLimit'} = $object->getSwapLimit(); - } - if (null !== $object->getSystemTime()) { - $data->{'SystemTime'} = $object->getSystemTime(); - } - if (null !== $object->getServerVersion()) { - $data->{'ServerVersion'} = $object->getServerVersion(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/SystemVersionComponentsItemNormalizer.php b/generated/Normalizer/SystemVersionComponentsItemNormalizer.php new file mode 100644 index 00000000..785c84af --- /dev/null +++ b/generated/Normalizer/SystemVersionComponentsItemNormalizer.php @@ -0,0 +1,146 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SystemVersionComponentsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SystemVersionComponentsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SystemVersionComponentsItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SystemVersionComponentsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($data['Version']); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('Details', $data) && $data['Details'] !== null) { + $object->setDetails($data['Details']); + } + elseif (\array_key_exists('Details', $data) && $data['Details'] === null) { + $object->setDetails(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Name'] = $object->getName(); + $data['Version'] = $object->getVersion(); + if ($object->isInitialized('details') && null !== $object->getDetails()) { + $data['Details'] = $object->getDetails(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemVersionComponentsItem::class => false]; + } + } +} else { + class SystemVersionComponentsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SystemVersionComponentsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SystemVersionComponentsItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SystemVersionComponentsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($data['Version']); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('Details', $data) && $data['Details'] !== null) { + $object->setDetails($data['Details']); + } + elseif (\array_key_exists('Details', $data) && $data['Details'] === null) { + $object->setDetails(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Name'] = $object->getName(); + $data['Version'] = $object->getVersion(); + if ($object->isInitialized('details') && null !== $object->getDetails()) { + $data['Details'] = $object->getDetails(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemVersionComponentsItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SystemVersionNormalizer.php b/generated/Normalizer/SystemVersionNormalizer.php new file mode 100644 index 00000000..1d00188d --- /dev/null +++ b/generated/Normalizer/SystemVersionNormalizer.php @@ -0,0 +1,332 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SystemVersionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SystemVersion::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SystemVersion::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SystemVersion(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Platform', $data) && $data['Platform'] !== null) { + $object->setPlatform($this->denormalizer->denormalize($data['Platform'], \Docker\API\Model\SystemVersionPlatform::class, 'json', $context)); + } + elseif (\array_key_exists('Platform', $data) && $data['Platform'] === null) { + $object->setPlatform(null); + } + if (\array_key_exists('Components', $data) && $data['Components'] !== null) { + $values = []; + foreach ($data['Components'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\SystemVersionComponentsItem::class, 'json', $context); + } + $object->setComponents($values); + } + elseif (\array_key_exists('Components', $data) && $data['Components'] === null) { + $object->setComponents(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($data['Version']); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('ApiVersion', $data) && $data['ApiVersion'] !== null) { + $object->setApiVersion($data['ApiVersion']); + } + elseif (\array_key_exists('ApiVersion', $data) && $data['ApiVersion'] === null) { + $object->setApiVersion(null); + } + if (\array_key_exists('MinAPIVersion', $data) && $data['MinAPIVersion'] !== null) { + $object->setMinAPIVersion($data['MinAPIVersion']); + } + elseif (\array_key_exists('MinAPIVersion', $data) && $data['MinAPIVersion'] === null) { + $object->setMinAPIVersion(null); + } + if (\array_key_exists('GitCommit', $data) && $data['GitCommit'] !== null) { + $object->setGitCommit($data['GitCommit']); + } + elseif (\array_key_exists('GitCommit', $data) && $data['GitCommit'] === null) { + $object->setGitCommit(null); + } + if (\array_key_exists('GoVersion', $data) && $data['GoVersion'] !== null) { + $object->setGoVersion($data['GoVersion']); + } + elseif (\array_key_exists('GoVersion', $data) && $data['GoVersion'] === null) { + $object->setGoVersion(null); + } + if (\array_key_exists('Os', $data) && $data['Os'] !== null) { + $object->setOs($data['Os']); + } + elseif (\array_key_exists('Os', $data) && $data['Os'] === null) { + $object->setOs(null); + } + if (\array_key_exists('Arch', $data) && $data['Arch'] !== null) { + $object->setArch($data['Arch']); + } + elseif (\array_key_exists('Arch', $data) && $data['Arch'] === null) { + $object->setArch(null); + } + if (\array_key_exists('KernelVersion', $data) && $data['KernelVersion'] !== null) { + $object->setKernelVersion($data['KernelVersion']); + } + elseif (\array_key_exists('KernelVersion', $data) && $data['KernelVersion'] === null) { + $object->setKernelVersion(null); + } + if (\array_key_exists('Experimental', $data) && $data['Experimental'] !== null) { + $object->setExperimental($data['Experimental']); + } + elseif (\array_key_exists('Experimental', $data) && $data['Experimental'] === null) { + $object->setExperimental(null); + } + if (\array_key_exists('BuildTime', $data) && $data['BuildTime'] !== null) { + $object->setBuildTime($data['BuildTime']); + } + elseif (\array_key_exists('BuildTime', $data) && $data['BuildTime'] === null) { + $object->setBuildTime(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('platform') && null !== $object->getPlatform()) { + $data['Platform'] = $this->normalizer->normalize($object->getPlatform(), 'json', $context); + } + if ($object->isInitialized('components') && null !== $object->getComponents()) { + $values = []; + foreach ($object->getComponents() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Components'] = $values; + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $object->getVersion(); + } + if ($object->isInitialized('apiVersion') && null !== $object->getApiVersion()) { + $data['ApiVersion'] = $object->getApiVersion(); + } + if ($object->isInitialized('minAPIVersion') && null !== $object->getMinAPIVersion()) { + $data['MinAPIVersion'] = $object->getMinAPIVersion(); + } + if ($object->isInitialized('gitCommit') && null !== $object->getGitCommit()) { + $data['GitCommit'] = $object->getGitCommit(); + } + if ($object->isInitialized('goVersion') && null !== $object->getGoVersion()) { + $data['GoVersion'] = $object->getGoVersion(); + } + if ($object->isInitialized('os') && null !== $object->getOs()) { + $data['Os'] = $object->getOs(); + } + if ($object->isInitialized('arch') && null !== $object->getArch()) { + $data['Arch'] = $object->getArch(); + } + if ($object->isInitialized('kernelVersion') && null !== $object->getKernelVersion()) { + $data['KernelVersion'] = $object->getKernelVersion(); + } + if ($object->isInitialized('experimental') && null !== $object->getExperimental()) { + $data['Experimental'] = $object->getExperimental(); + } + if ($object->isInitialized('buildTime') && null !== $object->getBuildTime()) { + $data['BuildTime'] = $object->getBuildTime(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemVersion::class => false]; + } + } +} else { + class SystemVersionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SystemVersion::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SystemVersion::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SystemVersion(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Platform', $data) && $data['Platform'] !== null) { + $object->setPlatform($this->denormalizer->denormalize($data['Platform'], \Docker\API\Model\SystemVersionPlatform::class, 'json', $context)); + } + elseif (\array_key_exists('Platform', $data) && $data['Platform'] === null) { + $object->setPlatform(null); + } + if (\array_key_exists('Components', $data) && $data['Components'] !== null) { + $values = []; + foreach ($data['Components'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\SystemVersionComponentsItem::class, 'json', $context); + } + $object->setComponents($values); + } + elseif (\array_key_exists('Components', $data) && $data['Components'] === null) { + $object->setComponents(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($data['Version']); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('ApiVersion', $data) && $data['ApiVersion'] !== null) { + $object->setApiVersion($data['ApiVersion']); + } + elseif (\array_key_exists('ApiVersion', $data) && $data['ApiVersion'] === null) { + $object->setApiVersion(null); + } + if (\array_key_exists('MinAPIVersion', $data) && $data['MinAPIVersion'] !== null) { + $object->setMinAPIVersion($data['MinAPIVersion']); + } + elseif (\array_key_exists('MinAPIVersion', $data) && $data['MinAPIVersion'] === null) { + $object->setMinAPIVersion(null); + } + if (\array_key_exists('GitCommit', $data) && $data['GitCommit'] !== null) { + $object->setGitCommit($data['GitCommit']); + } + elseif (\array_key_exists('GitCommit', $data) && $data['GitCommit'] === null) { + $object->setGitCommit(null); + } + if (\array_key_exists('GoVersion', $data) && $data['GoVersion'] !== null) { + $object->setGoVersion($data['GoVersion']); + } + elseif (\array_key_exists('GoVersion', $data) && $data['GoVersion'] === null) { + $object->setGoVersion(null); + } + if (\array_key_exists('Os', $data) && $data['Os'] !== null) { + $object->setOs($data['Os']); + } + elseif (\array_key_exists('Os', $data) && $data['Os'] === null) { + $object->setOs(null); + } + if (\array_key_exists('Arch', $data) && $data['Arch'] !== null) { + $object->setArch($data['Arch']); + } + elseif (\array_key_exists('Arch', $data) && $data['Arch'] === null) { + $object->setArch(null); + } + if (\array_key_exists('KernelVersion', $data) && $data['KernelVersion'] !== null) { + $object->setKernelVersion($data['KernelVersion']); + } + elseif (\array_key_exists('KernelVersion', $data) && $data['KernelVersion'] === null) { + $object->setKernelVersion(null); + } + if (\array_key_exists('Experimental', $data) && $data['Experimental'] !== null) { + $object->setExperimental($data['Experimental']); + } + elseif (\array_key_exists('Experimental', $data) && $data['Experimental'] === null) { + $object->setExperimental(null); + } + if (\array_key_exists('BuildTime', $data) && $data['BuildTime'] !== null) { + $object->setBuildTime($data['BuildTime']); + } + elseif (\array_key_exists('BuildTime', $data) && $data['BuildTime'] === null) { + $object->setBuildTime(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('platform') && null !== $object->getPlatform()) { + $data['Platform'] = $this->normalizer->normalize($object->getPlatform(), 'json', $context); + } + if ($object->isInitialized('components') && null !== $object->getComponents()) { + $values = []; + foreach ($object->getComponents() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Components'] = $values; + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $object->getVersion(); + } + if ($object->isInitialized('apiVersion') && null !== $object->getApiVersion()) { + $data['ApiVersion'] = $object->getApiVersion(); + } + if ($object->isInitialized('minAPIVersion') && null !== $object->getMinAPIVersion()) { + $data['MinAPIVersion'] = $object->getMinAPIVersion(); + } + if ($object->isInitialized('gitCommit') && null !== $object->getGitCommit()) { + $data['GitCommit'] = $object->getGitCommit(); + } + if ($object->isInitialized('goVersion') && null !== $object->getGoVersion()) { + $data['GoVersion'] = $object->getGoVersion(); + } + if ($object->isInitialized('os') && null !== $object->getOs()) { + $data['Os'] = $object->getOs(); + } + if ($object->isInitialized('arch') && null !== $object->getArch()) { + $data['Arch'] = $object->getArch(); + } + if ($object->isInitialized('kernelVersion') && null !== $object->getKernelVersion()) { + $data['KernelVersion'] = $object->getKernelVersion(); + } + if ($object->isInitialized('experimental') && null !== $object->getExperimental()) { + $data['Experimental'] = $object->getExperimental(); + } + if ($object->isInitialized('buildTime') && null !== $object->getBuildTime()) { + $data['BuildTime'] = $object->getBuildTime(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemVersion::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/SystemVersionPlatformNormalizer.php b/generated/Normalizer/SystemVersionPlatformNormalizer.php new file mode 100644 index 00000000..97f6b28a --- /dev/null +++ b/generated/Normalizer/SystemVersionPlatformNormalizer.php @@ -0,0 +1,114 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SystemVersionPlatformNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SystemVersionPlatform::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SystemVersionPlatform::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SystemVersionPlatform(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Name'] = $object->getName(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemVersionPlatform::class => false]; + } + } +} else { + class SystemVersionPlatformNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\SystemVersionPlatform::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\SystemVersionPlatform::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\SystemVersionPlatform(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Name'] = $object->getName(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemVersionPlatform::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TLSInfoNormalizer.php b/generated/Normalizer/TLSInfoNormalizer.php new file mode 100644 index 00000000..7368e602 --- /dev/null +++ b/generated/Normalizer/TLSInfoNormalizer.php @@ -0,0 +1,154 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TLSInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TLSInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TLSInfo::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TLSInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('TrustRoot', $data) && $data['TrustRoot'] !== null) { + $object->setTrustRoot($data['TrustRoot']); + } + elseif (\array_key_exists('TrustRoot', $data) && $data['TrustRoot'] === null) { + $object->setTrustRoot(null); + } + if (\array_key_exists('CertIssuerSubject', $data) && $data['CertIssuerSubject'] !== null) { + $object->setCertIssuerSubject($data['CertIssuerSubject']); + } + elseif (\array_key_exists('CertIssuerSubject', $data) && $data['CertIssuerSubject'] === null) { + $object->setCertIssuerSubject(null); + } + if (\array_key_exists('CertIssuerPublicKey', $data) && $data['CertIssuerPublicKey'] !== null) { + $object->setCertIssuerPublicKey($data['CertIssuerPublicKey']); + } + elseif (\array_key_exists('CertIssuerPublicKey', $data) && $data['CertIssuerPublicKey'] === null) { + $object->setCertIssuerPublicKey(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('trustRoot') && null !== $object->getTrustRoot()) { + $data['TrustRoot'] = $object->getTrustRoot(); + } + if ($object->isInitialized('certIssuerSubject') && null !== $object->getCertIssuerSubject()) { + $data['CertIssuerSubject'] = $object->getCertIssuerSubject(); + } + if ($object->isInitialized('certIssuerPublicKey') && null !== $object->getCertIssuerPublicKey()) { + $data['CertIssuerPublicKey'] = $object->getCertIssuerPublicKey(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TLSInfo::class => false]; + } + } +} else { + class TLSInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TLSInfo::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TLSInfo::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TLSInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('TrustRoot', $data) && $data['TrustRoot'] !== null) { + $object->setTrustRoot($data['TrustRoot']); + } + elseif (\array_key_exists('TrustRoot', $data) && $data['TrustRoot'] === null) { + $object->setTrustRoot(null); + } + if (\array_key_exists('CertIssuerSubject', $data) && $data['CertIssuerSubject'] !== null) { + $object->setCertIssuerSubject($data['CertIssuerSubject']); + } + elseif (\array_key_exists('CertIssuerSubject', $data) && $data['CertIssuerSubject'] === null) { + $object->setCertIssuerSubject(null); + } + if (\array_key_exists('CertIssuerPublicKey', $data) && $data['CertIssuerPublicKey'] !== null) { + $object->setCertIssuerPublicKey($data['CertIssuerPublicKey']); + } + elseif (\array_key_exists('CertIssuerPublicKey', $data) && $data['CertIssuerPublicKey'] === null) { + $object->setCertIssuerPublicKey(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('trustRoot') && null !== $object->getTrustRoot()) { + $data['TrustRoot'] = $object->getTrustRoot(); + } + if ($object->isInitialized('certIssuerSubject') && null !== $object->getCertIssuerSubject()) { + $data['CertIssuerSubject'] = $object->getCertIssuerSubject(); + } + if ($object->isInitialized('certIssuerPublicKey') && null !== $object->getCertIssuerPublicKey()) { + $data['CertIssuerPublicKey'] = $object->getCertIssuerPublicKey(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TLSInfo::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskNormalizer.php b/generated/Normalizer/TaskNormalizer.php index 02fdf192..9f96f430 100644 --- a/generated/Normalizer/TaskNormalizer.php +++ b/generated/Normalizer/TaskNormalizer.php @@ -2,154 +2,383 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class TaskNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\Task') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\Task) { - return true; - } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\Task(); - if (property_exists($data, 'ID')) { - $object->setID($data->{'ID'}); - } - if (property_exists($data, 'Version')) { - $object->setVersion($this->serializer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\NodeVersion', 'raw', $context)); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Task::class; } - if (property_exists($data, 'CreatedAt')) { - $object->setCreatedAt(\DateTime::createFromFormat("Y-m-d\TH:i:sP", $data->{'CreatedAt'})); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Task::class; } - if (property_exists($data, 'UpdatedAt')) { - $object->setUpdatedAt(\DateTime::createFromFormat("Y-m-d\TH:i:sP", $data->{'UpdatedAt'})); - } - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Spec')) { - $object->setSpec($this->serializer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\TaskSpec', 'raw', $context)); - } - if (property_exists($data, 'ServiceID')) { - $object->setServiceID($data->{'ServiceID'}); - } - if (property_exists($data, 'Instance')) { - $object->setInstance($data->{'Instance'}); - } - if (property_exists($data, 'NodeID')) { - $object->setNodeID($data->{'NodeID'}); - } - if (property_exists($data, 'ServiceAnnotations')) { - $object->setServiceAnnotations($this->serializer->denormalize($data->{'ServiceAnnotations'}, 'Docker\\API\\Model\\Annotations', 'raw', $context)); - } - if (property_exists($data, 'Status')) { - $object->setStatus($this->serializer->denormalize($data->{'Status'}, 'Docker\\API\\Model\\TaskStatus', 'raw', $context)); - } - if (property_exists($data, 'DesiredState')) { - $object->setDesiredState($data->{'DesiredState'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Task(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\TaskSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('ServiceID', $data) && $data['ServiceID'] !== null) { + $object->setServiceID($data['ServiceID']); + } + elseif (\array_key_exists('ServiceID', $data) && $data['ServiceID'] === null) { + $object->setServiceID(null); + } + if (\array_key_exists('Slot', $data) && $data['Slot'] !== null) { + $object->setSlot($data['Slot']); + } + elseif (\array_key_exists('Slot', $data) && $data['Slot'] === null) { + $object->setSlot(null); + } + if (\array_key_exists('NodeID', $data) && $data['NodeID'] !== null) { + $object->setNodeID($data['NodeID']); + } + elseif (\array_key_exists('NodeID', $data) && $data['NodeID'] === null) { + $object->setNodeID(null); + } + if (\array_key_exists('AssignedGenericResources', $data) && $data['AssignedGenericResources'] !== null) { + $values_1 = []; + foreach ($data['AssignedGenericResources'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\GenericResourcesItem::class, 'json', $context); + } + $object->setAssignedGenericResources($values_1); + } + elseif (\array_key_exists('AssignedGenericResources', $data) && $data['AssignedGenericResources'] === null) { + $object->setAssignedGenericResources(null); + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($this->denormalizer->denormalize($data['Status'], \Docker\API\Model\TaskStatus::class, 'json', $context)); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('DesiredState', $data) && $data['DesiredState'] !== null) { + $object->setDesiredState($data['DesiredState']); + } + elseif (\array_key_exists('DesiredState', $data) && $data['DesiredState'] === null) { + $object->setDesiredState(null); + } + if (\array_key_exists('JobIteration', $data) && $data['JobIteration'] !== null) { + $object->setJobIteration($this->denormalizer->denormalize($data['JobIteration'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('JobIteration', $data) && $data['JobIteration'] === null) { + $object->setJobIteration(null); + } + return $object; } - if (property_exists($data, 'NetworksAttachments')) { - $value = $data->{'NetworksAttachments'}; - if (is_array($data->{'NetworksAttachments'})) { + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { $values = []; - foreach ($data->{'NetworksAttachments'} as $value_1) { - $values[] = $this->serializer->denormalize($value_1, 'Docker\\API\\Model\\NetworkAttachment', 'raw', $context); + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; } - $value = $values; + $data['Labels'] = $values; } - if (is_null($data->{'NetworksAttachments'})) { - $value = $data->{'NetworksAttachments'}; + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); } - $object->setNetworksAttachments($value); + if ($object->isInitialized('serviceID') && null !== $object->getServiceID()) { + $data['ServiceID'] = $object->getServiceID(); + } + if ($object->isInitialized('slot') && null !== $object->getSlot()) { + $data['Slot'] = $object->getSlot(); + } + if ($object->isInitialized('nodeID') && null !== $object->getNodeID()) { + $data['NodeID'] = $object->getNodeID(); + } + if ($object->isInitialized('assignedGenericResources') && null !== $object->getAssignedGenericResources()) { + $values_1 = []; + foreach ($object->getAssignedGenericResources() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['AssignedGenericResources'] = $values_1; + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['Status'] = $this->normalizer->normalize($object->getStatus(), 'json', $context); + } + if ($object->isInitialized('desiredState') && null !== $object->getDesiredState()) { + $data['DesiredState'] = $object->getDesiredState(); + } + if ($object->isInitialized('jobIteration') && null !== $object->getJobIteration()) { + $data['JobIteration'] = $this->normalizer->normalize($object->getJobIteration(), 'json', $context); + } + return $data; } - if (property_exists($data, 'Endpoint')) { - $object->setEndpoint($this->serializer->denormalize($data->{'Endpoint'}, 'Docker\\API\\Model\\Endpoint', 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Task::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class TaskNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); - } - if (null !== $object->getVersion()) { - $data->{'Version'} = json_decode($this->serializer->normalize($object->getVersion(), 'raw', $context)); - } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt()->format("Y-m-d\TH:i:sP"); - } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt()->format("Y-m-d\TH:i:sP"); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Task::class; } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Task::class; } - if (null !== $object->getSpec()) { - $data->{'Spec'} = json_decode($this->serializer->normalize($object->getSpec(), 'raw', $context)); - } - if (null !== $object->getServiceID()) { - $data->{'ServiceID'} = $object->getServiceID(); - } - if (null !== $object->getInstance()) { - $data->{'Instance'} = $object->getInstance(); - } - if (null !== $object->getNodeID()) { - $data->{'NodeID'} = $object->getNodeID(); - } - if (null !== $object->getServiceAnnotations()) { - $data->{'ServiceAnnotations'} = json_decode($this->serializer->normalize($object->getServiceAnnotations(), 'raw', $context)); - } - if (null !== $object->getStatus()) { - $data->{'Status'} = json_decode($this->serializer->normalize($object->getStatus(), 'raw', $context)); - } - if (null !== $object->getDesiredState()) { - $data->{'DesiredState'} = $object->getDesiredState(); - } - $value = $object->getNetworksAttachments(); - if (is_array($object->getNetworksAttachments())) { - $values = []; - foreach ($object->getNetworksAttachments() as $value_1) { - $values[] = $value_1; + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Task(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); + } + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] !== null) { + $object->setUpdatedAt($data['UpdatedAt']); + } + elseif (\array_key_exists('UpdatedAt', $data) && $data['UpdatedAt'] === null) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\TaskSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); } - $value = $values; + if (\array_key_exists('ServiceID', $data) && $data['ServiceID'] !== null) { + $object->setServiceID($data['ServiceID']); + } + elseif (\array_key_exists('ServiceID', $data) && $data['ServiceID'] === null) { + $object->setServiceID(null); + } + if (\array_key_exists('Slot', $data) && $data['Slot'] !== null) { + $object->setSlot($data['Slot']); + } + elseif (\array_key_exists('Slot', $data) && $data['Slot'] === null) { + $object->setSlot(null); + } + if (\array_key_exists('NodeID', $data) && $data['NodeID'] !== null) { + $object->setNodeID($data['NodeID']); + } + elseif (\array_key_exists('NodeID', $data) && $data['NodeID'] === null) { + $object->setNodeID(null); + } + if (\array_key_exists('AssignedGenericResources', $data) && $data['AssignedGenericResources'] !== null) { + $values_1 = []; + foreach ($data['AssignedGenericResources'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\GenericResourcesItem::class, 'json', $context); + } + $object->setAssignedGenericResources($values_1); + } + elseif (\array_key_exists('AssignedGenericResources', $data) && $data['AssignedGenericResources'] === null) { + $object->setAssignedGenericResources(null); + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($this->denormalizer->denormalize($data['Status'], \Docker\API\Model\TaskStatus::class, 'json', $context)); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('DesiredState', $data) && $data['DesiredState'] !== null) { + $object->setDesiredState($data['DesiredState']); + } + elseif (\array_key_exists('DesiredState', $data) && $data['DesiredState'] === null) { + $object->setDesiredState(null); + } + if (\array_key_exists('JobIteration', $data) && $data['JobIteration'] !== null) { + $object->setJobIteration($this->denormalizer->denormalize($data['JobIteration'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + } + elseif (\array_key_exists('JobIteration', $data) && $data['JobIteration'] === null) { + $object->setJobIteration(null); + } + return $object; } - if (is_null($object->getNetworksAttachments())) { - $value = $object->getNetworksAttachments(); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + if ($object->isInitialized('serviceID') && null !== $object->getServiceID()) { + $data['ServiceID'] = $object->getServiceID(); + } + if ($object->isInitialized('slot') && null !== $object->getSlot()) { + $data['Slot'] = $object->getSlot(); + } + if ($object->isInitialized('nodeID') && null !== $object->getNodeID()) { + $data['NodeID'] = $object->getNodeID(); + } + if ($object->isInitialized('assignedGenericResources') && null !== $object->getAssignedGenericResources()) { + $values_1 = []; + foreach ($object->getAssignedGenericResources() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['AssignedGenericResources'] = $values_1; + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['Status'] = $this->normalizer->normalize($object->getStatus(), 'json', $context); + } + if ($object->isInitialized('desiredState') && null !== $object->getDesiredState()) { + $data['DesiredState'] = $object->getDesiredState(); + } + if ($object->isInitialized('jobIteration') && null !== $object->getJobIteration()) { + $data['JobIteration'] = $this->normalizer->normalize($object->getJobIteration(), 'json', $context); + } + return $data; } - $data->{'NetworksAttachments'} = $value; - if (null !== $object->getEndpoint()) { - $data->{'Endpoint'} = json_decode($this->serializer->normalize($object->getEndpoint(), 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Task::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecContainerSpecConfigsItemFileNormalizer.php b/generated/Normalizer/TaskSpecContainerSpecConfigsItemFileNormalizer.php new file mode 100644 index 00000000..f55a5968 --- /dev/null +++ b/generated/Normalizer/TaskSpecContainerSpecConfigsItemFileNormalizer.php @@ -0,0 +1,172 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecContainerSpecConfigsItemFileNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('UID', $data) && $data['UID'] !== null) { + $object->setUID($data['UID']); + } + elseif (\array_key_exists('UID', $data) && $data['UID'] === null) { + $object->setUID(null); + } + if (\array_key_exists('GID', $data) && $data['GID'] !== null) { + $object->setGID($data['GID']); + } + elseif (\array_key_exists('GID', $data) && $data['GID'] === null) { + $object->setGID(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('uID') && null !== $object->getUID()) { + $data['UID'] = $object->getUID(); + } + if ($object->isInitialized('gID') && null !== $object->getGID()) { + $data['GID'] = $object->getGID(); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class => false]; + } + } +} else { + class TaskSpecContainerSpecConfigsItemFileNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('UID', $data) && $data['UID'] !== null) { + $object->setUID($data['UID']); + } + elseif (\array_key_exists('UID', $data) && $data['UID'] === null) { + $object->setUID(null); + } + if (\array_key_exists('GID', $data) && $data['GID'] !== null) { + $object->setGID($data['GID']); + } + elseif (\array_key_exists('GID', $data) && $data['GID'] === null) { + $object->setGID(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('uID') && null !== $object->getUID()) { + $data['UID'] = $object->getUID(); + } + if ($object->isInitialized('gID') && null !== $object->getGID()) { + $data['GID'] = $object->getGID(); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecContainerSpecConfigsItemNormalizer.php b/generated/Normalizer/TaskSpecContainerSpecConfigsItemNormalizer.php new file mode 100644 index 00000000..12cc1c62 --- /dev/null +++ b/generated/Normalizer/TaskSpecContainerSpecConfigsItemNormalizer.php @@ -0,0 +1,172 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecContainerSpecConfigsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecConfigsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('File', $data) && $data['File'] !== null) { + $object->setFile($this->denormalizer->denormalize($data['File'], \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class, 'json', $context)); + } + elseif (\array_key_exists('File', $data) && $data['File'] === null) { + $object->setFile(null); + } + if (\array_key_exists('Runtime', $data) && $data['Runtime'] !== null) { + $object->setRuntime($data['Runtime']); + } + elseif (\array_key_exists('Runtime', $data) && $data['Runtime'] === null) { + $object->setRuntime(null); + } + if (\array_key_exists('ConfigID', $data) && $data['ConfigID'] !== null) { + $object->setConfigID($data['ConfigID']); + } + elseif (\array_key_exists('ConfigID', $data) && $data['ConfigID'] === null) { + $object->setConfigID(null); + } + if (\array_key_exists('ConfigName', $data) && $data['ConfigName'] !== null) { + $object->setConfigName($data['ConfigName']); + } + elseif (\array_key_exists('ConfigName', $data) && $data['ConfigName'] === null) { + $object->setConfigName(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('file') && null !== $object->getFile()) { + $data['File'] = $this->normalizer->normalize($object->getFile(), 'json', $context); + } + if ($object->isInitialized('runtime') && null !== $object->getRuntime()) { + $data['Runtime'] = $object->getRuntime(); + } + if ($object->isInitialized('configID') && null !== $object->getConfigID()) { + $data['ConfigID'] = $object->getConfigID(); + } + if ($object->isInitialized('configName') && null !== $object->getConfigName()) { + $data['ConfigName'] = $object->getConfigName(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecConfigsItem::class => false]; + } + } +} else { + class TaskSpecContainerSpecConfigsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecConfigsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('File', $data) && $data['File'] !== null) { + $object->setFile($this->denormalizer->denormalize($data['File'], \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class, 'json', $context)); + } + elseif (\array_key_exists('File', $data) && $data['File'] === null) { + $object->setFile(null); + } + if (\array_key_exists('Runtime', $data) && $data['Runtime'] !== null) { + $object->setRuntime($data['Runtime']); + } + elseif (\array_key_exists('Runtime', $data) && $data['Runtime'] === null) { + $object->setRuntime(null); + } + if (\array_key_exists('ConfigID', $data) && $data['ConfigID'] !== null) { + $object->setConfigID($data['ConfigID']); + } + elseif (\array_key_exists('ConfigID', $data) && $data['ConfigID'] === null) { + $object->setConfigID(null); + } + if (\array_key_exists('ConfigName', $data) && $data['ConfigName'] !== null) { + $object->setConfigName($data['ConfigName']); + } + elseif (\array_key_exists('ConfigName', $data) && $data['ConfigName'] === null) { + $object->setConfigName(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('file') && null !== $object->getFile()) { + $data['File'] = $this->normalizer->normalize($object->getFile(), 'json', $context); + } + if ($object->isInitialized('runtime') && null !== $object->getRuntime()) { + $data['Runtime'] = $object->getRuntime(); + } + if ($object->isInitialized('configID') && null !== $object->getConfigID()) { + $data['ConfigID'] = $object->getConfigID(); + } + if ($object->isInitialized('configName') && null !== $object->getConfigName()) { + $data['ConfigName'] = $object->getConfigName(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecConfigsItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecContainerSpecDNSConfigNormalizer.php b/generated/Normalizer/TaskSpecContainerSpecDNSConfigNormalizer.php new file mode 100644 index 00000000..29e11e06 --- /dev/null +++ b/generated/Normalizer/TaskSpecContainerSpecDNSConfigNormalizer.php @@ -0,0 +1,202 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecContainerSpecDNSConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecDNSConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Nameservers', $data) && $data['Nameservers'] !== null) { + $values = []; + foreach ($data['Nameservers'] as $value) { + $values[] = $value; + } + $object->setNameservers($values); + } + elseif (\array_key_exists('Nameservers', $data) && $data['Nameservers'] === null) { + $object->setNameservers(null); + } + if (\array_key_exists('Search', $data) && $data['Search'] !== null) { + $values_1 = []; + foreach ($data['Search'] as $value_1) { + $values_1[] = $value_1; + } + $object->setSearch($values_1); + } + elseif (\array_key_exists('Search', $data) && $data['Search'] === null) { + $object->setSearch(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values_2 = []; + foreach ($data['Options'] as $value_2) { + $values_2[] = $value_2; + } + $object->setOptions($values_2); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('nameservers') && null !== $object->getNameservers()) { + $values = []; + foreach ($object->getNameservers() as $value) { + $values[] = $value; + } + $data['Nameservers'] = $values; + } + if ($object->isInitialized('search') && null !== $object->getSearch()) { + $values_1 = []; + foreach ($object->getSearch() as $value_1) { + $values_1[] = $value_1; + } + $data['Search'] = $values_1; + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values_2 = []; + foreach ($object->getOptions() as $value_2) { + $values_2[] = $value_2; + } + $data['Options'] = $values_2; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecDNSConfig::class => false]; + } + } +} else { + class TaskSpecContainerSpecDNSConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecDNSConfig(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Nameservers', $data) && $data['Nameservers'] !== null) { + $values = []; + foreach ($data['Nameservers'] as $value) { + $values[] = $value; + } + $object->setNameservers($values); + } + elseif (\array_key_exists('Nameservers', $data) && $data['Nameservers'] === null) { + $object->setNameservers(null); + } + if (\array_key_exists('Search', $data) && $data['Search'] !== null) { + $values_1 = []; + foreach ($data['Search'] as $value_1) { + $values_1[] = $value_1; + } + $object->setSearch($values_1); + } + elseif (\array_key_exists('Search', $data) && $data['Search'] === null) { + $object->setSearch(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values_2 = []; + foreach ($data['Options'] as $value_2) { + $values_2[] = $value_2; + } + $object->setOptions($values_2); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('nameservers') && null !== $object->getNameservers()) { + $values = []; + foreach ($object->getNameservers() as $value) { + $values[] = $value; + } + $data['Nameservers'] = $values; + } + if ($object->isInitialized('search') && null !== $object->getSearch()) { + $values_1 = []; + foreach ($object->getSearch() as $value_1) { + $values_1[] = $value_1; + } + $data['Search'] = $values_1; + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values_2 = []; + foreach ($object->getOptions() as $value_2) { + $values_2[] = $value_2; + } + $data['Options'] = $values_2; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecDNSConfig::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecContainerSpecNormalizer.php b/generated/Normalizer/TaskSpecContainerSpecNormalizer.php new file mode 100644 index 00000000..2662308b --- /dev/null +++ b/generated/Normalizer/TaskSpecContainerSpecNormalizer.php @@ -0,0 +1,812 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecContainerSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpec::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); + } + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Command', $data) && $data['Command'] !== null) { + $values_1 = []; + foreach ($data['Command'] as $value_1) { + $values_1[] = $value_1; + } + $object->setCommand($values_1); + } + elseif (\array_key_exists('Command', $data) && $data['Command'] === null) { + $object->setCommand(null); + } + if (\array_key_exists('Args', $data) && $data['Args'] !== null) { + $values_2 = []; + foreach ($data['Args'] as $value_2) { + $values_2[] = $value_2; + } + $object->setArgs($values_2); + } + elseif (\array_key_exists('Args', $data) && $data['Args'] === null) { + $object->setArgs(null); + } + if (\array_key_exists('Hostname', $data) && $data['Hostname'] !== null) { + $object->setHostname($data['Hostname']); + } + elseif (\array_key_exists('Hostname', $data) && $data['Hostname'] === null) { + $object->setHostname(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_3 = []; + foreach ($data['Env'] as $value_3) { + $values_3[] = $value_3; + } + $object->setEnv($values_3); + } + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Dir', $data) && $data['Dir'] !== null) { + $object->setDir($data['Dir']); + } + elseif (\array_key_exists('Dir', $data) && $data['Dir'] === null) { + $object->setDir(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('Groups', $data) && $data['Groups'] !== null) { + $values_4 = []; + foreach ($data['Groups'] as $value_4) { + $values_4[] = $value_4; + } + $object->setGroups($values_4); + } + elseif (\array_key_exists('Groups', $data) && $data['Groups'] === null) { + $object->setGroups(null); + } + if (\array_key_exists('Privileges', $data) && $data['Privileges'] !== null) { + $object->setPrivileges($this->denormalizer->denormalize($data['Privileges'], \Docker\API\Model\TaskSpecContainerSpecPrivileges::class, 'json', $context)); + } + elseif (\array_key_exists('Privileges', $data) && $data['Privileges'] === null) { + $object->setPrivileges(null); + } + if (\array_key_exists('TTY', $data) && $data['TTY'] !== null) { + $object->setTTY($data['TTY']); + } + elseif (\array_key_exists('TTY', $data) && $data['TTY'] === null) { + $object->setTTY(null); + } + if (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] !== null) { + $object->setOpenStdin($data['OpenStdin']); + } + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); + } + if (\array_key_exists('ReadOnly', $data) && $data['ReadOnly'] !== null) { + $object->setReadOnly($data['ReadOnly']); + } + elseif (\array_key_exists('ReadOnly', $data) && $data['ReadOnly'] === null) { + $object->setReadOnly(null); + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values_5 = []; + foreach ($data['Mounts'] as $value_5) { + $values_5[] = $this->denormalizer->denormalize($value_5, \Docker\API\Model\Mount::class, 'json', $context); + } + $object->setMounts($values_5); + } + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); + } + if (\array_key_exists('StopSignal', $data) && $data['StopSignal'] !== null) { + $object->setStopSignal($data['StopSignal']); + } + elseif (\array_key_exists('StopSignal', $data) && $data['StopSignal'] === null) { + $object->setStopSignal(null); + } + if (\array_key_exists('StopGracePeriod', $data) && $data['StopGracePeriod'] !== null) { + $object->setStopGracePeriod($data['StopGracePeriod']); + } + elseif (\array_key_exists('StopGracePeriod', $data) && $data['StopGracePeriod'] === null) { + $object->setStopGracePeriod(null); + } + if (\array_key_exists('HealthCheck', $data) && $data['HealthCheck'] !== null) { + $object->setHealthCheck($this->denormalizer->denormalize($data['HealthCheck'], \Docker\API\Model\HealthConfig::class, 'json', $context)); + } + elseif (\array_key_exists('HealthCheck', $data) && $data['HealthCheck'] === null) { + $object->setHealthCheck(null); + } + if (\array_key_exists('Hosts', $data) && $data['Hosts'] !== null) { + $values_6 = []; + foreach ($data['Hosts'] as $value_6) { + $values_6[] = $value_6; + } + $object->setHosts($values_6); + } + elseif (\array_key_exists('Hosts', $data) && $data['Hosts'] === null) { + $object->setHosts(null); + } + if (\array_key_exists('DNSConfig', $data) && $data['DNSConfig'] !== null) { + $object->setDNSConfig($this->denormalizer->denormalize($data['DNSConfig'], \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class, 'json', $context)); + } + elseif (\array_key_exists('DNSConfig', $data) && $data['DNSConfig'] === null) { + $object->setDNSConfig(null); + } + if (\array_key_exists('Secrets', $data) && $data['Secrets'] !== null) { + $values_7 = []; + foreach ($data['Secrets'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class, 'json', $context); + } + $object->setSecrets($values_7); + } + elseif (\array_key_exists('Secrets', $data) && $data['Secrets'] === null) { + $object->setSecrets(null); + } + if (\array_key_exists('OomScoreAdj', $data) && $data['OomScoreAdj'] !== null) { + $object->setOomScoreAdj($data['OomScoreAdj']); + } + elseif (\array_key_exists('OomScoreAdj', $data) && $data['OomScoreAdj'] === null) { + $object->setOomScoreAdj(null); + } + if (\array_key_exists('Configs', $data) && $data['Configs'] !== null) { + $values_8 = []; + foreach ($data['Configs'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class, 'json', $context); + } + $object->setConfigs($values_8); + } + elseif (\array_key_exists('Configs', $data) && $data['Configs'] === null) { + $object->setConfigs(null); + } + if (\array_key_exists('Isolation', $data) && $data['Isolation'] !== null) { + $object->setIsolation($data['Isolation']); + } + elseif (\array_key_exists('Isolation', $data) && $data['Isolation'] === null) { + $object->setIsolation(null); + } + if (\array_key_exists('Init', $data) && $data['Init'] !== null) { + $object->setInit($data['Init']); + } + elseif (\array_key_exists('Init', $data) && $data['Init'] === null) { + $object->setInit(null); + } + if (\array_key_exists('Sysctls', $data) && $data['Sysctls'] !== null) { + $values_9 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Sysctls'] as $key_1 => $value_9) { + $values_9[$key_1] = $value_9; + } + $object->setSysctls($values_9); + } + elseif (\array_key_exists('Sysctls', $data) && $data['Sysctls'] === null) { + $object->setSysctls(null); + } + if (\array_key_exists('CapabilityAdd', $data) && $data['CapabilityAdd'] !== null) { + $values_10 = []; + foreach ($data['CapabilityAdd'] as $value_10) { + $values_10[] = $value_10; + } + $object->setCapabilityAdd($values_10); + } + elseif (\array_key_exists('CapabilityAdd', $data) && $data['CapabilityAdd'] === null) { + $object->setCapabilityAdd(null); + } + if (\array_key_exists('CapabilityDrop', $data) && $data['CapabilityDrop'] !== null) { + $values_11 = []; + foreach ($data['CapabilityDrop'] as $value_11) { + $values_11[] = $value_11; + } + $object->setCapabilityDrop($values_11); + } + elseif (\array_key_exists('CapabilityDrop', $data) && $data['CapabilityDrop'] === null) { + $object->setCapabilityDrop(null); + } + if (\array_key_exists('Ulimits', $data) && $data['Ulimits'] !== null) { + $values_12 = []; + foreach ($data['Ulimits'] as $value_12) { + $values_12[] = $this->denormalizer->denormalize($value_12, \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class, 'json', $context); + } + $object->setUlimits($values_12); + } + elseif (\array_key_exists('Ulimits', $data) && $data['Ulimits'] === null) { + $object->setUlimits(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('command') && null !== $object->getCommand()) { + $values_1 = []; + foreach ($object->getCommand() as $value_1) { + $values_1[] = $value_1; + } + $data['Command'] = $values_1; + } + if ($object->isInitialized('args') && null !== $object->getArgs()) { + $values_2 = []; + foreach ($object->getArgs() as $value_2) { + $values_2[] = $value_2; + } + $data['Args'] = $values_2; + } + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); + } + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_3 = []; + foreach ($object->getEnv() as $value_3) { + $values_3[] = $value_3; + } + $data['Env'] = $values_3; + } + if ($object->isInitialized('dir') && null !== $object->getDir()) { + $data['Dir'] = $object->getDir(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); + } + if ($object->isInitialized('groups') && null !== $object->getGroups()) { + $values_4 = []; + foreach ($object->getGroups() as $value_4) { + $values_4[] = $value_4; + } + $data['Groups'] = $values_4; + } + if ($object->isInitialized('privileges') && null !== $object->getPrivileges()) { + $data['Privileges'] = $this->normalizer->normalize($object->getPrivileges(), 'json', $context); + } + if ($object->isInitialized('tTY') && null !== $object->getTTY()) { + $data['TTY'] = $object->getTTY(); + } + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); + } + if ($object->isInitialized('readOnly') && null !== $object->getReadOnly()) { + $data['ReadOnly'] = $object->getReadOnly(); + } + if ($object->isInitialized('mounts') && null !== $object->getMounts()) { + $values_5 = []; + foreach ($object->getMounts() as $value_5) { + $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); + } + $data['Mounts'] = $values_5; + } + if ($object->isInitialized('stopSignal') && null !== $object->getStopSignal()) { + $data['StopSignal'] = $object->getStopSignal(); + } + if ($object->isInitialized('stopGracePeriod') && null !== $object->getStopGracePeriod()) { + $data['StopGracePeriod'] = $object->getStopGracePeriod(); + } + if ($object->isInitialized('healthCheck') && null !== $object->getHealthCheck()) { + $data['HealthCheck'] = $this->normalizer->normalize($object->getHealthCheck(), 'json', $context); + } + if ($object->isInitialized('hosts') && null !== $object->getHosts()) { + $values_6 = []; + foreach ($object->getHosts() as $value_6) { + $values_6[] = $value_6; + } + $data['Hosts'] = $values_6; + } + if ($object->isInitialized('dNSConfig') && null !== $object->getDNSConfig()) { + $data['DNSConfig'] = $this->normalizer->normalize($object->getDNSConfig(), 'json', $context); + } + if ($object->isInitialized('secrets') && null !== $object->getSecrets()) { + $values_7 = []; + foreach ($object->getSecrets() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $data['Secrets'] = $values_7; + } + if ($object->isInitialized('oomScoreAdj') && null !== $object->getOomScoreAdj()) { + $data['OomScoreAdj'] = $object->getOomScoreAdj(); + } + if ($object->isInitialized('configs') && null !== $object->getConfigs()) { + $values_8 = []; + foreach ($object->getConfigs() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); + } + $data['Configs'] = $values_8; + } + if ($object->isInitialized('isolation') && null !== $object->getIsolation()) { + $data['Isolation'] = $object->getIsolation(); + } + if ($object->isInitialized('init') && null !== $object->getInit()) { + $data['Init'] = $object->getInit(); + } + if ($object->isInitialized('sysctls') && null !== $object->getSysctls()) { + $values_9 = []; + foreach ($object->getSysctls() as $key_1 => $value_9) { + $values_9[$key_1] = $value_9; + } + $data['Sysctls'] = $values_9; + } + if ($object->isInitialized('capabilityAdd') && null !== $object->getCapabilityAdd()) { + $values_10 = []; + foreach ($object->getCapabilityAdd() as $value_10) { + $values_10[] = $value_10; + } + $data['CapabilityAdd'] = $values_10; + } + if ($object->isInitialized('capabilityDrop') && null !== $object->getCapabilityDrop()) { + $values_11 = []; + foreach ($object->getCapabilityDrop() as $value_11) { + $values_11[] = $value_11; + } + $data['CapabilityDrop'] = $values_11; + } + if ($object->isInitialized('ulimits') && null !== $object->getUlimits()) { + $values_12 = []; + foreach ($object->getUlimits() as $value_12) { + $values_12[] = $this->normalizer->normalize($value_12, 'json', $context); + } + $data['Ulimits'] = $values_12; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpec::class => false]; + } + } +} else { + class TaskSpecContainerSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpec::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); + } + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { + $values[$key] = $value; + } + $object->setLabels($values); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Command', $data) && $data['Command'] !== null) { + $values_1 = []; + foreach ($data['Command'] as $value_1) { + $values_1[] = $value_1; + } + $object->setCommand($values_1); + } + elseif (\array_key_exists('Command', $data) && $data['Command'] === null) { + $object->setCommand(null); + } + if (\array_key_exists('Args', $data) && $data['Args'] !== null) { + $values_2 = []; + foreach ($data['Args'] as $value_2) { + $values_2[] = $value_2; + } + $object->setArgs($values_2); + } + elseif (\array_key_exists('Args', $data) && $data['Args'] === null) { + $object->setArgs(null); + } + if (\array_key_exists('Hostname', $data) && $data['Hostname'] !== null) { + $object->setHostname($data['Hostname']); + } + elseif (\array_key_exists('Hostname', $data) && $data['Hostname'] === null) { + $object->setHostname(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_3 = []; + foreach ($data['Env'] as $value_3) { + $values_3[] = $value_3; + } + $object->setEnv($values_3); + } + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Dir', $data) && $data['Dir'] !== null) { + $object->setDir($data['Dir']); + } + elseif (\array_key_exists('Dir', $data) && $data['Dir'] === null) { + $object->setDir(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('Groups', $data) && $data['Groups'] !== null) { + $values_4 = []; + foreach ($data['Groups'] as $value_4) { + $values_4[] = $value_4; + } + $object->setGroups($values_4); + } + elseif (\array_key_exists('Groups', $data) && $data['Groups'] === null) { + $object->setGroups(null); + } + if (\array_key_exists('Privileges', $data) && $data['Privileges'] !== null) { + $object->setPrivileges($this->denormalizer->denormalize($data['Privileges'], \Docker\API\Model\TaskSpecContainerSpecPrivileges::class, 'json', $context)); + } + elseif (\array_key_exists('Privileges', $data) && $data['Privileges'] === null) { + $object->setPrivileges(null); + } + if (\array_key_exists('TTY', $data) && $data['TTY'] !== null) { + $object->setTTY($data['TTY']); + } + elseif (\array_key_exists('TTY', $data) && $data['TTY'] === null) { + $object->setTTY(null); + } + if (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] !== null) { + $object->setOpenStdin($data['OpenStdin']); + } + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); + } + if (\array_key_exists('ReadOnly', $data) && $data['ReadOnly'] !== null) { + $object->setReadOnly($data['ReadOnly']); + } + elseif (\array_key_exists('ReadOnly', $data) && $data['ReadOnly'] === null) { + $object->setReadOnly(null); + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values_5 = []; + foreach ($data['Mounts'] as $value_5) { + $values_5[] = $this->denormalizer->denormalize($value_5, \Docker\API\Model\Mount::class, 'json', $context); + } + $object->setMounts($values_5); + } + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); + } + if (\array_key_exists('StopSignal', $data) && $data['StopSignal'] !== null) { + $object->setStopSignal($data['StopSignal']); + } + elseif (\array_key_exists('StopSignal', $data) && $data['StopSignal'] === null) { + $object->setStopSignal(null); + } + if (\array_key_exists('StopGracePeriod', $data) && $data['StopGracePeriod'] !== null) { + $object->setStopGracePeriod($data['StopGracePeriod']); + } + elseif (\array_key_exists('StopGracePeriod', $data) && $data['StopGracePeriod'] === null) { + $object->setStopGracePeriod(null); + } + if (\array_key_exists('HealthCheck', $data) && $data['HealthCheck'] !== null) { + $object->setHealthCheck($this->denormalizer->denormalize($data['HealthCheck'], \Docker\API\Model\HealthConfig::class, 'json', $context)); + } + elseif (\array_key_exists('HealthCheck', $data) && $data['HealthCheck'] === null) { + $object->setHealthCheck(null); + } + if (\array_key_exists('Hosts', $data) && $data['Hosts'] !== null) { + $values_6 = []; + foreach ($data['Hosts'] as $value_6) { + $values_6[] = $value_6; + } + $object->setHosts($values_6); + } + elseif (\array_key_exists('Hosts', $data) && $data['Hosts'] === null) { + $object->setHosts(null); + } + if (\array_key_exists('DNSConfig', $data) && $data['DNSConfig'] !== null) { + $object->setDNSConfig($this->denormalizer->denormalize($data['DNSConfig'], \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class, 'json', $context)); + } + elseif (\array_key_exists('DNSConfig', $data) && $data['DNSConfig'] === null) { + $object->setDNSConfig(null); + } + if (\array_key_exists('Secrets', $data) && $data['Secrets'] !== null) { + $values_7 = []; + foreach ($data['Secrets'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class, 'json', $context); + } + $object->setSecrets($values_7); + } + elseif (\array_key_exists('Secrets', $data) && $data['Secrets'] === null) { + $object->setSecrets(null); + } + if (\array_key_exists('OomScoreAdj', $data) && $data['OomScoreAdj'] !== null) { + $object->setOomScoreAdj($data['OomScoreAdj']); + } + elseif (\array_key_exists('OomScoreAdj', $data) && $data['OomScoreAdj'] === null) { + $object->setOomScoreAdj(null); + } + if (\array_key_exists('Configs', $data) && $data['Configs'] !== null) { + $values_8 = []; + foreach ($data['Configs'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class, 'json', $context); + } + $object->setConfigs($values_8); + } + elseif (\array_key_exists('Configs', $data) && $data['Configs'] === null) { + $object->setConfigs(null); + } + if (\array_key_exists('Isolation', $data) && $data['Isolation'] !== null) { + $object->setIsolation($data['Isolation']); + } + elseif (\array_key_exists('Isolation', $data) && $data['Isolation'] === null) { + $object->setIsolation(null); + } + if (\array_key_exists('Init', $data) && $data['Init'] !== null) { + $object->setInit($data['Init']); + } + elseif (\array_key_exists('Init', $data) && $data['Init'] === null) { + $object->setInit(null); + } + if (\array_key_exists('Sysctls', $data) && $data['Sysctls'] !== null) { + $values_9 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Sysctls'] as $key_1 => $value_9) { + $values_9[$key_1] = $value_9; + } + $object->setSysctls($values_9); + } + elseif (\array_key_exists('Sysctls', $data) && $data['Sysctls'] === null) { + $object->setSysctls(null); + } + if (\array_key_exists('CapabilityAdd', $data) && $data['CapabilityAdd'] !== null) { + $values_10 = []; + foreach ($data['CapabilityAdd'] as $value_10) { + $values_10[] = $value_10; + } + $object->setCapabilityAdd($values_10); + } + elseif (\array_key_exists('CapabilityAdd', $data) && $data['CapabilityAdd'] === null) { + $object->setCapabilityAdd(null); + } + if (\array_key_exists('CapabilityDrop', $data) && $data['CapabilityDrop'] !== null) { + $values_11 = []; + foreach ($data['CapabilityDrop'] as $value_11) { + $values_11[] = $value_11; + } + $object->setCapabilityDrop($values_11); + } + elseif (\array_key_exists('CapabilityDrop', $data) && $data['CapabilityDrop'] === null) { + $object->setCapabilityDrop(null); + } + if (\array_key_exists('Ulimits', $data) && $data['Ulimits'] !== null) { + $values_12 = []; + foreach ($data['Ulimits'] as $value_12) { + $values_12[] = $this->denormalizer->denormalize($value_12, \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class, 'json', $context); + } + $object->setUlimits($values_12); + } + elseif (\array_key_exists('Ulimits', $data) && $data['Ulimits'] === null) { + $object->setUlimits(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = []; + foreach ($object->getLabels() as $key => $value) { + $values[$key] = $value; + } + $data['Labels'] = $values; + } + if ($object->isInitialized('command') && null !== $object->getCommand()) { + $values_1 = []; + foreach ($object->getCommand() as $value_1) { + $values_1[] = $value_1; + } + $data['Command'] = $values_1; + } + if ($object->isInitialized('args') && null !== $object->getArgs()) { + $values_2 = []; + foreach ($object->getArgs() as $value_2) { + $values_2[] = $value_2; + } + $data['Args'] = $values_2; + } + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); + } + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_3 = []; + foreach ($object->getEnv() as $value_3) { + $values_3[] = $value_3; + } + $data['Env'] = $values_3; + } + if ($object->isInitialized('dir') && null !== $object->getDir()) { + $data['Dir'] = $object->getDir(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); + } + if ($object->isInitialized('groups') && null !== $object->getGroups()) { + $values_4 = []; + foreach ($object->getGroups() as $value_4) { + $values_4[] = $value_4; + } + $data['Groups'] = $values_4; + } + if ($object->isInitialized('privileges') && null !== $object->getPrivileges()) { + $data['Privileges'] = $this->normalizer->normalize($object->getPrivileges(), 'json', $context); + } + if ($object->isInitialized('tTY') && null !== $object->getTTY()) { + $data['TTY'] = $object->getTTY(); + } + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); + } + if ($object->isInitialized('readOnly') && null !== $object->getReadOnly()) { + $data['ReadOnly'] = $object->getReadOnly(); + } + if ($object->isInitialized('mounts') && null !== $object->getMounts()) { + $values_5 = []; + foreach ($object->getMounts() as $value_5) { + $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); + } + $data['Mounts'] = $values_5; + } + if ($object->isInitialized('stopSignal') && null !== $object->getStopSignal()) { + $data['StopSignal'] = $object->getStopSignal(); + } + if ($object->isInitialized('stopGracePeriod') && null !== $object->getStopGracePeriod()) { + $data['StopGracePeriod'] = $object->getStopGracePeriod(); + } + if ($object->isInitialized('healthCheck') && null !== $object->getHealthCheck()) { + $data['HealthCheck'] = $this->normalizer->normalize($object->getHealthCheck(), 'json', $context); + } + if ($object->isInitialized('hosts') && null !== $object->getHosts()) { + $values_6 = []; + foreach ($object->getHosts() as $value_6) { + $values_6[] = $value_6; + } + $data['Hosts'] = $values_6; + } + if ($object->isInitialized('dNSConfig') && null !== $object->getDNSConfig()) { + $data['DNSConfig'] = $this->normalizer->normalize($object->getDNSConfig(), 'json', $context); + } + if ($object->isInitialized('secrets') && null !== $object->getSecrets()) { + $values_7 = []; + foreach ($object->getSecrets() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $data['Secrets'] = $values_7; + } + if ($object->isInitialized('oomScoreAdj') && null !== $object->getOomScoreAdj()) { + $data['OomScoreAdj'] = $object->getOomScoreAdj(); + } + if ($object->isInitialized('configs') && null !== $object->getConfigs()) { + $values_8 = []; + foreach ($object->getConfigs() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); + } + $data['Configs'] = $values_8; + } + if ($object->isInitialized('isolation') && null !== $object->getIsolation()) { + $data['Isolation'] = $object->getIsolation(); + } + if ($object->isInitialized('init') && null !== $object->getInit()) { + $data['Init'] = $object->getInit(); + } + if ($object->isInitialized('sysctls') && null !== $object->getSysctls()) { + $values_9 = []; + foreach ($object->getSysctls() as $key_1 => $value_9) { + $values_9[$key_1] = $value_9; + } + $data['Sysctls'] = $values_9; + } + if ($object->isInitialized('capabilityAdd') && null !== $object->getCapabilityAdd()) { + $values_10 = []; + foreach ($object->getCapabilityAdd() as $value_10) { + $values_10[] = $value_10; + } + $data['CapabilityAdd'] = $values_10; + } + if ($object->isInitialized('capabilityDrop') && null !== $object->getCapabilityDrop()) { + $values_11 = []; + foreach ($object->getCapabilityDrop() as $value_11) { + $values_11[] = $value_11; + } + $data['CapabilityDrop'] = $values_11; + } + if ($object->isInitialized('ulimits') && null !== $object->getUlimits()) { + $values_12 = []; + foreach ($object->getUlimits() as $value_12) { + $values_12[] = $this->normalizer->normalize($value_12, 'json', $context); + } + $data['Ulimits'] = $values_12; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpec::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecContainerSpecPrivilegesAppArmorNormalizer.php b/generated/Normalizer/TaskSpecContainerSpecPrivilegesAppArmorNormalizer.php new file mode 100644 index 00000000..eba7f748 --- /dev/null +++ b/generated/Normalizer/TaskSpecContainerSpecPrivilegesAppArmorNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecContainerSpecPrivilegesAppArmorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class => false]; + } + } +} else { + class TaskSpecContainerSpecPrivilegesAppArmorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer.php b/generated/Normalizer/TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer.php new file mode 100644 index 00000000..17e775b2 --- /dev/null +++ b/generated/Normalizer/TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer.php @@ -0,0 +1,154 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $object->setConfig($data['Config']); + } + elseif (\array_key_exists('Config', $data) && $data['Config'] === null) { + $object->setConfig(null); + } + if (\array_key_exists('File', $data) && $data['File'] !== null) { + $object->setFile($data['File']); + } + elseif (\array_key_exists('File', $data) && $data['File'] === null) { + $object->setFile(null); + } + if (\array_key_exists('Registry', $data) && $data['Registry'] !== null) { + $object->setRegistry($data['Registry']); + } + elseif (\array_key_exists('Registry', $data) && $data['Registry'] === null) { + $object->setRegistry(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $data['Config'] = $object->getConfig(); + } + if ($object->isInitialized('file') && null !== $object->getFile()) { + $data['File'] = $object->getFile(); + } + if ($object->isInitialized('registry') && null !== $object->getRegistry()) { + $data['Registry'] = $object->getRegistry(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class => false]; + } + } +} else { + class TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $object->setConfig($data['Config']); + } + elseif (\array_key_exists('Config', $data) && $data['Config'] === null) { + $object->setConfig(null); + } + if (\array_key_exists('File', $data) && $data['File'] !== null) { + $object->setFile($data['File']); + } + elseif (\array_key_exists('File', $data) && $data['File'] === null) { + $object->setFile(null); + } + if (\array_key_exists('Registry', $data) && $data['Registry'] !== null) { + $object->setRegistry($data['Registry']); + } + elseif (\array_key_exists('Registry', $data) && $data['Registry'] === null) { + $object->setRegistry(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $data['Config'] = $object->getConfig(); + } + if ($object->isInitialized('file') && null !== $object->getFile()) { + $data['File'] = $object->getFile(); + } + if ($object->isInitialized('registry') && null !== $object->getRegistry()) { + $data['Registry'] = $object->getRegistry(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecContainerSpecPrivilegesNormalizer.php b/generated/Normalizer/TaskSpecContainerSpecPrivilegesNormalizer.php new file mode 100644 index 00000000..4f03ae03 --- /dev/null +++ b/generated/Normalizer/TaskSpecContainerSpecPrivilegesNormalizer.php @@ -0,0 +1,190 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecContainerSpecPrivilegesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecPrivileges::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecPrivileges::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecPrivileges(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CredentialSpec', $data) && $data['CredentialSpec'] !== null) { + $object->setCredentialSpec($this->denormalizer->denormalize($data['CredentialSpec'], \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class, 'json', $context)); + } + elseif (\array_key_exists('CredentialSpec', $data) && $data['CredentialSpec'] === null) { + $object->setCredentialSpec(null); + } + if (\array_key_exists('SELinuxContext', $data) && $data['SELinuxContext'] !== null) { + $object->setSELinuxContext($this->denormalizer->denormalize($data['SELinuxContext'], \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class, 'json', $context)); + } + elseif (\array_key_exists('SELinuxContext', $data) && $data['SELinuxContext'] === null) { + $object->setSELinuxContext(null); + } + if (\array_key_exists('Seccomp', $data) && $data['Seccomp'] !== null) { + $object->setSeccomp($this->denormalizer->denormalize($data['Seccomp'], \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class, 'json', $context)); + } + elseif (\array_key_exists('Seccomp', $data) && $data['Seccomp'] === null) { + $object->setSeccomp(null); + } + if (\array_key_exists('AppArmor', $data) && $data['AppArmor'] !== null) { + $object->setAppArmor($this->denormalizer->denormalize($data['AppArmor'], \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class, 'json', $context)); + } + elseif (\array_key_exists('AppArmor', $data) && $data['AppArmor'] === null) { + $object->setAppArmor(null); + } + if (\array_key_exists('NoNewPrivileges', $data) && $data['NoNewPrivileges'] !== null) { + $object->setNoNewPrivileges($data['NoNewPrivileges']); + } + elseif (\array_key_exists('NoNewPrivileges', $data) && $data['NoNewPrivileges'] === null) { + $object->setNoNewPrivileges(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('credentialSpec') && null !== $object->getCredentialSpec()) { + $data['CredentialSpec'] = $this->normalizer->normalize($object->getCredentialSpec(), 'json', $context); + } + if ($object->isInitialized('sELinuxContext') && null !== $object->getSELinuxContext()) { + $data['SELinuxContext'] = $this->normalizer->normalize($object->getSELinuxContext(), 'json', $context); + } + if ($object->isInitialized('seccomp') && null !== $object->getSeccomp()) { + $data['Seccomp'] = $this->normalizer->normalize($object->getSeccomp(), 'json', $context); + } + if ($object->isInitialized('appArmor') && null !== $object->getAppArmor()) { + $data['AppArmor'] = $this->normalizer->normalize($object->getAppArmor(), 'json', $context); + } + if ($object->isInitialized('noNewPrivileges') && null !== $object->getNoNewPrivileges()) { + $data['NoNewPrivileges'] = $object->getNoNewPrivileges(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivileges::class => false]; + } + } +} else { + class TaskSpecContainerSpecPrivilegesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecPrivileges::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecPrivileges::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecPrivileges(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CredentialSpec', $data) && $data['CredentialSpec'] !== null) { + $object->setCredentialSpec($this->denormalizer->denormalize($data['CredentialSpec'], \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class, 'json', $context)); + } + elseif (\array_key_exists('CredentialSpec', $data) && $data['CredentialSpec'] === null) { + $object->setCredentialSpec(null); + } + if (\array_key_exists('SELinuxContext', $data) && $data['SELinuxContext'] !== null) { + $object->setSELinuxContext($this->denormalizer->denormalize($data['SELinuxContext'], \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class, 'json', $context)); + } + elseif (\array_key_exists('SELinuxContext', $data) && $data['SELinuxContext'] === null) { + $object->setSELinuxContext(null); + } + if (\array_key_exists('Seccomp', $data) && $data['Seccomp'] !== null) { + $object->setSeccomp($this->denormalizer->denormalize($data['Seccomp'], \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class, 'json', $context)); + } + elseif (\array_key_exists('Seccomp', $data) && $data['Seccomp'] === null) { + $object->setSeccomp(null); + } + if (\array_key_exists('AppArmor', $data) && $data['AppArmor'] !== null) { + $object->setAppArmor($this->denormalizer->denormalize($data['AppArmor'], \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class, 'json', $context)); + } + elseif (\array_key_exists('AppArmor', $data) && $data['AppArmor'] === null) { + $object->setAppArmor(null); + } + if (\array_key_exists('NoNewPrivileges', $data) && $data['NoNewPrivileges'] !== null) { + $object->setNoNewPrivileges($data['NoNewPrivileges']); + } + elseif (\array_key_exists('NoNewPrivileges', $data) && $data['NoNewPrivileges'] === null) { + $object->setNoNewPrivileges(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('credentialSpec') && null !== $object->getCredentialSpec()) { + $data['CredentialSpec'] = $this->normalizer->normalize($object->getCredentialSpec(), 'json', $context); + } + if ($object->isInitialized('sELinuxContext') && null !== $object->getSELinuxContext()) { + $data['SELinuxContext'] = $this->normalizer->normalize($object->getSELinuxContext(), 'json', $context); + } + if ($object->isInitialized('seccomp') && null !== $object->getSeccomp()) { + $data['Seccomp'] = $this->normalizer->normalize($object->getSeccomp(), 'json', $context); + } + if ($object->isInitialized('appArmor') && null !== $object->getAppArmor()) { + $data['AppArmor'] = $this->normalizer->normalize($object->getAppArmor(), 'json', $context); + } + if ($object->isInitialized('noNewPrivileges') && null !== $object->getNoNewPrivileges()) { + $data['NoNewPrivileges'] = $object->getNoNewPrivileges(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivileges::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer.php b/generated/Normalizer/TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer.php new file mode 100644 index 00000000..1ae8af5a --- /dev/null +++ b/generated/Normalizer/TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer.php @@ -0,0 +1,190 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Disable', $data) && $data['Disable'] !== null) { + $object->setDisable($data['Disable']); + } + elseif (\array_key_exists('Disable', $data) && $data['Disable'] === null) { + $object->setDisable(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('Role', $data) && $data['Role'] !== null) { + $object->setRole($data['Role']); + } + elseif (\array_key_exists('Role', $data) && $data['Role'] === null) { + $object->setRole(null); + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Level', $data) && $data['Level'] !== null) { + $object->setLevel($data['Level']); + } + elseif (\array_key_exists('Level', $data) && $data['Level'] === null) { + $object->setLevel(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('disable') && null !== $object->getDisable()) { + $data['Disable'] = $object->getDisable(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); + } + if ($object->isInitialized('role') && null !== $object->getRole()) { + $data['Role'] = $object->getRole(); + } + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('level') && null !== $object->getLevel()) { + $data['Level'] = $object->getLevel(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class => false]; + } + } +} else { + class TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Disable', $data) && $data['Disable'] !== null) { + $object->setDisable($data['Disable']); + } + elseif (\array_key_exists('Disable', $data) && $data['Disable'] === null) { + $object->setDisable(null); + } + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); + } + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('Role', $data) && $data['Role'] !== null) { + $object->setRole($data['Role']); + } + elseif (\array_key_exists('Role', $data) && $data['Role'] === null) { + $object->setRole(null); + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); + } + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Level', $data) && $data['Level'] !== null) { + $object->setLevel($data['Level']); + } + elseif (\array_key_exists('Level', $data) && $data['Level'] === null) { + $object->setLevel(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('disable') && null !== $object->getDisable()) { + $data['Disable'] = $object->getDisable(); + } + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); + } + if ($object->isInitialized('role') && null !== $object->getRole()) { + $data['Role'] = $object->getRole(); + } + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); + } + if ($object->isInitialized('level') && null !== $object->getLevel()) { + $data['Level'] = $object->getLevel(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecContainerSpecPrivilegesSeccompNormalizer.php b/generated/Normalizer/TaskSpecContainerSpecPrivilegesSeccompNormalizer.php new file mode 100644 index 00000000..d4d5657b --- /dev/null +++ b/generated/Normalizer/TaskSpecContainerSpecPrivilegesSeccompNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecContainerSpecPrivilegesSeccompNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('Profile', $data) && $data['Profile'] !== null) { + $object->setProfile($data['Profile']); + } + elseif (\array_key_exists('Profile', $data) && $data['Profile'] === null) { + $object->setProfile(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + if ($object->isInitialized('profile') && null !== $object->getProfile()) { + $data['Profile'] = $object->getProfile(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class => false]; + } + } +} else { + class TaskSpecContainerSpecPrivilegesSeccompNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('Profile', $data) && $data['Profile'] !== null) { + $object->setProfile($data['Profile']); + } + elseif (\array_key_exists('Profile', $data) && $data['Profile'] === null) { + $object->setProfile(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + if ($object->isInitialized('profile') && null !== $object->getProfile()) { + $data['Profile'] = $object->getProfile(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecContainerSpecSecretsItemFileNormalizer.php b/generated/Normalizer/TaskSpecContainerSpecSecretsItemFileNormalizer.php new file mode 100644 index 00000000..d6d3b3b2 --- /dev/null +++ b/generated/Normalizer/TaskSpecContainerSpecSecretsItemFileNormalizer.php @@ -0,0 +1,172 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecContainerSpecSecretsItemFileNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('UID', $data) && $data['UID'] !== null) { + $object->setUID($data['UID']); + } + elseif (\array_key_exists('UID', $data) && $data['UID'] === null) { + $object->setUID(null); + } + if (\array_key_exists('GID', $data) && $data['GID'] !== null) { + $object->setGID($data['GID']); + } + elseif (\array_key_exists('GID', $data) && $data['GID'] === null) { + $object->setGID(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('uID') && null !== $object->getUID()) { + $data['UID'] = $object->getUID(); + } + if ($object->isInitialized('gID') && null !== $object->getGID()) { + $data['GID'] = $object->getGID(); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class => false]; + } + } +} else { + class TaskSpecContainerSpecSecretsItemFileNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('UID', $data) && $data['UID'] !== null) { + $object->setUID($data['UID']); + } + elseif (\array_key_exists('UID', $data) && $data['UID'] === null) { + $object->setUID(null); + } + if (\array_key_exists('GID', $data) && $data['GID'] !== null) { + $object->setGID($data['GID']); + } + elseif (\array_key_exists('GID', $data) && $data['GID'] === null) { + $object->setGID(null); + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); + } + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('uID') && null !== $object->getUID()) { + $data['UID'] = $object->getUID(); + } + if ($object->isInitialized('gID') && null !== $object->getGID()) { + $data['GID'] = $object->getGID(); + } + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecContainerSpecSecretsItemNormalizer.php b/generated/Normalizer/TaskSpecContainerSpecSecretsItemNormalizer.php new file mode 100644 index 00000000..53d61e78 --- /dev/null +++ b/generated/Normalizer/TaskSpecContainerSpecSecretsItemNormalizer.php @@ -0,0 +1,154 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecContainerSpecSecretsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecSecretsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('File', $data) && $data['File'] !== null) { + $object->setFile($this->denormalizer->denormalize($data['File'], \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class, 'json', $context)); + } + elseif (\array_key_exists('File', $data) && $data['File'] === null) { + $object->setFile(null); + } + if (\array_key_exists('SecretID', $data) && $data['SecretID'] !== null) { + $object->setSecretID($data['SecretID']); + } + elseif (\array_key_exists('SecretID', $data) && $data['SecretID'] === null) { + $object->setSecretID(null); + } + if (\array_key_exists('SecretName', $data) && $data['SecretName'] !== null) { + $object->setSecretName($data['SecretName']); + } + elseif (\array_key_exists('SecretName', $data) && $data['SecretName'] === null) { + $object->setSecretName(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('file') && null !== $object->getFile()) { + $data['File'] = $this->normalizer->normalize($object->getFile(), 'json', $context); + } + if ($object->isInitialized('secretID') && null !== $object->getSecretID()) { + $data['SecretID'] = $object->getSecretID(); + } + if ($object->isInitialized('secretName') && null !== $object->getSecretName()) { + $data['SecretName'] = $object->getSecretName(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecSecretsItem::class => false]; + } + } +} else { + class TaskSpecContainerSpecSecretsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecSecretsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('File', $data) && $data['File'] !== null) { + $object->setFile($this->denormalizer->denormalize($data['File'], \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class, 'json', $context)); + } + elseif (\array_key_exists('File', $data) && $data['File'] === null) { + $object->setFile(null); + } + if (\array_key_exists('SecretID', $data) && $data['SecretID'] !== null) { + $object->setSecretID($data['SecretID']); + } + elseif (\array_key_exists('SecretID', $data) && $data['SecretID'] === null) { + $object->setSecretID(null); + } + if (\array_key_exists('SecretName', $data) && $data['SecretName'] !== null) { + $object->setSecretName($data['SecretName']); + } + elseif (\array_key_exists('SecretName', $data) && $data['SecretName'] === null) { + $object->setSecretName(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('file') && null !== $object->getFile()) { + $data['File'] = $this->normalizer->normalize($object->getFile(), 'json', $context); + } + if ($object->isInitialized('secretID') && null !== $object->getSecretID()) { + $data['SecretID'] = $object->getSecretID(); + } + if ($object->isInitialized('secretName') && null !== $object->getSecretName()) { + $data['SecretName'] = $object->getSecretName(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecSecretsItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecContainerSpecUlimitsItemNormalizer.php b/generated/Normalizer/TaskSpecContainerSpecUlimitsItemNormalizer.php new file mode 100644 index 00000000..601d04e9 --- /dev/null +++ b/generated/Normalizer/TaskSpecContainerSpecUlimitsItemNormalizer.php @@ -0,0 +1,154 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecContainerSpecUlimitsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecUlimitsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Soft', $data) && $data['Soft'] !== null) { + $object->setSoft($data['Soft']); + } + elseif (\array_key_exists('Soft', $data) && $data['Soft'] === null) { + $object->setSoft(null); + } + if (\array_key_exists('Hard', $data) && $data['Hard'] !== null) { + $object->setHard($data['Hard']); + } + elseif (\array_key_exists('Hard', $data) && $data['Hard'] === null) { + $object->setHard(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('soft') && null !== $object->getSoft()) { + $data['Soft'] = $object->getSoft(); + } + if ($object->isInitialized('hard') && null !== $object->getHard()) { + $data['Hard'] = $object->getHard(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class => false]; + } + } +} else { + class TaskSpecContainerSpecUlimitsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecContainerSpecUlimitsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Soft', $data) && $data['Soft'] !== null) { + $object->setSoft($data['Soft']); + } + elseif (\array_key_exists('Soft', $data) && $data['Soft'] === null) { + $object->setSoft(null); + } + if (\array_key_exists('Hard', $data) && $data['Hard'] !== null) { + $object->setHard($data['Hard']); + } + elseif (\array_key_exists('Hard', $data) && $data['Hard'] === null) { + $object->setHard(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('soft') && null !== $object->getSoft()) { + $data['Soft'] = $object->getSoft(); + } + if ($object->isInitialized('hard') && null !== $object->getHard()) { + $data['Hard'] = $object->getHard(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecLogDriverNormalizer.php b/generated/Normalizer/TaskSpecLogDriverNormalizer.php new file mode 100644 index 00000000..4d2a6842 --- /dev/null +++ b/generated/Normalizer/TaskSpecLogDriverNormalizer.php @@ -0,0 +1,152 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecLogDriverNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecLogDriver::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecLogDriver::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecLogDriver(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { + $values[$key] = $value; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $key => $value) { + $values[$key] = $value; + } + $data['Options'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecLogDriver::class => false]; + } + } +} else { + class TaskSpecLogDriverNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecLogDriver::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecLogDriver::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecLogDriver(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { + $values[$key] = $value; + } + $object->setOptions($values); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = []; + foreach ($object->getOptions() as $key => $value) { + $values[$key] = $value; + } + $data['Options'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecLogDriver::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecNetworkAttachmentSpecNormalizer.php b/generated/Normalizer/TaskSpecNetworkAttachmentSpecNormalizer.php new file mode 100644 index 00000000..16aa37fe --- /dev/null +++ b/generated/Normalizer/TaskSpecNetworkAttachmentSpecNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecNetworkAttachmentSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecNetworkAttachmentSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ContainerID', $data) && $data['ContainerID'] !== null) { + $object->setContainerID($data['ContainerID']); + } + elseif (\array_key_exists('ContainerID', $data) && $data['ContainerID'] === null) { + $object->setContainerID(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('containerID') && null !== $object->getContainerID()) { + $data['ContainerID'] = $object->getContainerID(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecNetworkAttachmentSpec::class => false]; + } + } +} else { + class TaskSpecNetworkAttachmentSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecNetworkAttachmentSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ContainerID', $data) && $data['ContainerID'] !== null) { + $object->setContainerID($data['ContainerID']); + } + elseif (\array_key_exists('ContainerID', $data) && $data['ContainerID'] === null) { + $object->setContainerID(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('containerID') && null !== $object->getContainerID()) { + $data['ContainerID'] = $object->getContainerID(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecNetworkAttachmentSpec::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecNormalizer.php b/generated/Normalizer/TaskSpecNormalizer.php index 53ae985d..f7fc05a5 100644 --- a/generated/Normalizer/TaskSpecNormalizer.php +++ b/generated/Normalizer/TaskSpecNormalizer.php @@ -2,74 +2,295 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class TaskSpecNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\TaskSpec') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\TaskSpec) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpec::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\TaskSpec(); - if (property_exists($data, 'ContainerSpec')) { - $object->setContainerSpec($this->serializer->denormalize($data->{'ContainerSpec'}, 'Docker\\API\\Model\\ContainerSpec', 'raw', $context)); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpec::class; } - if (property_exists($data, 'Resources')) { - $object->setResources($this->serializer->denormalize($data->{'Resources'}, 'Docker\\API\\Model\\TaskSpecResourceRequirements', 'raw', $context)); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('PluginSpec', $data) && $data['PluginSpec'] !== null) { + $object->setPluginSpec($this->denormalizer->denormalize($data['PluginSpec'], \Docker\API\Model\TaskSpecPluginSpec::class, 'json', $context)); + } + elseif (\array_key_exists('PluginSpec', $data) && $data['PluginSpec'] === null) { + $object->setPluginSpec(null); + } + if (\array_key_exists('ContainerSpec', $data) && $data['ContainerSpec'] !== null) { + $object->setContainerSpec($this->denormalizer->denormalize($data['ContainerSpec'], \Docker\API\Model\TaskSpecContainerSpec::class, 'json', $context)); + } + elseif (\array_key_exists('ContainerSpec', $data) && $data['ContainerSpec'] === null) { + $object->setContainerSpec(null); + } + if (\array_key_exists('NetworkAttachmentSpec', $data) && $data['NetworkAttachmentSpec'] !== null) { + $object->setNetworkAttachmentSpec($this->denormalizer->denormalize($data['NetworkAttachmentSpec'], \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class, 'json', $context)); + } + elseif (\array_key_exists('NetworkAttachmentSpec', $data) && $data['NetworkAttachmentSpec'] === null) { + $object->setNetworkAttachmentSpec(null); + } + if (\array_key_exists('Resources', $data) && $data['Resources'] !== null) { + $object->setResources($this->denormalizer->denormalize($data['Resources'], \Docker\API\Model\TaskSpecResources::class, 'json', $context)); + } + elseif (\array_key_exists('Resources', $data) && $data['Resources'] === null) { + $object->setResources(null); + } + if (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] !== null) { + $object->setRestartPolicy($this->denormalizer->denormalize($data['RestartPolicy'], \Docker\API\Model\TaskSpecRestartPolicy::class, 'json', $context)); + } + elseif (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] === null) { + $object->setRestartPolicy(null); + } + if (\array_key_exists('Placement', $data) && $data['Placement'] !== null) { + $object->setPlacement($this->denormalizer->denormalize($data['Placement'], \Docker\API\Model\TaskSpecPlacement::class, 'json', $context)); + } + elseif (\array_key_exists('Placement', $data) && $data['Placement'] === null) { + $object->setPlacement(null); + } + if (\array_key_exists('ForceUpdate', $data) && $data['ForceUpdate'] !== null) { + $object->setForceUpdate($data['ForceUpdate']); + } + elseif (\array_key_exists('ForceUpdate', $data) && $data['ForceUpdate'] === null) { + $object->setForceUpdate(null); + } + if (\array_key_exists('Runtime', $data) && $data['Runtime'] !== null) { + $object->setRuntime($data['Runtime']); + } + elseif (\array_key_exists('Runtime', $data) && $data['Runtime'] === null) { + $object->setRuntime(null); + } + if (\array_key_exists('Networks', $data) && $data['Networks'] !== null) { + $values = []; + foreach ($data['Networks'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\NetworkAttachmentConfig::class, 'json', $context); + } + $object->setNetworks($values); + } + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } + if (\array_key_exists('LogDriver', $data) && $data['LogDriver'] !== null) { + $object->setLogDriver($this->denormalizer->denormalize($data['LogDriver'], \Docker\API\Model\TaskSpecLogDriver::class, 'json', $context)); + } + elseif (\array_key_exists('LogDriver', $data) && $data['LogDriver'] === null) { + $object->setLogDriver(null); + } + return $object; } - if (property_exists($data, 'RestartPolicy')) { - $object->setRestartPolicy($this->serializer->denormalize($data->{'RestartPolicy'}, 'Docker\\API\\Model\\TaskSpecRestartPolicy', 'raw', $context)); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('pluginSpec') && null !== $object->getPluginSpec()) { + $data['PluginSpec'] = $this->normalizer->normalize($object->getPluginSpec(), 'json', $context); + } + if ($object->isInitialized('containerSpec') && null !== $object->getContainerSpec()) { + $data['ContainerSpec'] = $this->normalizer->normalize($object->getContainerSpec(), 'json', $context); + } + if ($object->isInitialized('networkAttachmentSpec') && null !== $object->getNetworkAttachmentSpec()) { + $data['NetworkAttachmentSpec'] = $this->normalizer->normalize($object->getNetworkAttachmentSpec(), 'json', $context); + } + if ($object->isInitialized('resources') && null !== $object->getResources()) { + $data['Resources'] = $this->normalizer->normalize($object->getResources(), 'json', $context); + } + if ($object->isInitialized('restartPolicy') && null !== $object->getRestartPolicy()) { + $data['RestartPolicy'] = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); + } + if ($object->isInitialized('placement') && null !== $object->getPlacement()) { + $data['Placement'] = $this->normalizer->normalize($object->getPlacement(), 'json', $context); + } + if ($object->isInitialized('forceUpdate') && null !== $object->getForceUpdate()) { + $data['ForceUpdate'] = $object->getForceUpdate(); + } + if ($object->isInitialized('runtime') && null !== $object->getRuntime()) { + $data['Runtime'] = $object->getRuntime(); + } + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values = []; + foreach ($object->getNetworks() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Networks'] = $values; + } + if ($object->isInitialized('logDriver') && null !== $object->getLogDriver()) { + $data['LogDriver'] = $this->normalizer->normalize($object->getLogDriver(), 'json', $context); + } + return $data; } - if (property_exists($data, 'Placement')) { - $object->setPlacement($this->serializer->denormalize($data->{'Placement'}, 'Docker\\API\\Model\\TaskSpecPlacement', 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpec::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class TaskSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getContainerSpec()) { - $data->{'ContainerSpec'} = json_decode($this->serializer->normalize($object->getContainerSpec(), 'raw', $context)); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpec::class; } - if (null !== $object->getResources()) { - $data->{'Resources'} = json_decode($this->serializer->normalize($object->getResources(), 'raw', $context)); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpec::class; } - if (null !== $object->getRestartPolicy()) { - $data->{'RestartPolicy'} = json_decode($this->serializer->normalize($object->getRestartPolicy(), 'raw', $context)); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('PluginSpec', $data) && $data['PluginSpec'] !== null) { + $object->setPluginSpec($this->denormalizer->denormalize($data['PluginSpec'], \Docker\API\Model\TaskSpecPluginSpec::class, 'json', $context)); + } + elseif (\array_key_exists('PluginSpec', $data) && $data['PluginSpec'] === null) { + $object->setPluginSpec(null); + } + if (\array_key_exists('ContainerSpec', $data) && $data['ContainerSpec'] !== null) { + $object->setContainerSpec($this->denormalizer->denormalize($data['ContainerSpec'], \Docker\API\Model\TaskSpecContainerSpec::class, 'json', $context)); + } + elseif (\array_key_exists('ContainerSpec', $data) && $data['ContainerSpec'] === null) { + $object->setContainerSpec(null); + } + if (\array_key_exists('NetworkAttachmentSpec', $data) && $data['NetworkAttachmentSpec'] !== null) { + $object->setNetworkAttachmentSpec($this->denormalizer->denormalize($data['NetworkAttachmentSpec'], \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class, 'json', $context)); + } + elseif (\array_key_exists('NetworkAttachmentSpec', $data) && $data['NetworkAttachmentSpec'] === null) { + $object->setNetworkAttachmentSpec(null); + } + if (\array_key_exists('Resources', $data) && $data['Resources'] !== null) { + $object->setResources($this->denormalizer->denormalize($data['Resources'], \Docker\API\Model\TaskSpecResources::class, 'json', $context)); + } + elseif (\array_key_exists('Resources', $data) && $data['Resources'] === null) { + $object->setResources(null); + } + if (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] !== null) { + $object->setRestartPolicy($this->denormalizer->denormalize($data['RestartPolicy'], \Docker\API\Model\TaskSpecRestartPolicy::class, 'json', $context)); + } + elseif (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] === null) { + $object->setRestartPolicy(null); + } + if (\array_key_exists('Placement', $data) && $data['Placement'] !== null) { + $object->setPlacement($this->denormalizer->denormalize($data['Placement'], \Docker\API\Model\TaskSpecPlacement::class, 'json', $context)); + } + elseif (\array_key_exists('Placement', $data) && $data['Placement'] === null) { + $object->setPlacement(null); + } + if (\array_key_exists('ForceUpdate', $data) && $data['ForceUpdate'] !== null) { + $object->setForceUpdate($data['ForceUpdate']); + } + elseif (\array_key_exists('ForceUpdate', $data) && $data['ForceUpdate'] === null) { + $object->setForceUpdate(null); + } + if (\array_key_exists('Runtime', $data) && $data['Runtime'] !== null) { + $object->setRuntime($data['Runtime']); + } + elseif (\array_key_exists('Runtime', $data) && $data['Runtime'] === null) { + $object->setRuntime(null); + } + if (\array_key_exists('Networks', $data) && $data['Networks'] !== null) { + $values = []; + foreach ($data['Networks'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\NetworkAttachmentConfig::class, 'json', $context); + } + $object->setNetworks($values); + } + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } + if (\array_key_exists('LogDriver', $data) && $data['LogDriver'] !== null) { + $object->setLogDriver($this->denormalizer->denormalize($data['LogDriver'], \Docker\API\Model\TaskSpecLogDriver::class, 'json', $context)); + } + elseif (\array_key_exists('LogDriver', $data) && $data['LogDriver'] === null) { + $object->setLogDriver(null); + } + return $object; } - if (null !== $object->getPlacement()) { - $data->{'Placement'} = json_decode($this->serializer->normalize($object->getPlacement(), 'raw', $context)); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('pluginSpec') && null !== $object->getPluginSpec()) { + $data['PluginSpec'] = $this->normalizer->normalize($object->getPluginSpec(), 'json', $context); + } + if ($object->isInitialized('containerSpec') && null !== $object->getContainerSpec()) { + $data['ContainerSpec'] = $this->normalizer->normalize($object->getContainerSpec(), 'json', $context); + } + if ($object->isInitialized('networkAttachmentSpec') && null !== $object->getNetworkAttachmentSpec()) { + $data['NetworkAttachmentSpec'] = $this->normalizer->normalize($object->getNetworkAttachmentSpec(), 'json', $context); + } + if ($object->isInitialized('resources') && null !== $object->getResources()) { + $data['Resources'] = $this->normalizer->normalize($object->getResources(), 'json', $context); + } + if ($object->isInitialized('restartPolicy') && null !== $object->getRestartPolicy()) { + $data['RestartPolicy'] = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); + } + if ($object->isInitialized('placement') && null !== $object->getPlacement()) { + $data['Placement'] = $this->normalizer->normalize($object->getPlacement(), 'json', $context); + } + if ($object->isInitialized('forceUpdate') && null !== $object->getForceUpdate()) { + $data['ForceUpdate'] = $object->getForceUpdate(); + } + if ($object->isInitialized('runtime') && null !== $object->getRuntime()) { + $data['Runtime'] = $object->getRuntime(); + } + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values = []; + foreach ($object->getNetworks() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Networks'] = $values; + } + if ($object->isInitialized('logDriver') && null !== $object->getLogDriver()) { + $data['LogDriver'] = $this->normalizer->normalize($object->getLogDriver(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpec::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecPlacementNormalizer.php b/generated/Normalizer/TaskSpecPlacementNormalizer.php index d3183311..34647ff9 100644 --- a/generated/Normalizer/TaskSpecPlacementNormalizer.php +++ b/generated/Normalizer/TaskSpecPlacementNormalizer.php @@ -2,76 +2,219 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class TaskSpecPlacementNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecPlacementNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\TaskSpecPlacement') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecPlacement::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\TaskSpecPlacement) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecPlacement::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\TaskSpecPlacement(); - if (property_exists($data, 'Constraints')) { - $value = $data->{'Constraints'}; - if (is_array($data->{'Constraints'})) { + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecPlacement(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Constraints', $data) && $data['Constraints'] !== null) { $values = []; - foreach ($data->{'Constraints'} as $value_1) { - $values[] = $value_1; + foreach ($data['Constraints'] as $value) { + $values[] = $value; + } + $object->setConstraints($values); + } + elseif (\array_key_exists('Constraints', $data) && $data['Constraints'] === null) { + $object->setConstraints(null); + } + if (\array_key_exists('Preferences', $data) && $data['Preferences'] !== null) { + $values_1 = []; + foreach ($data['Preferences'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\TaskSpecPlacementPreferencesItem::class, 'json', $context); + } + $object->setPreferences($values_1); + } + elseif (\array_key_exists('Preferences', $data) && $data['Preferences'] === null) { + $object->setPreferences(null); + } + if (\array_key_exists('MaxReplicas', $data) && $data['MaxReplicas'] !== null) { + $object->setMaxReplicas($data['MaxReplicas']); + } + elseif (\array_key_exists('MaxReplicas', $data) && $data['MaxReplicas'] === null) { + $object->setMaxReplicas(null); + } + if (\array_key_exists('Platforms', $data) && $data['Platforms'] !== null) { + $values_2 = []; + foreach ($data['Platforms'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\Platform::class, 'json', $context); } - $value = $values; + $object->setPlatforms($values_2); } - if (is_null($data->{'Constraints'})) { - $value = $data->{'Constraints'}; + elseif (\array_key_exists('Platforms', $data) && $data['Platforms'] === null) { + $object->setPlatforms(null); } - $object->setConstraints($value); + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('constraints') && null !== $object->getConstraints()) { + $values = []; + foreach ($object->getConstraints() as $value) { + $values[] = $value; + } + $data['Constraints'] = $values; + } + if ($object->isInitialized('preferences') && null !== $object->getPreferences()) { + $values_1 = []; + foreach ($object->getPreferences() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Preferences'] = $values_1; + } + if ($object->isInitialized('maxReplicas') && null !== $object->getMaxReplicas()) { + $data['MaxReplicas'] = $object->getMaxReplicas(); + } + if ($object->isInitialized('platforms') && null !== $object->getPlatforms()) { + $values_2 = []; + foreach ($object->getPlatforms() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['Platforms'] = $values_2; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecPlacement::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class TaskSpecPlacementNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - $value = $object->getConstraints(); - if (is_array($object->getConstraints())) { - $values = []; - foreach ($object->getConstraints() as $value_1) { - $values[] = $value_1; - } - $value = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecPlacement::class; } - if (is_null($object->getConstraints())) { - $value = $object->getConstraints(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecPlacement::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecPlacement(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Constraints', $data) && $data['Constraints'] !== null) { + $values = []; + foreach ($data['Constraints'] as $value) { + $values[] = $value; + } + $object->setConstraints($values); + } + elseif (\array_key_exists('Constraints', $data) && $data['Constraints'] === null) { + $object->setConstraints(null); + } + if (\array_key_exists('Preferences', $data) && $data['Preferences'] !== null) { + $values_1 = []; + foreach ($data['Preferences'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\TaskSpecPlacementPreferencesItem::class, 'json', $context); + } + $object->setPreferences($values_1); + } + elseif (\array_key_exists('Preferences', $data) && $data['Preferences'] === null) { + $object->setPreferences(null); + } + if (\array_key_exists('MaxReplicas', $data) && $data['MaxReplicas'] !== null) { + $object->setMaxReplicas($data['MaxReplicas']); + } + elseif (\array_key_exists('MaxReplicas', $data) && $data['MaxReplicas'] === null) { + $object->setMaxReplicas(null); + } + if (\array_key_exists('Platforms', $data) && $data['Platforms'] !== null) { + $values_2 = []; + foreach ($data['Platforms'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\Platform::class, 'json', $context); + } + $object->setPlatforms($values_2); + } + elseif (\array_key_exists('Platforms', $data) && $data['Platforms'] === null) { + $object->setPlatforms(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('constraints') && null !== $object->getConstraints()) { + $values = []; + foreach ($object->getConstraints() as $value) { + $values[] = $value; + } + $data['Constraints'] = $values; + } + if ($object->isInitialized('preferences') && null !== $object->getPreferences()) { + $values_1 = []; + foreach ($object->getPreferences() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Preferences'] = $values_1; + } + if ($object->isInitialized('maxReplicas') && null !== $object->getMaxReplicas()) { + $data['MaxReplicas'] = $object->getMaxReplicas(); + } + if ($object->isInitialized('platforms') && null !== $object->getPlatforms()) { + $values_2 = []; + foreach ($object->getPlatforms() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['Platforms'] = $values_2; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecPlacement::class => false]; } - $data->{'Constraints'} = $value; - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecPlacementPreferencesItemNormalizer.php b/generated/Normalizer/TaskSpecPlacementPreferencesItemNormalizer.php new file mode 100644 index 00000000..e21b020e --- /dev/null +++ b/generated/Normalizer/TaskSpecPlacementPreferencesItemNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecPlacementPreferencesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecPlacementPreferencesItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecPlacementPreferencesItem::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecPlacementPreferencesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Spread', $data) && $data['Spread'] !== null) { + $object->setSpread($this->denormalizer->denormalize($data['Spread'], \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class, 'json', $context)); + } + elseif (\array_key_exists('Spread', $data) && $data['Spread'] === null) { + $object->setSpread(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('spread') && null !== $object->getSpread()) { + $data['Spread'] = $this->normalizer->normalize($object->getSpread(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecPlacementPreferencesItem::class => false]; + } + } +} else { + class TaskSpecPlacementPreferencesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecPlacementPreferencesItem::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecPlacementPreferencesItem::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecPlacementPreferencesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Spread', $data) && $data['Spread'] !== null) { + $object->setSpread($this->denormalizer->denormalize($data['Spread'], \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class, 'json', $context)); + } + elseif (\array_key_exists('Spread', $data) && $data['Spread'] === null) { + $object->setSpread(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('spread') && null !== $object->getSpread()) { + $data['Spread'] = $this->normalizer->normalize($object->getSpread(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecPlacementPreferencesItem::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecPlacementPreferencesItemSpreadNormalizer.php b/generated/Normalizer/TaskSpecPlacementPreferencesItemSpreadNormalizer.php new file mode 100644 index 00000000..377ef48d --- /dev/null +++ b/generated/Normalizer/TaskSpecPlacementPreferencesItemSpreadNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecPlacementPreferencesItemSpreadNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('SpreadDescriptor', $data) && $data['SpreadDescriptor'] !== null) { + $object->setSpreadDescriptor($data['SpreadDescriptor']); + } + elseif (\array_key_exists('SpreadDescriptor', $data) && $data['SpreadDescriptor'] === null) { + $object->setSpreadDescriptor(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('spreadDescriptor') && null !== $object->getSpreadDescriptor()) { + $data['SpreadDescriptor'] = $object->getSpreadDescriptor(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class => false]; + } + } +} else { + class TaskSpecPlacementPreferencesItemSpreadNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('SpreadDescriptor', $data) && $data['SpreadDescriptor'] !== null) { + $object->setSpreadDescriptor($data['SpreadDescriptor']); + } + elseif (\array_key_exists('SpreadDescriptor', $data) && $data['SpreadDescriptor'] === null) { + $object->setSpreadDescriptor(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('spreadDescriptor') && null !== $object->getSpreadDescriptor()) { + $data['SpreadDescriptor'] = $object->getSpreadDescriptor(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecPluginSpecNormalizer.php b/generated/Normalizer/TaskSpecPluginSpecNormalizer.php new file mode 100644 index 00000000..45c06e4a --- /dev/null +++ b/generated/Normalizer/TaskSpecPluginSpecNormalizer.php @@ -0,0 +1,188 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecPluginSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecPluginSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecPluginSpec::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecPluginSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Remote', $data) && $data['Remote'] !== null) { + $object->setRemote($data['Remote']); + } + elseif (\array_key_exists('Remote', $data) && $data['Remote'] === null) { + $object->setRemote(null); + } + if (\array_key_exists('Disabled', $data) && $data['Disabled'] !== null) { + $object->setDisabled($data['Disabled']); + } + elseif (\array_key_exists('Disabled', $data) && $data['Disabled'] === null) { + $object->setDisabled(null); + } + if (\array_key_exists('PluginPrivilege', $data) && $data['PluginPrivilege'] !== null) { + $values = []; + foreach ($data['PluginPrivilege'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\PluginPrivilege::class, 'json', $context); + } + $object->setPluginPrivilege($values); + } + elseif (\array_key_exists('PluginPrivilege', $data) && $data['PluginPrivilege'] === null) { + $object->setPluginPrivilege(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('remote') && null !== $object->getRemote()) { + $data['Remote'] = $object->getRemote(); + } + if ($object->isInitialized('disabled') && null !== $object->getDisabled()) { + $data['Disabled'] = $object->getDisabled(); + } + if ($object->isInitialized('pluginPrivilege') && null !== $object->getPluginPrivilege()) { + $values = []; + foreach ($object->getPluginPrivilege() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['PluginPrivilege'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecPluginSpec::class => false]; + } + } +} else { + class TaskSpecPluginSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecPluginSpec::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecPluginSpec::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecPluginSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Remote', $data) && $data['Remote'] !== null) { + $object->setRemote($data['Remote']); + } + elseif (\array_key_exists('Remote', $data) && $data['Remote'] === null) { + $object->setRemote(null); + } + if (\array_key_exists('Disabled', $data) && $data['Disabled'] !== null) { + $object->setDisabled($data['Disabled']); + } + elseif (\array_key_exists('Disabled', $data) && $data['Disabled'] === null) { + $object->setDisabled(null); + } + if (\array_key_exists('PluginPrivilege', $data) && $data['PluginPrivilege'] !== null) { + $values = []; + foreach ($data['PluginPrivilege'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\PluginPrivilege::class, 'json', $context); + } + $object->setPluginPrivilege($values); + } + elseif (\array_key_exists('PluginPrivilege', $data) && $data['PluginPrivilege'] === null) { + $object->setPluginPrivilege(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('remote') && null !== $object->getRemote()) { + $data['Remote'] = $object->getRemote(); + } + if ($object->isInitialized('disabled') && null !== $object->getDisabled()) { + $data['Disabled'] = $object->getDisabled(); + } + if ($object->isInitialized('pluginPrivilege') && null !== $object->getPluginPrivilege()) { + $values = []; + foreach ($object->getPluginPrivilege() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['PluginPrivilege'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecPluginSpec::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecResourceRequirementsNormalizer.php b/generated/Normalizer/TaskSpecResourceRequirementsNormalizer.php deleted file mode 100644 index ecbed2a3..00000000 --- a/generated/Normalizer/TaskSpecResourceRequirementsNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -setLimits($this->serializer->denormalize($data->{'Limits'}, 'Docker\\API\\Model\\NodeResources', 'raw', $context)); - } - if (property_exists($data, 'Reservations')) { - $object->setReservations($this->serializer->denormalize($data->{'Reservations'}, 'Docker\\API\\Model\\NodeResources', 'raw', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getLimits()) { - $data->{'Limits'} = json_decode($this->serializer->normalize($object->getLimits(), 'raw', $context)); - } - if (null !== $object->getReservations()) { - $data->{'Reservations'} = json_decode($this->serializer->normalize($object->getReservations(), 'raw', $context)); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/TaskSpecResourcesNormalizer.php b/generated/Normalizer/TaskSpecResourcesNormalizer.php new file mode 100644 index 00000000..b5341b76 --- /dev/null +++ b/generated/Normalizer/TaskSpecResourcesNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecResourcesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecResources::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecResources::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecResources(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Limits', $data) && $data['Limits'] !== null) { + $object->setLimits($this->denormalizer->denormalize($data['Limits'], \Docker\API\Model\Limit::class, 'json', $context)); + } + elseif (\array_key_exists('Limits', $data) && $data['Limits'] === null) { + $object->setLimits(null); + } + if (\array_key_exists('Reservations', $data) && $data['Reservations'] !== null) { + $object->setReservations($this->denormalizer->denormalize($data['Reservations'], \Docker\API\Model\ResourceObject::class, 'json', $context)); + } + elseif (\array_key_exists('Reservations', $data) && $data['Reservations'] === null) { + $object->setReservations(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('limits') && null !== $object->getLimits()) { + $data['Limits'] = $this->normalizer->normalize($object->getLimits(), 'json', $context); + } + if ($object->isInitialized('reservations') && null !== $object->getReservations()) { + $data['Reservations'] = $this->normalizer->normalize($object->getReservations(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecResources::class => false]; + } + } +} else { + class TaskSpecResourcesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecResources::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecResources::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecResources(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Limits', $data) && $data['Limits'] !== null) { + $object->setLimits($this->denormalizer->denormalize($data['Limits'], \Docker\API\Model\Limit::class, 'json', $context)); + } + elseif (\array_key_exists('Limits', $data) && $data['Limits'] === null) { + $object->setLimits(null); + } + if (\array_key_exists('Reservations', $data) && $data['Reservations'] !== null) { + $object->setReservations($this->denormalizer->denormalize($data['Reservations'], \Docker\API\Model\ResourceObject::class, 'json', $context)); + } + elseif (\array_key_exists('Reservations', $data) && $data['Reservations'] === null) { + $object->setReservations(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('limits') && null !== $object->getLimits()) { + $data['Limits'] = $this->normalizer->normalize($object->getLimits(), 'json', $context); + } + if ($object->isInitialized('reservations') && null !== $object->getReservations()) { + $data['Reservations'] = $this->normalizer->normalize($object->getReservations(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecResources::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/TaskSpecRestartPolicyNormalizer.php b/generated/Normalizer/TaskSpecRestartPolicyNormalizer.php index 844ad6ea..a919ddec 100644 --- a/generated/Normalizer/TaskSpecRestartPolicyNormalizer.php +++ b/generated/Normalizer/TaskSpecRestartPolicyNormalizer.php @@ -2,74 +2,171 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class TaskSpecRestartPolicyNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\TaskSpecRestartPolicy') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskSpecRestartPolicyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($data instanceof \Docker\API\Model\TaskSpecRestartPolicy) { - return true; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecRestartPolicy::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\TaskSpecRestartPolicy(); - if (property_exists($data, 'Condition')) { - $object->setCondition($data->{'Condition'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecRestartPolicy::class; } - if (property_exists($data, 'Delay')) { - $object->setDelay($data->{'Delay'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecRestartPolicy(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Condition', $data) && $data['Condition'] !== null) { + $object->setCondition($data['Condition']); + } + elseif (\array_key_exists('Condition', $data) && $data['Condition'] === null) { + $object->setCondition(null); + } + if (\array_key_exists('Delay', $data) && $data['Delay'] !== null) { + $object->setDelay($data['Delay']); + } + elseif (\array_key_exists('Delay', $data) && $data['Delay'] === null) { + $object->setDelay(null); + } + if (\array_key_exists('MaxAttempts', $data) && $data['MaxAttempts'] !== null) { + $object->setMaxAttempts($data['MaxAttempts']); + } + elseif (\array_key_exists('MaxAttempts', $data) && $data['MaxAttempts'] === null) { + $object->setMaxAttempts(null); + } + if (\array_key_exists('Window', $data) && $data['Window'] !== null) { + $object->setWindow($data['Window']); + } + elseif (\array_key_exists('Window', $data) && $data['Window'] === null) { + $object->setWindow(null); + } + return $object; } - if (property_exists($data, 'MaxAttempts')) { - $object->setMaxAttempts($data->{'MaxAttempts'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('condition') && null !== $object->getCondition()) { + $data['Condition'] = $object->getCondition(); + } + if ($object->isInitialized('delay') && null !== $object->getDelay()) { + $data['Delay'] = $object->getDelay(); + } + if ($object->isInitialized('maxAttempts') && null !== $object->getMaxAttempts()) { + $data['MaxAttempts'] = $object->getMaxAttempts(); + } + if ($object->isInitialized('window') && null !== $object->getWindow()) { + $data['Window'] = $object->getWindow(); + } + return $data; } - if (property_exists($data, 'Window')) { - $object->setWindow($data->{'Window'}); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecRestartPolicy::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class TaskSpecRestartPolicyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getCondition()) { - $data->{'Condition'} = $object->getCondition(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskSpecRestartPolicy::class; } - if (null !== $object->getDelay()) { - $data->{'Delay'} = $object->getDelay(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskSpecRestartPolicy::class; } - if (null !== $object->getMaxAttempts()) { - $data->{'MaxAttempts'} = $object->getMaxAttempts(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskSpecRestartPolicy(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Condition', $data) && $data['Condition'] !== null) { + $object->setCondition($data['Condition']); + } + elseif (\array_key_exists('Condition', $data) && $data['Condition'] === null) { + $object->setCondition(null); + } + if (\array_key_exists('Delay', $data) && $data['Delay'] !== null) { + $object->setDelay($data['Delay']); + } + elseif (\array_key_exists('Delay', $data) && $data['Delay'] === null) { + $object->setDelay(null); + } + if (\array_key_exists('MaxAttempts', $data) && $data['MaxAttempts'] !== null) { + $object->setMaxAttempts($data['MaxAttempts']); + } + elseif (\array_key_exists('MaxAttempts', $data) && $data['MaxAttempts'] === null) { + $object->setMaxAttempts(null); + } + if (\array_key_exists('Window', $data) && $data['Window'] !== null) { + $object->setWindow($data['Window']); + } + elseif (\array_key_exists('Window', $data) && $data['Window'] === null) { + $object->setWindow(null); + } + return $object; } - if (null !== $object->getWindow()) { - $data->{'Window'} = $object->getWindow(); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('condition') && null !== $object->getCondition()) { + $data['Condition'] = $object->getCondition(); + } + if ($object->isInitialized('delay') && null !== $object->getDelay()) { + $data['Delay'] = $object->getDelay(); + } + if ($object->isInitialized('maxAttempts') && null !== $object->getMaxAttempts()) { + $data['MaxAttempts'] = $object->getMaxAttempts(); + } + if ($object->isInitialized('window') && null !== $object->getWindow()) { + $data['Window'] = $object->getWindow(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecRestartPolicy::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/TaskStatusNormalizer.php b/generated/Normalizer/TaskStatusNormalizer.php index 0b29154a..2b45589a 100644 --- a/generated/Normalizer/TaskStatusNormalizer.php +++ b/generated/Normalizer/TaskStatusNormalizer.php @@ -2,80 +2,207 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class TaskStatusNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) - { - if ($type !== 'Docker\\API\\Model\\TaskStatus') { - return false; - } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\TaskStatus) { - return true; - } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TaskStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $object = new \Docker\API\Model\TaskStatus(); - if (property_exists($data, 'Timestamp')) { - $object->setTimestamp($data->{'Timestamp'}); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskStatus::class; } - if (property_exists($data, 'State')) { - $object->setState($data->{'State'}); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskStatus::class; } - if (property_exists($data, 'Message')) { - $object->setMessage($data->{'Message'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Timestamp', $data) && $data['Timestamp'] !== null) { + $object->setTimestamp($data['Timestamp']); + } + elseif (\array_key_exists('Timestamp', $data) && $data['Timestamp'] === null) { + $object->setTimestamp(null); + } + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); + } + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); + } + if (\array_key_exists('Message', $data) && $data['Message'] !== null) { + $object->setMessage($data['Message']); + } + elseif (\array_key_exists('Message', $data) && $data['Message'] === null) { + $object->setMessage(null); + } + if (\array_key_exists('Err', $data) && $data['Err'] !== null) { + $object->setErr($data['Err']); + } + elseif (\array_key_exists('Err', $data) && $data['Err'] === null) { + $object->setErr(null); + } + if (\array_key_exists('ContainerStatus', $data) && $data['ContainerStatus'] !== null) { + $object->setContainerStatus($this->denormalizer->denormalize($data['ContainerStatus'], \Docker\API\Model\ContainerStatus::class, 'json', $context)); + } + elseif (\array_key_exists('ContainerStatus', $data) && $data['ContainerStatus'] === null) { + $object->setContainerStatus(null); + } + if (\array_key_exists('PortStatus', $data) && $data['PortStatus'] !== null) { + $object->setPortStatus($this->denormalizer->denormalize($data['PortStatus'], \Docker\API\Model\PortStatus::class, 'json', $context)); + } + elseif (\array_key_exists('PortStatus', $data) && $data['PortStatus'] === null) { + $object->setPortStatus(null); + } + return $object; } - if (property_exists($data, 'Err')) { - $object->setErr($data->{'Err'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('timestamp') && null !== $object->getTimestamp()) { + $data['Timestamp'] = $object->getTimestamp(); + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); + } + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['Message'] = $object->getMessage(); + } + if ($object->isInitialized('err') && null !== $object->getErr()) { + $data['Err'] = $object->getErr(); + } + if ($object->isInitialized('containerStatus') && null !== $object->getContainerStatus()) { + $data['ContainerStatus'] = $this->normalizer->normalize($object->getContainerStatus(), 'json', $context); + } + if ($object->isInitialized('portStatus') && null !== $object->getPortStatus()) { + $data['PortStatus'] = $this->normalizer->normalize($object->getPortStatus(), 'json', $context); + } + return $data; } - if (property_exists($data, 'ContainerStatus')) { - $object->setContainerStatus($this->serializer->denormalize($data->{'ContainerStatus'}, 'Docker\\API\\Model\\ContainerStatus', 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskStatus::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class TaskStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getTimestamp()) { - $data->{'Timestamp'} = $object->getTimestamp(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\TaskStatus::class; } - if (null !== $object->getState()) { - $data->{'State'} = $object->getState(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\TaskStatus::class; } - if (null !== $object->getMessage()) { - $data->{'Message'} = $object->getMessage(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\TaskStatus(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Timestamp', $data) && $data['Timestamp'] !== null) { + $object->setTimestamp($data['Timestamp']); + } + elseif (\array_key_exists('Timestamp', $data) && $data['Timestamp'] === null) { + $object->setTimestamp(null); + } + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); + } + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); + } + if (\array_key_exists('Message', $data) && $data['Message'] !== null) { + $object->setMessage($data['Message']); + } + elseif (\array_key_exists('Message', $data) && $data['Message'] === null) { + $object->setMessage(null); + } + if (\array_key_exists('Err', $data) && $data['Err'] !== null) { + $object->setErr($data['Err']); + } + elseif (\array_key_exists('Err', $data) && $data['Err'] === null) { + $object->setErr(null); + } + if (\array_key_exists('ContainerStatus', $data) && $data['ContainerStatus'] !== null) { + $object->setContainerStatus($this->denormalizer->denormalize($data['ContainerStatus'], \Docker\API\Model\ContainerStatus::class, 'json', $context)); + } + elseif (\array_key_exists('ContainerStatus', $data) && $data['ContainerStatus'] === null) { + $object->setContainerStatus(null); + } + if (\array_key_exists('PortStatus', $data) && $data['PortStatus'] !== null) { + $object->setPortStatus($this->denormalizer->denormalize($data['PortStatus'], \Docker\API\Model\PortStatus::class, 'json', $context)); + } + elseif (\array_key_exists('PortStatus', $data) && $data['PortStatus'] === null) { + $object->setPortStatus(null); + } + return $object; } - if (null !== $object->getErr()) { - $data->{'Err'} = $object->getErr(); + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('timestamp') && null !== $object->getTimestamp()) { + $data['Timestamp'] = $object->getTimestamp(); + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); + } + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['Message'] = $object->getMessage(); + } + if ($object->isInitialized('err') && null !== $object->getErr()) { + $data['Err'] = $object->getErr(); + } + if ($object->isInitialized('containerStatus') && null !== $object->getContainerStatus()) { + $data['ContainerStatus'] = $this->normalizer->normalize($object->getContainerStatus(), 'json', $context); + } + if ($object->isInitialized('portStatus') && null !== $object->getPortStatus()) { + $data['PortStatus'] = $this->normalizer->normalize($object->getPortStatus(), 'json', $context); + } + return $data; } - if (null !== $object->getContainerStatus()) { - $data->{'ContainerStatus'} = json_decode($this->serializer->normalize($object->getContainerStatus(), 'raw', $context)); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskStatus::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/ThrottleDeviceNormalizer.php b/generated/Normalizer/ThrottleDeviceNormalizer.php new file mode 100644 index 00000000..d19b2d3f --- /dev/null +++ b/generated/Normalizer/ThrottleDeviceNormalizer.php @@ -0,0 +1,136 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ThrottleDeviceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ThrottleDevice::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ThrottleDevice::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ThrottleDevice(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Path', $data) && $data['Path'] !== null) { + $object->setPath($data['Path']); + } + elseif (\array_key_exists('Path', $data) && $data['Path'] === null) { + $object->setPath(null); + } + if (\array_key_exists('Rate', $data) && $data['Rate'] !== null) { + $object->setRate($data['Rate']); + } + elseif (\array_key_exists('Rate', $data) && $data['Rate'] === null) { + $object->setRate(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('path') && null !== $object->getPath()) { + $data['Path'] = $object->getPath(); + } + if ($object->isInitialized('rate') && null !== $object->getRate()) { + $data['Rate'] = $object->getRate(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ThrottleDevice::class => false]; + } + } +} else { + class ThrottleDeviceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\ThrottleDevice::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\ThrottleDevice::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\ThrottleDevice(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Path', $data) && $data['Path'] !== null) { + $object->setPath($data['Path']); + } + elseif (\array_key_exists('Path', $data) && $data['Path'] === null) { + $object->setPath(null); + } + if (\array_key_exists('Rate', $data) && $data['Rate'] !== null) { + $object->setRate($data['Rate']); + } + elseif (\array_key_exists('Rate', $data) && $data['Rate'] === null) { + $object->setRate(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('path') && null !== $object->getPath()) { + $data['Path'] = $object->getPath(); + } + if ($object->isInitialized('rate') && null !== $object->getRate()) { + $data['Rate'] = $object->getRate(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ThrottleDevice::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/UlimitNormalizer.php b/generated/Normalizer/UlimitNormalizer.php deleted file mode 100644 index 3e36e8e0..00000000 --- a/generated/Normalizer/UlimitNormalizer.php +++ /dev/null @@ -1,69 +0,0 @@ -setName($data->{'Name'}); - } - if (property_exists($data, 'Soft')) { - $object->setSoft($data->{'Soft'}); - } - if (property_exists($data, 'Hard')) { - $object->setHard($data->{'Hard'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getSoft()) { - $data->{'Soft'} = $object->getSoft(); - } - if (null !== $object->getHard()) { - $data->{'Hard'} = $object->getHard(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/UpdateConfigNormalizer.php b/generated/Normalizer/UpdateConfigNormalizer.php deleted file mode 100644 index bc76b025..00000000 --- a/generated/Normalizer/UpdateConfigNormalizer.php +++ /dev/null @@ -1,68 +0,0 @@ -setParallelism($data->{'Parallelism'}); - } - if (property_exists($data, 'Delay')) { - $object->setDelay($data->{'Delay'}); - } - if (property_exists($data, 'FailureAction')) { - $object->setFailureAction($data->{'FailureAction'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getParallelism()) { - $data->{'Parallelism'} = $object->getParallelism(); - } - if (null !== $object->getDelay()) { - $data->{'Delay'} = $object->getDelay(); - } - if (null !== $object->getFailureAction()) { - $data->{'FailureAction'} = $object->getFailureAction(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/UpdateStatusNormalizer.php b/generated/Normalizer/UpdateStatusNormalizer.php deleted file mode 100644 index 3f450758..00000000 --- a/generated/Normalizer/UpdateStatusNormalizer.php +++ /dev/null @@ -1,74 +0,0 @@ -setState($data->{'State'}); - } - if (property_exists($data, 'StartedAt')) { - $object->setStartedAt(\DateTime::createFromFormat("Y-m-d\TH:i:sP", $data->{'StartedAt'})); - } - if (property_exists($data, 'CompletedAt')) { - $object->setCompletedAt(\DateTime::createFromFormat("Y-m-d\TH:i:sP", $data->{'CompletedAt'})); - } - if (property_exists($data, 'Message')) { - $object->setMessage($data->{'Message'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getState()) { - $data->{'State'} = $object->getState(); - } - if (null !== $object->getStartedAt()) { - $data->{'StartedAt'} = $object->getStartedAt()->format("Y-m-d\TH:i:sP"); - } - if (null !== $object->getCompletedAt()) { - $data->{'CompletedAt'} = $object->getCompletedAt()->format("Y-m-d\TH:i:sP"); - } - if (null !== $object->getMessage()) { - $data->{'Message'} = $object->getMessage(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/VersionNormalizer.php b/generated/Normalizer/VersionNormalizer.php deleted file mode 100644 index ced15d30..00000000 --- a/generated/Normalizer/VersionNormalizer.php +++ /dev/null @@ -1,105 +0,0 @@ -setVersion($data->{'Version'}); - } - if (property_exists($data, 'Os')) { - $object->setOs($data->{'Os'}); - } - if (property_exists($data, 'KernelVersion')) { - $object->setKernelVersion($data->{'KernelVersion'}); - } - if (property_exists($data, 'GoVersion')) { - $object->setGoVersion($data->{'GoVersion'}); - } - if (property_exists($data, 'GitCommit')) { - $object->setGitCommit($data->{'GitCommit'}); - } - if (property_exists($data, 'Arch')) { - $object->setArch($data->{'Arch'}); - } - if (property_exists($data, 'ApiVersion')) { - $object->setApiVersion($data->{'ApiVersion'}); - } - if (property_exists($data, 'Experimental')) { - $object->setExperimental($data->{'Experimental'}); - } - if (property_exists($data, 'BuildTime')) { - $object->setBuildTime($data->{'BuildTime'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getVersion()) { - $data->{'Version'} = $object->getVersion(); - } - if (null !== $object->getOs()) { - $data->{'Os'} = $object->getOs(); - } - if (null !== $object->getKernelVersion()) { - $data->{'KernelVersion'} = $object->getKernelVersion(); - } - if (null !== $object->getGoVersion()) { - $data->{'GoVersion'} = $object->getGoVersion(); - } - if (null !== $object->getGitCommit()) { - $data->{'GitCommit'} = $object->getGitCommit(); - } - if (null !== $object->getArch()) { - $data->{'Arch'} = $object->getArch(); - } - if (null !== $object->getApiVersion()) { - $data->{'ApiVersion'} = $object->getApiVersion(); - } - if (null !== $object->getExperimental()) { - $data->{'Experimental'} = $object->getExperimental(); - } - if (null !== $object->getBuildTime()) { - $data->{'BuildTime'} = $object->getBuildTime(); - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/VolumeConfigNormalizer.php b/generated/Normalizer/VolumeConfigNormalizer.php deleted file mode 100644 index 1059f915..00000000 --- a/generated/Normalizer/VolumeConfigNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($data->{'Name'}); - } - if (property_exists($data, 'Driver')) { - $object->setDriver($data->{'Driver'}); - } - if (property_exists($data, 'DriverOpts')) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'DriverOpts'} as $key => $value) { - $values[$key] = $value; - } - $object->setDriverOpts($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); - } - if (null !== $object->getDriverOpts()) { - $values = new \stdClass(); - foreach ($object->getDriverOpts() as $key => $value) { - $values->{$key} = $value; - } - $data->{'DriverOpts'} = $values; - } - - return json_encode($data); - } -} diff --git a/generated/Normalizer/VolumeCreateOptionsNormalizer.php b/generated/Normalizer/VolumeCreateOptionsNormalizer.php new file mode 100644 index 00000000..1579ee19 --- /dev/null +++ b/generated/Normalizer/VolumeCreateOptionsNormalizer.php @@ -0,0 +1,222 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class VolumeCreateOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\VolumeCreateOptions::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\VolumeCreateOptions::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\VolumeCreateOptions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('DriverOpts', $data) && $data['DriverOpts'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['DriverOpts'] as $key => $value) { + $values[$key] = $value; + } + $object->setDriverOpts($values); + } + elseif (\array_key_exists('DriverOpts', $data) && $data['DriverOpts'] === null) { + $object->setDriverOpts(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $object->setLabels($values_1); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('ClusterVolumeSpec', $data) && $data['ClusterVolumeSpec'] !== null) { + $object->setClusterVolumeSpec($this->denormalizer->denormalize($data['ClusterVolumeSpec'], \Docker\API\Model\ClusterVolumeSpec::class, 'json', $context)); + } + elseif (\array_key_exists('ClusterVolumeSpec', $data) && $data['ClusterVolumeSpec'] === null) { + $object->setClusterVolumeSpec(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('driverOpts') && null !== $object->getDriverOpts()) { + $values = []; + foreach ($object->getDriverOpts() as $key => $value) { + $values[$key] = $value; + } + $data['DriverOpts'] = $values; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_1 = []; + foreach ($object->getLabels() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $data['Labels'] = $values_1; + } + if ($object->isInitialized('clusterVolumeSpec') && null !== $object->getClusterVolumeSpec()) { + $data['ClusterVolumeSpec'] = $this->normalizer->normalize($object->getClusterVolumeSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumeCreateOptions::class => false]; + } + } +} else { + class VolumeCreateOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\VolumeCreateOptions::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\VolumeCreateOptions::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\VolumeCreateOptions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('DriverOpts', $data) && $data['DriverOpts'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['DriverOpts'] as $key => $value) { + $values[$key] = $value; + } + $object->setDriverOpts($values); + } + elseif (\array_key_exists('DriverOpts', $data) && $data['DriverOpts'] === null) { + $object->setDriverOpts(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $object->setLabels($values_1); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('ClusterVolumeSpec', $data) && $data['ClusterVolumeSpec'] !== null) { + $object->setClusterVolumeSpec($this->denormalizer->denormalize($data['ClusterVolumeSpec'], \Docker\API\Model\ClusterVolumeSpec::class, 'json', $context)); + } + elseif (\array_key_exists('ClusterVolumeSpec', $data) && $data['ClusterVolumeSpec'] === null) { + $object->setClusterVolumeSpec(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); + } + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); + } + if ($object->isInitialized('driverOpts') && null !== $object->getDriverOpts()) { + $values = []; + foreach ($object->getDriverOpts() as $key => $value) { + $values[$key] = $value; + } + $data['DriverOpts'] = $values; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_1 = []; + foreach ($object->getLabels() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $data['Labels'] = $values_1; + } + if ($object->isInitialized('clusterVolumeSpec') && null !== $object->getClusterVolumeSpec()) { + $data['ClusterVolumeSpec'] = $this->normalizer->normalize($object->getClusterVolumeSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumeCreateOptions::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/VolumeListNormalizer.php b/generated/Normalizer/VolumeListNormalizer.php deleted file mode 100644 index 198faf48..00000000 --- a/generated/Normalizer/VolumeListNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -{'Volumes'}; - if (is_array($data->{'Volumes'})) { - $values = []; - foreach ($data->{'Volumes'} as $value_1) { - $values[] = $this->serializer->denormalize($value_1, 'Docker\\API\\Model\\Volume', 'raw', $context); - } - $value = $values; - } - if (is_null($data->{'Volumes'})) { - $value = $data->{'Volumes'}; - } - $object->setVolumes($value); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - $value = $object->getVolumes(); - if (is_array($object->getVolumes())) { - $values = []; - foreach ($object->getVolumes() as $value_1) { - $values[] = $value_1; - } - $value = $values; - } - if (is_null($object->getVolumes())) { - $value = $object->getVolumes(); - } - $data->{'Volumes'} = $value; - - return json_encode($data); - } -} diff --git a/generated/Normalizer/VolumeListResponseNormalizer.php b/generated/Normalizer/VolumeListResponseNormalizer.php new file mode 100644 index 00000000..09399993 --- /dev/null +++ b/generated/Normalizer/VolumeListResponseNormalizer.php @@ -0,0 +1,168 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class VolumeListResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\VolumeListResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\VolumeListResponse::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\VolumeListResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Volumes', $data) && $data['Volumes'] !== null) { + $values = []; + foreach ($data['Volumes'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\Volume::class, 'json', $context); + } + $object->setVolumes($values); + } + elseif (\array_key_exists('Volumes', $data) && $data['Volumes'] === null) { + $object->setVolumes(null); + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values_1 = []; + foreach ($data['Warnings'] as $value_1) { + $values_1[] = $value_1; + } + $object->setWarnings($values_1); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values = []; + foreach ($object->getVolumes() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Volumes'] = $values; + } + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values_1 = []; + foreach ($object->getWarnings() as $value_1) { + $values_1[] = $value_1; + } + $data['Warnings'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumeListResponse::class => false]; + } + } +} else { + class VolumeListResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\VolumeListResponse::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\VolumeListResponse::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\VolumeListResponse(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Volumes', $data) && $data['Volumes'] !== null) { + $values = []; + foreach ($data['Volumes'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\Volume::class, 'json', $context); + } + $object->setVolumes($values); + } + elseif (\array_key_exists('Volumes', $data) && $data['Volumes'] === null) { + $object->setVolumes(null); + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values_1 = []; + foreach ($data['Warnings'] as $value_1) { + $values_1[] = $value_1; + } + $object->setWarnings($values_1); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values = []; + foreach ($object->getVolumes() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Volumes'] = $values; + } + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values_1 = []; + foreach ($object->getWarnings() as $value_1) { + $values_1[] = $value_1; + } + $data['Warnings'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumeListResponse::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/VolumeNormalizer.php b/generated/Normalizer/VolumeNormalizer.php index 6827b912..3d42709c 100644 --- a/generated/Normalizer/VolumeNormalizer.php +++ b/generated/Normalizer/VolumeNormalizer.php @@ -2,68 +2,303 @@ namespace Docker\API\Normalizer; +use Jane\Component\JsonSchemaRuntime\Reference; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; +use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; -use Symfony\Component\Serializer\SerializerAwareInterface; -use Symfony\Component\Serializer\SerializerAwareTrait; - -class VolumeNormalizer implements SerializerAwareInterface, DenormalizerAwareInterface, DenormalizerInterface, NormalizerAwareInterface, NormalizerInterface -{ - use SerializerAwareTrait; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null) +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use Symfony\Component\HttpKernel\Kernel; +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class VolumeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - if ($type !== 'Docker\\API\\Model\\Volume') { - return false; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Volume::class; } - - return true; - } - - public function supportsNormalization($data, $format = null) - { - if ($data instanceof \Docker\API\Model\Volume) { - return true; + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Volume::class; } - - return false; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - $object = new \Docker\API\Model\Volume(); - if (property_exists($data, 'Name')) { - $object->setName($data->{'Name'}); + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Volume(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Mountpoint', $data) && $data['Mountpoint'] !== null) { + $object->setMountpoint($data['Mountpoint']); + } + elseif (\array_key_exists('Mountpoint', $data) && $data['Mountpoint'] === null) { + $object->setMountpoint(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Status'] as $key => $value) { + $values[$key] = $value; + } + $object->setStatus($values); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $object->setLabels($values_1); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Scope', $data) && $data['Scope'] !== null) { + $object->setScope($data['Scope']); + } + elseif (\array_key_exists('Scope', $data) && $data['Scope'] === null) { + $object->setScope(null); + } + if (\array_key_exists('ClusterVolume', $data) && $data['ClusterVolume'] !== null) { + $object->setClusterVolume($this->denormalizer->denormalize($data['ClusterVolume'], \Docker\API\Model\ClusterVolume::class, 'json', $context)); + } + elseif (\array_key_exists('ClusterVolume', $data) && $data['ClusterVolume'] === null) { + $object->setClusterVolume(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; + } + $object->setOptions($values_2); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + if (\array_key_exists('UsageData', $data) && $data['UsageData'] !== null) { + $object->setUsageData($this->denormalizer->denormalize($data['UsageData'], \Docker\API\Model\VolumeUsageData::class, 'json', $context)); + } + elseif (\array_key_exists('UsageData', $data) && $data['UsageData'] === null) { + $object->setUsageData(null); + } + return $object; } - if (property_exists($data, 'Driver')) { - $object->setDriver($data->{'Driver'}); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Name'] = $object->getName(); + $data['Driver'] = $object->getDriver(); + $data['Mountpoint'] = $object->getMountpoint(); + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $values = []; + foreach ($object->getStatus() as $key => $value) { + $values[$key] = $value; + } + $data['Status'] = $values; + } + $values_1 = []; + foreach ($object->getLabels() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $data['Labels'] = $values_1; + $data['Scope'] = $object->getScope(); + if ($object->isInitialized('clusterVolume') && null !== $object->getClusterVolume()) { + $data['ClusterVolume'] = $this->normalizer->normalize($object->getClusterVolume(), 'json', $context); + } + $values_2 = []; + foreach ($object->getOptions() as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; + } + $data['Options'] = $values_2; + if ($object->isInitialized('usageData') && null !== $object->getUsageData()) { + $data['UsageData'] = $this->normalizer->normalize($object->getUsageData(), 'json', $context); + } + return $data; } - if (property_exists($data, 'Mountpoint')) { - $object->setMountpoint($data->{'Mountpoint'}); + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Volume::class => false]; } - - return $object; } - - public function normalize($object, $format = null, array $context = []) +} else { + class VolumeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\Volume::class; } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\Volume::class; } - if (null !== $object->getMountpoint()) { - $data->{'Mountpoint'} = $object->getMountpoint(); + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\Volume(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); + } + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); + } + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Mountpoint', $data) && $data['Mountpoint'] !== null) { + $object->setMountpoint($data['Mountpoint']); + } + elseif (\array_key_exists('Mountpoint', $data) && $data['Mountpoint'] === null) { + $object->setMountpoint(null); + } + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); + } + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); + } + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Status'] as $key => $value) { + $values[$key] = $value; + } + $object->setStatus($values); + } + elseif (\array_key_exists('Status', $data) && $data['Status'] === null) { + $object->setStatus(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $object->setLabels($values_1); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Scope', $data) && $data['Scope'] !== null) { + $object->setScope($data['Scope']); + } + elseif (\array_key_exists('Scope', $data) && $data['Scope'] === null) { + $object->setScope(null); + } + if (\array_key_exists('ClusterVolume', $data) && $data['ClusterVolume'] !== null) { + $object->setClusterVolume($this->denormalizer->denormalize($data['ClusterVolume'], \Docker\API\Model\ClusterVolume::class, 'json', $context)); + } + elseif (\array_key_exists('ClusterVolume', $data) && $data['ClusterVolume'] === null) { + $object->setClusterVolume(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; + } + $object->setOptions($values_2); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); + } + if (\array_key_exists('UsageData', $data) && $data['UsageData'] !== null) { + $object->setUsageData($this->denormalizer->denormalize($data['UsageData'], \Docker\API\Model\VolumeUsageData::class, 'json', $context)); + } + elseif (\array_key_exists('UsageData', $data) && $data['UsageData'] === null) { + $object->setUsageData(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Name'] = $object->getName(); + $data['Driver'] = $object->getDriver(); + $data['Mountpoint'] = $object->getMountpoint(); + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $values = []; + foreach ($object->getStatus() as $key => $value) { + $values[$key] = $value; + } + $data['Status'] = $values; + } + $values_1 = []; + foreach ($object->getLabels() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $data['Labels'] = $values_1; + $data['Scope'] = $object->getScope(); + if ($object->isInitialized('clusterVolume') && null !== $object->getClusterVolume()) { + $data['ClusterVolume'] = $this->normalizer->normalize($object->getClusterVolume(), 'json', $context); + } + $values_2 = []; + foreach ($object->getOptions() as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; + } + $data['Options'] = $values_2; + if ($object->isInitialized('usageData') && null !== $object->getUsageData()) { + $data['UsageData'] = $this->normalizer->normalize($object->getUsageData(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Volume::class => false]; } - - return json_encode($data); } -} +} \ No newline at end of file diff --git a/generated/Normalizer/VolumeUsageDataNormalizer.php b/generated/Normalizer/VolumeUsageDataNormalizer.php new file mode 100644 index 00000000..f35ba7b7 --- /dev/null +++ b/generated/Normalizer/VolumeUsageDataNormalizer.php @@ -0,0 +1,128 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class VolumeUsageDataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\VolumeUsageData::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\VolumeUsageData::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\VolumeUsageData(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + if (\array_key_exists('RefCount', $data) && $data['RefCount'] !== null) { + $object->setRefCount($data['RefCount']); + } + elseif (\array_key_exists('RefCount', $data) && $data['RefCount'] === null) { + $object->setRefCount(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['Size'] = $object->getSize(); + $data['RefCount'] = $object->getRefCount(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumeUsageData::class => false]; + } + } +} else { + class VolumeUsageDataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\VolumeUsageData::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\VolumeUsageData::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\VolumeUsageData(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); + } + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); + } + if (\array_key_exists('RefCount', $data) && $data['RefCount'] !== null) { + $object->setRefCount($data['RefCount']); + } + elseif (\array_key_exists('RefCount', $data) && $data['RefCount'] === null) { + $object->setRefCount(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['Size'] = $object->getSize(); + $data['RefCount'] = $object->getRefCount(); + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumeUsageData::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/VolumesNamePutBodyNormalizer.php b/generated/Normalizer/VolumesNamePutBodyNormalizer.php new file mode 100644 index 00000000..3774ce79 --- /dev/null +++ b/generated/Normalizer/VolumesNamePutBodyNormalizer.php @@ -0,0 +1,118 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class VolumesNamePutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\VolumesNamePutBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\VolumesNamePutBody::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\VolumesNamePutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\ClusterVolumeSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumesNamePutBody::class => false]; + } + } +} else { + class VolumesNamePutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\VolumesNamePutBody::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\VolumesNamePutBody::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\VolumesNamePutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Spec', $data) && $data['Spec'] !== null) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\ClusterVolumeSpec::class, 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumesNamePutBody::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Normalizer/VolumesPrunePostResponse200Normalizer.php b/generated/Normalizer/VolumesPrunePostResponse200Normalizer.php new file mode 100644 index 00000000..41af3a5e --- /dev/null +++ b/generated/Normalizer/VolumesPrunePostResponse200Normalizer.php @@ -0,0 +1,152 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class VolumesPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\VolumesPrunePostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\VolumesPrunePostResponse200::class; + } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\VolumesPrunePostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('VolumesDeleted', $data) && $data['VolumesDeleted'] !== null) { + $values = []; + foreach ($data['VolumesDeleted'] as $value) { + $values[] = $value; + } + $object->setVolumesDeleted($values); + } + elseif (\array_key_exists('VolumesDeleted', $data) && $data['VolumesDeleted'] === null) { + $object->setVolumesDeleted(null); + } + if (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] !== null) { + $object->setSpaceReclaimed($data['SpaceReclaimed']); + } + elseif (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] === null) { + $object->setSpaceReclaimed(null); + } + return $object; + } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('volumesDeleted') && null !== $object->getVolumesDeleted()) { + $values = []; + foreach ($object->getVolumesDeleted() as $value) { + $values[] = $value; + } + $data['VolumesDeleted'] = $values; + } + if ($object->isInitialized('spaceReclaimed') && null !== $object->getSpaceReclaimed()) { + $data['SpaceReclaimed'] = $object->getSpaceReclaimed(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumesPrunePostResponse200::class => false]; + } + } +} else { + class VolumesPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === \Docker\API\Model\VolumesPrunePostResponse200::class; + } + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === \Docker\API\Model\VolumesPrunePostResponse200::class; + } + /** + * @return mixed + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Docker\API\Model\VolumesPrunePostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('VolumesDeleted', $data) && $data['VolumesDeleted'] !== null) { + $values = []; + foreach ($data['VolumesDeleted'] as $value) { + $values[] = $value; + } + $object->setVolumesDeleted($values); + } + elseif (\array_key_exists('VolumesDeleted', $data) && $data['VolumesDeleted'] === null) { + $object->setVolumesDeleted(null); + } + if (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] !== null) { + $object->setSpaceReclaimed($data['SpaceReclaimed']); + } + elseif (\array_key_exists('SpaceReclaimed', $data) && $data['SpaceReclaimed'] === null) { + $object->setSpaceReclaimed(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('volumesDeleted') && null !== $object->getVolumesDeleted()) { + $values = []; + foreach ($object->getVolumesDeleted() as $value) { + $values[] = $value; + } + $data['VolumesDeleted'] = $values; + } + if ($object->isInitialized('spaceReclaimed') && null !== $object->getSpaceReclaimed()) { + $data['SpaceReclaimed'] = $object->getSpaceReclaimed(); + } + return $data; + } + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumesPrunePostResponse200::class => false]; + } + } +} \ No newline at end of file diff --git a/generated/Resource/ContainerResource.php b/generated/Resource/ContainerResource.php deleted file mode 100644 index f24cd503..00000000 --- a/generated/Resource/ContainerResource.php +++ /dev/null @@ -1,830 +0,0 @@ - last created containers, include non-running ones. - * @var string $since Show only containers created since Id, include non-running ones. - * @var string $before Show only containers created before Id, include non-running ones. - * @var bool $size 1/True/true or 0/False/false, Show the containers sizes. - * @var array $filters A JSON encoded value of the filters (a map[string][]string) to process on the containers list - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\ContainerInfo[] - */ - public function findAll($parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('all', false); - $queryParam->setDefault('limit', null); - $queryParam->setDefault('since', null); - $queryParam->setDefault('before', null); - $queryParam->setDefault('size', null); - $queryParam->setDefault('filters', null); - $url = '/containers/json'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ContainerInfo[]', 'json'); - } - } - - return $response; - } - - /** - * Create a container. - * - * @param \Docker\API\Model\ContainerConfig $container Container to create - * @param array $parameters { - * - * @var string $name Assign the specified name to the container. Must match /?[a-zA-Z0-9_-]+. - * @var string $Content-Type Content Type of input - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\ContainerCreateResult - */ - public function create(\Docker\API\Model\ContainerConfig $container, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('name', null); - $queryParam->setDefault('Content-Type', 'application/json'); - $queryParam->setHeaderParameters(['Content-Type']); - $url = '/containers/create'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($container, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('201' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ContainerCreateResult', 'json'); - } - } - - return $response; - } - - /** - * Return low-level information on the container id. - * - * @param string $id The container id or name - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\Container - */ - public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/containers/{id}/json'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Container', 'json'); - } - } - - return $response; - } - - /** - * List processes running inside the container id. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var string $ps_args ps arguments to use (e.g., aux) - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\ContainerTop - */ - public function listProcesses($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('ps_args', null); - $url = '/containers/{id}/top'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ContainerTop', 'json'); - } - } - - return $response; - } - - /** - * Get stdout and stderr logs from the container id. Note: This endpoint works only for containers with json-file logging driver. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var bool $follow 1/True/true or 0/False/false, return stream. Default false. - * @var bool $stdout 1/True/true or 0/False/false, show stdout log. Default false. - * @var bool $stderr 1/True/true or 0/False/false, show stderr log. Default false. - * @var int $since UNIX timestamp (integer) to filter logs. Specifying a timestamp will only output log-entries since that timestamp. Default: 0 (unfiltered) - * @var bool $timestamps 1/True/true or 0/False/false, print timestamps for every log line. - * @var string $tail Output specified number of lines at the end of logs: all or . Default all. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function logs($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('follow', false); - $queryParam->setDefault('stdout', false); - $queryParam->setDefault('stderr', false); - $queryParam->setDefault('since', 0); - $queryParam->setDefault('timestamps', false); - $queryParam->setDefault('tail', null); - $url = '/containers/{id}/logs'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Inspect changes on a container’s filesystem. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var int $kind Kind of changes - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\ContainerChange[] - */ - public function changes($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('kind', null); - $url = '/containers/{id}/changes'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ContainerChange[]', 'json'); - } - } - - return $response; - } - - /** - * Export the contents of container id. - * - * @param string $id The container id or name - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function export($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/containers/{id}/export'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * This endpoint returns a live stream of a container’s resource usage statistics. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var bool $stream Stream stats - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function stats($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('stream', null); - $url = '/containers/{id}/stats'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Resize the TTY for container with id. The unit is number of characters. You must restart the container for the resize to take effect. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var int $h Height of the tty session - * @var int $w Width of the tty session - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function resize($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('h', null); - $queryParam->setDefault('w', null); - $url = '/containers/{id}/resize'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Start the container id. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var string $detachKeys Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl- where is one of: a-z, @, ^, [, , or _. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function start($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('detachKeys', null); - $url = '/containers/{id}/start'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Stop the container id. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var int $t number of seconds to wait before killing the container - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function stop($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('t', null); - $url = '/containers/{id}/stop'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Restart the container id. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var int $t number of seconds to wait before killing the container - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function restart($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('t', null); - $url = '/containers/{id}/restart'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Send a posix signal to a container. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var string $signal Signal to send to the container, integer or string like SIGINT, defaults to SIGKILL - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function kill($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('signal', null); - $url = '/containers/{id}/kill'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Update resource configs of one or more containers. - * - * @param string $id The container id or name - * @param \Docker\API\Model\ResourceUpdate $resourceConfig Resources to update on container - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\ContainerUpdateResult - */ - public function update($id, \Docker\API\Model\ResourceUpdate $resourceConfig, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/containers/{id}/update'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($resourceConfig, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ContainerUpdateResult', 'json'); - } - } - - return $response; - } - - /** - * Rename the container id to a new_name. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var string $name New name for the container - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function rename($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setRequired('name'); - $url = '/containers/{id}/rename'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Pause the container id. - * - * @param string $id The container id or name - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function pause($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/containers/{id}/pause'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Unpause the container id. - * - * @param string $id The container id or name - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function unpause($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/containers/{id}/unpause'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Attach to the container id. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var string $logs 1/True/true or 0/False/false, return logs. Default false - * @var string $stream 1/True/true or 0/False/false, return stream. Default false - * @var string $stdin 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false. - * @var string $stdout 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false. - * @var string $stderr 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false. - * @var string $detachKeys Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl- where is one of: a-z, @, ^, [, , or _. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function attach($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('logs', null); - $queryParam->setDefault('stream', null); - $queryParam->setDefault('stdin', null); - $queryParam->setDefault('stdout', null); - $queryParam->setDefault('stderr', null); - $queryParam->setDefault('detachKeys', null); - $url = '/containers/{id}/attach'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Attach to the container id with a websocket. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var string $logs 1/True/true or 0/False/false, return logs. Default false - * @var string $stream 1/True/true or 0/False/false, return stream. Default false - * @var string $stdin 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false. - * @var string $stdout 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false. - * @var string $stderr 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false. - * @var string $detachKeys Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl- where is one of: a-z, @, ^, [, , or _. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function attachWebsocket($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('logs', null); - $queryParam->setDefault('stream', null); - $queryParam->setDefault('stdin', null); - $queryParam->setDefault('stdout', null); - $queryParam->setDefault('stderr', null); - $queryParam->setDefault('detachKeys', null); - $url = '/containers/{id}/attach/ws'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Block until container id stops, then returns the exit code. - * - * @param string $id The container id or name - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\ContainerWait - */ - public function wait($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/containers/{id}/wait'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ContainerWait', 'json'); - } - } - - return $response; - } - - /** - * Remove the container id from the filesystem. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var string $v 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false. - * @var string $force 1/True/true or 0/False/false, Kill then remove the container. Default false. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function remove($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('v', null); - $queryParam->setDefault('force', null); - $url = '/containers/{id}'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('DELETE', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Get an tar archive of a resource in the filesystem of container id. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var string $path Resource in the container’s filesystem to archive. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function getArchive($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setRequired('path'); - $url = '/containers/{id}/archive'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Retrieving information about files and folders in a container. - * - * @param string $id The container id or name - * @param array $parameters { - * - * @var string $path Resource in the container’s filesystem to archive. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function getArchiveInformation($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setRequired('path'); - $url = '/containers/{id}/archive'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('HEAD', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Upload a tar archive to be extracted to a path in the filesystem of container id. - * - * @param string $id The container id or name - * @param string $inputStream The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz. - * @param array $parameters { - * - * @var string $path Path to a directory in the container to extract the archive’s contents into. - * @var string $noOverwriteDirNonDir If “1”, “true”, or “True” then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function putArchive($id, $inputStream, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setRequired('path'); - $queryParam->setDefault('noOverwriteDirNonDir', null); - $url = '/containers/{id}/archive'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $inputStream; - $request = $this->messageFactory->createRequest('PUT', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } -} diff --git a/generated/Resource/ExecResource.php b/generated/Resource/ExecResource.php deleted file mode 100644 index 72de1d8a..00000000 --- a/generated/Resource/ExecResource.php +++ /dev/null @@ -1,148 +0,0 @@ -setDefault('Content-Type', 'application/json'); - $queryParam->setHeaderParameters(['Content-Type']); - $url = '/containers/{id}/exec'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($execConfig, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('201' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ExecCreateResult', 'json'); - } - } - - return $response; - } - - /** - * Starts a previously set up exec instance id. If detach is true, this API returns after starting the exec command. Otherwise, this API sets up an interactive session with the exec command. - * - * @param string $id Exec instance id - * @param \Docker\API\Model\ExecStartConfig $execStartConfig Exec configuration - * @param array $parameters { - * - * @var string $Content-Type Content Type Header - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function start($id, \Docker\API\Model\ExecStartConfig $execStartConfig, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('Content-Type', 'application/json'); - $queryParam->setHeaderParameters(['Content-Type']); - $url = '/exec/{id}/start'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($execStartConfig, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Resize the tty session used by the exec command id. - * - * @param string $id Exec instance id - * @param array $parameters { - * - * @var int $h Height of the tty session - * @var int $w Width of the tty session - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function resize($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('h', null); - $queryParam->setDefault('w', null); - $url = '/exec/{id}/resize'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Return low-level information about the exec command id. - * - * @param string $id Exec instance id - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\ExecCommand - */ - public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/exec/{id}/json'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ExecCommand', 'json'); - } - } - - return $response; - } -} diff --git a/generated/Resource/ImageResource.php b/generated/Resource/ImageResource.php deleted file mode 100644 index 9a9e9fb0..00000000 --- a/generated/Resource/ImageResource.php +++ /dev/null @@ -1,495 +0,0 @@ -setDefault('all', false); - $queryParam->setDefault('filters', null); - $queryParam->setDefault('filter', null); - $queryParam->setDefault('digests', null); - $url = '/images/json'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ImageItem[]', 'json'); - } - } - - return $response; - } - - /** - * Build an image from Dockerfile via stdin. - * - * @param string $inputStream The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz. - * @param array $parameters { - * - * @var string $dockerfile Path within the build context to the Dockerfile. This is ignored if remote is specified and points to an individual filename. - * @var string $t A repository name (and optionally a tag) to apply to the resulting image in case of success. - * @var string $remote A Git repository URI or HTTP/HTTPS URI build source. If the URI specifies a filename, the file’s contents are placed into a file called Dockerfile. - * @var bool $q Suppress verbose build output. - * @var bool $nocache Do not use the cache when building the image. - * @var string $pull Attempt to pull the image even if an older image exists locally - * @var bool $rm Remove intermediate containers after a successful build (default behavior). - * @var bool $forcerm always remove intermediate containers (includes rm) - * @var int $memory Set memory limit for build. - * @var int $memswap Total memory (memory + swap), -1 to disable swap. - * @var int $cpushares CPU shares (relative weight). - * @var string $cpusetcpus CPUs in which to allow execution (e.g., 0-3, 0,1). - * @var int $cpuperiod The length of a CPU period in microseconds. - * @var int $cpuquota Microseconds of CPU time that the container can get in a CPU period. - * @var int $buildargs Total memory (memory + swap), -1 to disable swap. - * @var string $Content-type Set to 'application/tar'. - * @var string $X-Registry-Config A base64-url-safe-encoded Registry Auth Config JSON object - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function build($inputStream, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('dockerfile', null); - $queryParam->setDefault('t', null); - $queryParam->setDefault('remote', null); - $queryParam->setDefault('q', false); - $queryParam->setDefault('nocache', false); - $queryParam->setDefault('pull', null); - $queryParam->setDefault('rm', true); - $queryParam->setDefault('forcerm', false); - $queryParam->setDefault('memory', null); - $queryParam->setDefault('memswap', null); - $queryParam->setDefault('cpushares', null); - $queryParam->setDefault('cpusetcpus', null); - $queryParam->setDefault('cpuperiod', null); - $queryParam->setDefault('cpuquota', null); - $queryParam->setDefault('buildargs', null); - $queryParam->setDefault('Content-type', 'application/tar'); - $queryParam->setHeaderParameters(['Content-type']); - $queryParam->setDefault('X-Registry-Config', null); - $queryParam->setHeaderParameters(['X-Registry-Config']); - $url = '/build'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $inputStream; - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Create an image either by pulling it from the registry or by importing it. - * - * @param string $inputImage Image content if the value - has been specified in fromSrc query parameter - * @param array $parameters { - * - * @var string $fromImage Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. - * @var string $fromSrc Source to import. The value may be a URL from which the image can be retrieved or - to read the image from the request body. This parameter may only be used when importing an image. - * @var string $repo Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image. - * @var string $tag Tag or digest. - * @var string $X-Registry-Auth A base64-encoded AuthConfig object - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function create($inputImage, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('fromImage', null); - $queryParam->setDefault('fromSrc', null); - $queryParam->setDefault('repo', null); - $queryParam->setDefault('tag', null); - $queryParam->setDefault('X-Registry-Auth', null); - $queryParam->setHeaderParameters(['X-Registry-Auth']); - $url = '/images/create'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $inputImage; - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Return low-level information on the image name. - * - * @param string $name Image name or id - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\Image - */ - public function find($name, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/images/{name}/json'; - $url = str_replace('{name}', urlencode($name), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Image', 'json'); - } - } - - return $response; - } - - /** - * Return the history of the image name. - * - * @param string $name Image name or id - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\ImageHistoryItem[] - */ - public function history($name, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/images/{name}/history'; - $url = str_replace('{name}', urlencode($name), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ImageHistoryItem[]', 'json'); - } - } - - return $response; - } - - /** - * Push the image name on the registry. - * - * @param string $name Image name or id - * @param array $parameters { - * - * @var string $tag The tag to associate with the image on the registry. - * @var string $X-Registry-Auth A base64-encoded AuthConfig object - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function push($name, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('tag', null); - $queryParam->setRequired('X-Registry-Auth'); - $queryParam->setHeaderParameters(['X-Registry-Auth']); - $url = '/images/{name}/push'; - $url = str_replace('{name}', urlencode($name), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Tag the image name into a repository. - * - * @param string $name Image name or id - * @param array $parameters { - * - * @var string $repo The repository to tag in. - * @var string $tag The new tag name. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function tag($name, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('repo', null); - $queryParam->setDefault('tag', null); - $url = '/images/{name}/tag'; - $url = str_replace('{name}', urlencode($name), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Remove the image name from the filesystem. - * - * @param string $name Image name or id - * @param array $parameters { - * - * @var string $force 1/True/true or 0/False/false, default false - * @var string $noprune 1/True/true or 0/False/false, default false. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function remove($name, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('force', null); - $queryParam->setDefault('noprune', null); - $url = '/images/{name}'; - $url = str_replace('{name}', urlencode($name), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('DELETE', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Search for an image on Docker Hub. - * - * @param array $parameters { - * - * @var string $term Term to search - * @var int $limit Maximum returned search results - * @var string $filters A JSON encoded value of the filters (a map[string][]string) to process on the images list. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\ImageSearchResult[] - */ - public function search($parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('term', null); - $queryParam->setDefault('limit', null); - $queryParam->setDefault('filters', null); - $url = '/images/search'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string)$response->getBody(), 'Docker\\API\\Model\\ImageSearchResult[]', 'json'); - } - } - - return $response; - } - - /** - * Create a new image from a container’s changes. - * - * @param \Docker\API\Model\ContainerConfig $containerConfig The container configuration - * @param array $parameters { - * - * @var string $container Container id or name to commit - * @var string $repo Repository name for the created image - * @var string $tag Tag name for the create image - * @var string $comment Commit message - * @var string $author author (e.g., “John Hannibal Smith “) - * @var string $pause 1/True/true or 0/False/false, whether to pause the container before committing - * @var string $changes Dockerfile instructions to apply while committing - * @var string $Content-Type Content Type of input - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\CommitResult - */ - public function commit(\Docker\API\Model\ContainerConfig $containerConfig, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('container', null); - $queryParam->setDefault('repo', null); - $queryParam->setDefault('tag', null); - $queryParam->setDefault('comment', null); - $queryParam->setDefault('author', null); - $queryParam->setDefault('pause', null); - $queryParam->setDefault('changes', null); - $queryParam->setDefault('Content-Type', 'application/json'); - $queryParam->setHeaderParameters(['Content-Type']); - $url = '/commit'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($containerConfig, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('201' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\CommitResult', 'json'); - } - } - - return $response; - } - - /** - * Get a tarball containing all images and metadata for the repository specified by name. - * - * @param string $name Image name or id - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function save($name, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/images/{name}/get'; - $url = str_replace('{name}', urlencode($name), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Get a tarball containing all images and metadata for one or more repositories. - * - * @param array $parameters { - * - * @var array $names Image names to filter - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function saveAll($parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('names', null); - $url = '/images/get'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Load a set of images and tags into a Docker repository. See the image tarball format for more details. - * - * @param string $imagesTarball Tar archive containing images - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function load($imagesTarball, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/images/load'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $imagesTarball; - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } -} diff --git a/generated/Resource/MiscResource.php b/generated/Resource/MiscResource.php deleted file mode 100644 index 470760f3..00000000 --- a/generated/Resource/MiscResource.php +++ /dev/null @@ -1,159 +0,0 @@ -buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($authConfig, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\AuthResult', 'json'); - } - } - - return $response; - } - - /** - * Display system-wide information. - * - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\SystemInformation - */ - public function getSystemInformation($parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/info'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\SystemInformation', 'json'); - } - } - - return $response; - } - - /** - * Show the docker version information. - * - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\Version - */ - public function getVersion($parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/version'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Version', 'json'); - } - } - - return $response; - } - - /** - * Ping the docker server. - * - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function ping($parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/_ping'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Get container events from docker, either in real time via streaming, or via polling (using since). - * - * @param array $parameters { - * - * @var int $since Timestamp used for polling - * @var int $until Timestamp used for polling - * @var string $filters A json encoded value of the filters (a map[string][]string) to process on the event list. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function getEvents($parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('since', null); - $queryParam->setDefault('until', null); - $queryParam->setDefault('filters', null); - $url = '/events'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } -} diff --git a/generated/Resource/NetworkResource.php b/generated/Resource/NetworkResource.php deleted file mode 100644 index 77ff0a2b..00000000 --- a/generated/Resource/NetworkResource.php +++ /dev/null @@ -1,208 +0,0 @@ -setDefault('filters', null); - $url = '/networks'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Network[]', 'json'); - } - } - - return $response; - } - - /** - * Remove a network. - * - * @param string $id Network id or name - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function remove($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/networks/{id}'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('DELETE', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Inspect network. - * - * @param string $id Network id or name - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\Network - */ - public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/networks/{id}'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Network', 'json'); - } - } - - return $response; - } - - /** - * Create network. - * - * @param \Docker\API\Model\NetworkCreateConfig $networkConfig Network configuration - * @param array $parameters { - * - * @var string $Content-Type Content Type of input - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\NetworkCreateResult - */ - public function create(\Docker\API\Model\NetworkCreateConfig $networkConfig, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('Content-Type', 'application/json'); - $queryParam->setHeaderParameters(['Content-Type']); - $url = '/networks/create'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($networkConfig, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('201' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\NetworkCreateResult', 'json'); - } - } - - return $response; - } - - /** - * Connect a container to a network. - * - * @param string $id Network id or name - * @param \Docker\API\Model\ContainerConnect $container Container - * @param array $parameters { - * - * @var string $Content-Type Content Type of input - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function connect($id, \Docker\API\Model\ContainerConnect $container, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('Content-Type', 'application/json'); - $queryParam->setHeaderParameters(['Content-Type']); - $url = '/networks/{id}/connect'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($container, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Disconnect a container to a network. - * - * @param string $id Network id or name - * @param \Docker\API\Model\ContainerDisconnect $container Container - * @param array $parameters { - * - * @var string $Content-Type Content Type of input - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function disconnect($id, \Docker\API\Model\ContainerDisconnect $container, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('Content-Type', 'application/json'); - $queryParam->setHeaderParameters(['Content-Type']); - $url = '/networks/{id}/disconnect'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($container, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } -} diff --git a/generated/Resource/NodeResource.php b/generated/Resource/NodeResource.php deleted file mode 100644 index 05398530..00000000 --- a/generated/Resource/NodeResource.php +++ /dev/null @@ -1,76 +0,0 @@ -setDefault('filters', null); - $url = '/nodes'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Node[]', 'json'); - } - } - - return $response; - } - - /** - * Return low-level information on the node id. - * - * @param string $id Node id or name - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\Node - */ - public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/nodes/{id}'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Node', 'json'); - } - } - - return $response; - } -} diff --git a/generated/Resource/ServiceResource.php b/generated/Resource/ServiceResource.php deleted file mode 100644 index b5ddb44b..00000000 --- a/generated/Resource/ServiceResource.php +++ /dev/null @@ -1,167 +0,0 @@ -setDefault('filters', null); - $url = '/services'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Service[]', 'json'); - } - } - - return $response; - } - - /** - * Create a service. - * - * @param \Docker\API\Model\ServiceSpec $serviceSpec Service specification to create - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\ServiceCreateResponse - */ - public function create(\Docker\API\Model\ServiceSpec $serviceSpec, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/services/create'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($serviceSpec, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('201' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ServiceCreateResponse', 'json'); - } - } - - return $response; - } - - /** - * Stop and remove the service id. - * - * @param string $id Service id or name - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function remove($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/services/{id}'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('DELETE', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Get details on a service. - * - * @param string $id Service id or name - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\Service - */ - public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/services/{id}'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Service', 'json'); - } - } - - return $response; - } - - /** - * Update the service id. - * - * @param string $id Service id or name - * @param \Docker\API\Model\ServiceSpec $serviceSpec Service specification to update - * @param array $parameters { - * - * @var int $version The version number of the service object being updated. This is required to avoid conflicting writes. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function update($id, \Docker\API\Model\ServiceSpec $serviceSpec, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setRequired('version'); - $url = '/services/{id}/update'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($serviceSpec, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } -} diff --git a/generated/Resource/SwarmResource.php b/generated/Resource/SwarmResource.php deleted file mode 100644 index a549cf93..00000000 --- a/generated/Resource/SwarmResource.php +++ /dev/null @@ -1,121 +0,0 @@ -buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($swarmConfig, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Join an existing new Swarm. - * - * @param \Docker\API\Model\SwarmJoinConfig $swarmJoinConfig Config for joining the Swarm - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function join(\Docker\API\Model\SwarmJoinConfig $swarmJoinConfig, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/swarm/join'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($swarmJoinConfig, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Leave a Swarm. - * - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function leave($parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/swarm/leave'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Update a Swarm. - * - * @param \Docker\API\Model\SwarmUpdateConfig $swarmUpdateConfig Config for updating the Swarm - * @param array $parameters { - * - * @var int $version The version number of the swarm object being updated. This is required to avoid conflicting writes. - * @var bool $rotateWorkerToken Set to true (or 1) to rotate the worker join token. - * @var bool $rotateManagerToken Set to true (or 1) to rotate the manager join token. - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function update(\Docker\API\Model\SwarmUpdateConfig $swarmUpdateConfig, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setRequired('version'); - $queryParam->setDefault('rotateWorkerToken', null); - $queryParam->setDefault('rotateManagerToken', null); - $url = '/swarm/update'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($swarmUpdateConfig, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } -} diff --git a/generated/Resource/TaskResource.php b/generated/Resource/TaskResource.php deleted file mode 100644 index 6e7cd349..00000000 --- a/generated/Resource/TaskResource.php +++ /dev/null @@ -1,76 +0,0 @@ -setDefault('filters', null); - $url = '/tasks'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Task[]', 'json'); - } - } - - return $response; - } - - /** - * Get details on a task. - * - * @param string $id Task id or name - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\Task - */ - public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/tasks/{id}'; - $url = str_replace('{id}', urlencode($id), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Task', 'json'); - } - } - - return $response; - } -} diff --git a/generated/Resource/VolumeResource.php b/generated/Resource/VolumeResource.php deleted file mode 100644 index fb5b7701..00000000 --- a/generated/Resource/VolumeResource.php +++ /dev/null @@ -1,140 +0,0 @@ -setDefault('filters', null); - $url = '/volumes'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\VolumeList', 'json'); - } - } - - return $response; - } - - /** - * Create a volume. - * - * @param \Docker\API\Model\VolumeConfig $volumeConfig Volume configuration - * @param array $parameters { - * - * @var string $Content-Type Content Type of input - * } - * - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\Volume - */ - public function create(\Docker\API\Model\VolumeConfig $volumeConfig, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $queryParam->setDefault('Content-Type', 'application/json'); - $queryParam->setHeaderParameters(['Content-Type']); - $url = '/volumes/create'; - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $this->serializer->normalize($volumeConfig, 'json'); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('201' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Volume', 'json'); - } - } - - return $response; - } - - /** - * Instruct the driver to remove the volume. - * - * @param string $name Volume name or id - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function remove($name, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/volumes/{name}'; - $url = str_replace('{name}', urlencode($name), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('DELETE', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - - return $response; - } - - /** - * Inspect a volume. - * - * @param string $name Volume name or id - * @param array $parameters List of parameters - * @param string $fetch Fetch mode (object or response) - * - * @return \Psr\Http\Message\ResponseInterface|\Docker\API\Model\Volume - */ - public function find($name, $parameters = [], $fetch = self::FETCH_OBJECT) - { - $queryParam = new QueryParam(); - $url = '/volumes/{name}'; - $url = str_replace('{name}', urlencode($name), $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $promise = $this->httpClient->sendAsyncRequest($request); - if (self::FETCH_PROMISE === $fetch) { - return $promise; - } - $response = $promise->wait(); - if (self::FETCH_OBJECT == $fetch) { - if ('200' == $response->getStatusCode()) { - return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Volume', 'json'); - } - } - - return $response; - } -} diff --git a/generated/Runtime/Client/BaseEndpoint.php b/generated/Runtime/Client/BaseEndpoint.php new file mode 100644 index 00000000..4fa7ec81 --- /dev/null +++ b/generated/Runtime/Client/BaseEndpoint.php @@ -0,0 +1,67 @@ +getQueryOptionsResolver()->resolve($this->queryParameters); + $optionsResolved = array_map(function ($value) { + return null !== $value ? $value : ''; + }, $optionsResolved); + return http_build_query($optionsResolved, '', '&', PHP_QUERY_RFC3986); + } + public function getHeaders(array $baseHeaders = []): array + { + return array_merge($this->getExtraHeaders(), $baseHeaders, $this->getHeadersOptionsResolver()->resolve($this->headerParameters)); + } + protected function getQueryOptionsResolver(): OptionsResolver + { + return new OptionsResolver(); + } + protected function getHeadersOptionsResolver(): OptionsResolver + { + return new OptionsResolver(); + } + // ---------------------------------------------------------------------------------------------------- + // Used for OpenApi2 compatibility + protected function getFormBody(): array + { + return [['Content-Type' => ['application/x-www-form-urlencoded']], http_build_query($this->getFormOptionsResolver()->resolve($this->formParameters))]; + } + protected function getMultipartBody($streamFactory = null): array + { + $bodyBuilder = new MultipartStreamBuilder($streamFactory); + $formParameters = $this->getFormOptionsResolver()->resolve($this->formParameters); + foreach ($formParameters as $key => $value) { + $bodyBuilder->addResource($key, $value); + } + return [['Content-Type' => ['multipart/form-data; boundary="' . ($bodyBuilder->getBoundary() . '"')]], $bodyBuilder->build()]; + } + protected function getFormOptionsResolver(): OptionsResolver + { + return new OptionsResolver(); + } + protected function getSerializedBody(SerializerInterface $serializer): array + { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } +} \ No newline at end of file diff --git a/generated/Runtime/Client/Client.php b/generated/Runtime/Client/Client.php new file mode 100644 index 00000000..07ada3ab --- /dev/null +++ b/generated/Runtime/Client/Client.php @@ -0,0 +1,82 @@ +httpClient = $httpClient; + $this->requestFactory = $requestFactory; + $this->serializer = $serializer; + $this->streamFactory = $streamFactory; + } + public function executeEndpoint(Endpoint $endpoint, string $fetch = self::FETCH_OBJECT) + { + if (self::FETCH_RESPONSE === $fetch) { + trigger_deprecation('jane-php/open-api-common', '7.3', 'Using %s::%s method with $fetch parameter equals to response is deprecated, use %s::%s instead.', __CLASS__, __METHOD__, __CLASS__, 'executeRawEndpoint'); + return $this->executeRawEndpoint($endpoint); + } + return $endpoint->parseResponse($this->processEndpoint($endpoint), $this->serializer, $fetch); + } + public function executeRawEndpoint(Endpoint $endpoint): ResponseInterface + { + return $this->processEndpoint($endpoint); + } + private function processEndpoint(Endpoint $endpoint): ResponseInterface + { + [$bodyHeaders, $body] = $endpoint->getBody($this->serializer, $this->streamFactory); + $queryString = $endpoint->getQueryString(); + $uriGlue = false === strpos($endpoint->getUri(), '?') ? '?' : '&'; + $uri = $queryString !== '' ? $endpoint->getUri() . $uriGlue . $queryString : $endpoint->getUri(); + $request = $this->requestFactory->createRequest($endpoint->getMethod(), $uri); + if ($body) { + if ($body instanceof StreamInterface) { + $request = $request->withBody($body); + } elseif (is_resource($body)) { + $request = $request->withBody($this->streamFactory->createStreamFromResource($body)); + } elseif (strlen($body) <= 4000 && @file_exists($body)) { + // more than 4096 chars will trigger an error + $request = $request->withBody($this->streamFactory->createStreamFromFile($body)); + } else { + $request = $request->withBody($this->streamFactory->createStream($body)); + } + } + foreach ($endpoint->getHeaders($bodyHeaders) as $name => $value) { + $request = $request->withHeader($name, !is_bool($value) ? $value : ($value ? 'true' : 'false')); + } + if (count($endpoint->getAuthenticationScopes()) > 0) { + $scopes = []; + foreach ($endpoint->getAuthenticationScopes() as $scope) { + $scopes[] = $scope; + } + $request = $request->withHeader(AuthenticationRegistry::SCOPES_HEADER, $scopes); + } + return $this->httpClient->sendRequest($request); + } +} \ No newline at end of file diff --git a/generated/Runtime/Client/CustomQueryResolver.php b/generated/Runtime/Client/CustomQueryResolver.php new file mode 100644 index 00000000..d4c9df87 --- /dev/null +++ b/generated/Runtime/Client/CustomQueryResolver.php @@ -0,0 +1,9 @@ +hasHeader('Content-Type') ? current($response->getHeader('Content-Type')) : null; + return $this->transformResponseBody($response, $serializer, $contentType); + } +} \ No newline at end of file diff --git a/generated/Runtime/Normalizer/CheckArray.php b/generated/Runtime/Normalizer/CheckArray.php new file mode 100644 index 00000000..f92abf09 --- /dev/null +++ b/generated/Runtime/Normalizer/CheckArray.php @@ -0,0 +1,13 @@ += 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4) { + class ReferenceNormalizer implements NormalizerInterface + { + /** + * {@inheritdoc} + */ + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $ref = []; + $ref['$ref'] = (string) $object->getReferenceUri(); + return $ref; + } + /** + * {@inheritdoc} + */ + public function supportsNormalization($data, $format = null): bool + { + return $data instanceof Reference; + } + } +} else { + class ReferenceNormalizer implements NormalizerInterface + { + /** + * {@inheritdoc} + */ + public function normalize($object, $format = null, array $context = []) + { + $ref = []; + $ref['$ref'] = (string) $object->getReferenceUri(); + return $ref; + } + /** + * {@inheritdoc} + */ + public function supportsNormalization($data, $format = null): bool + { + return $data instanceof Reference; + } + } +} \ No newline at end of file diff --git a/generated/Runtime/Normalizer/ValidationException.php b/generated/Runtime/Normalizer/ValidationException.php new file mode 100644 index 00000000..c56ee80f --- /dev/null +++ b/generated/Runtime/Normalizer/ValidationException.php @@ -0,0 +1,20 @@ +violationList = $violationList; + parent::__construct(sprintf('Model validation failed with %d errors.', $violationList->count()), 400); + } + public function getViolationList(): ConstraintViolationListInterface + { + return $this->violationList; + } +} \ No newline at end of file diff --git a/generated/Runtime/Normalizer/ValidatorTrait.php b/generated/Runtime/Normalizer/ValidatorTrait.php new file mode 100644 index 00000000..20829be7 --- /dev/null +++ b/generated/Runtime/Normalizer/ValidatorTrait.php @@ -0,0 +1,17 @@ +validate($data, $constraint); + if ($violations->count() > 0) { + throw new ValidationException($violations); + } + } +} \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6b2f7063..5e418bc2 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,14 +3,10 @@ diff --git a/src/Context/Context.php b/src/Context/Context.php index c4df01dd..c3d3c6ca 100644 --- a/src/Context/Context.php +++ b/src/Context/Context.php @@ -99,7 +99,7 @@ public function read() */ public function toTar(): string { - $process = new Process('/usr/bin/env tar c .', $this->directory); + $process = new Process(['/usr/bin/env', 'tar', 'c', '.'], $this->directory); $process->run(); if (!$process->isSuccessful()) { diff --git a/src/Context/ContextBuilder.php b/src/Context/ContextBuilder.php index bbbadaf4..8ff10433 100644 --- a/src/Context/ContextBuilder.php +++ b/src/Context/ContextBuilder.php @@ -233,7 +233,7 @@ public function volume(string $volume): ContextBuilder */ public function getContext(): Context { - if ($this->directory !== null) { + if (isset($this->directory)) { $this->cleanDirectory(); } @@ -249,7 +249,9 @@ public function getContext(): Context */ public function __destruct() { - $this->cleanDirectory(); + if (isset($this->directory)) { + $this->cleanDirectory(); + } } /** @@ -330,6 +332,8 @@ private function getFile(string $directory, string $content): string */ private function cleanDirectory(): void { - $this->fs->remove($this->directory); + if (isset($this->directory)) { + $this->fs->remove($this->directory); + } } } diff --git a/src/Custom/ArrayDenormalizer.php b/src/Custom/ArrayDenormalizer.php deleted file mode 100644 index 5c6e3758..00000000 --- a/src/Custom/ArrayDenormalizer.php +++ /dev/null @@ -1,43 +0,0 @@ -serializer; - $type = substr($type, 0, -2); - - return array_map( - function ($data) use ($serializer, $type, $format, $context) { - return $serializer->denormalize($data, $type, $format, $context); - }, - $data - ); - } - - /** - * {@inheritdoc} - */ - public function supportsDenormalization($data, $type, $format = null) - { - if (!($this->serializer instanceof DenormalizerInterface)) { - return false; - } - - if (!is_array($data)) { - return false; - } - - return substr($type, -2) === '[]' && $this->serializer->supportsDenormalization($data, substr($type, 0, -2), $format); - } -} \ No newline at end of file diff --git a/src/Custom/QueryParam.php b/src/Custom/QueryParam.php deleted file mode 100644 index ff8babd0..00000000 --- a/src/Custom/QueryParam.php +++ /dev/null @@ -1,76 +0,0 @@ -formParameters[$option] = true; - } - - return $this; - } - - public function setHeaderParameters(array $optionNames): QueryParam - { - foreach ($optionNames as $option) { - $this->headerParameters[$option] = true; - } - - return $this; - } - - public function buildQueryString(array $options): string - { - $options = $this->resolve($options); - - foreach ($this->formParameters as $key => $isFormParameter) { - if ($isFormParameter && isset($options[$key])) { - unset($options[$key]); - } - } - - foreach ($this->headerParameters as $key => $isHeaderParameter) { - if ($isHeaderParameter && isset($options[$key])) { - unset($options[$key]); - } - } - - return http_build_query($options); - } - - public function buildFormDataString(array $options): string - { - $options = $this->resolve($options); - $formOptions = []; - - foreach ($this->formParameters as $key => $isFormParameter) { - if ($isFormParameter && isset($options[$key])) { - $formOptions[$key] = $options[$key]; - } - } - - return http_build_query($formOptions); - } - - public function buildHeaders(array $options): array - { - $options = $this->resolve($options); - $headerOptions = []; - - foreach ($this->headerParameters as $key => $isHeaderParameter) { - if ($isHeaderParameter && isset($options[$key])) { - $headerOptions[$key] = $options[$key]; - } - } - - return $headerOptions; - } -} \ No newline at end of file diff --git a/src/Custom/Resource.php b/src/Custom/Resource.php deleted file mode 100644 index 964eb256..00000000 --- a/src/Custom/Resource.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = new FlexibleHttpClient($httpClient); - $this->messageFactory = $messageFactory; - $this->serializer = $serializer; - } -} \ No newline at end of file diff --git a/src/Docker.php b/src/Docker.php index 3973e5f9..9fb9c324 100644 --- a/src/Docker.php +++ b/src/Docker.php @@ -2,7 +2,6 @@ namespace Docker; -use Docker\API\Normalizer\NormalizerFactory; use Docker\Manager\{ContainerManager, ExecManager, ImageManager, @@ -14,9 +13,9 @@ TaskManager, VolumeManager}; use GuzzleHttp\Psr7\HttpFactory; -use Http\Message\MessageFactory; -use Http\Message\MessageFactory\GuzzleMessageFactory; use Psr\Http\Client\ClientInterface; +use Psr\Http\Message\RequestFactoryInterface; +use Psr\Http\Message\StreamFactoryInterface; use Symfony\Component\Serializer\Encoder\JsonDecode; use Symfony\Component\Serializer\Encoder\JsonEncode; use Symfony\Component\Serializer\Encoder\JsonEncoder; @@ -27,21 +26,6 @@ */ class Docker { - /** - * @var ClientInterface - */ - private $httpClient; - - /** - * @var Serializer - */ - private $serializer; - - /** - * @var MessageFactory - */ - private $messageFactory; - /** * @var ContainerManager */ @@ -95,37 +79,49 @@ class Docker /** * @param ClientInterface|null $httpClient Http client to use with Docker * @param Serializer|null $serializer Deserialize docker response into php objects - * @param HttpFactory|null $messageFactory How to create docker request (in PSR7) + * @param RequestFactoryInterface|null $messageFactory How to create docker request (in PSR7) + * @param StreamFactoryInterface|null $streamFactory How to create stream (in PSR7) */ - public function __construct(?ClientInterface $httpClient = null, ?Serializer $serializer = null, ?HttpFactory $messageFactory = null) + public function __construct( + private ?ClientInterface $httpClient = null, + private ?Serializer $serializer = null, + private ?RequestFactoryInterface $messageFactory = null, + private ?StreamFactoryInterface $streamFactory = null, + ) { - $this->httpClient = $httpClient ?: DockerClient::createFromEnv(); + if ($this->httpClient === null) { + $this->httpClient = DockerClient::createFromEnv(); + } - if ($serializer === null) { - $serializer = new Serializer( - NormalizerFactory::create(), + if ($this->serializer === null) { + $this->serializer = new Serializer( + [ + new \Symfony\Component\Serializer\Normalizer\ArrayDenormalizer(), + new \Docker\API\Normalizer\JaneObjectNormalizer(), + ], [ new JsonEncoder( new JsonEncode(), new JsonDecode(), - [JsonDecode::ASSOCIATIVE => false], + [JsonDecode::ASSOCIATIVE => true], ), ] ); } - if ($messageFactory === null) { - $messageFactory = new GuzzleMessageFactory(); + if ($this->messageFactory === null) { + $this->messageFactory = new HttpFactory(); } - $this->serializer = $serializer; - $this->messageFactory = $messageFactory; + if ($this->streamFactory === null) { + $this->streamFactory = new HttpFactory(); + } } public function getContainerManager(): ContainerManager { if (null === $this->containerManager) { - $this->containerManager = new ContainerManager($this->httpClient, $this->messageFactory, $this->serializer); + $this->containerManager = new ContainerManager($this->httpClient, $this->messageFactory, $this->serializer, $this->streamFactory); } return $this->containerManager; @@ -134,7 +130,7 @@ public function getContainerManager(): ContainerManager public function getImageManager(): ImageManager { if (null === $this->imageManager) { - $this->imageManager = new ImageManager($this->httpClient, $this->messageFactory, $this->serializer); + $this->imageManager = new ImageManager($this->httpClient, $this->messageFactory, $this->serializer, $this->streamFactory); } return $this->imageManager; @@ -143,7 +139,7 @@ public function getImageManager(): ImageManager public function getMiscManager(): MiscManager { if (null === $this->miscManager) { - $this->miscManager = new MiscManager($this->httpClient, $this->messageFactory, $this->serializer); + $this->miscManager = new MiscManager($this->httpClient, $this->messageFactory, $this->serializer, $this->streamFactory); } return $this->miscManager; @@ -152,7 +148,7 @@ public function getMiscManager(): MiscManager public function getExecManager(): ExecManager { if (null === $this->execManager) { - $this->execManager = new ExecManager($this->httpClient, $this->messageFactory, $this->serializer); + $this->execManager = new ExecManager($this->httpClient, $this->messageFactory, $this->serializer, $this->streamFactory); } return $this->execManager; @@ -161,7 +157,7 @@ public function getExecManager(): ExecManager public function getVolumeManager(): VolumeManager { if (null === $this->volumeManager) { - $this->volumeManager = new VolumeManager($this->httpClient, $this->messageFactory, $this->serializer); + $this->volumeManager = new VolumeManager($this->httpClient, $this->messageFactory, $this->serializer, $this->streamFactory); } return $this->volumeManager; @@ -170,7 +166,7 @@ public function getVolumeManager(): VolumeManager public function getNetworkManager(): NetworkManager { if (null === $this->networkManager) { - $this->networkManager = new NetworkManager($this->httpClient, $this->messageFactory, $this->serializer); + $this->networkManager = new NetworkManager($this->httpClient, $this->messageFactory, $this->serializer, $this->streamFactory); } return $this->networkManager; @@ -179,7 +175,7 @@ public function getNetworkManager(): NetworkManager public function getNodeManager(): NodeManager { if (null === $this->nodeManager) { - $this->nodeManager = new NodeManager($this->httpClient, $this->messageFactory, $this->serializer); + $this->nodeManager = new NodeManager($this->httpClient, $this->messageFactory, $this->serializer, $this->streamFactory); } return $this->nodeManager; @@ -188,7 +184,7 @@ public function getNodeManager(): NodeManager public function getServiceManager(): ServiceManager { if (null === $this->serviceManager) { - $this->serviceManager = new ServiceManager($this->httpClient, $this->messageFactory, $this->serializer); + $this->serviceManager = new ServiceManager($this->httpClient, $this->messageFactory, $this->serializer, $this->streamFactory); } return $this->serviceManager; @@ -197,7 +193,7 @@ public function getServiceManager(): ServiceManager public function getSwarmManager(): SwarmManager { if (null === $this->swarmManager) { - $this->swarmManager = new SwarmManager($this->httpClient, $this->messageFactory, $this->serializer); + $this->swarmManager = new SwarmManager($this->httpClient, $this->messageFactory, $this->serializer, $this->streamFactory); } return $this->swarmManager; @@ -206,7 +202,7 @@ public function getSwarmManager(): SwarmManager public function getTaskManager(): TaskManager { if (null === $this->taskManager) { - $this->taskManager = new TaskManager($this->httpClient, $this->messageFactory, $this->serializer); + $this->taskManager = new TaskManager($this->httpClient, $this->messageFactory, $this->serializer, $this->streamFactory); } return $this->taskManager; diff --git a/src/DockerClient.php b/src/DockerClient.php index 0b9f399c..2b5be5d8 100644 --- a/src/DockerClient.php +++ b/src/DockerClient.php @@ -2,13 +2,13 @@ namespace Docker; use GuzzleHttp\Psr7\Uri; +use GuzzleHttp\Psr7\HttpFactory; use Http\Client\Common\Plugin\{ AddHostPlugin, ContentLengthPlugin, DecoderPlugin, ErrorPlugin }; -use Http\Message\MessageFactory\GuzzleMessageFactory; use Http\Client\Common\PluginClient; use Docker\SocketClient\Client as SocketHttpClient; use Psr\Http\Message\RequestInterface; @@ -21,7 +21,7 @@ class DockerClient implements ClientInterface public function __construct($socketClientOptions = []) { - $socketClient = new SocketHttpClient(new GuzzleMessageFactory(), $socketClientOptions); + $socketClient = new SocketHttpClient(new HttpFactory(), $socketClientOptions); $host = preg_match('/unix:\/\//', $socketClientOptions['remote_socket']) ? 'http://localhost' : $socketClientOptions['remote_socket']; $this->httpClient = new PluginClient($socketClient, [ diff --git a/src/Manager/BaseManager.php b/src/Manager/BaseManager.php new file mode 100644 index 00000000..201223a1 --- /dev/null +++ b/src/Manager/BaseManager.php @@ -0,0 +1,46 @@ +httpClient = new FlexibleHttpClient($httpClient); + $this->api = new Client( + $this->httpClient, + $this->messageFactory, + $this->serializer, + $this->streamFactory, + ); + } + + protected function extractRegistryAuth(array &$parameters, array &$headerParameters): void + { + if (isset($parameters['X-Registry-Auth'])) { + if ($parameters['X-Registry-Auth'] instanceof AuthConfig) { + $parameters['X-Registry-Auth'] = base64_encode($this->serializer->serialize($parameters['X-Registry-Auth'], 'json')); + } + $headerParameters['X-Registry-Auth'] = $parameters['X-Registry-Auth']; + unset($parameters['X-Registry-Auth']); + } + } +} diff --git a/src/Manager/ContainerManager.php b/src/Manager/ContainerManager.php index 3b93f14a..5651f820 100644 --- a/src/Manager/ContainerManager.php +++ b/src/Manager/ContainerManager.php @@ -2,23 +2,34 @@ namespace Docker\Manager; -use Docker\API\Resource\ContainerResource; -use Docker\Custom\QueryParam; use Docker\Stream\AttachWebsocketStream; use Docker\Stream\DockerRawStream; -class ContainerManager extends ContainerResource +class ContainerManager extends BaseManager { const FETCH_STREAM = 'stream'; /** - * {@inheritdoc} + * Attach to the container id. + * + * @param string $id The container id or name + * @param array $parameters + * { + * @var string $logs 1/True/true or 0/False/false, return logs. Default false + * @var string $stream 1/True/true or 0/False/false, return stream. Default false + * @var string $stdin 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false. + * @var string $stdout 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false. + * @var string $stderr 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false. + * @var string $detachKeys Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl- where is one of: a-z, @, ^, [, , or _. + * } + * + * @param string $fetch Fetch mode (object or response) * * @return \Psr\Http\Message\ResponseInterface|DockerRawStream */ public function attach($id, $parameters = [], $fetch = self::FETCH_STREAM) { - $response = parent::attach($id, $parameters, $fetch); + $response = $this->api->containerAttach(urlencode($id), $parameters, self::FETCH_RESPONSE); if ($response->getStatusCode() == 200 && DockerRawStream::HEADER == $response->getHeaderLine('Content-Type')) { if ($fetch == self::FETCH_STREAM) { @@ -30,36 +41,38 @@ public function attach($id, $parameters = [], $fetch = self::FETCH_STREAM) } /** - * {@inheritdoc} + * Attach to the container id with a websocket. + * + * @param string $id The container id or name + * @param array $parameters + * { + * @var string $logs 1/True/true or 0/False/false, return logs. Default false + * @var string $stream 1/True/true or 0/False/false, return stream. Default false + * @var string $stdin 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false. + * @var string $stdout 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false. + * @var string $stderr 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false. + * @var string $detachKeys Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl- where is one of: a-z, @, ^, [, , or _. + * } + * + * @param string $fetch Fetch mode (object or response) * * @return \Psr\Http\Message\ResponseInterface|AttachWebsocketStream */ public function attachWebsocket($id, $parameters = [], $fetch = self::FETCH_STREAM) { - $queryParam = new QueryParam(); - $queryParam->setDefault('logs', null); - $queryParam->setDefault('stream', null); - $queryParam->setDefault('stdin', null); - $queryParam->setDefault('stdout', null); - $queryParam->setDefault('stderr', null); - - $url = '/containers/{id}/attach/ws'; - $url = str_replace('{id}', $id, $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - - $headers = array_merge([ - 'Host' => 'localhost', - 'Origin' => 'php://docker-php', - 'Upgrade' => 'websocket', - 'Connection' => 'Upgrade', - 'Sec-WebSocket-Version' => '13', - 'Sec-WebSocket-Key' => base64_encode(uniqid()), - ], $queryParam->buildHeaders($parameters)); - - $body = $queryParam->buildFormDataString($parameters); - - $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); - $response = $this->httpClient->sendRequest($request); + $response = $this->api->executeEndpoint(new class (urlencode($id), $parameters) extends \Docker\API\Endpoint\ContainerAttachWebsocket { + public function getExtraHeaders(): array + { + return array_merge(parent::getExtraHeaders(), [ + 'Host' => 'localhost', + 'Origin' => 'php://docker-php', + 'Upgrade' => 'websocket', + 'Connection' => 'Upgrade', + 'Sec-WebSocket-Version' => '13', + 'Sec-WebSocket-Key' => base64_encode(uniqid()), + ]); + } + }, self::FETCH_RESPONSE); if ($response->getStatusCode() == 101) { if ($fetch == self::FETCH_STREAM) { @@ -75,8 +88,9 @@ public function attachWebsocket($id, $parameters = [], $fetch = self::FETCH_STRE * * @return \Psr\Http\Message\ResponseInterface|DockerRawStream|string[][] */ - public function logs($id, $parameters = [], $fetch = self::FETCH_OBJECT) { - $response = parent::logs($id, $parameters, $fetch); + public function logs($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + $response = $this->api->containerLogs(urlencode($id), $parameters, self::FETCH_RESPONSE); if ($response->getStatusCode() == 200) { if ($fetch == self::FETCH_STREAM) { @@ -106,4 +120,109 @@ public function logs($id, $parameters = [], $fetch = self::FETCH_OBJECT) { return $response; } + + public function findAll($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerList($parameters, $fetch); + } + + public function create(\Docker\API\Model\ContainersCreatePostBody $container, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerCreate($container, $parameters, $fetch); + } + + public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerInspect(urlencode($id), $parameters, $fetch); + } + + public function listProcesses($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerTop(urlencode($id), $parameters, $fetch); + } + + public function changes($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerChanges(urlencode($id), $fetch); + } + + public function export($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerExport(urlencode($id), $fetch); + } + + public function stats($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerStats(urlencode($id), $parameters, $fetch); + } + + public function resize($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerResize(urlencode($id), $parameters, $fetch); + } + + public function start($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerStart(urlencode($id), $parameters, $fetch); + } + + public function stop($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerStop(urlencode($id), $parameters, $fetch); + } + + public function restart($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerRestart(urlencode($id), $parameters, $fetch); + } + + public function kill($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerKill(urlencode($id), $parameters, $fetch); + } + + public function update($id, \Docker\API\Model\ContainersIdUpdatePostBody $resourceConfig, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerUpdate(urlencode($id), $resourceConfig, $fetch); + } + + public function rename($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerRename(urlencode($id), $parameters, $fetch); + } + + public function pause($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerPause(urlencode($id), $fetch); + } + + public function unpause($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerUnpause(urlencode($id), $fetch); + } + + public function wait($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerWait(urlencode($id), $parameters, $fetch); + } + + public function remove($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerDelete(urlencode($id), $parameters, $fetch); + } + + public function getArchive($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerArchive(urlencode($id), $parameters, $fetch); + } + + public function getArchiveInformation($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerArchiveInfo(urlencode($id), $parameters, $fetch); + } + + public function putArchive($id, $inputStream, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->putContainerArchive(urlencode($id), $inputStream, $parameters, $fetch); + } } diff --git a/src/Manager/ExecManager.php b/src/Manager/ExecManager.php index 590293a2..50c9cb1a 100644 --- a/src/Manager/ExecManager.php +++ b/src/Manager/ExecManager.php @@ -2,16 +2,15 @@ namespace Docker\Manager; -use Docker\API\Resource\ExecResource; use Docker\Stream\DockerRawStream; -class ExecManager extends ExecResource +class ExecManager extends BaseManager { const FETCH_STREAM = 'stream'; - public function start($id, \Docker\API\Model\ExecStartConfig $execStartConfig, $parameters = [], $fetch = self::FETCH_OBJECT) + public function start($id, \Docker\API\Model\ExecIdStartPostBody $execStartConfig, $parameters = [], $fetch = self::FETCH_OBJECT) { - $response = parent::start($id, $execStartConfig, $parameters, $fetch); + $response = $this->api->execStart(urlencode($id), $execStartConfig, self::FETCH_RESPONSE); if ($response->getStatusCode() == 200 && DockerRawStream::HEADER == $response->getHeaderLine('Content-Type')) { if ($fetch == self::FETCH_STREAM) { @@ -22,4 +21,18 @@ public function start($id, \Docker\API\Model\ExecStartConfig $execStartConfig, $ return $response; } + public function create($id, \Docker\API\Model\ContainersIdExecPostBody $execConfig, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->containerExec(urlencode($id), $execConfig, $fetch); + } + + public function resize($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->execResize(urlencode($id), $parameters, $fetch); + } + + public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->execInspect(urlencode($id), $fetch); + } } diff --git a/src/Manager/ImageManager.php b/src/Manager/ImageManager.php index 96f849a7..31e86a63 100644 --- a/src/Manager/ImageManager.php +++ b/src/Manager/ImageManager.php @@ -2,29 +2,47 @@ namespace Docker\Manager; -use Docker\API\Model\AuthConfig; use Docker\API\Model\BuildInfo; use Docker\API\Model\CreateImageInfo; use Docker\API\Model\PushImageInfo; -use Docker\API\Resource\ImageResource; -use Docker\Custom\QueryParam; use Docker\Stream\BuildStream; use Docker\Stream\CreateImageStream; use Docker\Stream\PushStream; use Docker\Stream\TarStream; use Psr\Http\Message\StreamInterface; -class ImageManager extends ImageResource +class ImageManager extends BaseManager { const FETCH_STREAM = 'stream'; - /** - * {@inheritdoc} + * Build an image from Dockerfile via stdin. * - * @param resource|StreamInterface|string $inputStream The input stream (encoded with tar) containing the Dockerfile - * and other files for the image. + * @param BaseManager|StreamInterface|string $inputStream The input stream (encoded with tar) containing the Dockerfile + * * and other files for the image. + * @param array $parameters + * { + * @param string $fetch Fetch mode (object or response) * * @return \Psr\Http\Message\ResponseInterface|BuildInfo[]|BuildStream + *@var string $dockerfile Path within the build context to the Dockerfile. This is ignored if remote is specified and points to an individual filename. + * @var string $t A repository name (and optionally a tag) to apply to the resulting image in case of success. + * @var string $remote A Git repository URI or HTTP/HTTPS URI build source. If the URI specifies a filename, the file’s contents are placed into a file called Dockerfile. + * @var bool $q Suppress verbose build output. + * @var bool $nocache Do not use the cache when building the image. + * @var string $pull Attempt to pull the image even if an older image exists locally + * @var bool $rm Remove intermediate containers after a successful build (default behavior). + * @var bool $forcerm always remove intermediate containers (includes rm) + * @var int $memory Set memory limit for build. + * @var int $memswap Total memory (memory + swap), -1 to disable swap. + * @var int $cpushares CPU shares (relative weight). + * @var string $cpusetcpus CPUs in which to allow execution (e.g., 0-3, 0,1). + * @var int $cpuperiod The length of a CPU period in microseconds. + * @var int $cpuquota Microseconds of CPU time that the container can get in a CPU period. + * @var int $buildargs Total memory (memory + swap), -1 to disable swap. + * @var string $Content-type Set to 'application/tar'. + * @var string $X-Registry-Config A base64-url-safe-encoded Registry Auth Config JSON object + * } + * */ public function build($inputStream, $parameters = [], $fetch = self::FETCH_OBJECT) { @@ -32,7 +50,7 @@ public function build($inputStream, $parameters = [], $fetch = self::FETCH_OBJEC $inputStream = new TarStream($inputStream); } - $response = parent::build($inputStream, $parameters, $fetch); + $response = $this->api->imageBuild($inputStream, $parameters, [], self::FETCH_RESPONSE); if (200 === $response->getStatusCode()) { if (self::FETCH_STREAM === $fetch) { @@ -62,11 +80,10 @@ public function build($inputStream, $parameters = [], $fetch = self::FETCH_OBJEC */ public function create($inputStream = null, $parameters = [], $fetch = self::FETCH_OBJECT) { - if (isset($parameters['X-Registry-Auth']) && $parameters['X-Registry-Auth'] instanceof AuthConfig) { - $parameters['X-Registry-Auth'] = base64_encode($this->serializer->serialize($parameters['X-Registry-Auth'], 'json')); - } + $headerParameters = []; + $this->extractRegistryAuth($parameters, $headerParameters); - $response = parent::create($inputStream, $parameters, self::FETCH_RESPONSE); + $response = $this->api->imageCreate($inputStream ?? '', $parameters, $headerParameters, self::FETCH_RESPONSE); if (200 === $response->getStatusCode()) { if (self::FETCH_STREAM === $fetch) { @@ -92,29 +109,14 @@ public function create($inputStream = null, $parameters = [], $fetch = self::FET /** * {@inheritdoc} * - * @return \Psr\Http\Message\ResponseInterface|PushImageInfo[]|CreateImageStream + * @return \Psr\Http\Message\ResponseInterface|PushImageInfo[]|PushStream */ public function push($name, $parameters = [], $fetch = self::FETCH_OBJECT) { - if (isset($parameters['X-Registry-Auth']) && $parameters['X-Registry-Auth'] instanceof AuthConfig) { - $parameters['X-Registry-Auth'] = base64_encode($this->serializer->serialize($parameters['X-Registry-Auth'], 'json')); - } + $headerParameters = []; + $this->extractRegistryAuth($parameters, $headerParameters); - $queryParam = new QueryParam(); - $queryParam->setDefault('tag', null); - $queryParam->setDefault('X-Registry-Auth', null); - $queryParam->setHeaderParameters(['X-Registry-Auth']); - - $url = 'http://localhost/images/{name}/push'; - $url = str_replace('{name}', $name, $url); - $url = $url . ('?' . $queryParam->buildQueryString($parameters)); - - $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); - - $body = $queryParam->buildFormDataString($parameters); - - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); - $response = $this->httpClient->sendRequest($request); + $response = $this->api->imagePush(urlencode($name), $parameters, $headerParameters, self::FETCH_RESPONSE); if (200 === $response->getStatusCode()) { if (self::FETCH_STREAM === $fetch) { @@ -136,4 +138,54 @@ public function push($name, $parameters = [], $fetch = self::FETCH_OBJECT) return $response; } + + public function findAll($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->imageList($parameters, $fetch); + } + + public function find($name, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->imageInspect(urlencode($name), $fetch); + } + + public function history($name, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->imageHistory(urlencode($name), $fetch); + } + + public function tag($name, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->imageTag(urlencode($name), $parameters, $fetch); + } + + public function remove($name, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->imageDelete(urlencode($name), $parameters, $fetch); + } + + public function search($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->imageSearch($parameters, $fetch); + } + + public function commit(\Docker\API\Model\ContainerConfig $containerConfig, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->imageCommit($containerConfig, $parameters, $fetch); + } + + public function save($name, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->imageGet(urlencode($name), $fetch); + } + + public function saveAll($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->imageGetAll($parameters, $fetch); + } + + public function load($imagesTarball, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->imageLoad($imagesTarball, $parameters, $fetch); + } } diff --git a/src/Manager/MiscManager.php b/src/Manager/MiscManager.php index c1511759..f01a0596 100644 --- a/src/Manager/MiscManager.php +++ b/src/Manager/MiscManager.php @@ -2,11 +2,10 @@ namespace Docker\Manager; -use Docker\API\Model\Event; -use Docker\API\Resource\MiscResource; +use Docker\API\Model\EventMessage; use Docker\Stream\EventStream; -class MiscManager extends MiscResource +class MiscManager extends BaseManager { const FETCH_STREAM = 'stream'; @@ -15,7 +14,13 @@ class MiscManager extends MiscResource */ public function getEvents($parameters = [], $fetch = self::FETCH_OBJECT): EventStream|array|\Psr\Http\Message\ResponseInterface { - $response = parent::getEvents($parameters, self::FETCH_RESPONSE); + if (isset($parameters['since'])) { + $parameters['since'] = (string) $parameters['since']; + } + if (isset($parameters['until'])) { + $parameters['until'] = (string) $parameters['until']; + } + $response = $this->api->systemEvents($parameters, self::FETCH_RESPONSE); if (200 === $response->getStatusCode()) { if (self::FETCH_STREAM === $fetch) { @@ -26,7 +31,7 @@ public function getEvents($parameters = [], $fetch = self::FETCH_OBJECT): EventS $eventList = []; $stream = new EventStream($response->getBody(), $this->serializer); - $stream->onFrame(function (Event $event) use (&$eventList) { + $stream->onFrame(function (EventMessage $event) use (&$eventList) { $eventList[] = $event; }); $stream->wait(); @@ -37,4 +42,24 @@ public function getEvents($parameters = [], $fetch = self::FETCH_OBJECT): EventS return $response; } + + public function checkAuthentication(\Docker\API\Model\AuthConfig $authConfig, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->systemAuth($authConfig, $fetch); + } + + public function getSystemInformation($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->systemInfo($fetch); + } + + public function getVersion($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->systemVersion($fetch); + } + + public function ping($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->systemPing($fetch); + } } diff --git a/src/Manager/NetworkManager.php b/src/Manager/NetworkManager.php index 34f95d5f..a26fc293 100644 --- a/src/Manager/NetworkManager.php +++ b/src/Manager/NetworkManager.php @@ -2,8 +2,35 @@ namespace Docker\Manager; -use Docker\API\Resource\NetworkResource; - -class NetworkManager extends NetworkResource +class NetworkManager extends BaseManager { + public function findAll($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->networkList($parameters, $fetch); + } + + public function remove($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->networkDelete(urlencode($id), $fetch); + } + + public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->networkInspect(urlencode($id), $parameters, $fetch); + } + + public function create(\Docker\API\Model\NetworksCreatePostBody $networkConfig, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->networkCreate($networkConfig, $fetch); + } + + public function connect($id, \Docker\API\Model\NetworksIdConnectPostBody $container, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->networkConnect(urlencode($id), $container, $fetch); + } + + public function disconnect($id, \Docker\API\Model\NetworksIdDisconnectPostBody $container, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->networkDisconnect(urlencode($id), $container, $fetch); + } } diff --git a/src/Manager/NodeManager.php b/src/Manager/NodeManager.php index 83420ddf..7eb492a2 100644 --- a/src/Manager/NodeManager.php +++ b/src/Manager/NodeManager.php @@ -2,8 +2,15 @@ namespace Docker\Manager; -use Docker\API\Resource\NodeResource; - -class NodeManager extends NodeResource +class NodeManager extends BaseManager { + public function findAll($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->nodeList($parameters, $fetch); + } + + public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->nodeInspect(urlencode($id), $fetch); + } } diff --git a/src/Manager/ServiceManager.php b/src/Manager/ServiceManager.php index b3e77278..740a2109 100644 --- a/src/Manager/ServiceManager.php +++ b/src/Manager/ServiceManager.php @@ -2,8 +2,36 @@ namespace Docker\Manager; -use Docker\API\Resource\ServiceResource; - -class ServiceManager extends ServiceResource +class ServiceManager extends BaseManager { + public function findAll($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->serviceList($parameters, $fetch); + } + + public function create(\Docker\API\Model\ServicesCreatePostBody $serviceSpec, $parameters = [], $fetch = self::FETCH_OBJECT) + { + $headerParameters = []; + $this->extractRegistryAuth($parameters, $headerParameters); + + return $this->api->serviceCreate($serviceSpec, $headerParameters, $fetch); + } + + public function remove($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->serviceDelete(urlencode($id), $fetch); + } + + public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->serviceInspect(urlencode($id), $parameters, $fetch); + } + + public function update($id, \Docker\API\Model\ServicesIdUpdatePostBody $serviceSpec, $parameters = [], $fetch = self::FETCH_OBJECT) + { + $headerParameters = []; + $this->extractRegistryAuth($parameters, $headerParameters); + + return $this->api->serviceUpdate(urlencode($id), $serviceSpec, $parameters, $headerParameters, $fetch); + } } diff --git a/src/Manager/SwarmManager.php b/src/Manager/SwarmManager.php index e691a596..aa7fa327 100644 --- a/src/Manager/SwarmManager.php +++ b/src/Manager/SwarmManager.php @@ -2,8 +2,25 @@ namespace Docker\Manager; -use Docker\API\Resource\SwarmResource; - -class SwarmManager extends SwarmResource +class SwarmManager extends BaseManager { + public function initialize(\Docker\API\Model\SwarmInitPostBody $swarmConfig, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->swarmInit($swarmConfig, $fetch); + } + + public function join(\Docker\API\Model\SwarmJoinPostBody $swarmJoinConfig, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->swarmJoin($swarmJoinConfig, $fetch); + } + + public function leave($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->swarmLeave($parameters, $fetch); + } + + public function update(\Docker\API\Model\SwarmSpec $swarmUpdateConfig, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->swarmUpdate($swarmUpdateConfig, $parameters, $fetch); + } } diff --git a/src/Manager/TaskManager.php b/src/Manager/TaskManager.php index bce5f290..89bf9f2b 100644 --- a/src/Manager/TaskManager.php +++ b/src/Manager/TaskManager.php @@ -2,8 +2,15 @@ namespace Docker\Manager; -use Docker\API\Resource\TaskResource; - -class TaskManager extends TaskResource +class TaskManager extends BaseManager { + public function findAll($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->taskList($parameters, $fetch); + } + + public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->taskInspect(urlencode($id), $fetch); + } } diff --git a/src/Manager/VolumeManager.php b/src/Manager/VolumeManager.php index 744c6cd6..5b1f53c7 100644 --- a/src/Manager/VolumeManager.php +++ b/src/Manager/VolumeManager.php @@ -2,8 +2,25 @@ namespace Docker\Manager; -use Docker\API\Resource\VolumeResource; - -class VolumeManager extends VolumeResource +class VolumeManager extends BaseManager { + public function findAll($parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->volumeList($parameters, $fetch); + } + + public function create(\Docker\API\Model\VolumeCreateOptions $volumeConfig, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->volumeCreate($volumeConfig, $fetch); + } + + public function remove($name, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->volumeDelete(urlencode($name), $parameters, $fetch); + } + + public function find($name, $parameters = [], $fetch = self::FETCH_OBJECT) + { + return $this->api->volumeInspect(urlencode($name), $fetch); + } } diff --git a/src/SocketClient/Client.php b/src/SocketClient/Client.php index 957ee376..bf74073e 100644 --- a/src/SocketClient/Client.php +++ b/src/SocketClient/Client.php @@ -7,10 +7,10 @@ use Docker\SocketClient\Exception\SSLConnectionException; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\ResponseFactoryInterface; use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; use Psr\Http\Client\ClientInterface; -use Http\Message\MessageFactory; /** * Socket Http Client. @@ -48,7 +48,7 @@ class Client implements ClientInterface * @var int $ssl_method Crypto method for ssl/tls, see PHP doc, defaults to STREAM_CRYPTO_METHOD_TLS_CLIENT * } */ - public function __construct(MessageFactory $responseFactory, array $config = []) + public function __construct(ResponseFactoryInterface $responseFactory, array $config = []) { $this->responseFactory = $responseFactory; $this->config = $this->configure($config); diff --git a/src/SocketClient/ResponseReader.php b/src/SocketClient/ResponseReader.php index 29b45bf5..67d77481 100644 --- a/src/SocketClient/ResponseReader.php +++ b/src/SocketClient/ResponseReader.php @@ -4,9 +4,9 @@ use Docker\SocketClient\Exception\BrokenPipeException; use Docker\SocketClient\Exception\TimeoutException; -use Http\Message\MessageFactory; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\ResponseFactoryInterface; /** * Method for reading response. @@ -18,9 +18,9 @@ trait ResponseReader { /** - * @var MessageFactory For creating response + * @var ResponseFactoryInterface For creating response */ - protected MessageFactory $responseFactory; + protected ResponseFactoryInterface $responseFactory; /** * Read a response from a socket. @@ -79,7 +79,11 @@ protected function readResponse(RequestInterface $request, $socket): ResponseInt : ''; } - $response = $this->responseFactory->createResponse($status, $reason, $responseHeaders, null, $protocol); + $response = $this->responseFactory->createResponse($status, $reason); + $response = $response->withProtocolVersion($protocol); + foreach ($responseHeaders as $name => $values) { + $response = $response->withAddedHeader($name, $values); + } $stream = $this->createStream($socket, $response); return $response->withBody($stream); diff --git a/src/Stream/BuildStream.php b/src/Stream/BuildStream.php index 3a9130a6..949268e3 100644 --- a/src/Stream/BuildStream.php +++ b/src/Stream/BuildStream.php @@ -14,6 +14,6 @@ class BuildStream extends MultiJsonStream */ protected function getDecodeClass(): string { - return 'Docker\API\Model\BuildInfo'; + return \Docker\API\Model\BuildInfo::class; } } diff --git a/src/Stream/CreateImageStream.php b/src/Stream/CreateImageStream.php index 2f370229..720581de 100644 --- a/src/Stream/CreateImageStream.php +++ b/src/Stream/CreateImageStream.php @@ -14,6 +14,6 @@ class CreateImageStream extends MultiJsonStream */ protected function getDecodeClass(): string { - return 'Docker\API\Model\CreateImageInfo'; + return \Docker\API\Model\CreateImageInfo::class; } } diff --git a/src/Stream/EventStream.php b/src/Stream/EventStream.php index da83d66e..137addb6 100644 --- a/src/Stream/EventStream.php +++ b/src/Stream/EventStream.php @@ -14,6 +14,6 @@ class EventStream extends MultiJsonStream */ protected function getDecodeClass(): string { - return 'Docker\API\Model\Event'; + return \Docker\API\Model\EventMessage::class; } } diff --git a/src/Stream/PushStream.php b/src/Stream/PushStream.php index 17d81ff1..aba0782f 100644 --- a/src/Stream/PushStream.php +++ b/src/Stream/PushStream.php @@ -14,6 +14,6 @@ class PushStream extends MultiJsonStream */ protected function getDecodeClass(): string { - return 'Docker\API\Model\PushImageInfo'; + return \Docker\API\Model\PushImageInfo::class; } } diff --git a/tests/Context/ContextBuilderTest.php b/tests/Context/ContextBuilderTest.php index 9ed4c62a..815d6286 100644 --- a/tests/Context/ContextBuilderTest.php +++ b/tests/Context/ContextBuilderTest.php @@ -16,7 +16,7 @@ public function testRemovesFilesOnDestruct() unset($contextBuilder); - $this->assertFileNotExists($context->getDirectory().'/Dockerfile'); + $this->assertFileDoesNotExist($context->getDirectory().'/Dockerfile'); } public function testWritesContextToDisk() @@ -75,7 +75,7 @@ public function testWritesAddCommands() $context = $contextBuilder->getContext(); - $this->assertRegExp(<<assertMatchesRegularExpression(<<run(); $this->assertEquals(strlen($process->getOutput()), strlen($context->toTar())); @@ -24,6 +24,6 @@ public function testReturnsValidTarStream() $directory = __DIR__.DIRECTORY_SEPARATOR."context-test"; $context = new Context($directory); - $this->assertInternalType('resource', $context->toStream()); + $this->assertIsResource($context->toStream()); } } diff --git a/tests/Manager/ContainerManagerTest.php b/tests/Manager/ContainerManagerTest.php index b552fdcb..d8f62460 100644 --- a/tests/Manager/ContainerManagerTest.php +++ b/tests/Manager/ContainerManagerTest.php @@ -2,7 +2,7 @@ namespace Docker\Tests\Manager; -use Docker\API\Model\ContainerConfig; +use Docker\API\Model\ContainersCreatePostBody; use Docker\Manager\ContainerManager; use Docker\Tests\TestCase; @@ -21,7 +21,7 @@ private function getManager() /** * Be sure to have image before doing test */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::getDocker()->getImageManager()->create(null, [ 'fromImage' => 'busybox:latest' @@ -30,7 +30,7 @@ public static function setUpBeforeClass() public function testAttach() { - $containerConfig = new ContainerConfig(); + $containerConfig = new ContainersCreatePostBody(); $containerConfig->setImage('busybox:latest'); $containerConfig->setCmd(['echo', '-n', 'output']); $containerConfig->setAttachStdout(true); @@ -57,7 +57,7 @@ public function testAttach() public function testAttachWebsocket() { - $containerConfig = new ContainerConfig(); + $containerConfig = new ContainersCreatePostBody(); $containerConfig->setImage('busybox:latest'); $containerConfig->setCmd(['sh']); $containerConfig->setAttachStdout(true); @@ -70,9 +70,6 @@ public function testAttachWebsocket() $containerCreateResult = $this->getManager()->create($containerConfig); $webSocketStream = $this->getManager()->attachWebsocket($containerCreateResult->getId(), [ 'stream' => true, - 'stdout' => true, - 'stderr' => true, - 'stdin' => true, ]); $this->getManager()->start($containerCreateResult->getId()); @@ -93,7 +90,7 @@ public function testAttachWebsocket() $output .= $data; } - $this->assertContains("echo", $output); + $this->assertStringContainsString("echo", $output); // Exit the container $webSocketStream->write("exit\n"); @@ -101,7 +98,7 @@ public function testAttachWebsocket() public function testLogs() { - $containerConfig = new ContainerConfig(); + $containerConfig = new ContainersCreatePostBody(); $containerConfig->setImage('busybox:latest'); $containerConfig->setCmd(['echo', '-n', 'output']); $containerConfig->setAttachStdout(true); @@ -118,6 +115,6 @@ public function testLogs() ]); - $this->assertContains("output", $logs['stdout'][0]); + $this->assertStringContainsString("output", $logs['stdout'][0]); } } diff --git a/tests/Manager/ExecManagerTest.php b/tests/Manager/ExecManagerTest.php index 72c14f3f..949c83f2 100644 --- a/tests/Manager/ExecManagerTest.php +++ b/tests/Manager/ExecManagerTest.php @@ -2,10 +2,9 @@ namespace Docker\Tests\Manager; -use Docker\API\Model\ContainerConfig; -use Docker\API\Model\ExecConfig; -use Docker\API\Model\ExecStartConfig; -use Docker\Manager\ContainerManager; +use Docker\API\Model\ContainersCreatePostBody; +use Docker\API\Model\ContainersIdExecPostBody; +use Docker\API\Model\ExecIdStartPostBody; use Docker\Manager\ExecManager; use Docker\Tests\TestCase; @@ -25,14 +24,14 @@ public function testStartStream() { $createContainerResult = $this->createContainer(); - $execConfig = new ExecConfig(); + $execConfig = new ContainersIdExecPostBody(); $execConfig->setAttachStdout(true); $execConfig->setAttachStderr(true); $execConfig->setCmd(["echo", "output"]); $execCreateResult = $this->getManager()->create($createContainerResult->getId(), $execConfig); - $execStartConfig = new ExecStartConfig(); + $execStartConfig = new ExecIdStartPostBody(); $execStartConfig->setDetach(false); $execStartConfig->setTty(false); @@ -57,12 +56,12 @@ public function testExecFind() { $createContainerResult = $this->createContainer(); - $execConfig = new ExecConfig(); + $execConfig = new ContainersIdExecPostBody(); $execConfig->setCmd(["/bin/true"]); $execCreateResult = $this->getManager()->create($createContainerResult->getId(), $execConfig); - $execStartConfig = new ExecStartConfig(); + $execStartConfig = new ExecIdStartPostBody(); $execStartConfig->setDetach(false); $execStartConfig->setTty(false); @@ -70,7 +69,7 @@ public function testExecFind() $execFindResult = $this->getManager()->find($execCreateResult->getId()); - $this->assertInstanceOf('Docker\API\Model\ExecCommand', $execFindResult); + $this->assertInstanceOf(\Docker\API\Model\ExecIdJsonGetResponse200::class, $execFindResult); self::getDocker()->getContainerManager()->kill($createContainerResult->getId(), [ 'signal' => 'SIGKILL' @@ -79,7 +78,7 @@ public function testExecFind() private function createContainer() { - $containerConfig = new ContainerConfig(); + $containerConfig = new ContainersCreatePostBody(); $containerConfig->setImage('busybox:latest'); $containerConfig->setCmd(['sh']); $containerConfig->setOpenStdin(true); diff --git a/tests/Manager/ImageManagerTest.php b/tests/Manager/ImageManagerTest.php index 0137924d..91cfb877 100644 --- a/tests/Manager/ImageManagerTest.php +++ b/tests/Manager/ImageManagerTest.php @@ -40,7 +40,7 @@ public function testBuildStream() }); $buildStream->wait(); - $this->assertContains("Successfully", $lastMessage); + $this->assertStringContainsString("Successfully", $lastMessage); } public function testBuildObject() @@ -52,8 +52,8 @@ public function testBuildObject() $context = $contextBuilder->getContext(); $buildInfos = $this->getManager()->build($context->read(), ['t' => 'test-image'], ImageManager::FETCH_OBJECT); - $this->assertInternalType('array', $buildInfos); - $this->assertContains("Successfully", $buildInfos[count($buildInfos) - 1]->getStream()); + $this->assertIsArray($buildInfos); + $this->assertStringContainsString("Successfully", $buildInfos[count($buildInfos) - 1]->getStream()); } public function testCreateStream() @@ -73,7 +73,7 @@ public function testCreateStream() }); $createImageStream->wait(); - $this->assertContains("Pulling from library/registry", $firstMessage); + $this->assertStringContainsString("Pulling from library/registry", $firstMessage); } public function testCreateObject() @@ -82,8 +82,8 @@ public function testCreateObject() 'fromImage' => 'registry:latest' ], ImageManager::FETCH_OBJECT); - $this->assertInternalType('array', $createImagesInfos); - $this->assertContains("Pulling from library/registry", $createImagesInfos[0]->getStatus()); + $this->assertIsArray($createImagesInfos); + $this->assertStringContainsString("Pulling from library/registry", $createImagesInfos[0]->getStatus()); } public function testPushStream() @@ -112,7 +112,7 @@ public function testPushStream() }); $pushImageStream->wait(); - $this->assertContains("The push refers to repository [localhost:5000/test-image]", $firstMessage); + $this->assertStringContainsString("The push refers to repository [localhost:5000/test-image]", $firstMessage); } public function testPushObject() @@ -130,7 +130,25 @@ public function testPushObject() 'X-Registry-Auth' => $registryConfig ], ImageManager::FETCH_OBJECT); - $this->assertInternalType('array', $pushImageInfos); - $this->assertContains("The push refers to repository [localhost:5000/test-image]", $pushImageInfos[0]->getStatus()); + $this->assertIsArray($pushImageInfos); + $this->assertStringContainsString("The push refers to repository [localhost:5000/test-image]", $pushImageInfos[0]->getStatus()); + } + + public function testTag() + { + $contextBuilder = new ContextBuilder(); + $contextBuilder->from('ubuntu:precise'); + $contextBuilder->add('/test', 'test file content'); + + $context = $contextBuilder->getContext(); + $this->getManager()->build($context->read(), ['t' => 'localhost:5000/test-image']); + + $this->getManager()->tag('localhost:5000/test-image', ['repo' => 'localhost:5000/test-image', 'tag' => 'new-tag']); + + $image = $this->getManager()->find('localhost:5000/test-image:new-tag'); + $this->assertNotNull($image); + + $images = $this->getManager()->findAll(['filters' => json_encode(['reference' => ['localhost:5000/test-image:new-tag']])]); + $this->assertCount(1, $images); } } diff --git a/tests/Manager/MiscManagerTest.php b/tests/Manager/MiscManagerTest.php index 05e70d4d..29bafcb0 100644 --- a/tests/Manager/MiscManagerTest.php +++ b/tests/Manager/MiscManagerTest.php @@ -2,7 +2,7 @@ namespace Docker\Tests\Manager; -use Docker\API\Model\Event; +use Docker\API\Model\EventMessage; use Docker\Manager\MiscManager; use Docker\Tests\TestCase; @@ -26,7 +26,7 @@ public function testGetEventsStream() ], MiscManager::FETCH_STREAM); $lastEvent = null; - $stream->onFrame(function (Event $event) use (&$lastEvent) { + $stream->onFrame(function (EventMessage $event) use (&$lastEvent) { $lastEvent = $event; }); @@ -35,17 +35,17 @@ public function testGetEventsStream() ]); $stream->wait(); - $this->assertInstanceOf('Docker\API\Model\Event', $lastEvent); + $this->assertInstanceOf(EventMessage::class, $lastEvent); } public function testGetEventsObject() { $events = $this->getManager()->getEvents([ - 'since' => time() - (60 * 60 * 24), + 'since' => time() - 60, 'until' => time() ], MiscManager::FETCH_OBJECT); - $this->assertInternalType('array', $events); - $this->assertInstanceOf('Docker\API\Model\Event', $events[0]); + $this->assertIsArray($events); + $this->assertInstanceOf(EventMessage::class, $events[0]); } } diff --git a/tests/TestCase.php b/tests/TestCase.php index 3bc435d9..a769c7d9 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -3,9 +3,8 @@ namespace Docker\Tests; use Docker\Docker; -use PHPUnit_Framework_TestCase; -class TestCase extends PHPUnit_Framework_TestCase +class TestCase extends \PHPUnit\Framework\TestCase { private static $docker; diff --git a/v1.47.yaml b/v1.47.yaml new file mode 100644 index 00000000..a4b63a18 --- /dev/null +++ b/v1.47.yaml @@ -0,0 +1,12939 @@ +# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API. +# +# This is used for generating API documentation and the types used by the +# client/server. See api/README.md for more information. +# +# Some style notes: +# - This file is used by ReDoc, which allows GitHub Flavored Markdown in +# descriptions. +# - There is no maximum line length, for ease of editing and pretty diffs. +# - operationIds are in the format "NounVerb", with a singular noun. + +swagger: "2.0" +schemes: + - "http" + - "https" +produces: + - "application/json" + - "text/plain" +consumes: + - "application/json" + - "text/plain" +basePath: "/v1.47" +info: + title: "Docker Engine API" + version: "1.47" + x-logo: + url: "https://docs.docker.com/assets/images/logo-docker-main.png" + description: | + The Engine API is an HTTP API served by Docker Engine. It is the API the + Docker client uses to communicate with the Engine, so everything the Docker + client can do can be done with the API. + + Most of the client's commands map directly to API endpoints (e.g. `docker ps` + is `GET /containers/json`). The notable exception is running containers, + which consists of several API calls. + + # Errors + + The API uses standard HTTP status codes to indicate the success or failure + of the API call. The body of the response will be JSON in the following + format: + + ``` + { + "message": "page not found" + } + ``` + + # Versioning + + The API is usually changed in each release, so API calls are versioned to + ensure that clients don't break. To lock to a specific version of the API, + you prefix the URL with its version, for example, call `/v1.30/info` to use + the v1.30 version of the `/info` endpoint. If the API version specified in + the URL is not supported by the daemon, a HTTP `400 Bad Request` error message + is returned. + + If you omit the version-prefix, the current version of the API (v1.47) is used. + For example, calling `/info` is the same as calling `/v1.47/info`. Using the + API without a version-prefix is deprecated and will be removed in a future release. + + Engine releases in the near future should support this version of the API, + so your client will continue to work even if it is talking to a newer Engine. + + The API uses an open schema model, which means server may add extra properties + to responses. Likewise, the server will ignore any extra query parameters and + request body properties. When you write clients, you need to ignore additional + properties in responses to ensure they do not break when talking to newer + daemons. + + + # Authentication + + Authentication for registries is handled client side. The client has to send + authentication details to various endpoints that need to communicate with + registries, such as `POST /images/(name)/push`. These are sent as + `X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5) + (JSON) string with the following structure: + + ``` + { + "username": "string", + "password": "string", + "email": "string", + "serveraddress": "string" + } + ``` + + The `serveraddress` is a domain/IP without a protocol. Throughout this + structure, double quotes are required. + + If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), + you can just pass this instead of credentials: + + ``` + { + "identitytoken": "9cbaf023786cd7..." + } + ``` + +# The tags on paths define the menu sections in the ReDoc documentation, so +# the usage of tags must make sense for that: +# - They should be singular, not plural. +# - There should not be too many tags, or the menu becomes unwieldy. For +# example, it is preferable to add a path to the "System" tag instead of +# creating a tag with a single path in it. +# - The order of tags in this list defines the order in the menu. +tags: + # Primary objects + - name: "Container" + x-displayName: "Containers" + description: | + Create and manage containers. + - name: "Image" + x-displayName: "Images" + - name: "Network" + x-displayName: "Networks" + description: | + Networks are user-defined networks that containers can be attached to. + See the [networking documentation](https://docs.docker.com/network/) + for more information. + - name: "Volume" + x-displayName: "Volumes" + description: | + Create and manage persistent storage that can be attached to containers. + - name: "Exec" + x-displayName: "Exec" + description: | + Run new commands inside running containers. Refer to the + [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) + for more information. + + To exec a command in a container, you first need to create an exec instance, + then start it. These two API endpoints are wrapped up in a single command-line + command, `docker exec`. + + # Swarm things + - name: "Swarm" + x-displayName: "Swarm" + description: | + Engines can be clustered together in a swarm. Refer to the + [swarm mode documentation](https://docs.docker.com/engine/swarm/) + for more information. + - name: "Node" + x-displayName: "Nodes" + description: | + Nodes are instances of the Engine participating in a swarm. Swarm mode + must be enabled for these endpoints to work. + - name: "Service" + x-displayName: "Services" + description: | + Services are the definitions of tasks to run on a swarm. Swarm mode must + be enabled for these endpoints to work. + - name: "Task" + x-displayName: "Tasks" + description: | + A task is a container running on a swarm. It is the atomic scheduling unit + of swarm. Swarm mode must be enabled for these endpoints to work. + - name: "Secret" + x-displayName: "Secrets" + description: | + Secrets are sensitive data that can be used by services. Swarm mode must + be enabled for these endpoints to work. + - name: "Config" + x-displayName: "Configs" + description: | + Configs are application configurations that can be used by services. Swarm + mode must be enabled for these endpoints to work. + # System things + - name: "Plugin" + x-displayName: "Plugins" + - name: "System" + x-displayName: "System" + +definitions: + Port: + type: "object" + description: "An open port on a container" + required: [PrivatePort, Type] + properties: + IP: + type: "string" + format: "ip-address" + description: "Host IP address that the container's port is mapped to" + PrivatePort: + type: "integer" + format: "uint16" + x-nullable: false + description: "Port on the container" + PublicPort: + type: "integer" + format: "uint16" + description: "Port exposed on the host" + Type: + type: "string" + x-nullable: false + enum: ["tcp", "udp", "sctp"] + example: + PrivatePort: 8080 + PublicPort: 80 + Type: "tcp" + + MountPoint: + type: "object" + description: | + MountPoint represents a mount point configuration inside the container. + This is used for reporting the mountpoints in use by a container. + properties: + Type: + description: | + The mount type: + + - `bind` a mount of a file or directory from the host into the container. + - `volume` a docker volume with the given `Name`. + - `tmpfs` a `tmpfs`. + - `npipe` a named pipe from the host into the container. + - `cluster` a Swarm cluster volume + type: "string" + enum: + - "bind" + - "volume" + - "tmpfs" + - "npipe" + - "cluster" + example: "volume" + Name: + description: | + Name is the name reference to the underlying data defined by `Source` + e.g., the volume name. + type: "string" + example: "myvolume" + Source: + description: | + Source location of the mount. + + For volumes, this contains the storage location of the volume (within + `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + the source (host) part of the bind-mount. For `tmpfs` mount points, this + field is empty. + type: "string" + example: "/var/lib/docker/volumes/myvolume/_data" + Destination: + description: | + Destination is the path relative to the container root (`/`) where + the `Source` is mounted inside the container. + type: "string" + example: "/usr/share/nginx/html/" + Driver: + description: | + Driver is the volume driver used to create the volume (if it is a volume). + type: "string" + example: "local" + Mode: + description: | + Mode is a comma separated list of options supplied by the user when + creating the bind/volume mount. + + The default is platform-specific (`"z"` on Linux, empty on Windows). + type: "string" + example: "z" + RW: + description: | + Whether the mount is mounted writable (read-write). + type: "boolean" + example: true + Propagation: + description: | + Propagation describes how mounts are propagated from the host into the + mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + for details. This field is not used on Windows. + type: "string" + example: "" + + DeviceMapping: + type: "object" + description: "A device mapping between the host and container" + properties: + PathOnHost: + type: "string" + PathInContainer: + type: "string" + CgroupPermissions: + type: "string" + example: + PathOnHost: "/dev/deviceName" + PathInContainer: "/dev/deviceName" + CgroupPermissions: "mrw" + + DeviceRequest: + type: "object" + description: "A request for devices to be sent to device drivers" + properties: + Driver: + type: "string" + example: "nvidia" + Count: + type: "integer" + example: -1 + DeviceIDs: + type: "array" + items: + type: "string" + example: + - "0" + - "1" + - "GPU-fef8089b-4820-abfc-e83e-94318197576e" + Capabilities: + description: | + A list of capabilities; an OR list of AND lists of capabilities. + type: "array" + items: + type: "array" + items: + type: "string" + example: + # gpu AND nvidia AND compute + - ["gpu", "nvidia", "compute"] + Options: + description: | + Driver-specific options, specified as a key/value pairs. These options + are passed directly to the driver. + type: "object" + additionalProperties: + type: "string" + + ThrottleDevice: + type: "object" + properties: + Path: + description: "Device path" + type: "string" + Rate: + description: "Rate" + type: "integer" + format: "int64" + minimum: 0 + + Mount: + type: "object" + properties: + Target: + description: "Container path." + type: "string" + Source: + description: "Mount source (e.g. a volume name, a host path)." + type: "string" + Type: + description: | + The mount type. Available types: + + - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. + - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `cluster` a Swarm cluster volume + type: "string" + enum: + - "bind" + - "volume" + - "tmpfs" + - "npipe" + - "cluster" + ReadOnly: + description: "Whether the mount should be read-only." + type: "boolean" + Consistency: + description: "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + type: "string" + BindOptions: + description: "Optional configuration for the `bind` type." + type: "object" + properties: + Propagation: + description: "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`." + type: "string" + enum: + - "private" + - "rprivate" + - "shared" + - "rshared" + - "slave" + - "rslave" + NonRecursive: + description: "Disable recursive bind mount." + type: "boolean" + default: false + CreateMountpoint: + description: "Create mount point on host if missing" + type: "boolean" + default: false + ReadOnlyNonRecursive: + description: | + Make the mount non-recursively read-only, but still leave the mount recursive + (unless NonRecursive is set to `true` in conjunction). + + Added in v1.44, before that version all read-only mounts were + non-recursive by default. To match the previous behaviour this + will default to `true` for clients on versions prior to v1.44. + type: "boolean" + default: false + ReadOnlyForceRecursive: + description: "Raise an error if the mount cannot be made recursively read-only." + type: "boolean" + default: false + VolumeOptions: + description: "Optional configuration for the `volume` type." + type: "object" + properties: + NoCopy: + description: "Populate volume with data from the target." + type: "boolean" + default: false + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + DriverConfig: + description: "Map of driver specific options" + type: "object" + properties: + Name: + description: "Name of the driver to use to create the volume." + type: "string" + Options: + description: "key/value map of driver specific options." + type: "object" + additionalProperties: + type: "string" + Subpath: + description: "Source path inside the volume. Must be relative without any back traversals." + type: "string" + example: "dir-inside-volume/subdirectory" + TmpfsOptions: + description: "Optional configuration for the `tmpfs` type." + type: "object" + properties: + SizeBytes: + description: "The size for the tmpfs mount in bytes." + type: "integer" + format: "int64" + Mode: + description: "The permission mode for the tmpfs mount in an integer." + type: "integer" + Options: + description: | + The options to be passed to the tmpfs mount. An array of arrays. + Flag options should be provided as 1-length arrays. Other types + should be provided as as 2-length arrays, where the first item is + the key and the second the value. + type: "array" + items: + type: "array" + minItems: 1 + maxItems: 2 + items: + type: "string" + example: + [["noexec"]] + + RestartPolicy: + description: | + The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + type: "object" + properties: + Name: + type: "string" + description: | + - Empty string means not to restart + - `no` Do not automatically restart + - `always` Always restart + - `unless-stopped` Restart always except when the user has manually stopped the container + - `on-failure` Restart only when the container exit code is non-zero + enum: + - "" + - "no" + - "always" + - "unless-stopped" + - "on-failure" + MaximumRetryCount: + type: "integer" + description: | + If `on-failure` is used, the number of times to retry before giving up. + + Resources: + description: "A container's resources (cgroups config, ulimits, etc)" + type: "object" + properties: + # Applicable to all platforms + CpuShares: + description: | + An integer value representing this container's relative CPU weight + versus other containers. + type: "integer" + Memory: + description: "Memory limit in bytes." + type: "integer" + format: "int64" + default: 0 + # Applicable to UNIX platforms + CgroupParent: + description: | + Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + type: "string" + BlkioWeight: + description: "Block IO weight (relative weight)." + type: "integer" + minimum: 0 + maximum: 1000 + BlkioWeightDevice: + description: | + Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + type: "array" + items: + type: "object" + properties: + Path: + type: "string" + Weight: + type: "integer" + minimum: 0 + BlkioDeviceReadBps: + description: | + Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteBps: + description: | + Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceReadIOps: + description: | + Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteIOps: + description: | + Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + CpuPeriod: + description: "The length of a CPU period in microseconds." + type: "integer" + format: "int64" + CpuQuota: + description: | + Microseconds of CPU time that the container can get in a CPU period. + type: "integer" + format: "int64" + CpuRealtimePeriod: + description: | + The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpuRealtimeRuntime: + description: | + The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpusetCpus: + description: | + CPUs in which to allow execution (e.g., `0-3`, `0,1`). + type: "string" + example: "0-3" + CpusetMems: + description: | + Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + type: "string" + Devices: + description: "A list of devices to add to the container." + type: "array" + items: + $ref: "#/definitions/DeviceMapping" + DeviceCgroupRules: + description: "a list of cgroup rules to apply to the container" + type: "array" + items: + type: "string" + example: "c 13:* rwm" + DeviceRequests: + description: | + A list of requests for devices to be sent to device drivers. + type: "array" + items: + $ref: "#/definitions/DeviceRequest" + KernelMemoryTCP: + description: | + Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + type: "integer" + format: "int64" + MemoryReservation: + description: "Memory soft limit in bytes." + type: "integer" + format: "int64" + MemorySwap: + description: | + Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + type: "integer" + format: "int64" + MemorySwappiness: + description: | + Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + type: "integer" + format: "int64" + minimum: 0 + maximum: 100 + NanoCpus: + description: "CPU quota in units of 10-9 CPUs." + type: "integer" + format: "int64" + OomKillDisable: + description: "Disable OOM Killer for the container." + type: "boolean" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + PidsLimit: + description: | + Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + type: "integer" + format: "int64" + x-nullable: true + Ulimits: + description: | + A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + # Applicable to Windows + CpuCount: + description: | + The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + CpuPercent: + description: | + The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + IOMaximumIOps: + description: "Maximum IOps for the container system drive (Windows only)" + type: "integer" + format: "int64" + IOMaximumBandwidth: + description: | + Maximum IO in bytes per second for the container system drive + (Windows only). + type: "integer" + format: "int64" + + Limit: + description: | + An object describing a limit on resources which can be requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + Pids: + description: | + Limits the maximum number of PIDs in the container. Set `0` for unlimited. + type: "integer" + format: "int64" + default: 0 + example: 100 + + ResourceObject: + description: | + An object describing the resources which can be advertised by a node and + requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + GenericResources: + $ref: "#/definitions/GenericResources" + + GenericResources: + description: | + User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + type: "array" + items: + type: "object" + properties: + NamedResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "string" + DiscreteResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "integer" + format: "int64" + example: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + HealthConfig: + description: "A test to perform to check that the container is healthy." + type: "object" + properties: + Test: + description: | + The test to perform. Possible values are: + + - `[]` inherit healthcheck from image or parent image + - `["NONE"]` disable healthcheck + - `["CMD", args...]` exec arguments directly + - `["CMD-SHELL", command]` run command with system's default shell + type: "array" + items: + type: "string" + Interval: + description: | + The time to wait between checks in nanoseconds. It should be 0 or at + least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + Timeout: + description: | + The time to wait before considering the check to have hung. It should + be 0 or at least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + Retries: + description: | + The number of consecutive failures needed to consider a container as + unhealthy. 0 means inherit. + type: "integer" + StartPeriod: + description: | + Start period for the container to initialize before starting + health-retries countdown in nanoseconds. It should be 0 or at least + 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + StartInterval: + description: | + The time to wait between checks in nanoseconds during the start period. + It should be 0 or at least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + + Health: + description: | + Health stores information about the container's healthcheck results. + type: "object" + x-nullable: true + properties: + Status: + description: | + Status is one of `none`, `starting`, `healthy` or `unhealthy` + + - "none" Indicates there is no healthcheck + - "starting" Starting indicates that the container is not yet ready + - "healthy" Healthy indicates that the container is running correctly + - "unhealthy" Unhealthy indicates that the container has a problem + type: "string" + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + Log: + type: "array" + description: | + Log contains the last few results (oldest first) + items: + $ref: "#/definitions/HealthcheckResult" + + HealthcheckResult: + description: | + HealthcheckResult stores information about a single run of a healthcheck probe + type: "object" + x-nullable: true + properties: + Start: + description: | + Date and time at which this check started in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "date-time" + example: "2020-01-04T10:44:24.496525531Z" + End: + description: | + Date and time at which this check ended in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2020-01-04T10:45:21.364524523Z" + ExitCode: + description: | + ExitCode meanings: + + - `0` healthy + - `1` unhealthy + - `2` reserved (considered unhealthy) + - other values: error running probe + type: "integer" + example: 0 + Output: + description: "Output from last check" + type: "string" + + HostConfig: + description: "Container configuration that depends on the host we are running on" + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + # Applicable to all platforms + Binds: + type: "array" + description: | + A list of volume bindings for this container. Each volume binding + is a string in one of these forms: + + - `host-src:container-dest[:options]` to bind-mount a host path + into the container. Both `host-src`, and `container-dest` must + be an _absolute_ path. + - `volume-name:container-dest[:options]` to bind-mount a volume + managed by a volume driver into the container. `container-dest` + must be an _absolute_ path. + + `options` is an optional, comma-delimited list of: + + - `nocopy` disables automatic copying of data from the container + path to the volume. The `nocopy` flag only applies to named volumes. + - `[ro|rw]` mounts a volume read-only or read-write, respectively. + If omitted or set to `rw`, volumes are mounted read-write. + - `[z|Z]` applies SELinux labels to allow or deny multiple containers + to read and write to the same volume. + - `z`: a _shared_ content label is applied to the content. This + label indicates that multiple containers can share the volume + content, for both reading and writing. + - `Z`: a _private unshared_ label is applied to the content. + This label indicates that only the current container can use + a private volume. Labeling systems such as SELinux require + proper labels to be placed on volume content that is mounted + into a container. Without a label, the security system can + prevent a container's processes from using the content. By + default, the labels set by the host operating system are not + modified. + - `[[r]shared|[r]slave|[r]private]` specifies mount + [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + This only applies to bind-mounted volumes, not internal volumes + or named volumes. Mount propagation requires the source mount + point (the location where the source directory is mounted in the + host operating system) to have the correct propagation properties. + For shared volumes, the source mount point must be set to `shared`. + For slave volumes, the mount must be set to either `shared` or + `slave`. + items: + type: "string" + ContainerIDFile: + type: "string" + description: "Path to a file where the container ID is written" + LogConfig: + type: "object" + description: "The logging configuration for this container" + properties: + Type: + type: "string" + enum: + - "json-file" + - "syslog" + - "journald" + - "gelf" + - "fluentd" + - "awslogs" + - "splunk" + - "etwlogs" + - "none" + Config: + type: "object" + additionalProperties: + type: "string" + NetworkMode: + type: "string" + description: | + Network mode to use for this container. Supported standard values + are: `bridge`, `host`, `none`, and `container:`. Any + other value is taken as a custom network's name to which this + container should connect to. + PortBindings: + $ref: "#/definitions/PortMap" + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + AutoRemove: + type: "boolean" + description: | + Automatically remove the container when the container's process + exits. This has no effect if `RestartPolicy` is set. + VolumeDriver: + type: "string" + description: "Driver that this container uses to mount volumes." + VolumesFrom: + type: "array" + description: | + A list of volumes to inherit from another container, specified in + the form `[:]`. + items: + type: "string" + Mounts: + description: | + Specification for mounts to be added to the container. + type: "array" + items: + $ref: "#/definitions/Mount" + ConsoleSize: + type: "array" + description: | + Initial console size, as an `[height, width]` array. + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + Annotations: + type: "object" + description: | + Arbitrary non-identifying metadata attached to container and + provided to the runtime when the container is started. + additionalProperties: + type: "string" + + # Applicable to UNIX platforms + CapAdd: + type: "array" + description: | + A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CapDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CgroupnsMode: + type: "string" + enum: + - "private" + - "host" + description: | + cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. + Dns: + type: "array" + description: "A list of DNS servers for the container to use." + items: + type: "string" + DnsOptions: + type: "array" + description: "A list of DNS options." + items: + type: "string" + DnsSearch: + type: "array" + description: "A list of DNS search domains." + items: + type: "string" + ExtraHosts: + type: "array" + description: | + A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + items: + type: "string" + GroupAdd: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + IpcMode: + type: "string" + description: | + IPC sharing mode for the container. Possible values are: + + - `"none"`: own private IPC namespace, with /dev/shm not mounted + - `"private"`: own private IPC namespace + - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + - `"container:"`: join another (shareable) container's IPC namespace + - `"host"`: use the host system's IPC namespace + + If not specified, daemon default is used, which can either be `"private"` + or `"shareable"`, depending on daemon version and configuration. + Cgroup: + type: "string" + description: "Cgroup to use for the container." + Links: + type: "array" + description: | + A list of links for the container in the form `container_name:alias`. + items: + type: "string" + OomScoreAdj: + type: "integer" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 500 + PidMode: + type: "string" + description: | + Set the PID (Process) Namespace mode for the container. It can be + either: + + - `"container:"`: joins another container's PID namespace + - `"host"`: use the host's PID namespace inside the container + Privileged: + type: "boolean" + description: "Gives the container full access to the host." + PublishAllPorts: + type: "boolean" + description: | + Allocates an ephemeral host port for all of a container's + exposed ports. + + Ports are de-allocated when the container stops and allocated when + the container starts. The allocated port might be changed when + restarting the container. + + The port is selected from the ephemeral port range that depends on + the kernel. For example, on Linux the range is defined by + `/proc/sys/net/ipv4/ip_local_port_range`. + ReadonlyRootfs: + type: "boolean" + description: "Mount the container's root filesystem as read only." + SecurityOpt: + type: "array" + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. + items: + type: "string" + StorageOpt: + type: "object" + description: | + Storage driver options for this container, in the form `{"size": "120G"}`. + additionalProperties: + type: "string" + Tmpfs: + type: "object" + description: | + A map of container directories which should be replaced by tmpfs + mounts, and their corresponding mount options. For example: + + ``` + { "/run": "rw,noexec,nosuid,size=65536k" } + ``` + additionalProperties: + type: "string" + UTSMode: + type: "string" + description: "UTS namespace to use for the container." + UsernsMode: + type: "string" + description: | + Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + ShmSize: + type: "integer" + format: "int64" + description: | + Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. + minimum: 0 + Sysctls: + type: "object" + description: | + A list of kernel parameters (sysctls) to set in the container. + For example: + + ``` + {"net.ipv4.ip_forward": "1"} + ``` + additionalProperties: + type: "string" + Runtime: + type: "string" + description: "Runtime to use with this container." + # Applicable to Windows + Isolation: + type: "string" + description: | + Isolation technology of the container. (Windows only) + enum: + - "default" + - "process" + - "hyperv" + MaskedPaths: + type: "array" + description: | + The list of paths to be masked inside the container (this overrides + the default set of paths). + items: + type: "string" + ReadonlyPaths: + type: "array" + description: | + The list of paths to be set as read-only inside the container + (this overrides the default set of paths). + items: + type: "string" + + ContainerConfig: + description: | + Configuration for a container that is portable between hosts. + type: "object" + properties: + Hostname: + description: | + The hostname to use for the container, as a valid RFC 1123 hostname. + type: "string" + example: "439f4e91bd1d" + Domainname: + description: | + The domain name to use for the container. + type: "string" + User: + description: "The user that commands are run as inside the container." + type: "string" + AttachStdin: + description: "Whether to attach to `stdin`." + type: "boolean" + default: false + AttachStdout: + description: "Whether to attach to `stdout`." + type: "boolean" + default: true + AttachStderr: + description: "Whether to attach to `stderr`." + type: "boolean" + default: true + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"/": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Tty: + description: | + Attach standard streams to a TTY, including `stdin` if it is not closed. + type: "boolean" + default: false + OpenStdin: + description: "Open `stdin`" + type: "boolean" + default: false + StdinOnce: + description: "Close `stdin` after one attached client disconnects" + type: "boolean" + default: false + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Image: + description: | + The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + type: "string" + example: "example-image:1.0" + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + NetworkDisabled: + description: "Disable networking for the container." + type: "boolean" + x-nullable: true + MacAddress: + description: | + MAC address of the container. + + Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. + type: "string" + x-nullable: true + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + StopTimeout: + description: "Timeout to stop a container in seconds." + type: "integer" + default: 10 + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + ImageConfig: + description: | + Configuration of the image. These fields are used as defaults + when starting a container from the image. + type: "object" + properties: + Hostname: + description: | + The hostname to use for the container, as a valid RFC 1123 hostname. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always empty. It must not be used, and will be removed in API v1.48. + type: "string" + example: "" + Domainname: + description: | + The domain name to use for the container. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always empty. It must not be used, and will be removed in API v1.48. + type: "string" + example: "" + User: + description: "The user that commands are run as inside the container." + type: "string" + example: "web:web" + AttachStdin: + description: | + Whether to attach to `stdin`. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + type: "boolean" + default: false + example: false + AttachStdout: + description: | + Whether to attach to `stdout`. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + type: "boolean" + default: false + example: false + AttachStderr: + description: | + Whether to attach to `stderr`. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + type: "boolean" + default: false + example: false + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"/": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Tty: + description: | + Attach standard streams to a TTY, including `stdin` if it is not closed. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + type: "boolean" + default: false + example: false + OpenStdin: + description: | + Open `stdin` + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + type: "boolean" + default: false + example: false + StdinOnce: + description: | + Close `stdin` after one attached client disconnects. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always false. It must not be used, and will be removed in API v1.48. + type: "boolean" + default: false + example: false + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Image: + description: | + The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always empty. It must not be used, and will be removed in API v1.48. + type: "string" + default: "" + example: "" + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: + "/app/data": {} + "/app/config": {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + NetworkDisabled: + description: | + Disable networking for the container. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always omitted. It must not be used, and will be removed in API v1.48. + type: "boolean" + default: false + example: false + x-nullable: true + MacAddress: + description: | + MAC address of the container. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always omitted. It must not be used, and will be removed in API v1.48. + type: "string" + default: "" + example: "" + x-nullable: true + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + StopTimeout: + description: | + Timeout to stop a container in seconds. + +


+ + > **Deprecated**: this field is not part of the image specification and is + > always omitted. It must not be used, and will be removed in API v1.48. + type: "integer" + default: 10 + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + # FIXME(thaJeztah): temporarily using a full example to remove some "omitempty" fields. Remove once the fields are removed. + example: + "Hostname": "" + "Domainname": "" + "User": "web:web" + "AttachStdin": false + "AttachStdout": false + "AttachStderr": false + "ExposedPorts": { + "80/tcp": {}, + "443/tcp": {} + } + "Tty": false + "OpenStdin": false + "StdinOnce": false + "Env": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"] + "Cmd": ["/bin/sh"] + "Healthcheck": { + "Test": ["string"], + "Interval": 0, + "Timeout": 0, + "Retries": 0, + "StartPeriod": 0, + "StartInterval": 0 + } + "ArgsEscaped": true + "Image": "" + "Volumes": { + "/app/data": {}, + "/app/config": {} + } + "WorkingDir": "/public/" + "Entrypoint": [] + "OnBuild": [] + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + "StopSignal": "SIGTERM" + "Shell": ["/bin/sh", "-c"] + + NetworkingConfig: + description: | + NetworkingConfig represents the container's networking configuration for + each of its interfaces. + It is used for the networking configs specified in the `docker create` + and `docker network connect` commands. + type: "object" + properties: + EndpointsConfig: + description: | + A mapping of network name to endpoint configuration for that network. + The endpoint configuration can be left empty to connect to that + network with no particular endpoint configuration. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + example: + # putting an example here, instead of using the example values from + # /definitions/EndpointSettings, because EndpointSettings contains + # operational data returned when inspecting a container that we don't + # accept here. + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + MacAddress: "02:42:ac:12:05:02" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + NetworkSettings: + description: "NetworkSettings exposes the network settings in the API" + type: "object" + properties: + Bridge: + description: | + Name of the default bridge interface when dockerd's --bridge flag is set. + type: "string" + example: "docker0" + SandboxID: + description: SandboxID uniquely represents a container's network stack. + type: "string" + example: "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + HairpinMode: + description: | + Indicates if hairpin NAT should be enabled on the virtual interface. + + Deprecated: This field is never set and will be removed in a future release. + type: "boolean" + example: false + LinkLocalIPv6Address: + description: | + IPv6 unicast address using the link-local prefix. + + Deprecated: This field is never set and will be removed in a future release. + type: "string" + example: "" + LinkLocalIPv6PrefixLen: + description: | + Prefix length of the IPv6 unicast address. + + Deprecated: This field is never set and will be removed in a future release. + type: "integer" + example: "" + Ports: + $ref: "#/definitions/PortMap" + SandboxKey: + description: SandboxKey is the full path of the netns handle + type: "string" + example: "/var/run/docker/netns/8ab54b426c38" + + SecondaryIPAddresses: + description: "Deprecated: This field is never set and will be removed in a future release." + type: "array" + items: + $ref: "#/definitions/Address" + x-nullable: true + + SecondaryIPv6Addresses: + description: "Deprecated: This field is never set and will be removed in a future release." + type: "array" + items: + $ref: "#/definitions/Address" + x-nullable: true + + # TODO properties below are part of DefaultNetworkSettings, which is + # marked as deprecated since Docker 1.9 and to be removed in Docker v17.12 + EndpointID: + description: | + EndpointID uniquely represents a service endpoint in a Sandbox. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + Gateway: + description: | + Gateway address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "172.17.0.1" + GlobalIPv6Address: + description: | + Global IPv6 address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "2001:db8::5689" + GlobalIPv6PrefixLen: + description: | + Mask length of the global IPv6 address. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "integer" + example: 64 + IPAddress: + description: | + IPv4 address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "172.17.0.4" + IPPrefixLen: + description: | + Mask length of the IPv4 address. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "integer" + example: 16 + IPv6Gateway: + description: | + IPv6 gateway address for this network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "2001:db8:2::100" + MacAddress: + description: | + MAC address for the container on the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "02:42:ac:11:00:04" + Networks: + description: | + Information about all networks that the container is connected to. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + + Address: + description: Address represents an IPv4 or IPv6 IP address. + type: "object" + properties: + Addr: + description: IP address. + type: "string" + PrefixLen: + description: Mask length of the IP address. + type: "integer" + + PortMap: + description: | + PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `/`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + type: "object" + additionalProperties: + type: "array" + x-nullable: true + items: + $ref: "#/definitions/PortBinding" + example: + "443/tcp": + - HostIp: "127.0.0.1" + HostPort: "4443" + "80/tcp": + - HostIp: "0.0.0.0" + HostPort: "80" + - HostIp: "0.0.0.0" + HostPort: "8080" + "80/udp": + - HostIp: "0.0.0.0" + HostPort: "80" + "53/udp": + - HostIp: "0.0.0.0" + HostPort: "53" + "2377/tcp": null + + PortBinding: + description: | + PortBinding represents a binding between a host IP address and a host + port. + type: "object" + properties: + HostIp: + description: "Host IP address that the container's port is mapped to." + type: "string" + example: "127.0.0.1" + HostPort: + description: "Host port number that the container's port is mapped to." + type: "string" + example: "4443" + + DriverData: + description: | + Information about the storage driver used to store the container's and + image's filesystem. + type: "object" + required: [Name, Data] + properties: + Name: + description: "Name of the storage driver." + type: "string" + x-nullable: false + example: "overlay2" + Data: + description: | + Low-level storage metadata, provided as key/value pairs. + + This information is driver-specific, and depends on the storage-driver + in use, and should be used for informational purposes only. + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: { + "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged", + "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff", + "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work" + } + + FilesystemChange: + description: | + Change in the container's filesystem. + type: "object" + required: [Path, Kind] + properties: + Path: + description: | + Path to file or directory that has changed. + type: "string" + x-nullable: false + Kind: + $ref: "#/definitions/ChangeType" + + ChangeType: + description: | + Kind of change + + Can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + type: "integer" + format: "uint8" + enum: [0, 1, 2] + x-nullable: false + + ImageInspect: + description: | + Information about an image in the local image cache. + type: "object" + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Parent: + description: | + ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + type: "string" + x-nullable: false + example: "" + Comment: + description: | + Optional message that was set when committing or importing the image. + type: "string" + x-nullable: false + example: "" + Created: + description: | + Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if present in the image, + and omitted otherwise. + type: "string" + format: "dateTime" + x-nullable: true + example: "2022-02-04T21:20:12.497794809Z" + DockerVersion: + description: | + The version of Docker that was used to build the image. + + Depending on how the image was created, this field may be empty. + type: "string" + x-nullable: false + example: "27.0.1" + Author: + description: | + Name of the author that was specified when committing the image, or as + specified through MAINTAINER (deprecated) in the Dockerfile. + type: "string" + x-nullable: false + example: "" + Config: + $ref: "#/definitions/ImageConfig" + Architecture: + description: | + Hardware CPU architecture that the image runs on. + type: "string" + x-nullable: false + example: "arm" + Variant: + description: | + CPU architecture variant (presently ARM-only). + type: "string" + x-nullable: true + example: "v7" + Os: + description: | + Operating System the image is built to run on. + type: "string" + x-nullable: false + example: "linux" + OsVersion: + description: | + Operating System version the image is built to run on (especially + for Windows). + type: "string" + example: "" + x-nullable: true + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + VirtualSize: + description: | + Total size of the image including all layers it is composed of. + + Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + type: "integer" + format: "int64" + example: 1239828 + GraphDriver: + $ref: "#/definitions/DriverData" + RootFS: + description: | + Information about the image's RootFS, including the layer IDs. + type: "object" + required: [Type] + properties: + Type: + type: "string" + x-nullable: false + example: "layers" + Layers: + type: "array" + items: + type: "string" + example: + - "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6" + - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + Metadata: + description: | + Additional metadata of the image in the local cache. This information + is local to the daemon, and not part of the image itself. + type: "object" + properties: + LastTagTime: + description: | + Date and time at which the image was last tagged in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if the image was tagged locally, + and omitted otherwise. + type: "string" + format: "dateTime" + example: "2022-02-28T14:40:02.623929178Z" + x-nullable: true + + ImageSummary: + type: "object" + x-go-name: "Summary" + required: + - Id + - ParentId + - RepoTags + - RepoDigests + - Created + - Size + - SharedSize + - Labels + - Containers + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + ParentId: + description: | + ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + type: "string" + x-nullable: false + example: "" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Created: + description: | + Date and time at which the image was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + x-nullable: false + example: "1644009612" + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 172064416 + SharedSize: + description: | + Total size of image layers that are shared between this image and other + images. + + This size is not calculated by default. `-1` indicates that the value + has not been set / calculated. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + VirtualSize: + description: |- + Total size of the image including all layers it is composed of. + + Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + type: "integer" + format: "int64" + example: 172064416 + Labels: + description: "User-defined key/value metadata." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Containers: + description: | + Number of containers using this image. Includes both stopped and running + containers. + + This size is not calculated by default, and depends on which API endpoint + is used. `-1` indicates that the value has not been set / calculated. + x-nullable: false + type: "integer" + example: 2 + Manifests: + description: | + Manifests is a list of manifests available in this image. + It provides a more detailed view of the platform-specific image manifests + or other image-attached data like build attestations. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: false + x-omitempty: true + items: + $ref: "#/definitions/ImageManifestSummary" + + AuthConfig: + type: "object" + properties: + username: + type: "string" + password: + type: "string" + email: + type: "string" + serveraddress: + type: "string" + example: + username: "hannibal" + password: "xxxx" + serveraddress: "https://index.docker.io/v1/" + + ProcessConfig: + type: "object" + properties: + privileged: + type: "boolean" + user: + type: "string" + tty: + type: "boolean" + entrypoint: + type: "string" + arguments: + type: "array" + items: + type: "string" + + Volume: + type: "object" + required: [Name, Driver, Mountpoint, Labels, Scope, Options] + properties: + Name: + type: "string" + description: "Name of the volume." + x-nullable: false + example: "tardis" + Driver: + type: "string" + description: "Name of the volume driver used by the volume." + x-nullable: false + example: "custom" + Mountpoint: + type: "string" + description: "Mount path of the volume on the host." + x-nullable: false + example: "/var/lib/docker/volumes/tardis" + CreatedAt: + type: "string" + format: "dateTime" + description: "Date/Time the volume was created." + example: "2016-06-07T20:31:11.853781916Z" + Status: + type: "object" + description: | + Low-level details about the volume, provided by the volume driver. + Details are returned as a map with key/value pairs: + `{"key":"value","key2":"value2"}`. + + The `Status` field is optional, and is omitted if the volume driver + does not support this feature. + additionalProperties: + type: "object" + example: + hello: "world" + Labels: + type: "object" + description: "User-defined key/value metadata." + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Scope: + type: "string" + description: | + The level at which the volume exists. Either `global` for cluster-wide, + or `local` for machine level. + default: "local" + x-nullable: false + enum: ["local", "global"] + example: "local" + ClusterVolume: + $ref: "#/definitions/ClusterVolume" + Options: + type: "object" + description: | + The driver specific options used when creating the volume. + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + UsageData: + type: "object" + x-nullable: true + x-go-name: "UsageData" + required: [Size, RefCount] + description: | + Usage details about the volume. This information is used by the + `GET /system/df` endpoint, and omitted in other endpoints. + properties: + Size: + type: "integer" + format: "int64" + default: -1 + description: | + Amount of disk space used by the volume (in bytes). This information + is only available for volumes created with the `"local"` volume + driver. For volumes created with other volume drivers, this field + is set to `-1` ("not available") + x-nullable: false + RefCount: + type: "integer" + format: "int64" + default: -1 + description: | + The number of containers referencing this volume. This field + is set to `-1` if the reference-count is not available. + x-nullable: false + + VolumeCreateOptions: + description: "Volume configuration" + type: "object" + title: "VolumeConfig" + x-go-name: "CreateOptions" + properties: + Name: + description: | + The new volume's name. If not specified, Docker generates a name. + type: "string" + x-nullable: false + example: "tardis" + Driver: + description: "Name of the volume driver to use." + type: "string" + default: "local" + x-nullable: false + example: "custom" + DriverOpts: + description: | + A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + type: "object" + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + ClusterVolumeSpec: + $ref: "#/definitions/ClusterVolumeSpec" + + VolumeListResponse: + type: "object" + title: "VolumeListResponse" + x-go-name: "ListResponse" + description: "Volume list response" + properties: + Volumes: + type: "array" + description: "List of volumes" + items: + $ref: "#/definitions/Volume" + Warnings: + type: "array" + description: | + Warnings that occurred when fetching the list of volumes. + items: + type: "string" + example: [] + + Network: + type: "object" + properties: + Name: + description: | + Name of the network. + type: "string" + example: "my_network" + Id: + description: | + ID that uniquely identifies a network on a single machine. + type: "string" + example: "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99" + Created: + description: | + Date and time at which the network was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-10-19T04:33:30.360899459Z" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level) + type: "string" + example: "local" + Driver: + description: | + The name of the driver used to create the network (e.g. `bridge`, + `overlay`). + type: "string" + example: "overlay" + EnableIPv4: + description: | + Whether the network was created with IPv4 enabled. + type: "boolean" + example: true + EnableIPv6: + description: | + Whether the network was created with IPv6 enabled. + type: "boolean" + example: false + IPAM: + $ref: "#/definitions/IPAM" + Internal: + description: | + Whether the network is created to only allow internal networking + connectivity. + type: "boolean" + default: false + example: false + Attachable: + description: | + Whether a global / swarm scope network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + default: false + example: false + Ingress: + description: | + Whether the network is providing the routing-mesh for the swarm cluster. + type: "boolean" + default: false + example: false + ConfigFrom: + $ref: "#/definitions/ConfigReference" + ConfigOnly: + description: | + Whether the network is a config-only network. Config-only networks are + placeholder networks for network configurations to be used by other + networks. Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + default: false + Containers: + description: | + Contains endpoints attached to the network. + type: "object" + additionalProperties: + $ref: "#/definitions/NetworkContainer" + example: + 19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c: + Name: "test" + EndpointID: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: "02:42:ac:13:00:02" + IPv4Address: "172.19.0.2/16" + IPv6Address: "" + Options: + description: | + Network-specific options uses when creating the network. + type: "object" + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Peers: + description: | + List of peer nodes for an overlay network. This field is only present + for overlay networks, and omitted for other network types. + type: "array" + items: + $ref: "#/definitions/PeerInfo" + x-nullable: true + # TODO: Add Services (only present when "verbose" is set). + + ConfigReference: + description: | + The config-only network source to provide the configuration for + this network. + type: "object" + properties: + Network: + description: | + The name of the config-only network that provides the network's + configuration. The specified network must be an existing config-only + network. Only network names are allowed, not network IDs. + type: "string" + example: "config_only_network_01" + + IPAM: + type: "object" + properties: + Driver: + description: "Name of the IPAM driver to use." + type: "string" + default: "default" + example: "default" + Config: + description: | + List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": , "IPRange": , "Gateway": , "AuxAddress": } + ``` + type: "array" + items: + $ref: "#/definitions/IPAMConfig" + Options: + description: "Driver-specific options, specified as a map." + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + + IPAMConfig: + type: "object" + properties: + Subnet: + type: "string" + example: "172.20.0.0/16" + IPRange: + type: "string" + example: "172.20.10.0/24" + Gateway: + type: "string" + example: "172.20.10.11" + AuxiliaryAddresses: + type: "object" + additionalProperties: + type: "string" + + NetworkContainer: + type: "object" + properties: + Name: + type: "string" + example: "container_1" + EndpointID: + type: "string" + example: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: + type: "string" + example: "02:42:ac:13:00:02" + IPv4Address: + type: "string" + example: "172.19.0.2/16" + IPv6Address: + type: "string" + example: "" + + PeerInfo: + description: | + PeerInfo represents one peer of an overlay network. + type: "object" + properties: + Name: + description: + ID of the peer-node in the Swarm cluster. + type: "string" + example: "6869d7c1732b" + IP: + description: + IP-address of the peer-node in the Swarm cluster. + type: "string" + example: "10.133.77.91" + + NetworkCreateResponse: + description: "OK response to NetworkCreate operation" + type: "object" + title: "NetworkCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warning] + properties: + Id: + description: "The ID of the created network." + type: "string" + x-nullable: false + example: "b5c4fc71e8022147cd25de22b22173de4e3b170134117172eb595cb91b4e7e5d" + Warning: + description: "Warnings encountered when creating the container" + type: "string" + x-nullable: false + example: "" + + BuildInfo: + type: "object" + properties: + id: + type: "string" + stream: + type: "string" + error: + type: "string" + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progress: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + aux: + $ref: "#/definitions/ImageID" + + BuildCache: + type: "object" + description: | + BuildCache contains information about a build cache record. + properties: + ID: + type: "string" + description: | + Unique ID of the build cache record. + example: "ndlpt0hhvkqcdfkputsk4cq9c" + Parent: + description: | + ID of the parent build cache record. + + > **Deprecated**: This field is deprecated, and omitted if empty. + type: "string" + x-nullable: true + example: "" + Parents: + description: | + List of parent build cache record IDs. + type: "array" + items: + type: "string" + x-nullable: true + example: ["hw53o5aio51xtltp5xjp8v7fx"] + Type: + type: "string" + description: | + Cache record type. + example: "regular" + # see https://github.com/moby/buildkit/blob/fce4a32258dc9d9664f71a4831d5de10f0670677/client/diskusage.go#L75-L84 + enum: + - "internal" + - "frontend" + - "source.local" + - "source.git.checkout" + - "exec.cachemount" + - "regular" + Description: + type: "string" + description: | + Description of the build-step that produced the build cache. + example: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + InUse: + type: "boolean" + description: | + Indicates if the build cache is in use. + example: false + Shared: + type: "boolean" + description: | + Indicates if the build cache is shared. + example: true + Size: + description: | + Amount of disk space used by the build cache (in bytes). + type: "integer" + example: 51 + CreatedAt: + description: | + Date and time at which the build cache was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + LastUsedAt: + description: | + Date and time at which the build cache was last used in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2017-08-09T07:09:37.632105588Z" + UsageCount: + type: "integer" + example: 26 + + ImageID: + type: "object" + description: "Image ID or Digest" + properties: + ID: + type: "string" + example: + ID: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + + CreateImageInfo: + type: "object" + properties: + id: + type: "string" + error: + type: "string" + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progress: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + + PushImageInfo: + type: "object" + properties: + error: + type: "string" + status: + type: "string" + progress: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + + ErrorDetail: + type: "object" + properties: + code: + type: "integer" + message: + type: "string" + + ProgressDetail: + type: "object" + properties: + current: + type: "integer" + total: + type: "integer" + + ErrorResponse: + description: "Represents an error." + type: "object" + required: ["message"] + properties: + message: + description: "The error message." + type: "string" + x-nullable: false + example: + message: "Something went wrong." + + IdResponse: + description: "Response to an API call that returns just an Id" + type: "object" + required: ["Id"] + properties: + Id: + description: "The id of the newly created object." + type: "string" + x-nullable: false + + EndpointSettings: + description: "Configuration for a network endpoint." + type: "object" + properties: + # Configurations + IPAMConfig: + $ref: "#/definitions/EndpointIPAMConfig" + Links: + type: "array" + items: + type: "string" + example: + - "container_1" + - "container_2" + MacAddress: + description: | + MAC address for the endpoint on this network. The network driver might ignore this parameter. + type: "string" + example: "02:42:ac:11:00:04" + Aliases: + type: "array" + items: + type: "string" + example: + - "server_x" + - "server_y" + DriverOpts: + description: | + DriverOpts is a mapping of driver options and values. These options + are passed directly to the driver and are driver specific. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + + # Operational data + NetworkID: + description: | + Unique ID of the network. + type: "string" + example: "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + EndpointID: + description: | + Unique ID for the service endpoint in a Sandbox. + type: "string" + example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + Gateway: + description: | + Gateway address for this network. + type: "string" + example: "172.17.0.1" + IPAddress: + description: | + IPv4 address. + type: "string" + example: "172.17.0.4" + IPPrefixLen: + description: | + Mask length of the IPv4 address. + type: "integer" + example: 16 + IPv6Gateway: + description: | + IPv6 gateway address. + type: "string" + example: "2001:db8:2::100" + GlobalIPv6Address: + description: | + Global IPv6 address. + type: "string" + example: "2001:db8::5689" + GlobalIPv6PrefixLen: + description: | + Mask length of the global IPv6 address. + type: "integer" + format: "int64" + example: 64 + DNSNames: + description: | + List of all DNS names an endpoint has on a specific network. This + list is based on the container name, network aliases, container short + ID, and hostname. + + These DNS names are non-fully qualified but can contain several dots. + You can get fully qualified DNS names by appending `.`. + For instance, if container name is `my.ctr` and the network is named + `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + `my.ctr.testnet`. + type: array + items: + type: string + example: ["foobar", "server_x", "server_y", "my.ctr"] + + EndpointIPAMConfig: + description: | + EndpointIPAMConfig represents an endpoint's IPAM configuration. + type: "object" + x-nullable: true + properties: + IPv4Address: + type: "string" + example: "172.20.30.33" + IPv6Address: + type: "string" + example: "2001:db8:abcd::3033" + LinkLocalIPs: + type: "array" + items: + type: "string" + example: + - "169.254.34.68" + - "fe80::3468" + + PluginMount: + type: "object" + x-nullable: false + required: [Name, Description, Settable, Source, Destination, Type, Options] + properties: + Name: + type: "string" + x-nullable: false + example: "some-mount" + Description: + type: "string" + x-nullable: false + example: "This is a mount that's used by the plugin." + Settable: + type: "array" + items: + type: "string" + Source: + type: "string" + example: "/var/lib/docker/plugins/" + Destination: + type: "string" + x-nullable: false + example: "/mnt/state" + Type: + type: "string" + x-nullable: false + example: "bind" + Options: + type: "array" + items: + type: "string" + example: + - "rbind" + - "rw" + + PluginDevice: + type: "object" + required: [Name, Description, Settable, Path] + x-nullable: false + properties: + Name: + type: "string" + x-nullable: false + Description: + type: "string" + x-nullable: false + Settable: + type: "array" + items: + type: "string" + Path: + type: "string" + example: "/dev/fuse" + + PluginEnv: + type: "object" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + Description: + x-nullable: false + type: "string" + Settable: + type: "array" + items: + type: "string" + Value: + type: "string" + + PluginInterfaceType: + type: "object" + x-nullable: false + required: [Prefix, Capability, Version] + properties: + Prefix: + type: "string" + x-nullable: false + Capability: + type: "string" + x-nullable: false + Version: + type: "string" + x-nullable: false + + PluginPrivilege: + description: | + Describes a permission the user has to accept upon installing + the plugin. + type: "object" + x-go-name: "PluginPrivilege" + properties: + Name: + type: "string" + example: "network" + Description: + type: "string" + Value: + type: "array" + items: + type: "string" + example: + - "host" + + Plugin: + description: "A plugin for the Engine API" + type: "object" + required: [Settings, Enabled, Config, Name] + properties: + Id: + type: "string" + example: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + Name: + type: "string" + x-nullable: false + example: "tiborvass/sample-volume-plugin" + Enabled: + description: + True if the plugin is running. False if the plugin is not running, + only installed. + type: "boolean" + x-nullable: false + example: true + Settings: + description: "Settings that can be modified by users." + type: "object" + x-nullable: false + required: [Args, Devices, Env, Mounts] + properties: + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + type: "string" + example: + - "DEBUG=0" + Args: + type: "array" + items: + type: "string" + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PluginReference: + description: "plugin remote reference used to push/pull the plugin" + type: "string" + x-nullable: false + example: "localhost:5000/tiborvass/sample-volume-plugin:latest" + Config: + description: "The config of a plugin." + type: "object" + x-nullable: false + required: + - Description + - Documentation + - Interface + - Entrypoint + - WorkDir + - Network + - Linux + - PidHost + - PropagatedMount + - IpcHost + - Mounts + - Env + - Args + properties: + DockerVersion: + description: "Docker Version used to create the plugin" + type: "string" + x-nullable: false + example: "17.06.0-ce" + Description: + type: "string" + x-nullable: false + example: "A sample volume plugin for Docker" + Documentation: + type: "string" + x-nullable: false + example: "https://docs.docker.com/engine/extend/plugins/" + Interface: + description: "The interface between Docker and the plugin" + x-nullable: false + type: "object" + required: [Types, Socket] + properties: + Types: + type: "array" + items: + $ref: "#/definitions/PluginInterfaceType" + example: + - "docker.volumedriver/1.0" + Socket: + type: "string" + x-nullable: false + example: "plugins.sock" + ProtocolScheme: + type: "string" + example: "some.protocol/v1.0" + description: "Protocol to use for clients connecting to the plugin." + enum: + - "" + - "moby.plugins.http/v1" + Entrypoint: + type: "array" + items: + type: "string" + example: + - "/usr/bin/sample-volume-plugin" + - "/data" + WorkDir: + type: "string" + x-nullable: false + example: "/bin/" + User: + type: "object" + x-nullable: false + properties: + UID: + type: "integer" + format: "uint32" + example: 1000 + GID: + type: "integer" + format: "uint32" + example: 1000 + Network: + type: "object" + x-nullable: false + required: [Type] + properties: + Type: + x-nullable: false + type: "string" + example: "host" + Linux: + type: "object" + x-nullable: false + required: [Capabilities, AllowAllDevices, Devices] + properties: + Capabilities: + type: "array" + items: + type: "string" + example: + - "CAP_SYS_ADMIN" + - "CAP_SYSLOG" + AllowAllDevices: + type: "boolean" + x-nullable: false + example: false + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PropagatedMount: + type: "string" + x-nullable: false + example: "/mnt/volumes" + IpcHost: + type: "boolean" + x-nullable: false + example: false + PidHost: + type: "boolean" + x-nullable: false + example: false + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + $ref: "#/definitions/PluginEnv" + example: + - Name: "DEBUG" + Description: "If set, prints debug messages" + Settable: null + Value: "0" + Args: + type: "object" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + example: "args" + Description: + x-nullable: false + type: "string" + example: "command line arguments" + Settable: + type: "array" + items: + type: "string" + Value: + type: "array" + items: + type: "string" + rootfs: + type: "object" + properties: + type: + type: "string" + example: "layers" + diff_ids: + type: "array" + items: + type: "string" + example: + - "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887" + - "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + + ObjectVersion: + description: | + The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + type: "object" + properties: + Index: + type: "integer" + format: "uint64" + example: 373531 + + NodeSpec: + type: "object" + properties: + Name: + description: "Name for the node." + type: "string" + example: "my-node" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Role: + description: "Role of the node." + type: "string" + enum: + - "worker" + - "manager" + example: "manager" + Availability: + description: "Availability of the node." + type: "string" + enum: + - "active" + - "pause" + - "drain" + example: "active" + example: + Availability: "active" + Name: "node-name" + Role: "manager" + Labels: + foo: "bar" + + Node: + type: "object" + properties: + ID: + type: "string" + example: "24ifsmvkjbyhk" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the node was added to the swarm in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the node was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/NodeSpec" + Description: + $ref: "#/definitions/NodeDescription" + Status: + $ref: "#/definitions/NodeStatus" + ManagerStatus: + $ref: "#/definitions/ManagerStatus" + + NodeDescription: + description: | + NodeDescription encapsulates the properties of the Node as reported by the + agent. + type: "object" + properties: + Hostname: + type: "string" + example: "bf3067039e47" + Platform: + $ref: "#/definitions/Platform" + Resources: + $ref: "#/definitions/ResourceObject" + Engine: + $ref: "#/definitions/EngineDescription" + TLSInfo: + $ref: "#/definitions/TLSInfo" + + Platform: + description: | + Platform represents the platform (Arch/OS). + type: "object" + properties: + Architecture: + description: | + Architecture represents the hardware architecture (for example, + `x86_64`). + type: "string" + example: "x86_64" + OS: + description: | + OS represents the Operating System (for example, `linux` or `windows`). + type: "string" + example: "linux" + + EngineDescription: + description: "EngineDescription provides information about an engine." + type: "object" + properties: + EngineVersion: + type: "string" + example: "17.06.0" + Labels: + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + Plugins: + type: "array" + items: + type: "object" + properties: + Type: + type: "string" + Name: + type: "string" + example: + - Type: "Log" + Name: "awslogs" + - Type: "Log" + Name: "fluentd" + - Type: "Log" + Name: "gcplogs" + - Type: "Log" + Name: "gelf" + - Type: "Log" + Name: "journald" + - Type: "Log" + Name: "json-file" + - Type: "Log" + Name: "splunk" + - Type: "Log" + Name: "syslog" + - Type: "Network" + Name: "bridge" + - Type: "Network" + Name: "host" + - Type: "Network" + Name: "ipvlan" + - Type: "Network" + Name: "macvlan" + - Type: "Network" + Name: "null" + - Type: "Network" + Name: "overlay" + - Type: "Volume" + Name: "local" + - Type: "Volume" + Name: "localhost:5000/vieux/sshfs:latest" + - Type: "Volume" + Name: "vieux/sshfs:latest" + + TLSInfo: + description: | + Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + type: "object" + properties: + TrustRoot: + description: | + The root CA certificate(s) that are used to validate leaf TLS + certificates. + type: "string" + CertIssuerSubject: + description: + The base64-url-safe-encoded raw subject bytes of the issuer. + type: "string" + CertIssuerPublicKey: + description: | + The base64-url-safe-encoded raw public key bytes of the issuer. + type: "string" + example: + TrustRoot: | + -----BEGIN CERTIFICATE----- + MIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw + EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0 + MzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH + A0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf + 3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB + Af8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO + PQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz + pxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H + -----END CERTIFICATE----- + CertIssuerSubject: "MBMxETAPBgNVBAMTCHN3YXJtLWNh" + CertIssuerPublicKey: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + + NodeStatus: + description: | + NodeStatus represents the status of a node. + + It provides the current status of the node, as seen by the manager. + type: "object" + properties: + State: + $ref: "#/definitions/NodeState" + Message: + type: "string" + example: "" + Addr: + description: "IP address of the node." + type: "string" + example: "172.17.0.2" + + NodeState: + description: "NodeState represents the state of a node." + type: "string" + enum: + - "unknown" + - "down" + - "ready" + - "disconnected" + example: "ready" + + ManagerStatus: + description: | + ManagerStatus represents the status of a manager. + + It provides the current status of a node's manager component, if the node + is a manager. + x-nullable: true + type: "object" + properties: + Leader: + type: "boolean" + default: false + example: true + Reachability: + $ref: "#/definitions/Reachability" + Addr: + description: | + The IP address and port at which the manager is reachable. + type: "string" + example: "10.0.0.46:2377" + + Reachability: + description: "Reachability represents the reachability of a node." + type: "string" + enum: + - "unknown" + - "unreachable" + - "reachable" + example: "reachable" + + SwarmSpec: + description: "User modifiable swarm configuration." + type: "object" + properties: + Name: + description: "Name of the swarm." + type: "string" + example: "default" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.corp.type: "production" + com.example.corp.department: "engineering" + Orchestration: + description: "Orchestration configuration." + type: "object" + x-nullable: true + properties: + TaskHistoryRetentionLimit: + description: | + The number of historic tasks to keep per instance or node. If + negative, never remove completed or failed tasks. + type: "integer" + format: "int64" + example: 10 + Raft: + description: "Raft configuration." + type: "object" + properties: + SnapshotInterval: + description: "The number of log entries between snapshots." + type: "integer" + format: "uint64" + example: 10000 + KeepOldSnapshots: + description: | + The number of snapshots to keep beyond the current snapshot. + type: "integer" + format: "uint64" + LogEntriesForSlowFollowers: + description: | + The number of log entries to keep around to sync up slow followers + after a snapshot is created. + type: "integer" + format: "uint64" + example: 500 + ElectionTick: + description: | + The number of ticks that a follower will wait for a message from + the leader before becoming a candidate and starting an election. + `ElectionTick` must be greater than `HeartbeatTick`. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 3 + HeartbeatTick: + description: | + The number of ticks between heartbeats. Every HeartbeatTick ticks, + the leader will send a heartbeat to the followers. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 1 + Dispatcher: + description: "Dispatcher configuration." + type: "object" + x-nullable: true + properties: + HeartbeatPeriod: + description: | + The delay for an agent to send a heartbeat to the dispatcher. + type: "integer" + format: "int64" + example: 5000000000 + CAConfig: + description: "CA configuration." + type: "object" + x-nullable: true + properties: + NodeCertExpiry: + description: "The duration node certificates are issued for." + type: "integer" + format: "int64" + example: 7776000000000000 + ExternalCAs: + description: | + Configuration for forwarding signing requests to an external + certificate authority. + type: "array" + items: + type: "object" + properties: + Protocol: + description: | + Protocol for communication with the external CA (currently + only `cfssl` is supported). + type: "string" + enum: + - "cfssl" + default: "cfssl" + URL: + description: | + URL where certificate signing requests should be sent. + type: "string" + Options: + description: | + An object with key/value pairs that are interpreted as + protocol-specific options for the external CA driver. + type: "object" + additionalProperties: + type: "string" + CACert: + description: | + The root CA certificate (in PEM format) this external CA uses + to issue TLS certificates (assumed to be to the current swarm + root CA certificate if not provided). + type: "string" + SigningCACert: + description: | + The desired signing CA certificate for all swarm node TLS leaf + certificates, in PEM format. + type: "string" + SigningCAKey: + description: | + The desired signing CA key for all swarm node TLS leaf certificates, + in PEM format. + type: "string" + ForceRotate: + description: | + An integer whose purpose is to force swarm to generate a new + signing CA certificate and key, if none have been specified in + `SigningCACert` and `SigningCAKey` + format: "uint64" + type: "integer" + EncryptionConfig: + description: "Parameters related to encryption-at-rest." + type: "object" + properties: + AutoLockManagers: + description: | + If set, generate a key and use it to lock data stored on the + managers. + type: "boolean" + example: false + TaskDefaults: + description: "Defaults for creating tasks in this cluster." + type: "object" + properties: + LogDriver: + description: | + The log driver to use for tasks created in the orchestrator if + unspecified by a service. + + Updating this value only affects new tasks. Existing tasks continue + to use their previously configured log driver until recreated. + type: "object" + properties: + Name: + description: | + The log driver to use as a default for new tasks. + type: "string" + example: "json-file" + Options: + description: | + Driver-specific options for the selected log driver, specified + as key/value pairs. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "10" + "max-size": "100m" + + # The Swarm information for `GET /info`. It is the same as `GET /swarm`, but + # without `JoinTokens`. + ClusterInfo: + description: | + ClusterInfo represents information about the swarm as is returned by the + "/info" endpoint. Join-tokens are not included. + x-nullable: true + type: "object" + properties: + ID: + description: "The ID of the swarm." + type: "string" + example: "abajmipo7b4xz5ip2nrla6b11" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/SwarmSpec" + TLSInfo: + $ref: "#/definitions/TLSInfo" + RootRotationInProgress: + description: | + Whether there is currently a root CA rotation in progress for the swarm + type: "boolean" + example: false + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + type: "integer" + format: "uint32" + default: 4789 + example: 4789 + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global scope + networks. + type: "array" + items: + type: "string" + format: "CIDR" + example: ["10.10.0.0/16", "20.20.0.0/16"] + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + type: "integer" + format: "uint32" + maximum: 29 + default: 24 + example: 24 + + JoinTokens: + description: | + JoinTokens contains the tokens workers and managers need to join the swarm. + type: "object" + properties: + Worker: + description: | + The token workers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + Manager: + description: | + The token managers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + + Swarm: + type: "object" + allOf: + - $ref: "#/definitions/ClusterInfo" + - type: "object" + properties: + JoinTokens: + $ref: "#/definitions/JoinTokens" + + TaskSpec: + description: "User modifiable task configuration." + type: "object" + properties: + PluginSpec: + type: "object" + description: | + Plugin spec for the service. *(Experimental release only.)* + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Name: + description: "The name or 'alias' to use for the plugin." + type: "string" + Remote: + description: "The plugin image reference to use." + type: "string" + Disabled: + description: "Disable the plugin once scheduled." + type: "boolean" + PluginPrivilege: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + ContainerSpec: + type: "object" + description: | + Container spec for the service. + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Image: + description: "The image name to use for the container" + type: "string" + Labels: + description: "User-defined key/value data." + type: "object" + additionalProperties: + type: "string" + Command: + description: "The command to be run in the image." + type: "array" + items: + type: "string" + Args: + description: "Arguments to the command." + type: "array" + items: + type: "string" + Hostname: + description: | + The hostname to use for the container, as a valid + [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. + type: "string" + Env: + description: | + A list of environment variables in the form `VAR=value`. + type: "array" + items: + type: "string" + Dir: + description: "The working directory for commands to run in." + type: "string" + User: + description: "The user inside the container." + type: "string" + Groups: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + Privileges: + type: "object" + description: "Security options for the container" + properties: + CredentialSpec: + type: "object" + description: "CredentialSpec for managed service account (Windows only)" + properties: + Config: + type: "string" + example: "0bt9dmxjvjiqermk6xrop3ekq" + description: | + Load credential spec from a Swarm Config with the given ID. + The specified config must also be present in the Configs + field with the Runtime property set. + +


+ + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + File: + type: "string" + example: "spec.json" + description: | + Load credential spec from this file. The file is read by + the daemon, and must be present in the `CredentialSpecs` + subdirectory in the docker data directory, which defaults + to `C:\ProgramData\Docker\` on Windows. + + For example, specifying `spec.json` loads + `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + +


+ + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + Registry: + type: "string" + description: | + Load credential spec from this value in the Windows + registry. The specified registry value must be located in: + + `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + +


+ + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + SELinuxContext: + type: "object" + description: "SELinux labels of the container" + properties: + Disable: + type: "boolean" + description: "Disable SELinux" + User: + type: "string" + description: "SELinux user label" + Role: + type: "string" + description: "SELinux role label" + Type: + type: "string" + description: "SELinux type label" + Level: + type: "string" + description: "SELinux level label" + Seccomp: + type: "object" + description: "Options for configuring seccomp on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "unconfined" + - "custom" + Profile: + description: "The custom seccomp profile as a json object" + type: "string" + AppArmor: + type: "object" + description: "Options for configuring AppArmor on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "disabled" + NoNewPrivileges: + type: "boolean" + description: "Configuration of the no_new_privs bit in the container" + + TTY: + description: "Whether a pseudo-TTY should be allocated." + type: "boolean" + OpenStdin: + description: "Open `stdin`" + type: "boolean" + ReadOnly: + description: "Mount the container's root filesystem as read only." + type: "boolean" + Mounts: + description: | + Specification for mounts to be added to containers created as part + of the service. + type: "array" + items: + $ref: "#/definitions/Mount" + StopSignal: + description: "Signal to stop the container." + type: "string" + StopGracePeriod: + description: | + Amount of time to wait for the container to terminate before + forcefully killing it. + type: "integer" + format: "int64" + HealthCheck: + $ref: "#/definitions/HealthConfig" + Hosts: + type: "array" + description: | + A list of hostname/IP mappings to add to the container's `hosts` + file. The format of extra hosts is specified in the + [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + man page: + + IP_address canonical_hostname [aliases...] + items: + type: "string" + DNSConfig: + description: | + Specification for DNS related configurations in resolver configuration + file (`resolv.conf`). + type: "object" + properties: + Nameservers: + description: "The IP addresses of the name servers." + type: "array" + items: + type: "string" + Search: + description: "A search list for host-name lookup." + type: "array" + items: + type: "string" + Options: + description: | + A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + type: "array" + items: + type: "string" + Secrets: + description: | + Secrets contains references to zero or more secrets that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + SecretID: + description: | + SecretID represents the ID of the specific secret that we're + referencing. + type: "string" + SecretName: + description: | + SecretName is the name of the secret that this references, + but this is just provided for lookup/display purposes. The + secret in the reference will be identified by its ID. + type: "string" + OomScoreAdj: + type: "integer" + format: "int64" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 0 + Configs: + description: | + Configs contains references to zero or more configs that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + +


+ + > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + Runtime: + description: | + Runtime represents a target that is not mounted into the + container but is used by the task + +


+ + > **Note**: `Configs.File` and `Configs.Runtime` are mutually + > exclusive + type: "object" + ConfigID: + description: | + ConfigID represents the ID of the specific config that we're + referencing. + type: "string" + ConfigName: + description: | + ConfigName is the name of the config that this references, + but this is just provided for lookup/display purposes. The + config in the reference will be identified by its ID. + type: "string" + Isolation: + type: "string" + description: | + Isolation technology of the containers running the service. + (Windows only) + enum: + - "default" + - "process" + - "hyperv" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + Sysctls: + description: | + Set kernel namedspaced parameters (sysctls) in the container. + The Sysctls option on services accepts the same sysctls as the + are supported on containers. Note that while the same sysctls are + supported, no guarantees or checks are made about their + suitability for a clustered environment, and it's up to the user + to determine whether a given sysctl will work properly in a + Service. + type: "object" + additionalProperties: + type: "string" + # This option is not used by Windows containers + CapabilityAdd: + type: "array" + description: | + A list of kernel capabilities to add to the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + - "CAP_SYS_ADMIN" + - "CAP_SYS_CHROOT" + - "CAP_SYSLOG" + CapabilityDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + Ulimits: + description: | + A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + NetworkAttachmentSpec: + description: | + Read-only spec type for non-swarm containers attached to swarm overlay + networks. + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + type: "object" + properties: + ContainerID: + description: "ID of the container represented by this task" + type: "string" + Resources: + description: | + Resource requirements which apply to each individual container created + as part of the service. + type: "object" + properties: + Limits: + description: "Define resources limits." + $ref: "#/definitions/Limit" + Reservations: + description: "Define resources reservation." + $ref: "#/definitions/ResourceObject" + RestartPolicy: + description: | + Specification for the restart policy which applies to containers + created as part of this service. + type: "object" + properties: + Condition: + description: "Condition for restart." + type: "string" + enum: + - "none" + - "on-failure" + - "any" + Delay: + description: "Delay between restart attempts." + type: "integer" + format: "int64" + MaxAttempts: + description: | + Maximum attempts to restart a given container before giving up + (default value is 0, which is ignored). + type: "integer" + format: "int64" + default: 0 + Window: + description: | + Windows is the time window used to evaluate the restart policy + (default value is 0, which is unbounded). + type: "integer" + format: "int64" + default: 0 + Placement: + type: "object" + properties: + Constraints: + description: | + An array of constraint expressions to limit the set of nodes where + a task can be scheduled. Constraint expressions can either use a + _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + nodes that satisfy every expression (AND match). Constraints can + match node or Docker Engine labels as follows: + + node attribute | matches | example + ---------------------|--------------------------------|----------------------------------------------- + `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + `node.hostname` | Node hostname | `node.hostname!=node-2` + `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + `node.platform.os` | Node operating system | `node.platform.os==windows` + `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + `node.labels` | User-defined node labels | `node.labels.security==high` + `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04` + + `engine.labels` apply to Docker Engine labels like operating system, + drivers, etc. Swarm administrators add `node.labels` for operational + purposes by using the [`node update endpoint`](#operation/NodeUpdate). + + type: "array" + items: + type: "string" + example: + - "node.hostname!=node3.corp.example.com" + - "node.role!=manager" + - "node.labels.type==production" + - "node.platform.os==linux" + - "node.platform.arch==x86_64" + Preferences: + description: | + Preferences provide a way to make the scheduler aware of factors + such as topology. They are provided in order from highest to + lowest precedence. + type: "array" + items: + type: "object" + properties: + Spread: + type: "object" + properties: + SpreadDescriptor: + description: | + label descriptor, such as `engine.labels.az`. + type: "string" + example: + - Spread: + SpreadDescriptor: "node.labels.datacenter" + - Spread: + SpreadDescriptor: "node.labels.rack" + MaxReplicas: + description: | + Maximum number of replicas for per node (default value is 0, which + is unlimited) + type: "integer" + format: "int64" + default: 0 + Platforms: + description: | + Platforms stores all the platforms that the service's image can + run on. This field is used in the platform filter for scheduling. + If empty, then the platform filter is off, meaning there are no + scheduling restrictions. + type: "array" + items: + $ref: "#/definitions/Platform" + ForceUpdate: + description: | + A counter that triggers an update even if no relevant parameters have + been changed. + type: "integer" + Runtime: + description: | + Runtime is the type of runtime specified for the task executor. + type: "string" + Networks: + description: "Specifies which networks the service should attach to." + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + LogDriver: + description: | + Specifies the log driver to use for tasks created from this spec. If + not present, the default one for the swarm will be used, finally + falling back to the engine default if not specified. + type: "object" + properties: + Name: + type: "string" + Options: + type: "object" + additionalProperties: + type: "string" + + TaskState: + type: "string" + enum: + - "new" + - "allocated" + - "pending" + - "assigned" + - "accepted" + - "preparing" + - "ready" + - "starting" + - "running" + - "complete" + - "shutdown" + - "failed" + - "rejected" + - "remove" + - "orphaned" + + ContainerStatus: + type: "object" + description: "represents the status of a container." + properties: + ContainerID: + type: "string" + PID: + type: "integer" + ExitCode: + type: "integer" + + PortStatus: + type: "object" + description: "represents the port status of a task's host ports whose service has published host ports" + properties: + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + TaskStatus: + type: "object" + description: "represents the status of a task." + properties: + Timestamp: + type: "string" + format: "dateTime" + State: + $ref: "#/definitions/TaskState" + Message: + type: "string" + Err: + type: "string" + ContainerStatus: + $ref: "#/definitions/ContainerStatus" + PortStatus: + $ref: "#/definitions/PortStatus" + + Task: + type: "object" + properties: + ID: + description: "The ID of the task." + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Name: + description: "Name of the task." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Spec: + $ref: "#/definitions/TaskSpec" + ServiceID: + description: "The ID of the service this task is part of." + type: "string" + Slot: + type: "integer" + NodeID: + description: "The ID of the node that this task is on." + type: "string" + AssignedGenericResources: + $ref: "#/definitions/GenericResources" + Status: + $ref: "#/definitions/TaskStatus" + DesiredState: + $ref: "#/definitions/TaskState" + JobIteration: + description: | + If the Service this Task belongs to is a job-mode service, contains + the JobIteration of the Service this Task was created for. Absent if + the Task was created for a Replicated or Global Service. + $ref: "#/definitions/ObjectVersion" + example: + ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + AssignedGenericResources: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + ServiceSpec: + description: "User modifiable configuration for a service." + type: object + properties: + Name: + description: "Name of the service." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + TaskTemplate: + $ref: "#/definitions/TaskSpec" + Mode: + description: "Scheduling mode for the service." + type: "object" + properties: + Replicated: + type: "object" + properties: + Replicas: + type: "integer" + format: "int64" + Global: + type: "object" + ReplicatedJob: + description: | + The mode used for services with a finite number of tasks that run + to a completed state. + type: "object" + properties: + MaxConcurrent: + description: | + The maximum number of replicas to run simultaneously. + type: "integer" + format: "int64" + default: 1 + TotalCompletions: + description: | + The total number of replicas desired to reach the Completed + state. If unset, will default to the value of `MaxConcurrent` + type: "integer" + format: "int64" + GlobalJob: + description: | + The mode used for services which run a task to the completed state + on each valid node. + type: "object" + UpdateConfig: + description: "Specification for the update strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be updated in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: "Amount of time between updates, in nanoseconds." + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an updated task fails to run, or stops running + during the update. + type: "string" + enum: + - "continue" + - "pause" + - "rollback" + Monitor: + description: | + Amount of time to monitor each updated task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during an update before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling out an updated task. Either + the old task is shut down before the new task is started, or the + new task is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + RollbackConfig: + description: "Specification for the rollback strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be rolled back in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: | + Amount of time between rollback iterations, in nanoseconds. + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an rolled back task fails to run, or stops + running during the rollback. + type: "string" + enum: + - "continue" + - "pause" + Monitor: + description: | + Amount of time to monitor each rolled back task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during a rollback before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling back a task. Either the old + task is shut down before the new task is started, or the new task + is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + Networks: + description: | + Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + + EndpointSpec: + $ref: "#/definitions/EndpointSpec" + + EndpointPortConfig: + type: "object" + properties: + Name: + type: "string" + Protocol: + type: "string" + enum: + - "tcp" + - "udp" + - "sctp" + TargetPort: + description: "The port inside the container." + type: "integer" + PublishedPort: + description: "The port on the swarm hosts." + type: "integer" + PublishMode: + description: | + The mode in which port is published. + +


+ + - "ingress" makes the target port accessible on every node, + regardless of whether there is a task for the service running on + that node or not. + - "host" bypasses the routing mesh and publish the port directly on + the swarm node where that service is running. + + type: "string" + enum: + - "ingress" + - "host" + default: "ingress" + example: "ingress" + + EndpointSpec: + description: "Properties that can be configured to access and load balance a service." + type: "object" + properties: + Mode: + description: | + The mode of resolution to use for internal load balancing between tasks. + type: "string" + enum: + - "vip" + - "dnsrr" + default: "vip" + Ports: + description: | + List of exposed ports that this service is accessible on from the + outside. Ports can only be provided if `vip` resolution mode is used. + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + Service: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ServiceSpec" + Endpoint: + type: "object" + properties: + Spec: + $ref: "#/definitions/EndpointSpec" + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + VirtualIPs: + type: "array" + items: + type: "object" + properties: + NetworkID: + type: "string" + Addr: + type: "string" + UpdateStatus: + description: "The status of a service update." + type: "object" + properties: + State: + type: "string" + enum: + - "updating" + - "paused" + - "completed" + StartedAt: + type: "string" + format: "dateTime" + CompletedAt: + type: "string" + format: "dateTime" + Message: + type: "string" + ServiceStatus: + description: | + The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + type: "object" + properties: + RunningTasks: + description: | + The number of tasks for the service currently in the Running state. + type: "integer" + format: "uint64" + example: 7 + DesiredTasks: + description: | + The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + type: "integer" + format: "uint64" + example: 10 + CompletedTasks: + description: | + The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + type: "integer" + format: "uint64" + JobStatus: + description: | + The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + type: "object" + properties: + JobIteration: + description: | + JobIteration is a value increased each time a Job is executed, + successfully or otherwise. "Executed", in this case, means the + job as a whole has been started, not that an individual Task has + been launched. A job is "Executed" when its ServiceSpec is + updated. JobIteration can be used to disambiguate Tasks belonging + to different executions of a job. Though JobIteration will + increase with each subsequent execution, it may not necessarily + increase by 1, and so JobIteration should not be used to + $ref: "#/definitions/ObjectVersion" + LastExecution: + description: | + The last time, as observed by the server, that this job was + started. + type: "string" + format: "dateTime" + example: + ID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Version: + Index: 19 + CreatedAt: "2016-06-07T21:05:51.880065305Z" + UpdatedAt: "2016-06-07T21:07:29.962229872Z" + Spec: + Name: "hopeful_cori" + TaskTemplate: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Endpoint: + Spec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + VirtualIPs: + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.2/16" + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.3/16" + + ImageDeleteResponseItem: + type: "object" + x-go-name: "DeleteResponse" + properties: + Untagged: + description: "The image ID of an image that was untagged" + type: "string" + Deleted: + description: "The image ID of an image that was deleted" + type: "string" + + ServiceCreateResponse: + type: "object" + description: | + contains the information returned to a client on the + creation of a new service. + properties: + ID: + description: "The ID of the created service." + type: "string" + x-nullable: false + example: "ak7w3gjqoa3kuz8xcpnyy0pvl" + Warnings: + description: | + Optional warning message. + + FIXME(thaJeztah): this should have "omitempty" in the generated type. + type: "array" + x-nullable: true + items: + type: "string" + example: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ServiceUpdateResponse: + type: "object" + properties: + Warnings: + description: "Optional warning messages" + type: "array" + items: + type: "string" + example: + Warnings: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ContainerSummary: + type: "object" + properties: + Id: + description: "The ID of this container" + type: "string" + x-go-name: "ID" + Names: + description: "The names that this container has been given" + type: "array" + items: + type: "string" + Image: + description: "The name of the image used when creating this container" + type: "string" + ImageID: + description: "The ID of the image that this container was created from" + type: "string" + Command: + description: "Command to run when starting the container" + type: "string" + Created: + description: "When the container was created" + type: "integer" + format: "int64" + Ports: + description: "The ports exposed by this container" + type: "array" + items: + $ref: "#/definitions/Port" + SizeRw: + description: "The size of files that have been created or changed by this container" + type: "integer" + format: "int64" + SizeRootFs: + description: "The total size of all the files in this container" + type: "integer" + format: "int64" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + State: + description: "The state of this container (e.g. `Exited`)" + type: "string" + Status: + description: "Additional human-readable status of this container (e.g. `Exit 0`)" + type: "string" + HostConfig: + type: "object" + properties: + NetworkMode: + type: "string" + Annotations: + description: "Arbitrary key-value metadata attached to container" + type: "object" + x-nullable: true + additionalProperties: + type: "string" + NetworkSettings: + description: "A summary of the container's network settings" + type: "object" + properties: + Networks: + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + Mounts: + type: "array" + items: + $ref: "#/definitions/MountPoint" + + Driver: + description: "Driver represents a driver (network, logging, secrets)." + type: "object" + required: [Name] + properties: + Name: + description: "Name of the driver." + type: "string" + x-nullable: false + example: "some-driver" + Options: + description: "Key/value map of driver-specific options." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + OptionA: "value for driver-specific option A" + OptionB: "value for driver-specific option B" + + SecretSpec: + type: "object" + properties: + Name: + description: "User-defined name of the secret." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Data: + description: | + Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + data to store as secret. + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + type: "string" + example: "" + Driver: + description: | + Name of the secrets driver used to fetch the secret's value from an + external secret store. + $ref: "#/definitions/Driver" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Secret: + type: "object" + properties: + ID: + type: "string" + example: "blt1owaxmitz71s9v5zh81zun" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + Spec: + $ref: "#/definitions/SecretSpec" + + ConfigSpec: + type: "object" + properties: + Name: + description: "User-defined name of the config." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Data: + description: | + Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + config data. + type: "string" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Config: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ConfigSpec" + + ContainerState: + description: | + ContainerState stores container's running state. It's part of ContainerJSONBase + and will be returned by the "inspect" command. + type: "object" + x-nullable: true + properties: + Status: + description: | + String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + type: "string" + enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] + example: "running" + Running: + description: | + Whether this container is running. + + Note that a running container can be _paused_. The `Running` and `Paused` + booleans are not mutually exclusive: + + When pausing a container (on Linux), the freezer cgroup is used to suspend + all processes in the container. Freezing the process requires the process to + be running. As a result, paused containers are both `Running` _and_ `Paused`. + + Use the `Status` field instead to determine if a container's state is "running". + type: "boolean" + example: true + Paused: + description: "Whether this container is paused." + type: "boolean" + example: false + Restarting: + description: "Whether this container is restarting." + type: "boolean" + example: false + OOMKilled: + description: | + Whether a process within this container has been killed because it ran + out of memory since the container was last started. + type: "boolean" + example: false + Dead: + type: "boolean" + example: false + Pid: + description: "The process ID of this container" + type: "integer" + example: 1234 + ExitCode: + description: "The last exit code of this container" + type: "integer" + example: 0 + Error: + type: "string" + StartedAt: + description: "The time when this container was last started." + type: "string" + example: "2020-01-06T09:06:59.461876391Z" + FinishedAt: + description: "The time when this container last exited." + type: "string" + example: "2020-01-06T09:07:59.461876391Z" + Health: + $ref: "#/definitions/Health" + + ContainerCreateResponse: + description: "OK response to ContainerCreate operation" + type: "object" + title: "ContainerCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warnings] + properties: + Id: + description: "The ID of the created container" + type: "string" + x-nullable: false + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Warnings: + description: "Warnings encountered when creating the container" + type: "array" + x-nullable: false + items: + type: "string" + example: [] + + ContainerWaitResponse: + description: "OK response to ContainerWait operation" + type: "object" + x-go-name: "WaitResponse" + title: "ContainerWaitResponse" + required: [StatusCode] + properties: + StatusCode: + description: "Exit code of the container" + type: "integer" + format: "int64" + x-nullable: false + Error: + $ref: "#/definitions/ContainerWaitExitError" + + ContainerWaitExitError: + description: "container waiting error, if any" + type: "object" + x-go-name: "WaitExitError" + properties: + Message: + description: "Details of an error" + type: "string" + + SystemVersion: + type: "object" + description: | + Response of Engine API: GET "/version" + properties: + Platform: + type: "object" + required: [Name] + properties: + Name: + type: "string" + Components: + type: "array" + description: | + Information about system components + items: + type: "object" + x-go-name: ComponentVersion + required: [Name, Version] + properties: + Name: + description: | + Name of the component + type: "string" + example: "Engine" + Version: + description: | + Version of the component + type: "string" + x-nullable: false + example: "27.0.1" + Details: + description: | + Key/value pairs of strings with additional information about the + component. These values are intended for informational purposes + only, and their content is not defined, and not part of the API + specification. + + These messages can be printed by the client as information to the user. + type: "object" + x-nullable: true + Version: + description: "The version of the daemon" + type: "string" + example: "27.0.1" + ApiVersion: + description: | + The default (and highest) API version that is supported by the daemon + type: "string" + example: "1.47" + MinAPIVersion: + description: | + The minimum API version that is supported by the daemon + type: "string" + example: "1.24" + GitCommit: + description: | + The Git commit of the source code that was used to build the daemon + type: "string" + example: "48a66213fe" + GoVersion: + description: | + The version Go used to compile the daemon, and the version of the Go + runtime in use. + type: "string" + example: "go1.21.13" + Os: + description: | + The operating system that the daemon is running on ("linux" or "windows") + type: "string" + example: "linux" + Arch: + description: | + The architecture that the daemon is running on + type: "string" + example: "amd64" + KernelVersion: + description: | + The kernel version (`uname -r`) that the daemon is running on. + + This field is omitted when empty. + type: "string" + example: "6.8.0-31-generic" + Experimental: + description: | + Indicates if the daemon is started with experimental features enabled. + + This field is omitted when empty / false. + type: "boolean" + example: true + BuildTime: + description: | + The date and time that the daemon was compiled. + type: "string" + example: "2020-06-22T15:49:27.000000000+00:00" + + SystemInfo: + type: "object" + properties: + ID: + description: | + Unique identifier of the daemon. + +


+ + > **Note**: The format of the ID itself is not part of the API, and + > should not be considered stable. + type: "string" + example: "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS" + Containers: + description: "Total number of containers on the host." + type: "integer" + example: 14 + ContainersRunning: + description: | + Number of containers with status `"running"`. + type: "integer" + example: 3 + ContainersPaused: + description: | + Number of containers with status `"paused"`. + type: "integer" + example: 1 + ContainersStopped: + description: | + Number of containers with status `"stopped"`. + type: "integer" + example: 10 + Images: + description: | + Total number of images on the host. + + Both _tagged_ and _untagged_ (dangling) images are counted. + type: "integer" + example: 508 + Driver: + description: "Name of the storage driver in use." + type: "string" + example: "overlay2" + DriverStatus: + description: | + Information specific to the storage driver, provided as + "label" / "value" pairs. + + This information is provided by the storage driver, and formatted + in a way consistent with the output of `docker info` on the command + line. + +


+ + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["Backing Filesystem", "extfs"] + - ["Supports d_type", "true"] + - ["Native Overlay Diff", "true"] + DockerRootDir: + description: | + Root directory of persistent Docker state. + + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + on Windows. + type: "string" + example: "/var/lib/docker" + Plugins: + $ref: "#/definitions/PluginsInfo" + MemoryLimit: + description: "Indicates if the host has memory limit support enabled." + type: "boolean" + example: true + SwapLimit: + description: "Indicates if the host has memory swap limit support enabled." + type: "boolean" + example: true + KernelMemoryTCP: + description: | + Indicates if the host has kernel memory TCP limit support enabled. This + field is omitted if not supported. + + Kernel memory TCP limits are not supported when using cgroups v2, which + does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. + type: "boolean" + example: true + CpuCfsPeriod: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + the host. + type: "boolean" + example: true + CpuCfsQuota: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + the host. + type: "boolean" + example: true + CPUShares: + description: | + Indicates if CPU Shares limiting is supported by the host. + type: "boolean" + example: true + CPUSet: + description: | + Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. + + See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) + type: "boolean" + example: true + PidsLimit: + description: "Indicates if the host kernel has PID limit support enabled." + type: "boolean" + example: true + OomKillDisable: + description: "Indicates if OOM killer disable is supported on the host." + type: "boolean" + IPv4Forwarding: + description: "Indicates IPv4 forwarding is enabled." + type: "boolean" + example: true + BridgeNfIptables: + description: "Indicates if `bridge-nf-call-iptables` is available on the host." + type: "boolean" + example: true + BridgeNfIp6tables: + description: "Indicates if `bridge-nf-call-ip6tables` is available on the host." + type: "boolean" + example: true + Debug: + description: | + Indicates if the daemon is running in debug-mode / with debug-level + logging enabled. + type: "boolean" + example: true + NFd: + description: | + The total number of file Descriptors in use by the daemon process. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 64 + NGoroutines: + description: | + The number of goroutines that currently exist. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 174 + SystemTime: + description: | + Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + format with nano-seconds. + type: "string" + example: "2017-08-08T20:28:29.06202363Z" + LoggingDriver: + description: | + The logging driver to use as a default for new containers. + type: "string" + CgroupDriver: + description: | + The driver to use for managing cgroups. + type: "string" + enum: ["cgroupfs", "systemd", "none"] + default: "cgroupfs" + example: "cgroupfs" + CgroupVersion: + description: | + The version of the cgroup. + type: "string" + enum: ["1", "2"] + default: "1" + example: "1" + NEventsListener: + description: "Number of event listeners subscribed." + type: "integer" + example: 30 + KernelVersion: + description: | + Kernel version of the host. + + On Linux, this information obtained from `uname`. On Windows this + information is queried from the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ + registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. + type: "string" + example: "6.8.0-31-generic" + OperatingSystem: + description: | + Name of the host's operating system, for example: "Ubuntu 24.04 LTS" + or "Windows Server 2016 Datacenter" + type: "string" + example: "Ubuntu 24.04 LTS" + OSVersion: + description: | + Version of the host's operating system + +


+ + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + type: "string" + example: "24.04" + OSType: + description: | + Generic type of the operating system of the host, as returned by the + Go runtime (`GOOS`). + + Currently returned values are "linux" and "windows". A full list of + possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "linux" + Architecture: + description: | + Hardware architecture of the host, as returned by the Go runtime + (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "x86_64" + NCPU: + description: | + The number of logical CPUs usable by the daemon. + + The number of available CPUs is checked by querying the operating + system when the daemon starts. Changes to operating system CPU + allocation after the daemon is started are not reflected. + type: "integer" + example: 4 + MemTotal: + description: | + Total amount of physical memory available on the host, in bytes. + type: "integer" + format: "int64" + example: 2095882240 + + IndexServerAddress: + description: | + Address / URL of the index server that is used for image search, + and as a default for user authentication for Docker Hub and Docker Cloud. + default: "https://index.docker.io/v1/" + type: "string" + example: "https://index.docker.io/v1/" + RegistryConfig: + $ref: "#/definitions/RegistryServiceConfig" + GenericResources: + $ref: "#/definitions/GenericResources" + HttpProxy: + description: | + HTTP-proxy configured for the daemon. This value is obtained from the + [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + HttpsProxy: + description: | + HTTPS-proxy configured for the daemon. This value is obtained from the + [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + NoProxy: + description: | + Comma-separated list of domain extensions for which no proxy should be + used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + environment variable. + + Containers do not automatically inherit this configuration. + type: "string" + example: "*.local, 169.254/16" + Name: + description: "Hostname of the host." + type: "string" + example: "node5.corp.example.com" + Labels: + description: | + User-defined labels (key/value metadata) as set on the daemon. + +


+ + > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + > set through the daemon configuration, and _node_ labels, set from a + > manager node in the Swarm. Node labels are not included in this + > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + > on a manager node in the Swarm. + type: "array" + items: + type: "string" + example: ["storage=ssd", "production"] + ExperimentalBuild: + description: | + Indicates if experimental features are enabled on the daemon. + type: "boolean" + example: true + ServerVersion: + description: | + Version string of the daemon. + type: "string" + example: "27.0.1" + Runtimes: + description: | + List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtimes configured on the daemon. Keys hold the "name" used to + reference the runtime. + + The Docker daemon relies on an OCI compliant runtime (invoked via the + `containerd` daemon) as its interface to the Linux kernel namespaces, + cgroups, and SELinux. + + The default runtime is `runc`, and automatically configured. Additional + runtimes can be configured by the user and will be listed here. + type: "object" + additionalProperties: + $ref: "#/definitions/Runtime" + default: + runc: + path: "runc" + example: + runc: + path: "runc" + runc-master: + path: "/go/bin/runc" + custom: + path: "/usr/local/bin/my-oci-runtime" + runtimeArgs: ["--debug", "--systemd-cgroup=false"] + DefaultRuntime: + description: | + Name of the default OCI runtime that is used when starting containers. + + The default can be overridden per-container at create time. + type: "string" + default: "runc" + example: "runc" + Swarm: + $ref: "#/definitions/SwarmInfo" + LiveRestoreEnabled: + description: | + Indicates if live restore is enabled. + + If enabled, containers are kept running when the daemon is shutdown + or upon daemon start if running containers are detected. + type: "boolean" + default: false + example: false + Isolation: + description: | + Represents the isolation technology to use as a default for containers. + The supported values are platform-specific. + + If no isolation value is specified on daemon start, on Windows client, + the default is `hyperv`, and on Windows server, the default is `process`. + + This option is currently not used on other platforms. + default: "default" + type: "string" + enum: + - "default" + - "hyperv" + - "process" + InitBinary: + description: | + Name and, optional, path of the `docker-init` binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "docker-init" + ContainerdCommit: + $ref: "#/definitions/Commit" + RuncCommit: + $ref: "#/definitions/Commit" + InitCommit: + $ref: "#/definitions/Commit" + SecurityOptions: + description: | + List of security features that are enabled on the daemon, such as + apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + no-new-privileges. + + Additional configuration options for each security feature may + be present, and are included as a comma-separated list of key/value + pairs. + type: "array" + items: + type: "string" + example: + - "name=apparmor" + - "name=seccomp,profile=default" + - "name=selinux" + - "name=userns" + - "name=rootless" + ProductLicense: + description: | + Reports a summary of the product license on the daemon. + + If a commercial license has been applied to the daemon, information + such as number of nodes, and expiration are included. + type: "string" + example: "Community Engine" + DefaultAddressPools: + description: | + List of custom default address pools for local networks, which can be + specified in the daemon.json file or dockerd option. + + Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + 10.10.[0-255].0/24 address pools. + type: "array" + items: + type: "object" + properties: + Base: + description: "The network address in CIDR format" + type: "string" + example: "10.10.0.0/16" + Size: + description: "The network pool size" + type: "integer" + example: "24" + Warnings: + description: | + List of warnings / informational messages about missing features, or + issues related to the daemon configuration. + + These messages can be printed by the client as information to the user. + type: "array" + items: + type: "string" + example: + - "WARNING: No memory limit support" + - "WARNING: bridge-nf-call-iptables is disabled" + - "WARNING: bridge-nf-call-ip6tables is disabled" + CDISpecDirs: + description: | + List of directories where (Container Device Interface) CDI + specifications are located. + + These specifications define vendor-specific modifications to an OCI + runtime specification for a container being created. + + An empty list indicates that CDI device injection is disabled. + + Note that since using CDI device injection requires the daemon to have + experimental enabled. For non-experimental daemons an empty list will + always be returned. + type: "array" + items: + type: "string" + example: + - "/etc/cdi" + - "/var/run/cdi" + Containerd: + $ref: "#/definitions/ContainerdInfo" + + ContainerdInfo: + description: | + Information for connecting to the containerd instance that is used by the daemon. + This is included for debugging purposes only. + type: "object" + x-nullable: true + properties: + Address: + description: "The address of the containerd socket." + type: "string" + example: "/run/containerd/containerd.sock" + Namespaces: + description: | + The namespaces that the daemon uses for running containers and + plugins in containerd. These namespaces can be configured in the + daemon configuration, and are considered to be used exclusively + by the daemon, Tampering with the containerd instance may cause + unexpected behavior. + + As these namespaces are considered to be exclusively accessed + by the daemon, it is not recommended to change these values, + or to change them to a value that is used by other systems, + such as cri-containerd. + type: "object" + properties: + Containers: + description: | + The default containerd namespace used for containers managed + by the daemon. + + The default namespace for containers is "moby", but will be + suffixed with the `.` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "moby" + example: "moby" + Plugins: + description: | + The default containerd namespace used for plugins managed by + the daemon. + + The default namespace for plugins is "plugins.moby", but will be + suffixed with the `.` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "plugins.moby" + example: "plugins.moby" + + # PluginsInfo is a temp struct holding Plugins name + # registered with docker daemon. It is used by Info struct + PluginsInfo: + description: | + Available plugins per type. + +


+ + > **Note**: Only unmanaged (V1) plugins are included in this list. + > V1 plugins are "lazily" loaded, and are not returned in this list + > if there is no resource using the plugin. + type: "object" + properties: + Volume: + description: "Names of available volume-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["local"] + Network: + description: "Names of available network-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["bridge", "host", "ipvlan", "macvlan", "null", "overlay"] + Authorization: + description: "Names of available authorization plugins." + type: "array" + items: + type: "string" + example: ["img-authz-plugin", "hbm"] + Log: + description: "Names of available logging-drivers, and logging-driver plugins." + type: "array" + items: + type: "string" + example: ["awslogs", "fluentd", "gcplogs", "gelf", "journald", "json-file", "splunk", "syslog"] + + + RegistryServiceConfig: + description: | + RegistryServiceConfig stores daemon registry services configuration. + type: "object" + x-nullable: true + properties: + AllowNondistributableArtifactsCIDRs: + description: | + List of IP ranges to which nondistributable artifacts can be pushed, + using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). + + Some images (for example, Windows base images) contain artifacts + whose distribution is restricted by license. When these images are + pushed to a registry, restricted artifacts are not included. + + This configuration override this behavior, and enables the daemon to + push nondistributable artifacts to all registries whose resolved IP + address is within the subnet described by the CIDR syntax. + + This option is useful when pushing images containing + nondistributable artifacts to a registry on an air-gapped network so + hosts on that network can pull the images without connecting to + another server. + + > **Warning**: Nondistributable artifacts typically have restrictions + > on how and where they can be distributed and shared. Only use this + > feature to push artifacts to private registries and ensure that you + > are in compliance with any terms that cover redistributing + > nondistributable artifacts. + + type: "array" + items: + type: "string" + example: ["::1/128", "127.0.0.0/8"] + AllowNondistributableArtifactsHostnames: + description: | + List of registry hostnames to which nondistributable artifacts can be + pushed, using the format `[:]` or `[:]`. + + Some images (for example, Windows base images) contain artifacts + whose distribution is restricted by license. When these images are + pushed to a registry, restricted artifacts are not included. + + This configuration override this behavior for the specified + registries. + + This option is useful when pushing images containing + nondistributable artifacts to a registry on an air-gapped network so + hosts on that network can pull the images without connecting to + another server. + + > **Warning**: Nondistributable artifacts typically have restrictions + > on how and where they can be distributed and shared. Only use this + > feature to push artifacts to private registries and ensure that you + > are in compliance with any terms that cover redistributing + > nondistributable artifacts. + type: "array" + items: + type: "string" + example: ["registry.internal.corp.example.com:3000", "[2001:db8:a0b:12f0::1]:443"] + InsecureRegistryCIDRs: + description: | + List of IP ranges of insecure registries, using the CIDR syntax + ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + from unknown CAs) communication. + + By default, local registries (`127.0.0.0/8`) are configured as + insecure. All other registries are secure. Communicating with an + insecure registry is not possible if the daemon assumes that registry + is secure. + + This configuration override this behavior, insecure communication with + registries whose resolved IP address is within the subnet described by + the CIDR syntax. + + Registries can also be marked insecure by hostname. Those registries + are listed under `IndexConfigs` and have their `Secure` field set to + `false`. + + > **Warning**: Using this option can be useful when running a local + > registry, but introduces security vulnerabilities. This option + > should therefore ONLY be used for testing purposes. For increased + > security, users should add their CA to their system's list of trusted + > CAs instead of enabling this option. + type: "array" + items: + type: "string" + example: ["::1/128", "127.0.0.0/8"] + IndexConfigs: + type: "object" + additionalProperties: + $ref: "#/definitions/IndexInfo" + example: + "127.0.0.1:5000": + "Name": "127.0.0.1:5000" + "Mirrors": [] + "Secure": false + "Official": false + "[2001:db8:a0b:12f0::1]:80": + "Name": "[2001:db8:a0b:12f0::1]:80" + "Mirrors": [] + "Secure": false + "Official": false + "docker.io": + Name: "docker.io" + Mirrors: ["https://hub-mirror.corp.example.com:5000/"] + Secure: true + Official: true + "registry.internal.corp.example.com:3000": + Name: "registry.internal.corp.example.com:3000" + Mirrors: [] + Secure: false + Official: false + Mirrors: + description: | + List of registry URLs that act as a mirror for the official + (`docker.io`) registry. + + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://[2001:db8:a0b:12f0::1]/" + + IndexInfo: + description: + IndexInfo contains information about a registry. + type: "object" + x-nullable: true + properties: + Name: + description: | + Name of the registry, such as "docker.io". + type: "string" + example: "docker.io" + Mirrors: + description: | + List of mirrors, expressed as URIs. + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://registry-2.docker.io/" + - "https://registry-3.docker.io/" + Secure: + description: | + Indicates if the registry is part of the list of insecure + registries. + + If `false`, the registry is insecure. Insecure registries accept + un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + unknown CAs) communication. + + > **Warning**: Insecure registries can be useful when running a local + > registry. However, because its use creates security vulnerabilities + > it should ONLY be enabled for testing purposes. For increased + > security, users should add their CA to their system's list of + > trusted CAs instead of enabling this option. + type: "boolean" + example: true + Official: + description: | + Indicates whether this is an official registry (i.e., Docker Hub / docker.io) + type: "boolean" + example: true + + Runtime: + description: | + Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtime. + + The runtime is invoked by the daemon via the `containerd` daemon. OCI + runtimes act as an interface to the Linux kernel namespaces, cgroups, + and SELinux. + type: "object" + properties: + path: + description: | + Name and, optional, path, of the OCI executable binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "/usr/local/bin/my-oci-runtime" + runtimeArgs: + description: | + List of command-line arguments to pass to the runtime when invoked. + type: "array" + x-nullable: true + items: + type: "string" + example: ["--debug", "--systemd-cgroup=false"] + status: + description: | + Information specific to the runtime. + + While this API specification does not define data provided by runtimes, + the following well-known properties may be provided by runtimes: + + `org.opencontainers.runtime-spec.features`: features structure as defined + in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + in a JSON string representation. + +


+ + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "org.opencontainers.runtime-spec.features": "{\"ociVersionMin\":\"1.0.0\",\"ociVersionMax\":\"1.1.0\",\"...\":\"...\"}" + + Commit: + description: | + Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + type: "object" + properties: + ID: + description: "Actual commit ID of external tool." + type: "string" + example: "cfb82a876ecc11b5ca0977d1733adbe58599088a" + Expected: + description: | + Commit ID of external tool expected by dockerd as set at build time. + type: "string" + example: "2d41c047c83e09a6d61d464906feb2a2f3c52aa4" + + SwarmInfo: + description: | + Represents generic information about swarm. + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + default: "" + example: "k67qz4598weg5unwwffg6z1m1" + NodeAddr: + description: | + IP address at which this node can be reached by other nodes in the + swarm. + type: "string" + default: "" + example: "10.0.0.46" + LocalNodeState: + $ref: "#/definitions/LocalNodeState" + ControlAvailable: + type: "boolean" + default: false + example: true + Error: + type: "string" + default: "" + RemoteManagers: + description: | + List of ID's and addresses of other managers in the swarm. + type: "array" + default: null + x-nullable: true + items: + $ref: "#/definitions/PeerNode" + example: + - NodeID: "71izy0goik036k48jg985xnds" + Addr: "10.0.0.158:2377" + - NodeID: "79y6h1o4gv8n120drcprv5nmc" + Addr: "10.0.0.159:2377" + - NodeID: "k67qz4598weg5unwwffg6z1m1" + Addr: "10.0.0.46:2377" + Nodes: + description: "Total number of nodes in the swarm." + type: "integer" + x-nullable: true + example: 4 + Managers: + description: "Total number of managers in the swarm." + type: "integer" + x-nullable: true + example: 3 + Cluster: + $ref: "#/definitions/ClusterInfo" + + LocalNodeState: + description: "Current local status of this node." + type: "string" + default: "" + enum: + - "" + - "inactive" + - "pending" + - "active" + - "error" + - "locked" + example: "active" + + PeerNode: + description: "Represents a peer-node in the swarm" + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + Addr: + description: | + IP address and ports at which this node can be reached. + type: "string" + + NetworkAttachmentConfig: + description: | + Specifies how a service should be attached to a particular network. + type: "object" + properties: + Target: + description: | + The target network for attachment. Must be a network name or ID. + type: "string" + Aliases: + description: | + Discoverable alternate names for the service on this network. + type: "array" + items: + type: "string" + DriverOpts: + description: | + Driver attachment options for the network target. + type: "object" + additionalProperties: + type: "string" + + EventActor: + description: | + Actor describes something that generates events, like a container, network, + or a volume. + type: "object" + properties: + ID: + description: "The ID of the object emitting the event" + type: "string" + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Attributes: + description: | + Various key/value attributes of the object, depending on its type. + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-label-value" + image: "alpine:latest" + name: "my-container" + + EventMessage: + description: | + EventMessage represents the information an event contains. + type: "object" + title: "SystemEventsResponse" + properties: + Type: + description: "The type of object emitting the event" + type: "string" + enum: ["builder", "config", "container", "daemon", "image", "network", "node", "plugin", "secret", "service", "volume"] + example: "container" + Action: + description: "The type of event" + type: "string" + example: "create" + Actor: + $ref: "#/definitions/EventActor" + scope: + description: | + Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + type: "string" + enum: ["local", "swarm"] + time: + description: "Timestamp of event" + type: "integer" + format: "int64" + example: 1629574695 + timeNano: + description: "Timestamp of event, with nanosecond accuracy" + type: "integer" + format: "int64" + example: 1629574695515050031 + + OCIDescriptor: + type: "object" + x-go-name: Descriptor + description: | + A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + properties: + mediaType: + description: | + The media type of the object this schema refers to. + type: "string" + example: "application/vnd.docker.distribution.manifest.v2+json" + digest: + description: | + The digest of the targeted content. + type: "string" + example: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + size: + description: | + The size in bytes of the blob. + type: "integer" + format: "int64" + example: 3987495 + # TODO Not yet including these fields for now, as they are nil / omitted in our response. + # urls: + # description: | + # List of URLs from which this object MAY be downloaded. + # type: "array" + # items: + # type: "string" + # format: "uri" + # annotations: + # description: | + # Arbitrary metadata relating to the targeted content. + # type: "object" + # additionalProperties: + # type: "string" + # platform: + # $ref: "#/definitions/OCIPlatform" + + OCIPlatform: + type: "object" + x-go-name: Platform + description: | + Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + properties: + architecture: + description: | + The CPU architecture, for example `amd64` or `ppc64`. + type: "string" + example: "arm" + os: + description: | + The operating system, for example `linux` or `windows`. + type: "string" + example: "windows" + os.version: + description: | + Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + type: "string" + example: "10.0.19041.1165" + os.features: + description: | + Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + type: "array" + items: + type: "string" + example: + - "win32k" + variant: + description: | + Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + type: "string" + example: "v7" + + DistributionInspect: + type: "object" + x-go-name: DistributionInspect + title: "DistributionInspectResponse" + required: [Descriptor, Platforms] + description: | + Describes the result obtained from contacting the registry to retrieve + image metadata. + properties: + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Platforms: + type: "array" + description: | + An array containing all platforms supported by the image. + items: + $ref: "#/definitions/OCIPlatform" + + ClusterVolume: + type: "object" + description: | + Options and information specific to, and only present on, Swarm CSI + cluster volumes. + properties: + ID: + type: "string" + description: | + The Swarm ID of this volume. Because cluster volumes are Swarm + objects, they have an ID, unlike non-cluster volumes. This ID can + be used to refer to the Volume instead of the name. + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + Info: + type: "object" + description: | + Information about the global status of the volume. + properties: + CapacityBytes: + type: "integer" + format: "int64" + description: | + The capacity of the volume in bytes. A value of 0 indicates that + the capacity is unknown. + VolumeContext: + type: "object" + description: | + A map of strings to strings returned from the storage plugin when + the volume is created. + additionalProperties: + type: "string" + VolumeID: + type: "string" + description: | + The ID of the volume as returned by the CSI storage plugin. This + is distinct from the volume's ID as provided by Docker. This ID + is never used by the user when communicating with Docker to refer + to this volume. If the ID is blank, then the Volume has not been + successfully created in the plugin yet. + AccessibleTopology: + type: "array" + description: | + The topology this volume is actually accessible from. + items: + $ref: "#/definitions/Topology" + PublishStatus: + type: "array" + description: | + The status of the volume as it pertains to its publishing and use on + specific nodes + items: + type: "object" + properties: + NodeID: + type: "string" + description: | + The ID of the Swarm node the volume is published on. + State: + type: "string" + description: | + The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + enum: + - "pending-publish" + - "published" + - "pending-node-unpublish" + - "pending-controller-unpublish" + PublishContext: + type: "object" + description: | + A map of strings to strings returned by the CSI controller + plugin when a volume is published. + additionalProperties: + type: "string" + + ClusterVolumeSpec: + type: "object" + description: | + Cluster-specific options used to create the volume. + properties: + Group: + type: "string" + description: | + Group defines the volume group of this volume. Volumes belonging to + the same group can be referred to by group name when creating + Services. Referring to a volume by group instructs Swarm to treat + volumes in that group interchangeably for the purpose of scheduling. + Volumes with an empty string for a group technically all belong to + the same, emptystring group. + AccessMode: + type: "object" + description: | + Defines how the volume is used by tasks. + properties: + Scope: + type: "string" + description: | + The set of nodes this volume can be used on at one time. + - `single` The volume may only be scheduled to one node at a time. + - `multi` the volume may be scheduled to any supported number of nodes at a time. + default: "single" + enum: ["single", "multi"] + x-nullable: false + Sharing: + type: "string" + description: | + The number and way that different tasks can use this volume + at one time. + - `none` The volume may only be used by one task at a time. + - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + - `all` The volume may have any number of readers and writers. + default: "none" + enum: ["none", "readonly", "onewriter", "all"] + x-nullable: false + MountVolume: + type: "object" + description: | + Options for using this volume as a Mount-type volume. + + Either MountVolume or BlockVolume, but not both, must be + present. + properties: + FsType: + type: "string" + description: | + Specifies the filesystem type for the mount volume. + Optional. + MountFlags: + type: "array" + description: | + Flags to pass when mounting the volume. Optional. + items: + type: "string" + BlockVolume: + type: "object" + description: | + Options for using this volume as a Block-type volume. + Intentionally empty. + Secrets: + type: "array" + description: | + Swarm Secrets that are passed to the CSI storage plugin when + operating on this volume. + items: + type: "object" + description: | + One cluster volume secret entry. Defines a key-value pair that + is passed to the plugin. + properties: + Key: + type: "string" + description: | + Key is the name of the key of the key-value pair passed to + the plugin. + Secret: + type: "string" + description: | + Secret is the swarm Secret object from which to read data. + This can be a Secret name or ID. The Secret data is + retrieved by swarm and used as the value of the key-value + pair passed to the plugin. + AccessibilityRequirements: + type: "object" + description: | + Requirements for the accessible topology of the volume. These + fields are optional. For an in-depth description of what these + fields mean, see the CSI specification. + properties: + Requisite: + type: "array" + description: | + A list of required topologies, at least one of which the + volume must be accessible from. + items: + $ref: "#/definitions/Topology" + Preferred: + type: "array" + description: | + A list of topologies that the volume should attempt to be + provisioned in. + items: + $ref: "#/definitions/Topology" + CapacityRange: + type: "object" + description: | + The desired capacity that the volume should be created with. If + empty, the plugin will decide the capacity. + properties: + RequiredBytes: + type: "integer" + format: "int64" + description: | + The volume must be at least this big. The value of 0 + indicates an unspecified minimum + LimitBytes: + type: "integer" + format: "int64" + description: | + The volume must not be bigger than this. The value of 0 + indicates an unspecified maximum. + Availability: + type: "string" + description: | + The availability of the volume for use in tasks. + - `active` The volume is fully available for scheduling on the cluster + - `pause` No new workloads should use the volume, but existing workloads are not stopped. + - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + default: "active" + x-nullable: false + enum: + - "active" + - "pause" + - "drain" + + Topology: + description: | + A map of topological domains to topological segments. For in depth + details, see documentation for the Topology object in the CSI + specification. + type: "object" + additionalProperties: + type: "string" + + ImageManifestSummary: + x-go-name: "ManifestSummary" + description: | + ImageManifestSummary represents a summary of an image manifest. + type: "object" + required: ["ID", "Descriptor", "Available", "Size", "Kind"] + properties: + ID: + description: | + ID is the content-addressable ID of an image and is the same as the + digest of the image manifest. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Available: + description: Indicates whether all the child content (image config, layers) is fully available locally. + type: "boolean" + example: true + Size: + type: "object" + x-nullable: false + required: ["Content", "Total"] + properties: + Total: + type: "integer" + format: "int64" + example: 8213251 + description: | + Total is the total size (in bytes) of all the locally present + data (both distributable and non-distributable) that's related to + this manifest and its children. + This equal to the sum of [Content] size AND all the sizes in the + [Size] struct present in the Kind-specific data struct. + For example, for an image kind (Kind == "image") + this would include the size of the image content and unpacked + image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). + Content: + description: | + Content is the size (in bytes) of all the locally present + content in the content store (e.g. image config, layers) + referenced by this manifest and its children. + This only includes blobs in the content store. + type: "integer" + format: "int64" + example: 3987495 + Kind: + type: "string" + example: "image" + enum: + - "image" + - "attestation" + - "unknown" + description: | + The kind of the manifest. + + kind | description + -------------|----------------------------------------------------------- + image | Image manifest that can be used to start a container. + attestation | Attestation manifest produced by the Buildkit builder for a specific image manifest. + ImageData: + description: | + The image data for the image manifest. + This field is only populated when Kind is "image". + type: "object" + x-nullable: true + x-omitempty: true + required: ["Platform", "Containers", "Size", "UnpackedSize"] + properties: + Platform: + $ref: "#/definitions/OCIPlatform" + description: | + OCI platform of the image. This will be the platform specified in the + manifest descriptor from the index/manifest list. + If it's not available, it will be obtained from the image config. + Containers: + description: | + The IDs of the containers that are using this image. + type: "array" + items: + type: "string" + example: ["ede54ee1fda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c7430", "abadbce344c096744d8d6071a90d474d28af8f1034b5ea9fb03c3f4bfc6d005e"] + Size: + type: "object" + x-nullable: false + required: ["Unpacked"] + properties: + Unpacked: + type: "integer" + format: "int64" + example: 3987495 + description: | + Unpacked is the size (in bytes) of the locally unpacked + (uncompressed) image content that's directly usable by the containers + running this image. + It's independent of the distributable content - e.g. + the image might still have an unpacked data that's still used by + some container even when the distributable/compressed content is + already gone. + AttestationData: + description: | + The image data for the attestation manifest. + This field is only populated when Kind is "attestation". + type: "object" + x-nullable: true + x-omitempty: true + required: ["For"] + properties: + For: + description: | + The digest of the image manifest that this attestation is for. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + +paths: + /containers/json: + get: + summary: "List containers" + description: | + Returns a list of containers. For details on the format, see the + [inspect endpoint](#operation/ContainerInspect). + + Note that it uses a different, smaller representation of a container + than inspecting a single container. For example, the list of linked + containers is not propagated . + operationId: "ContainerList" + produces: + - "application/json" + parameters: + - name: "all" + in: "query" + description: | + Return all containers. By default, only running containers are shown. + type: "boolean" + default: false + - name: "limit" + in: "query" + description: | + Return this number of most recently created containers, including + non-running ones. + type: "integer" + - name: "size" + in: "query" + description: | + Return the size of container as fields `SizeRw` and `SizeRootFs`. + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + Filters to process on the container list, encoded as JSON (a + `map[string][]string`). For example, `{"status": ["paused"]}` will + only return paused containers. + + Available filters: + + - `ancestor`=(`[:]`, ``, or ``) + - `before`=(`` or ``) + - `expose`=(`[/]`|`/[]`) + - `exited=` containers with exit code of `` + - `health`=(`starting`|`healthy`|`unhealthy`|`none`) + - `id=` a container's ID + - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + - `is-task=`(`true`|`false`) + - `label=key` or `label="key=value"` of a container label + - `name=` a container's name + - `network`=(`` or ``) + - `publish`=(`[/]`|`/[]`) + - `since`=(`` or ``) + - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) + - `volume`=(`` or ``) + type: "string" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/ContainerSummary" + examples: + application/json: + - Id: "8dfafdbc3a40" + Names: + - "/boring_feynman" + Image: "ubuntu:latest" + ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" + Command: "echo 1" + Created: 1367854155 + State: "Exited" + Status: "Exit 0" + Ports: + - PrivatePort: 2222 + PublicPort: 3333 + Type: "tcp" + Labels: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + SizeRw: 12288 + SizeRootFs: 0 + HostConfig: + NetworkMode: "default" + Annotations: + io.kubernetes.docker.type: "container" + NetworkSettings: + Networks: + bridge: + NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" + EndpointID: "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f" + Gateway: "172.17.0.1" + IPAddress: "172.17.0.2" + IPPrefixLen: 16 + IPv6Gateway: "" + GlobalIPv6Address: "" + GlobalIPv6PrefixLen: 0 + MacAddress: "02:42:ac:11:00:02" + Mounts: + - Name: "fac362...80535" + Source: "/data" + Destination: "/data" + Driver: "local" + Mode: "ro,Z" + RW: false + Propagation: "" + - Id: "9cd87474be90" + Names: + - "/coolName" + Image: "ubuntu:latest" + ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" + Command: "echo 222222" + Created: 1367854155 + State: "Exited" + Status: "Exit 0" + Ports: [] + Labels: {} + SizeRw: 12288 + SizeRootFs: 0 + HostConfig: + NetworkMode: "default" + Annotations: + io.kubernetes.docker.type: "container" + io.kubernetes.sandbox.id: "3befe639bed0fd6afdd65fd1fa84506756f59360ec4adc270b0fdac9be22b4d3" + NetworkSettings: + Networks: + bridge: + NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" + EndpointID: "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a" + Gateway: "172.17.0.1" + IPAddress: "172.17.0.8" + IPPrefixLen: 16 + IPv6Gateway: "" + GlobalIPv6Address: "" + GlobalIPv6PrefixLen: 0 + MacAddress: "02:42:ac:11:00:08" + Mounts: [] + - Id: "3176a2479c92" + Names: + - "/sleepy_dog" + Image: "ubuntu:latest" + ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" + Command: "echo 3333333333333333" + Created: 1367854154 + State: "Exited" + Status: "Exit 0" + Ports: [] + Labels: {} + SizeRw: 12288 + SizeRootFs: 0 + HostConfig: + NetworkMode: "default" + Annotations: + io.kubernetes.image.id: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" + io.kubernetes.image.name: "ubuntu:latest" + NetworkSettings: + Networks: + bridge: + NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" + EndpointID: "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d" + Gateway: "172.17.0.1" + IPAddress: "172.17.0.6" + IPPrefixLen: 16 + IPv6Gateway: "" + GlobalIPv6Address: "" + GlobalIPv6PrefixLen: 0 + MacAddress: "02:42:ac:11:00:06" + Mounts: [] + - Id: "4cb07b47f9fb" + Names: + - "/running_cat" + Image: "ubuntu:latest" + ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" + Command: "echo 444444444444444444444444444444444" + Created: 1367854152 + State: "Exited" + Status: "Exit 0" + Ports: [] + Labels: {} + SizeRw: 12288 + SizeRootFs: 0 + HostConfig: + NetworkMode: "default" + Annotations: + io.kubernetes.config.source: "api" + NetworkSettings: + Networks: + bridge: + NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" + EndpointID: "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9" + Gateway: "172.17.0.1" + IPAddress: "172.17.0.5" + IPPrefixLen: 16 + IPv6Gateway: "" + GlobalIPv6Address: "" + GlobalIPv6PrefixLen: 0 + MacAddress: "02:42:ac:11:00:05" + Mounts: [] + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/create: + post: + summary: "Create a container" + operationId: "ContainerCreate" + consumes: + - "application/json" + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "name" + in: "query" + description: | + Assign the specified name to the container. Must match + `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`. + type: "string" + pattern: "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$" + - name: "platform" + in: "query" + description: | + Platform in the format `os[/arch[/variant]]` used for image lookup. + + When specified, the daemon checks if the requested image is present + in the local image cache with the given OS and Architecture, and + otherwise returns a `404` status. + + If the option is not set, the host's native OS and Architecture are + used to look up the image in the image cache. However, if no platform + is passed and the given image does exist in the local image cache, + but its OS or architecture does not match, the container is created + with the available image, and a warning is added to the `Warnings` + field in the response, for example; + + WARNING: The requested image's platform (linux/arm64/v8) does not + match the detected host platform (linux/amd64) and no + specific platform was requested + + type: "string" + default: "" + - name: "body" + in: "body" + description: "Container to create" + schema: + allOf: + - $ref: "#/definitions/ContainerConfig" + - type: "object" + properties: + HostConfig: + $ref: "#/definitions/HostConfig" + NetworkingConfig: + $ref: "#/definitions/NetworkingConfig" + example: + Hostname: "" + Domainname: "" + User: "" + AttachStdin: false + AttachStdout: true + AttachStderr: true + Tty: false + OpenStdin: false + StdinOnce: false + Env: + - "FOO=bar" + - "BAZ=quux" + Cmd: + - "date" + Entrypoint: "" + Image: "ubuntu" + Labels: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + Volumes: + /volumes/data: {} + WorkingDir: "" + NetworkDisabled: false + MacAddress: "12:34:56:78:9a:bc" + ExposedPorts: + 22/tcp: {} + StopSignal: "SIGTERM" + StopTimeout: 10 + HostConfig: + Binds: + - "/tmp:/tmp" + Links: + - "redis3:redis" + Memory: 0 + MemorySwap: 0 + MemoryReservation: 0 + NanoCpus: 500000 + CpuPercent: 80 + CpuShares: 512 + CpuPeriod: 100000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpuQuota: 50000 + CpusetCpus: "0,1" + CpusetMems: "0,1" + MaximumIOps: 0 + MaximumIOBps: 0 + BlkioWeight: 300 + BlkioWeightDevice: + - {} + BlkioDeviceReadBps: + - {} + BlkioDeviceReadIOps: + - {} + BlkioDeviceWriteBps: + - {} + BlkioDeviceWriteIOps: + - {} + DeviceRequests: + - Driver: "nvidia" + Count: -1 + DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"] + Capabilities: [["gpu", "nvidia", "compute"]] + Options: + property1: "string" + property2: "string" + MemorySwappiness: 60 + OomKillDisable: false + OomScoreAdj: 500 + PidMode: "" + PidsLimit: 0 + PortBindings: + 22/tcp: + - HostPort: "11022" + PublishAllPorts: false + Privileged: false + ReadonlyRootfs: false + Dns: + - "8.8.8.8" + DnsOptions: + - "" + DnsSearch: + - "" + VolumesFrom: + - "parent" + - "other:ro" + CapAdd: + - "NET_ADMIN" + CapDrop: + - "MKNOD" + GroupAdd: + - "newgroup" + RestartPolicy: + Name: "" + MaximumRetryCount: 0 + AutoRemove: true + NetworkMode: "bridge" + Devices: [] + Ulimits: + - {} + LogConfig: + Type: "json-file" + Config: {} + SecurityOpt: [] + StorageOpt: {} + CgroupParent: "" + VolumeDriver: "" + ShmSize: 67108864 + NetworkingConfig: + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + required: true + responses: + 201: + description: "Container created successfully" + schema: + $ref: "#/definitions/ContainerCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/{id}/json: + get: + summary: "Inspect a container" + description: "Return low-level information about a container." + operationId: "ContainerInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "ContainerInspectResponse" + properties: + Id: + description: "The ID of the container" + type: "string" + Created: + description: "The time the container was created" + type: "string" + Path: + description: "The path to the command being run" + type: "string" + Args: + description: "The arguments to the command being run" + type: "array" + items: + type: "string" + State: + $ref: "#/definitions/ContainerState" + Image: + description: "The container's image ID" + type: "string" + ResolvConfPath: + type: "string" + HostnamePath: + type: "string" + HostsPath: + type: "string" + LogPath: + type: "string" + Name: + type: "string" + RestartCount: + type: "integer" + Driver: + type: "string" + Platform: + type: "string" + MountLabel: + type: "string" + ProcessLabel: + type: "string" + AppArmorProfile: + type: "string" + ExecIDs: + description: "IDs of exec instances that are running in the container." + type: "array" + items: + type: "string" + x-nullable: true + HostConfig: + $ref: "#/definitions/HostConfig" + GraphDriver: + $ref: "#/definitions/DriverData" + SizeRw: + description: | + The size of files that have been created or changed by this + container. + type: "integer" + format: "int64" + SizeRootFs: + description: "The total size of all the files in this container." + type: "integer" + format: "int64" + Mounts: + type: "array" + items: + $ref: "#/definitions/MountPoint" + Config: + $ref: "#/definitions/ContainerConfig" + NetworkSettings: + $ref: "#/definitions/NetworkSettings" + examples: + application/json: + AppArmorProfile: "" + Args: + - "-c" + - "exit 9" + Config: + AttachStderr: true + AttachStdin: false + AttachStdout: true + Cmd: + - "/bin/sh" + - "-c" + - "exit 9" + Domainname: "" + Env: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Healthcheck: + Test: ["CMD-SHELL", "exit 0"] + Hostname: "ba033ac44011" + Image: "ubuntu" + Labels: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + MacAddress: "" + NetworkDisabled: false + OpenStdin: false + StdinOnce: false + Tty: false + User: "" + Volumes: + /volumes/data: {} + WorkingDir: "" + StopSignal: "SIGTERM" + StopTimeout: 10 + Created: "2015-01-06T15:47:31.485331387Z" + Driver: "overlay2" + ExecIDs: + - "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca" + - "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + HostConfig: + MaximumIOps: 0 + MaximumIOBps: 0 + BlkioWeight: 0 + BlkioWeightDevice: + - {} + BlkioDeviceReadBps: + - {} + BlkioDeviceWriteBps: + - {} + BlkioDeviceReadIOps: + - {} + BlkioDeviceWriteIOps: + - {} + ContainerIDFile: "" + CpusetCpus: "" + CpusetMems: "" + CpuPercent: 80 + CpuShares: 0 + CpuPeriod: 100000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + Devices: [] + DeviceRequests: + - Driver: "nvidia" + Count: -1 + DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"] + Capabilities: [["gpu", "nvidia", "compute"]] + Options: + property1: "string" + property2: "string" + IpcMode: "" + Memory: 0 + MemorySwap: 0 + MemoryReservation: 0 + OomKillDisable: false + OomScoreAdj: 500 + NetworkMode: "bridge" + PidMode: "" + PortBindings: {} + Privileged: false + ReadonlyRootfs: false + PublishAllPorts: false + RestartPolicy: + MaximumRetryCount: 2 + Name: "on-failure" + LogConfig: + Type: "json-file" + Sysctls: + net.ipv4.ip_forward: "1" + Ulimits: + - {} + VolumeDriver: "" + ShmSize: 67108864 + HostnamePath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname" + HostsPath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts" + LogPath: "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log" + Id: "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39" + Image: "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2" + MountLabel: "" + Name: "/boring_euclid" + NetworkSettings: + Bridge: "" + SandboxID: "" + HairpinMode: false + LinkLocalIPv6Address: "" + LinkLocalIPv6PrefixLen: 0 + SandboxKey: "" + EndpointID: "" + Gateway: "" + GlobalIPv6Address: "" + GlobalIPv6PrefixLen: 0 + IPAddress: "" + IPPrefixLen: 0 + IPv6Gateway: "" + MacAddress: "" + Networks: + bridge: + NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" + EndpointID: "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d" + Gateway: "172.17.0.1" + IPAddress: "172.17.0.2" + IPPrefixLen: 16 + IPv6Gateway: "" + GlobalIPv6Address: "" + GlobalIPv6PrefixLen: 0 + MacAddress: "02:42:ac:12:00:02" + Path: "/bin/sh" + ProcessLabel: "" + ResolvConfPath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf" + RestartCount: 1 + State: + Error: "" + ExitCode: 9 + FinishedAt: "2015-01-06T15:47:32.080254511Z" + Health: + Status: "healthy" + FailingStreak: 0 + Log: + - Start: "2019-12-22T10:59:05.6385933Z" + End: "2019-12-22T10:59:05.8078452Z" + ExitCode: 0 + Output: "" + OOMKilled: false + Dead: false + Paused: false + Pid: 0 + Restarting: false + Running: true + StartedAt: "2015-01-06T15:47:32.072697474Z" + Status: "running" + Mounts: + - Name: "fac362...80535" + Source: "/data" + Destination: "/data" + Driver: "local" + Mode: "ro,Z" + RW: false + Propagation: "" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "size" + in: "query" + type: "boolean" + default: false + description: "Return the size of container as fields `SizeRw` and `SizeRootFs`" + tags: ["Container"] + /containers/{id}/top: + get: + summary: "List processes running inside a container" + description: | + On Unix systems, this is done by running the `ps` command. This endpoint + is not supported on Windows. + operationId: "ContainerTop" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "ContainerTopResponse" + description: "OK response to ContainerTop operation" + properties: + Titles: + description: "The ps column titles" + type: "array" + items: + type: "string" + Processes: + description: | + Each process running in the container, where each is process + is an array of values corresponding to the titles. + type: "array" + items: + type: "array" + items: + type: "string" + examples: + application/json: + Titles: + - "UID" + - "PID" + - "PPID" + - "C" + - "STIME" + - "TTY" + - "TIME" + - "CMD" + Processes: + - + - "root" + - "13642" + - "882" + - "0" + - "17:03" + - "pts/0" + - "00:00:00" + - "/bin/bash" + - + - "root" + - "13735" + - "13642" + - "0" + - "17:06" + - "pts/0" + - "00:00:00" + - "sleep 10" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "ps_args" + in: "query" + description: "The arguments to pass to `ps`. For example, `aux`" + type: "string" + default: "-ef" + tags: ["Container"] + /containers/{id}/logs: + get: + summary: "Get container logs" + description: | + Get `stdout` and `stderr` logs from a container. + + Note: This endpoint works only for containers with the `json-file` or + `journald` logging driver. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ContainerLogs" + responses: + 200: + description: | + logs returned as a stream in response body. + For the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). + Note that unlike the attach endpoint, the logs endpoint does not + upgrade the connection and does not set Content-Type. + schema: + type: "string" + format: "binary" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "until" + in: "query" + description: "Only return logs before this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Container"] + /containers/{id}/changes: + get: + summary: "Get changes on a container’s filesystem" + description: | + Returns which files in a container's filesystem have been added, deleted, + or modified. The `Kind` of modification can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + operationId: "ContainerChanges" + produces: ["application/json"] + responses: + 200: + description: "The list of changes" + schema: + type: "array" + items: + $ref: "#/definitions/FilesystemChange" + examples: + application/json: + - Path: "/dev" + Kind: 0 + - Path: "/dev/kmsg" + Kind: 1 + - Path: "/test" + Kind: 1 + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/export: + get: + summary: "Export a container" + description: "Export the contents of a container as a tarball." + operationId: "ContainerExport" + produces: + - "application/octet-stream" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/stats: + get: + summary: "Get container stats based on resource usage" + description: | + This endpoint returns a live stream of a container’s resource usage + statistics. + + The `precpu_stats` is the CPU statistic of the *previous* read, and is + used to calculate the CPU usage percentage. It is not an exact copy + of the `cpu_stats` field. + + If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is + nil then for compatibility with older daemons the length of the + corresponding `cpu_usage.percpu_usage` array should be used. + + On a cgroup v2 host, the following fields are not set + * `blkio_stats`: all fields other than `io_service_bytes_recursive` + * `cpu_stats`: `cpu_usage.percpu_usage` + * `memory_stats`: `max_usage` and `failcnt` + Also, `memory_stats.stats` fields are incompatible with cgroup v1. + + To calculate the values shown by the `stats` command of the docker cli tool + the following formulas can be used: + * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * available_memory = `memory_stats.limit` + * Memory usage % = `(used_memory / available_memory) * 100.0` + * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` + * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage` + * number_cpus = `length(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus` + * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0` + operationId: "ContainerStats" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + type: "object" + examples: + application/json: + read: "2015-01-08T22:57:31.547920715Z" + pids_stats: + current: 3 + networks: + eth0: + rx_bytes: 5338 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 36 + tx_bytes: 648 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 8 + eth5: + rx_bytes: 4641 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 26 + tx_bytes: 690 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 9 + memory_stats: + stats: + total_pgmajfault: 0 + cache: 0 + mapped_file: 0 + total_inactive_file: 0 + pgpgout: 414 + rss: 6537216 + total_mapped_file: 0 + writeback: 0 + unevictable: 0 + pgpgin: 477 + total_unevictable: 0 + pgmajfault: 0 + total_rss: 6537216 + total_rss_huge: 6291456 + total_writeback: 0 + total_inactive_anon: 0 + rss_huge: 6291456 + hierarchical_memory_limit: 67108864 + total_pgfault: 964 + total_active_file: 0 + active_anon: 6537216 + total_active_anon: 6537216 + total_pgpgout: 414 + total_cache: 0 + inactive_anon: 0 + active_file: 0 + pgfault: 964 + inactive_file: 0 + total_pgpgin: 477 + max_usage: 6651904 + usage: 6537216 + failcnt: 0 + limit: 67108864 + blkio_stats: {} + cpu_stats: + cpu_usage: + percpu_usage: + - 8646879 + - 24472255 + - 36438778 + - 30657443 + usage_in_usermode: 50000000 + total_usage: 100215355 + usage_in_kernelmode: 30000000 + system_cpu_usage: 739306590000000 + online_cpus: 4 + throttling_data: + periods: 0 + throttled_periods: 0 + throttled_time: 0 + precpu_stats: + cpu_usage: + percpu_usage: + - 8646879 + - 24350896 + - 36438778 + - 30657443 + usage_in_usermode: 50000000 + total_usage: 100093996 + usage_in_kernelmode: 30000000 + system_cpu_usage: 9492140000000 + online_cpus: 4 + throttling_data: + periods: 0 + throttled_periods: 0 + throttled_time: 0 + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "stream" + in: "query" + description: | + Stream the output. If false, the stats will be output once and then + it will disconnect. + type: "boolean" + default: true + - name: "one-shot" + in: "query" + description: | + Only get a single stat instead of waiting for 2 cycles. Must be used + with `stream=false`. + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/resize: + post: + summary: "Resize a container TTY" + description: "Resize the TTY for a container." + operationId: "ContainerResize" + consumes: + - "application/octet-stream" + produces: + - "text/plain" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "cannot resize container" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Container"] + /containers/{id}/start: + post: + summary: "Start a container" + operationId: "ContainerStart" + responses: + 204: + description: "no error" + 304: + description: "container already started" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container. Format is a + single character `[a-Z]` or `ctrl-` where `` is one + of: `a-z`, `@`, `^`, `[`, `,` or `_`. + type: "string" + tags: ["Container"] + /containers/{id}/stop: + post: + summary: "Stop a container" + operationId: "ContainerStop" + responses: + 204: + description: "no error" + 304: + description: "container already stopped" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/restart: + post: + summary: "Restart a container" + operationId: "ContainerRestart" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/kill: + post: + summary: "Kill a container" + description: | + Send a POSIX signal to a container, defaulting to killing to the + container. + operationId: "ContainerKill" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is not running" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + default: "SIGKILL" + tags: ["Container"] + /containers/{id}/update: + post: + summary: "Update a container" + description: | + Change various configuration options of a container without having to + recreate it. + operationId: "ContainerUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "The container has been updated." + schema: + type: "object" + title: "ContainerUpdateResponse" + description: "OK response to ContainerUpdate operation" + properties: + Warnings: + type: "array" + items: + type: "string" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "update" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + example: + BlkioWeight: 300 + CpuShares: 512 + CpuPeriod: 100000 + CpuQuota: 50000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpusetCpus: "0,1" + CpusetMems: "0" + Memory: 314572800 + MemorySwap: 514288000 + MemoryReservation: 209715200 + RestartPolicy: + MaximumRetryCount: 4 + Name: "on-failure" + tags: ["Container"] + /containers/{id}/rename: + post: + summary: "Rename a container" + operationId: "ContainerRename" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "name already in use" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "name" + in: "query" + required: true + description: "New name for the container" + type: "string" + tags: ["Container"] + /containers/{id}/pause: + post: + summary: "Pause a container" + description: | + Use the freezer cgroup to suspend all processes in a container. + + Traditionally, when suspending a process the `SIGSTOP` signal is used, + which is observable by the process being suspended. With the freezer + cgroup the process is unaware, and unable to capture, that it is being + suspended, and subsequently resumed. + operationId: "ContainerPause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/unpause: + post: + summary: "Unpause a container" + description: "Resume a container which has been paused." + operationId: "ContainerUnpause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/attach: + post: + summary: "Attach to a container" + description: | + Attach to a container to read its output or send it input. You can attach + to the same container multiple times and you can reattach to containers + that have been detached. + + Either the `stream` or `logs` parameter must be `true` for this endpoint + to do anything. + + See the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) + for more details. + + ### Hijacking + + This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, + and `stderr` on the same socket. + + This is the response from the daemon for an attach request: + + ``` + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + [STREAM] + ``` + + After the headers and two new lines, the TCP connection can now be used + for raw, bidirectional communication between the client and server. + + To hint potential proxies about connection hijacking, the Docker client + can also optionally send connection upgrade headers. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 + Upgrade: tcp + Connection: Upgrade + ``` + + The Docker daemon will respond with a `101 UPGRADED` response, and will + similarly follow with the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + [STREAM] + ``` + + ### Stream format + + When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), + the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream + and the stream over the hijacked connected is multiplexed to separate out + `stdout` and `stderr`. The stream consists of a series of frames, each + containing a header and a payload. + + The header contains the information which the stream writes (`stdout` or + `stderr`). It also contains the size of the associated frame encoded in + the last four bytes (`uint32`). + + It is encoded on the first eight bytes like this: + + ```go + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + ``` + + `STREAM_TYPE` can be: + + - 0: `stdin` (is written on `stdout`) + - 1: `stdout` + - 2: `stderr` + + `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size + encoded as big endian. + + Following the header is the payload, which is the specified number of + bytes of `STREAM_TYPE`. + + The simplest way to implement this protocol is the following: + + 1. Read 8 bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + + ### Stream format when using a TTY + + When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), + the stream is not multiplexed. The data exchanged over the hijacked + connection is simply the raw data from the process PTY and client's + `stdin`. + + operationId: "ContainerAttach" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, + `@`, `^`, `[`, `,` or `_`. + type: "string" + - name: "logs" + in: "query" + description: | + Replay previous logs from the container. + + This is useful for attaching to a container that has started and you + want to output everything since the container started. + + If `stream` is also enabled, once all the previous output has been + returned, it will seamlessly transition into streaming current + output. + type: "boolean" + default: false + - name: "stream" + in: "query" + description: | + Stream attached streams from the time the request was made onwards. + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/attach/ws: + get: + summary: "Attach to a container via a websocket" + operationId: "ContainerAttachWebsocket" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, + `@`, `^`, `[`, `,`, or `_`. + type: "string" + - name: "logs" + in: "query" + description: "Return logs" + type: "boolean" + default: false + - name: "stream" + in: "query" + description: "Return stream" + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/wait: + post: + summary: "Wait for a container" + description: "Block until a container stops, then returns the exit code." + operationId: "ContainerWait" + produces: ["application/json"] + responses: + 200: + description: "The container has exit." + schema: + $ref: "#/definitions/ContainerWaitResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "condition" + in: "query" + description: | + Wait until a container state reaches the given condition. + + Defaults to `not-running` if omitted or empty. + type: "string" + enum: + - "not-running" + - "next-exit" + - "removed" + default: "not-running" + tags: ["Container"] + /containers/{id}: + delete: + summary: "Remove a container" + operationId: "ContainerDelete" + responses: + 204: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: | + You cannot remove a running container: c2ada9df5af8. Stop the + container before attempting removal or force remove + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "v" + in: "query" + description: "Remove anonymous volumes associated with the container." + type: "boolean" + default: false + - name: "force" + in: "query" + description: "If the container is running, kill it before removing it." + type: "boolean" + default: false + - name: "link" + in: "query" + description: "Remove the specified link associated with the container." + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/archive: + head: + summary: "Get information about files in a container" + description: | + A response header `X-Docker-Container-Path-Stat` is returned, containing + a base64 - encoded JSON object with some filesystem header information + about the path. + operationId: "ContainerArchiveInfo" + responses: + 200: + description: "no error" + headers: + X-Docker-Container-Path-Stat: + type: "string" + description: | + A base64 - encoded JSON object with some filesystem header + information about the path + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + get: + summary: "Get an archive of a filesystem resource in a container" + description: "Get a tar archive of a resource in the filesystem of container id." + operationId: "ContainerArchive" + produces: ["application/x-tar"] + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + put: + summary: "Extract an archive of files or folders to a directory in a container" + description: | + Upload a tar archive to be extracted to a path in the filesystem of container id. + `path` parameter is asserted to be a directory. If it exists as a file, 400 error + will be returned with message "not a directory". + operationId: "PutContainerArchive" + consumes: ["application/x-tar", "application/octet-stream"] + responses: + 200: + description: "The content was extracted successfully" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "not a directory" + 403: + description: "Permission denied, the volume or container rootfs is marked as read-only." + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such container or path does not exist inside the container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Path to a directory in the container to extract the archive’s contents into. " + type: "string" + - name: "noOverwriteDirNonDir" + in: "query" + description: | + If `1`, `true`, or `True` then it will be an error if unpacking the + given content would cause an existing directory to be replaced with + a non-directory and vice versa. + type: "string" + - name: "copyUIDGID" + in: "query" + description: | + If `1`, `true`, then it will copy UID/GID maps to the dest file or + dir + type: "string" + - name: "inputStream" + in: "body" + required: true + description: | + The input stream must be a tar archive compressed with one of the + following algorithms: `identity` (no compression), `gzip`, `bzip2`, + or `xz`. + schema: + type: "string" + format: "binary" + tags: ["Container"] + /containers/prune: + post: + summary: "Delete stopped containers" + produces: + - "application/json" + operationId: "ContainerPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ContainerPruneResponse" + properties: + ContainersDeleted: + description: "Container IDs that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /images/json: + get: + summary: "List Images" + description: "Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image." + operationId: "ImageList" + produces: + - "application/json" + responses: + 200: + description: "Summary image data for the images matching the query" + schema: + type: "array" + items: + $ref: "#/definitions/ImageSummary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "all" + in: "query" + description: "Show all images. Only images from a final layer (no children) are shown by default." + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the images list. + + Available filters: + + - `before`=(`[:]`, `` or ``) + - `dangling=true` + - `label=key` or `label="key=value"` of an image label + - `reference`=(`[:]`) + - `since`=(`[:]`, `` or ``) + - `until=` + type: "string" + - name: "shared-size" + in: "query" + description: "Compute and show shared size as a `SharedSize` field on each image." + type: "boolean" + default: false + - name: "digests" + in: "query" + description: "Show digest information as a `RepoDigests` field on each image." + type: "boolean" + default: false + - name: "manifests" + in: "query" + description: "Include `Manifests` in the image summary." + type: "boolean" + default: false + tags: ["Image"] + /build: + post: + summary: "Build an image" + description: | + Build an image from a tar archive with a `Dockerfile` in it. + + The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). + + The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. + + The build is canceled if the client drops the connection by quitting or being killed. + operationId: "ImageBuild" + consumes: + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "inputStream" + in: "body" + description: "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." + schema: + type: "string" + format: "binary" + - name: "dockerfile" + in: "query" + description: "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`." + type: "string" + default: "Dockerfile" + - name: "t" + in: "query" + description: "A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters." + type: "string" + - name: "extrahosts" + in: "query" + description: "Extra hosts to add to /etc/hosts" + type: "string" + - name: "remote" + in: "query" + description: "A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball." + type: "string" + - name: "q" + in: "query" + description: "Suppress verbose build output." + type: "boolean" + default: false + - name: "nocache" + in: "query" + description: "Do not use the cache when building the image." + type: "boolean" + default: false + - name: "cachefrom" + in: "query" + description: "JSON array of images used for build cache resolution." + type: "string" + - name: "pull" + in: "query" + description: "Attempt to pull the image even if an older image exists locally." + type: "string" + - name: "rm" + in: "query" + description: "Remove intermediate containers after a successful build." + type: "boolean" + default: true + - name: "forcerm" + in: "query" + description: "Always remove intermediate containers, even upon failure." + type: "boolean" + default: false + - name: "memory" + in: "query" + description: "Set memory limit for build." + type: "integer" + - name: "memswap" + in: "query" + description: "Total memory (memory + swap). Set as `-1` to disable swap." + type: "integer" + - name: "cpushares" + in: "query" + description: "CPU shares (relative weight)." + type: "integer" + - name: "cpusetcpus" + in: "query" + description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)." + type: "string" + - name: "cpuperiod" + in: "query" + description: "The length of a CPU period in microseconds." + type: "integer" + - name: "cpuquota" + in: "query" + description: "Microseconds of CPU time that the container can get in a CPU period." + type: "integer" + - name: "buildargs" + in: "query" + description: > + JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker + uses the buildargs as the environment context for commands run via the `Dockerfile` RUN + instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for + passing secret values. + + + For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the + query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded. + + + [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) + type: "string" + - name: "shmsize" + in: "query" + description: "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB." + type: "integer" + - name: "squash" + in: "query" + description: "Squash the resulting images layers into a single layer. *(Experimental release only.)*" + type: "boolean" + - name: "labels" + in: "query" + description: "Arbitrary key/value labels to set on the image, as a JSON map of string pairs." + type: "string" + - name: "networkmode" + in: "query" + description: | + Sets the networking mode for the run commands during build. Supported + standard values are: `bridge`, `host`, `none`, and `container:`. + Any other value is taken as a custom network's name or ID to which this + container should connect to. + type: "string" + - name: "Content-type" + in: "header" + type: "string" + enum: + - "application/x-tar" + default: "application/x-tar" + - name: "X-Registry-Config" + in: "header" + description: | + This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. + + The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: + + ``` + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + ``` + + Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + type: "string" + - name: "platform" + in: "query" + description: "Platform in the format os[/arch[/variant]]" + type: "string" + default: "" + - name: "target" + in: "query" + description: "Target build stage" + type: "string" + default: "" + - name: "outputs" + in: "query" + description: "BuildKit output configuration" + type: "string" + default: "" + - name: "version" + in: "query" + type: "string" + default: "1" + enum: ["1", "2"] + description: | + Version of the builder backend to use. + + - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) + - `2` is [BuildKit](https://github.com/moby/buildkit) + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /build/prune: + post: + summary: "Delete builder cache" + produces: + - "application/json" + operationId: "BuildPrune" + parameters: + - name: "keep-storage" + in: "query" + description: "Amount of disk space in bytes to keep for cache" + type: "integer" + format: "int64" + - name: "all" + in: "query" + type: "boolean" + description: "Remove all types of build cache" + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the list of build cache objects. + + Available filters: + + - `until=` remove cache older than ``. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time. + - `id=` + - `parent=` + - `type=` + - `description=` + - `inuse` + - `shared` + - `private` + responses: + 200: + description: "No error" + schema: + type: "object" + title: "BuildPruneResponse" + properties: + CachesDeleted: + type: "array" + items: + description: "ID of build cache object" + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /images/create: + post: + summary: "Create an image" + description: "Pull or import an image." + operationId: "ImageCreate" + consumes: + - "text/plain" + - "application/octet-stream" + produces: + - "application/json" + responses: + 200: + description: "no error" + 404: + description: "repository does not exist or no read access" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "fromImage" + in: "query" + description: "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed." + type: "string" + - name: "fromSrc" + in: "query" + description: "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image." + type: "string" + - name: "repo" + in: "query" + description: "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image." + type: "string" + - name: "tag" + in: "query" + description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." + type: "string" + - name: "message" + in: "query" + description: "Set commit message for imported image." + type: "string" + - name: "inputImage" + in: "body" + description: "Image content if the value `-` has been specified in fromSrc query parameter" + schema: + type: "string" + required: false + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "changes" + in: "query" + description: | + Apply `Dockerfile` instructions to the image that is created, + for example: `changes=ENV DEBUG=true`. + Note that `ENV DEBUG=true` should be URI component encoded. + + Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + type: "array" + items: + type: "string" + - name: "platform" + in: "query" + description: | + Platform in the format os[/arch[/variant]]. + + When used in combination with the `fromImage` option, the daemon checks + if the given image is present in the local image cache with the given + OS and Architecture, and otherwise attempts to pull the image. If the + option is not set, the host's native OS and Architecture are used. + If the given image does not exist in the local image cache, the daemon + attempts to pull the image with the host's native OS and Architecture. + If the given image does exists in the local image cache, but its OS or + architecture does not match, a warning is produced. + + When used with the `fromSrc` option to import an image from an archive, + this option sets the platform information for the imported image. If + the option is not set, the host's native OS and Architecture are used + for the imported image. + type: "string" + default: "" + tags: ["Image"] + /images/{name}/json: + get: + summary: "Inspect an image" + description: "Return low-level information about an image." + operationId: "ImageInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/ImageInspect" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + tags: ["Image"] + /images/{name}/history: + get: + summary: "Get the history of an image" + description: "Return parent layers of an image." + operationId: "ImageHistory" + produces: ["application/json"] + responses: + 200: + description: "List of image layers" + schema: + type: "array" + items: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false + examples: + application/json: + - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" + Created: 1398108230 + CreatedBy: "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /" + Tags: + - "ubuntu:lucid" + - "ubuntu:10.04" + Size: 182964289 + Comment: "" + - Id: "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8" + Created: 1398108222 + CreatedBy: "/bin/sh -c #(nop) MAINTAINER Tianon Gravi - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/" + Tags: [] + Size: 0 + Comment: "" + - Id: "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158" + Created: 1371157430 + CreatedBy: "" + Tags: + - "scratch12:latest" + - "scratch:latest" + Size: 0 + Comment: "Imported from -" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + tags: ["Image"] + /images/{name}/push: + post: + summary: "Push an image" + description: | + Push an image to a registry. + + If you wish to push an image on to a private registry, that image must + already have a tag which references the registry. For example, + `registry.example.com/myimage:latest`. + + The push is cancelled if the HTTP connection is closed. + operationId: "ImagePush" + consumes: + - "application/octet-stream" + responses: + 200: + description: "No error" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + Name of the image to push. For example, `registry.example.com/myimage`. + The image must be present in the local image store with the same name. + + The name should be provided without tag; if a tag is provided, it + is ignored. For example, `registry.example.com/myimage:latest` is + considered equivalent to `registry.example.com/myimage`. + + Use the `tag` parameter to specify the tag to push. + type: "string" + required: true + - name: "tag" + in: "query" + description: | + Tag of the image to push. For example, `latest`. If no tag is provided, + all tags of the given image that are present in the local image store + are pushed. + type: "string" + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant to push. + If not provided, all available variants will attempt to be pushed. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to push to the registry. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + required: true + tags: ["Image"] + /images/{name}/tag: + post: + summary: "Tag an image" + description: "Tag an image so that it becomes part of a repository." + operationId: "ImageTag" + responses: + 201: + description: "No error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID to tag." + type: "string" + required: true + - name: "repo" + in: "query" + description: "The repository to tag in. For example, `someuser/someimage`." + type: "string" + - name: "tag" + in: "query" + description: "The name of the new tag." + type: "string" + tags: ["Image"] + /images/{name}: + delete: + summary: "Remove an image" + description: | + Remove an image, along with any untagged parent images that were + referenced by that image. + + Images can't be removed if they have descendant images, are being + used by a running container or are being used by a build. + operationId: "ImageDelete" + produces: ["application/json"] + responses: + 200: + description: "The image was deleted successfully" + schema: + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + examples: + application/json: + - Untagged: "3e2f21a89f" + - Deleted: "3e2f21a89f" + - Deleted: "53b4f83ac9" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "force" + in: "query" + description: "Remove the image even if it is being used by stopped containers or has other tags" + type: "boolean" + default: false + - name: "noprune" + in: "query" + description: "Do not delete untagged parent images" + type: "boolean" + default: false + tags: ["Image"] + /images/search: + get: + summary: "Search images" + description: "Search for an image on Docker Hub." + operationId: "ImageSearch" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + type: "object" + title: "ImageSearchResponseItem" + properties: + description: + type: "string" + is_official: + type: "boolean" + is_automated: + description: | + Whether this repository has automated builds enabled. + +


+ + > **Deprecated**: This field is deprecated and will always be "false". + type: "boolean" + example: false + name: + type: "string" + star_count: + type: "integer" + examples: + application/json: + - description: "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!" + is_official: true + is_automated: false + name: "alpine" + star_count: 10093 + - description: "Busybox base image." + is_official: true + is_automated: false + name: "Busybox base image." + star_count: 3037 + - description: "The PostgreSQL object-relational database system provides reliability and data integrity." + is_official: true + is_automated: false + name: "postgres" + star_count: 12408 + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "term" + in: "query" + description: "Term to search" + type: "string" + required: true + - name: "limit" + in: "query" + description: "Maximum number of results to return" + type: "integer" + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: + + - `is-official=(true|false)` + - `stars=` Matches images that has at least 'number' stars. + type: "string" + tags: ["Image"] + /images/prune: + post: + summary: "Delete unused images" + produces: + - "application/json" + operationId: "ImagePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: + + - `dangling=` When set to `true` (or `1`), prune only + unused *and* untagged images. When set to `false` + (or `0`), all unused images are pruned. + - `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ImagePruneResponse" + properties: + ImagesDeleted: + description: "Images that were deleted" + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /auth: + post: + summary: "Check auth configuration" + description: | + Validate credentials for a registry and, if available, get an identity + token for accessing the registry without password. + operationId: "SystemAuth" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "An identity token was generated successfully." + schema: + type: "object" + title: "SystemAuthResponse" + required: [Status] + properties: + Status: + description: "The status of the authentication" + type: "string" + x-nullable: false + IdentityToken: + description: "An opaque token used to authenticate a user after a successful login" + type: "string" + x-nullable: false + examples: + application/json: + Status: "Login Succeeded" + IdentityToken: "9cbaf023786cd7..." + 204: + description: "No error" + 401: + description: "Auth error" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "authConfig" + in: "body" + description: "Authentication to check" + schema: + $ref: "#/definitions/AuthConfig" + tags: ["System"] + /info: + get: + summary: "Get system information" + operationId: "SystemInfo" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/SystemInfo" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /version: + get: + summary: "Get version" + description: "Returns the version of Docker that is running and various information about the system that Docker is running on." + operationId: "SystemVersion" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/SystemVersion" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /_ping: + get: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPing" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "OK" + headers: + API-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: | + Default version of docker image builder + + The default on Linux is version "2" (BuildKit), but the daemon + can be configured to recommend version "1" (classic Builder). + Windows does not yet support BuildKit for native Windows images, + and uses "1" (classic builder) as a default. + + This value is a recommendation as advertised by the daemon, and + it is up to the client to choose which builder to use. + default: "2" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + headers: + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + tags: ["System"] + head: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPingHead" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "(empty)" + headers: + API-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: "Default version of docker image builder" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /commit: + post: + summary: "Create a new image from a container" + operationId: "ImageCommit" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IdResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "containerConfig" + in: "body" + description: "The container configuration" + schema: + $ref: "#/definitions/ContainerConfig" + - name: "container" + in: "query" + description: "The ID or name of the container to commit" + type: "string" + - name: "repo" + in: "query" + description: "Repository name for the created image" + type: "string" + - name: "tag" + in: "query" + description: "Tag name for the create image" + type: "string" + - name: "comment" + in: "query" + description: "Commit message" + type: "string" + - name: "author" + in: "query" + description: "Author of the image (e.g., `John Hannibal Smith `)" + type: "string" + - name: "pause" + in: "query" + description: "Whether to pause the container before committing" + type: "boolean" + default: true + - name: "changes" + in: "query" + description: "`Dockerfile` instructions to apply while committing" + type: "string" + tags: ["Image"] + /events: + get: + summary: "Monitor events" + description: | + Stream real-time events from the server. + + Various objects within Docker report events when something happens to them. + + Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` + + Images report these events: `create`, `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` + + Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` + + Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` + + The Docker daemon reports these events: `reload` + + Services report these events: `create`, `update`, and `remove` + + Nodes report these events: `create`, `update`, and `remove` + + Secrets report these events: `create`, `update`, and `remove` + + Configs report these events: `create`, `update`, and `remove` + + The Builder reports `prune` events + + operationId: "SystemEvents" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/EventMessage" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "since" + in: "query" + description: "Show events created since this timestamp then stream new events." + type: "string" + - name: "until" + in: "query" + description: "Show events created until this timestamp then stop streaming." + type: "string" + - name: "filters" + in: "query" + description: | + A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: + + - `config=` config name or ID + - `container=` container name or ID + - `daemon=` daemon name or ID + - `event=` event type + - `image=` image name or ID + - `label=` image or container label + - `network=` network name or ID + - `node=` node ID + - `plugin`= plugin name or ID + - `scope`= local or swarm + - `secret=` secret name or ID + - `service=` service name or ID + - `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` + - `volume=` volume name + type: "string" + tags: ["System"] + /system/df: + get: + summary: "Get data usage information" + operationId: "SystemDataUsage" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "SystemDataUsageResponse" + properties: + LayersSize: + type: "integer" + format: "int64" + Images: + type: "array" + items: + $ref: "#/definitions/ImageSummary" + Containers: + type: "array" + items: + $ref: "#/definitions/ContainerSummary" + Volumes: + type: "array" + items: + $ref: "#/definitions/Volume" + BuildCache: + type: "array" + items: + $ref: "#/definitions/BuildCache" + example: + LayersSize: 1092588 + Images: + - + Id: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" + ParentId: "" + RepoTags: + - "busybox:latest" + RepoDigests: + - "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + Created: 1466724217 + Size: 1092588 + SharedSize: 0 + Labels: {} + Containers: 1 + Containers: + - + Id: "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148" + Names: + - "/top" + Image: "busybox" + ImageID: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" + Command: "top" + Created: 1472592424 + Ports: [] + SizeRootFs: 1092588 + Labels: {} + State: "exited" + Status: "Exited (0) 56 minutes ago" + HostConfig: + NetworkMode: "default" + NetworkSettings: + Networks: + bridge: + IPAMConfig: null + Links: null + Aliases: null + NetworkID: "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92" + EndpointID: "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a" + Gateway: "172.18.0.1" + IPAddress: "172.18.0.2" + IPPrefixLen: 16 + IPv6Gateway: "" + GlobalIPv6Address: "" + GlobalIPv6PrefixLen: 0 + MacAddress: "02:42:ac:12:00:02" + Mounts: [] + Volumes: + - + Name: "my-volume" + Driver: "local" + Mountpoint: "/var/lib/docker/volumes/my-volume/_data" + Labels: null + Scope: "local" + Options: null + UsageData: + Size: 10920104 + RefCount: 2 + BuildCache: + - + ID: "hw53o5aio51xtltp5xjp8v7fx" + Parents: [] + Type: "regular" + Description: "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0" + InUse: false + Shared: true + Size: 0 + CreatedAt: "2021-06-28T13:31:01.474619385Z" + LastUsedAt: "2021-07-07T22:02:32.738075951Z" + UsageCount: 26 + - + ID: "ndlpt0hhvkqcdfkputsk4cq9c" + Parents: ["ndlpt0hhvkqcdfkputsk4cq9c"] + Type: "regular" + Description: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + InUse: false + Shared: true + Size: 51 + CreatedAt: "2021-06-28T13:31:03.002625487Z" + LastUsedAt: "2021-07-07T22:02:32.773909517Z" + UsageCount: 26 + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "type" + in: "query" + description: | + Object types, for which to compute and return data. + type: "array" + collectionFormat: multi + items: + type: "string" + enum: ["container", "image", "volume", "build-cache"] + tags: ["System"] + /images/{name}/get: + get: + summary: "Export an image" + description: | + Get a tarball containing all images and metadata for a repository. + + If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. + + ### Image tarball format + + An image tarball contains one directory per image layer (named using its long ID), each containing these files: + + - `VERSION`: currently `1.0` - the file format version + - `json`: detailed layer information, similar to `docker inspect layer_id` + - `layer.tar`: A tarfile containing the filesystem changes in this layer + + The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions. + + If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. + + ```json + { + "hello-world": { + "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" + } + } + ``` + operationId: "ImageGet" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + tags: ["Image"] + /images/get: + get: + summary: "Export several images" + description: | + Get a tarball containing all images and metadata for several image + repositories. + + For each value of the `names` parameter: if it is a specific name and + tag (e.g. `ubuntu:latest`), then only that image (and its parents) are + returned; if it is an image ID, similarly only that image (and its parents) + are returned and there would be no names referenced in the 'repositories' + file for this image ID. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageGetAll" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "names" + in: "query" + description: "Image names to filter by" + type: "array" + items: + type: "string" + tags: ["Image"] + /images/load: + post: + summary: "Import images" + description: | + Load a set of images and tags into a repository. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageLoad" + consumes: + - "application/x-tar" + produces: + - "application/json" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "imagesTarball" + in: "body" + description: "Tar archive containing images" + schema: + type: "string" + format: "binary" + - name: "quiet" + in: "query" + description: "Suppress progress details during load." + type: "boolean" + default: false + tags: ["Image"] + /containers/{id}/exec: + post: + summary: "Create an exec instance" + description: "Run a command inside a running container." + operationId: "ContainerExec" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IdResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is paused" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execConfig" + in: "body" + description: "Exec configuration" + schema: + type: "object" + title: "ExecConfig" + properties: + AttachStdin: + type: "boolean" + description: "Attach to `stdin` of the exec command." + AttachStdout: + type: "boolean" + description: "Attach to `stdout` of the exec command." + AttachStderr: + type: "boolean" + description: "Attach to `stderr` of the exec command." + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + DetachKeys: + type: "string" + description: | + Override the key sequence for detaching a container. Format is + a single character `[a-Z]` or `ctrl-` where `` + is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + Env: + description: | + A list of environment variables in the form `["VAR=value", ...]`. + type: "array" + items: + type: "string" + Cmd: + type: "array" + description: "Command to run, as a string or array of strings." + items: + type: "string" + Privileged: + type: "boolean" + description: "Runs the exec process with extended privileges." + default: false + User: + type: "string" + description: | + The user, and optionally, group to run the exec process inside + the container. Format is one of: `user`, `user:group`, `uid`, + or `uid:gid`. + WorkingDir: + type: "string" + description: | + The working directory for the exec process inside the container. + example: + AttachStdin: false + AttachStdout: true + AttachStderr: true + DetachKeys: "ctrl-p,ctrl-q" + Tty: false + Cmd: + - "date" + Env: + - "FOO=bar" + - "BAZ=quux" + required: true + - name: "id" + in: "path" + description: "ID or name of container" + type: "string" + required: true + tags: ["Exec"] + /exec/{id}/start: + post: + summary: "Start an exec instance" + description: | + Starts a previously set up exec instance. If detach is true, this endpoint + returns immediately after starting the command. Otherwise, it sets up an + interactive session with the command. + operationId: "ExecStart" + consumes: + - "application/json" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "No error" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Container is stopped or paused" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execStartConfig" + in: "body" + schema: + type: "object" + title: "ExecStartConfig" + properties: + Detach: + type: "boolean" + description: "Detach from the command." + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: + Detach: false + Tty: true + ConsoleSize: [80, 64] + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + /exec/{id}/resize: + post: + summary: "Resize an exec instance" + description: | + Resize the TTY session used by an exec instance. This endpoint only works + if `tty` was specified as part of creating and starting the exec instance. + operationId: "ExecResize" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Exec"] + /exec/{id}/json: + get: + summary: "Inspect an exec instance" + description: "Return low-level information about an exec instance." + operationId: "ExecInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ExecInspectResponse" + properties: + CanRemove: + type: "boolean" + DetachKeys: + type: "string" + ID: + type: "string" + Running: + type: "boolean" + ExitCode: + type: "integer" + ProcessConfig: + $ref: "#/definitions/ProcessConfig" + OpenStdin: + type: "boolean" + OpenStderr: + type: "boolean" + OpenStdout: + type: "boolean" + ContainerID: + type: "string" + Pid: + type: "integer" + description: "The system process ID for the exec process." + examples: + application/json: + CanRemove: false + ContainerID: "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126" + DetachKeys: "" + ExitCode: 2 + ID: "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b" + OpenStderr: true + OpenStdin: true + OpenStdout: true + ProcessConfig: + arguments: + - "-c" + - "exit 2" + entrypoint: "sh" + privileged: false + tty: true + user: "1000" + Running: false + Pid: 42000 + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + + /volumes: + get: + summary: "List volumes" + operationId: "VolumeList" + produces: ["application/json"] + responses: + 200: + description: "Summary volume data that matches the query" + schema: + $ref: "#/definitions/VolumeListResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to + process on the volumes list. Available filters: + + - `dangling=` When set to `true` (or `1`), returns all + volumes that are not in use by a container. When set to `false` + (or `0`), only volumes that are in use by one or more + containers are returned. + - `driver=` Matches volumes based on their driver. + - `label=` or `label=:` Matches volumes based on + the presence of a `label` alone or a `label` and a value. + - `name=` Matches all or part of a volume name. + type: "string" + format: "json" + tags: ["Volume"] + + /volumes/create: + post: + summary: "Create a volume" + operationId: "VolumeCreate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 201: + description: "The volume was created successfully" + schema: + $ref: "#/definitions/Volume" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "volumeConfig" + in: "body" + required: true + description: "Volume configuration" + schema: + $ref: "#/definitions/VolumeCreateOptions" + tags: ["Volume"] + + /volumes/{name}: + get: + summary: "Inspect a volume" + operationId: "VolumeInspect" + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/Volume" + 404: + description: "No such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + tags: ["Volume"] + + put: + summary: | + "Update a volume. Valid only for Swarm cluster volumes" + operationId: "VolumeUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "The name or ID of the volume" + type: "string" + required: true + - name: "body" + in: "body" + schema: + # though the schema for is an object that contains only a + # ClusterVolumeSpec, wrapping the ClusterVolumeSpec in this object + # means that if, later on, we support things like changing the + # labels, we can do so without duplicating that information to the + # ClusterVolumeSpec. + type: "object" + description: "Volume configuration" + properties: + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + description: | + The spec of the volume to update. Currently, only Availability may + change. All other fields must remain unchanged. + - name: "version" + in: "query" + description: | + The version number of the volume being updated. This is required to + avoid conflicting writes. Found in the volume's `ClusterVolume` + field. + type: "integer" + format: "int64" + required: true + tags: ["Volume"] + + delete: + summary: "Remove a volume" + description: "Instruct the driver to remove the volume." + operationId: "VolumeDelete" + responses: + 204: + description: "The volume was removed" + 404: + description: "No such volume or volume driver" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Volume is in use and cannot be removed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + - name: "force" + in: "query" + description: "Force the removal of the volume" + type: "boolean" + default: false + tags: ["Volume"] + + /volumes/prune: + post: + summary: "Delete unused volumes" + produces: + - "application/json" + operationId: "VolumePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "VolumePruneResponse" + properties: + VolumesDeleted: + description: "Volumes that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Volume"] + /networks: + get: + summary: "List networks" + description: | + Returns a list of networks. For details on the format, see the + [network inspect endpoint](#operation/NetworkInspect). + + Note that it uses a different, smaller representation of a network than + inspecting a single network. For example, the list of containers attached + to the network is not propagated in API versions 1.28 and up. + operationId: "NetworkList" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/Network" + examples: + application/json: + - Name: "bridge" + Id: "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566" + Created: "2016-10-19T06:21:00.416543526Z" + Scope: "local" + Driver: "bridge" + EnableIPv4: true + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: + - + Subnet: "172.17.0.0/16" + Options: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + - Name: "none" + Id: "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "null" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + - Name: "host" + Id: "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "host" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to process + on the networks list. + + Available filters: + + - `dangling=` When set to `true` (or `1`), returns all + networks that are not in use by a container. When set to `false` + (or `0`), only networks that are in use by one or more + containers are returned. + - `driver=` Matches a network's driver. + - `id=` Matches all or part of a network ID. + - `label=` or `label==` of a network label. + - `name=` Matches all or part of a network name. + - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). + - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + type: "string" + tags: ["Network"] + + /networks/{id}: + get: + summary: "Inspect a network" + operationId: "NetworkInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/Network" + 404: + description: "Network not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "verbose" + in: "query" + description: "Detailed inspect output for troubleshooting" + type: "boolean" + default: false + - name: "scope" + in: "query" + description: "Filter the network by scope (swarm, global, or local)" + type: "string" + tags: ["Network"] + + delete: + summary: "Remove a network" + operationId: "NetworkDelete" + responses: + 204: + description: "No error" + 403: + description: "operation not supported for pre-defined networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such network" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + tags: ["Network"] + + /networks/create: + post: + summary: "Create a network" + operationId: "NetworkCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "Network created successfully" + schema: + $ref: "#/definitions/NetworkCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: | + Forbidden operation. This happens when trying to create a network named after a pre-defined network, + or when trying to create an overlay network on a daemon which is not part of a Swarm cluster. + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "plugin not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "networkConfig" + in: "body" + description: "Network configuration" + required: true + schema: + type: "object" + title: "NetworkCreateRequest" + required: ["Name"] + properties: + Name: + description: "The network's name." + type: "string" + example: "my_network" + Driver: + description: "Name of the network driver plugin to use." + type: "string" + default: "bridge" + example: "bridge" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level). + type: "string" + Internal: + description: "Restrict external access to the network." + type: "boolean" + Attachable: + description: | + Globally scoped network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + example: true + Ingress: + description: | + Ingress network is the network which provides the routing-mesh + in swarm mode. + type: "boolean" + example: false + ConfigOnly: + description: | + Creates a config-only network. Config-only networks are placeholder + networks for network configurations to be used by other networks. + Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + default: false + example: false + ConfigFrom: + description: | + Specifies the source which will provide the configuration for + this network. The specified network must be an existing + config-only network; see ConfigOnly. + $ref: "#/definitions/ConfigReference" + IPAM: + description: "Optional custom IP scheme for the network." + $ref: "#/definitions/IPAM" + EnableIPv4: + description: | + Enable IPv4 on the network. + To disable IPv4, the daemon must be started with experimental features enabled. + type: "boolean" + example: true + EnableIPv6: + description: "Enable IPv6 on the network." + type: "boolean" + example: true + Options: + description: "Network specific options to be used by the drivers." + type: "object" + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + tags: ["Network"] + + /networks/{id}/connect: + post: + summary: "Connect a container to a network" + description: "The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container" + operationId: "NetworkConnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "Operation forbidden" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + type: "object" + title: "NetworkConnectRequest" + properties: + Container: + type: "string" + description: "The ID or name of the container to connect to the network." + EndpointConfig: + $ref: "#/definitions/EndpointSettings" + example: + Container: "3613f73ba0e4" + EndpointConfig: + IPAMConfig: + IPv4Address: "172.24.56.89" + IPv6Address: "2001:db8::5689" + MacAddress: "02:42:ac:12:05:02" + tags: ["Network"] + + /networks/{id}/disconnect: + post: + summary: "Disconnect a container from a network" + operationId: "NetworkDisconnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 403: + description: "Operation not supported for swarm scoped networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + type: "object" + title: "NetworkDisconnectRequest" + properties: + Container: + type: "string" + description: | + The ID or name of the container to disconnect from the network. + Force: + type: "boolean" + description: | + Force the container to disconnect from the network. + tags: ["Network"] + /networks/prune: + post: + summary: "Delete unused networks" + produces: + - "application/json" + operationId: "NetworkPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "NetworkPruneResponse" + properties: + NetworksDeleted: + description: "Networks that were deleted" + type: "array" + items: + type: "string" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Network"] + /plugins: + get: + summary: "List plugins" + operationId: "PluginList" + description: "Returns information about installed plugins." + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/Plugin" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the plugin list. + + Available filters: + + - `capability=` + - `enable=|` + tags: ["Plugin"] + + /plugins/privileges: + get: + summary: "Get plugin privileges" + operationId: "GetPluginPrivileges" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: + - "Plugin" + + /plugins/pull: + post: + summary: "Install a plugin" + operationId: "PluginPull" + description: | + Pulls and installs a plugin. After the plugin is installed, it can be + enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). + produces: + - "application/json" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + Remote reference for plugin to install. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "name" + in: "query" + description: | + Local name for the pulled plugin. + + The `:latest` tag is optional, and is used as the default if omitted. + required: false + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/{name}/json: + get: + summary: "Inspect a plugin" + operationId: "PluginInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: ["Plugin"] + /plugins/{name}: + delete: + summary: "Remove a plugin" + operationId: "PluginDelete" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Disable the plugin before removing. This may result in issues if the + plugin is in use by a container. + type: "boolean" + default: false + tags: ["Plugin"] + /plugins/{name}/enable: + post: + summary: "Enable a plugin" + operationId: "PluginEnable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "timeout" + in: "query" + description: "Set the HTTP client timeout (in seconds)" + type: "integer" + default: 0 + tags: ["Plugin"] + /plugins/{name}/disable: + post: + summary: "Disable a plugin" + operationId: "PluginDisable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Force disable a plugin even if still in use. + required: false + type: "boolean" + tags: ["Plugin"] + /plugins/{name}/upgrade: + post: + summary: "Upgrade a plugin" + operationId: "PluginUpgrade" + responses: + 204: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "remote" + in: "query" + description: | + Remote reference to upgrade to. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/create: + post: + summary: "Create a plugin" + operationId: "PluginCreate" + consumes: + - "application/x-tar" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "tarContext" + in: "body" + description: "Path to tar containing plugin rootfs and manifest" + schema: + type: "string" + format: "binary" + tags: ["Plugin"] + /plugins/{name}/push: + post: + summary: "Push a plugin" + operationId: "PluginPush" + description: | + Push a plugin to the registry. + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + responses: + 200: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /plugins/{name}/set: + post: + summary: "Configure a plugin" + operationId: "PluginSet" + consumes: + - "application/json" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + type: "string" + example: ["DEBUG=1"] + responses: + 204: + description: "No error" + 404: + description: "Plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /nodes: + get: + summary: "List nodes" + operationId: "NodeList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Node" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `id=` + - `label=` + - `membership=`(`accepted`|`pending`)` + - `name=` + - `node.label=` + - `role=`(`manager`|`worker`)` + type: "string" + tags: ["Node"] + /nodes/{id}: + get: + summary: "Inspect a node" + operationId: "NodeInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Node" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + tags: ["Node"] + delete: + summary: "Delete a node" + operationId: "NodeDelete" + responses: + 200: + description: "no error" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + - name: "force" + in: "query" + description: "Force remove a node from the swarm" + default: false + type: "boolean" + tags: ["Node"] + /nodes/{id}/update: + post: + summary: "Update a node" + operationId: "NodeUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID of the node" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/NodeSpec" + - name: "version" + in: "query" + description: | + The version number of the node object being updated. This is required + to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Node"] + /swarm: + get: + summary: "Inspect swarm" + operationId: "SwarmInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Swarm" + 404: + description: "no such swarm" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/init: + post: + summary: "Initialize a new swarm" + operationId: "SwarmInit" + produces: + - "application/json" + - "text/plain" + responses: + 200: + description: "no error" + schema: + description: "The node ID" + type: "string" + example: "7v2t30z9blmxuhnyo6s4cpenp" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmInitRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication, as well + as determining the networking interface used for the VXLAN + Tunnel Endpoint (VTEP). This can either be an address/port + combination in the form `192.168.1.1:4567`, or an interface + followed by a port number, like `eth0:4567`. If the port number + is omitted, the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + ``), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + type: "string" + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + if no port is set or is set to 0, default port 4789 will be used. + type: "integer" + format: "uint32" + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global + scope networks. + type: "array" + items: + type: "string" + example: ["10.10.0.0/16", "20.20.0.0/16"] + ForceNewCluster: + description: "Force creation of a new swarm." + type: "boolean" + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created + from the default subnet pool. + type: "integer" + format: "uint32" + Spec: + $ref: "#/definitions/SwarmSpec" + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathPort: 4789 + DefaultAddrPool: ["10.10.0.0/8", "20.20.0.0/8"] + SubnetSize: 24 + ForceNewCluster: false + Spec: + Orchestration: {} + Raft: {} + Dispatcher: {} + CAConfig: {} + EncryptionConfig: + AutoLockManagers: false + tags: ["Swarm"] + /swarm/join: + post: + summary: "Join an existing swarm" + operationId: "SwarmJoin" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmJoinRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + ``), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + type: "string" + RemoteAddrs: + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" + JoinToken: + description: "Secret token for joining this swarm." + type: "string" + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + RemoteAddrs: + - "node1:2377" + JoinToken: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + tags: ["Swarm"] + /swarm/leave: + post: + summary: "Leave a swarm" + operationId: "SwarmLeave" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "force" + description: | + Force leave swarm, even if this is the last manager or that it will + break the cluster. + in: "query" + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/update: + post: + summary: "Update a swarm" + operationId: "SwarmUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + $ref: "#/definitions/SwarmSpec" + - name: "version" + in: "query" + description: | + The version number of the swarm object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + - name: "rotateWorkerToken" + in: "query" + description: "Rotate the worker join token." + type: "boolean" + default: false + - name: "rotateManagerToken" + in: "query" + description: "Rotate the manager join token." + type: "boolean" + default: false + - name: "rotateManagerUnlockKey" + in: "query" + description: "Rotate the manager unlock key." + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/unlockkey: + get: + summary: "Get the unlock key" + operationId: "SwarmUnlockkey" + consumes: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "UnlockKeyResponse" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/unlock: + post: + summary: "Unlock a locked manager" + operationId: "SwarmUnlock" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmUnlockRequest" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /services: + get: + summary: "List services" + operationId: "ServiceList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Service" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the services list. + + Available filters: + + - `id=` + - `label=` + - `mode=["replicated"|"global"]` + - `name=` + - name: "status" + in: "query" + type: "boolean" + description: | + Include service status, with count of running and desired tasks. + tags: ["Service"] + /services/create: + post: + summary: "Create a service" + operationId: "ServiceCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/ServiceCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "network is not eligible for services" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "name conflicts with an existing service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "web" + TaskTemplate: + ContainerSpec: + Image: "nginx:alpine" + Mounts: + - + ReadOnly: true + Source: "web-data" + Target: "/usr/share/nginx/html" + Type: "volume" + VolumeOptions: + DriverConfig: {} + Labels: + com.example.something: "something-value" + Hosts: ["10.10.10.10 host1", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2"] + User: "33" + DNSConfig: + Nameservers: ["8.8.8.8"] + Search: ["example.org"] + Options: ["timeout:3"] + Secrets: + - + File: + Name: "www.example.org.key" + UID: "33" + GID: "33" + Mode: 384 + SecretID: "fpjqlhnwb19zds35k8wn80lq9" + SecretName: "example_org_domain_key" + OomScoreAdj: 0 + LogDriver: + Name: "json-file" + Options: + max-file: "3" + max-size: "10M" + Placement: {} + Resources: + Limits: + MemoryBytes: 104857600 + Reservations: {} + RestartPolicy: + Condition: "on-failure" + Delay: 10000000000 + MaxAttempts: 10 + Mode: + Replicated: + Replicas: 4 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Ports: + - + Protocol: "tcp" + PublishedPort: 8080 + TargetPort: 80 + Labels: + foo: "bar" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + tags: ["Service"] + /services/{id}: + get: + summary: "Inspect a service" + operationId: "ServiceInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Service" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "insertDefaults" + in: "query" + description: "Fill empty fields with default values." + type: "boolean" + default: false + tags: ["Service"] + delete: + summary: "Delete a service" + operationId: "ServiceDelete" + responses: + 200: + description: "no error" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + tags: ["Service"] + /services/{id}/update: + post: + summary: "Update a service" + operationId: "ServiceUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ServiceUpdateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "top" + TaskTemplate: + ContainerSpec: + Image: "busybox" + Args: + - "top" + OomScoreAdj: 0 + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + + - name: "version" + in: "query" + description: | + The version number of the service object being updated. This is + required to avoid conflicting writes. + This version number should be the value as currently set on the + service *before* the update. You can find the current version by + calling `GET /services/{id}` + required: true + type: "integer" + - name: "registryAuthFrom" + in: "query" + description: | + If the `X-Registry-Auth` header is not specified, this parameter + indicates where to find registry authorization credentials. + type: "string" + enum: ["spec", "previous-spec"] + default: "spec" + - name: "rollback" + in: "query" + description: | + Set to this parameter to `previous` to cause a server-side rollback + to the previous service spec. The supplied spec will be ignored in + this case. + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + + tags: ["Service"] + /services/{id}/logs: + get: + summary: "Get service logs" + description: | + Get `stdout` and `stderr` logs from a service. See also + [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ServiceLogs" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such service: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the service" + type: "string" + - name: "details" + in: "query" + description: "Show service context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Service"] + /tasks: + get: + summary: "List tasks" + operationId: "TaskList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Task" + example: + - ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + - ID: "1yljwbmlr8er2waf8orvqpwms" + Version: + Index: 30 + CreatedAt: "2016-06-07T21:07:30.019104782Z" + UpdatedAt: "2016-06-07T21:07:30.231958098Z" + Name: "hopeful_cori" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:30.202183143Z" + State: "shutdown" + Message: "shutdown" + ContainerStatus: + ContainerID: "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + DesiredState: "shutdown" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.5/16" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the tasks list. + + Available filters: + + - `desired-state=(running | shutdown | accepted)` + - `id=` + - `label=key` or `label="key=value"` + - `name=` + - `node=` + - `service=` + tags: ["Task"] + /tasks/{id}: + get: + summary: "Inspect a task" + operationId: "TaskInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Task" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID of the task" + required: true + type: "string" + tags: ["Task"] + /tasks/{id}/logs: + get: + summary: "Get task logs" + description: | + Get `stdout` and `stderr` logs from a task. + See also [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + operationId: "TaskLogs" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such task: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID of the task" + type: "string" + - name: "details" + in: "query" + description: "Show task context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Task"] + /secrets: + get: + summary: "List secrets" + operationId: "SecretList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Secret" + example: + - ID: "blt1owaxmitz71s9v5zh81zun" + Version: + Index: 85 + CreatedAt: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: "2017-07-20T13:55:28.678958722Z" + Spec: + Name: "mysql-passwd" + Labels: + some.label: "some.value" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the secrets list. + + Available filters: + + - `id=` + - `label= or label==value` + - `name=` + - `names=` + tags: ["Secret"] + /secrets/create: + post: + summary: "Create a secret" + operationId: "SecretCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IdResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/SecretSpec" + - type: "object" + example: + Name: "app-key.crt" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + tags: ["Secret"] + /secrets/{id}: + get: + summary: "Inspect a secret" + operationId: "SecretInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Secret" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + delete: + summary: "Delete a secret" + operationId: "SecretDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + /secrets/{id}/update: + post: + summary: "Update a Secret" + operationId: "SecretUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such secret" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the secret" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/SecretSpec" + description: | + The spec of the secret to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [SecretInspect endpoint](#operation/SecretInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the secret object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Secret"] + /configs: + get: + summary: "List configs" + operationId: "ConfigList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Config" + example: + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "server.conf" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the configs list. + + Available filters: + + - `id=` + - `label= or label==value` + - `name=` + - `names=` + tags: ["Config"] + /configs/create: + post: + summary: "Create a config" + operationId: "ConfigCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IdResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/ConfigSpec" + - type: "object" + example: + Name: "server.conf" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + tags: ["Config"] + /configs/{id}: + get: + summary: "Inspect a config" + operationId: "ConfigInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Config" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + delete: + summary: "Delete a config" + operationId: "ConfigDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + /configs/{id}/update: + post: + summary: "Update a Config" + operationId: "ConfigUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such config" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the config" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/ConfigSpec" + description: | + The spec of the config to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [ConfigInspect endpoint](#operation/ConfigInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the config object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Config"] + /distribution/{name}/json: + get: + summary: "Get image information from the registry" + description: | + Return image digest and platform information by contacting the registry. + operationId: "DistributionInspect" + produces: + - "application/json" + responses: + 200: + description: "descriptor and platform information" + schema: + $ref: "#/definitions/DistributionInspect" + 401: + description: "Failed authentication or no image found" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + tags: ["Distribution"] + /session: + post: + summary: "Initialize interactive session" + description: | + Start a new interactive session with a server. Session allows server to + call back to the client for advanced capabilities. + + ### Hijacking + + This endpoint hijacks the HTTP connection to HTTP2 transport that allows + the client to expose gPRC services on that connection. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /session HTTP/1.1 + Upgrade: h2c + Connection: Upgrade + ``` + + The Docker daemon responds with a `101 UPGRADED` response follow with + the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Connection: Upgrade + Upgrade: h2c + ``` + operationId: "Session" + produces: + - "application/vnd.docker.raw-stream" + responses: + 101: + description: "no error, hijacking successful" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Session"]