diff --git a/.jane-openapi b/.jane-openapi index 16230b9d..01c8f15f 100644 --- a/.jane-openapi +++ b/.jane-openapi @@ -4,6 +4,6 @@ return [ 'directory' => 'src', 'namespace' => 'Docker\\API', 'openapi-file' => __DIR__ . '/docker-swagger.yaml', - 'async' => true, +// 'async' => true, 'strict' => false, -]; \ No newline at end of file +]; diff --git a/README.md b/README.md index 43e2521e..9ec322a0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ -# No longer maintained - -I'm backing off maintaining this library due to a lack of motivation, time and usage of docker, contact me on twitter https://twitter.com/joelwurtz if you wish to take over this repository (or just do a fork). - # Docker PHP Api Generated API Client from OpenAPI specification of Docker, by Jane OpenAPI Client generator. @@ -18,6 +14,9 @@ This library does *not* respect semver and will instead follow Jane OpenAPI vers * Second and third number are the Docker API Version * Last number is the minor revision number for this -So 4.1.25.0 is the version 1.25 of Docker API generated with Jane OpenAPI in a 4.X version. +So 7.1.43.0 is the version 1.43 of Docker API generated with Jane OpenAPI in a 7.X version. You should always fix the version, or at least the 3 first numbers (4.1.25.*) + +# No longer maintained by original author +I'm backing off maintaining this library due to a lack of motivation, time and usage of docker, contact me on twitter https://twitter.com/joelwurtz if you wish to take over this repository (or just do a fork). diff --git a/composer.json b/composer.json index f901f8f1..286e8436 100644 --- a/composer.json +++ b/composer.json @@ -10,14 +10,14 @@ }, "require": { "php": ">=7.1", - "jane-php/open-api-runtime": "^4.0" + "nyholm/psr7": "^1.8", + "jane-php/open-api-runtime": "^7.5", + "friendsofphp/php-cs-fixer": "*", + "amphp/artax": "^3.0" }, "require-dev": { "phpunit/phpunit": "^6.0", - "friendsofphp/php-cs-fixer": "^2.9", - "jane-php/open-api": "^4.0", - "jane-php/json-schema": "^4.0", - "amphp/artax": "^3.0" + "jane-php/open-api-2": "^7.5" }, "suggest": { "amphp/artax": "To use the async api" @@ -25,8 +25,16 @@ "extra": { "branch-alias": { "4.1.36": "4.1.36.x-dev" + }, + "symfony": { + "allow-contrib": "true" } }, "minimum-stability": "dev", - "prefer-stable": true + "prefer-stable": true, + "config": { + "allow-plugins": { + "php-http/discovery": true + } + } } diff --git a/docker-swagger.yaml b/docker-swagger.yaml index 5d77c604..2a6e2d4c 100644 --- a/docker-swagger.yaml +++ b/docker-swagger.yaml @@ -19,20 +19,26 @@ produces: consumes: - "application/json" - "text/plain" -basePath: "/v1.36" +basePath: "/v1.43" info: title: "Docker Engine API" - version: "1.36" + version: "1.43" x-logo: - url: "https://docs.docker.com/images/logo-docker-main.png" + url: "/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. + 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. + 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: + 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: ``` { @@ -49,8 +55,8 @@ info: 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.36) is used. - For example, calling `/info` is the same as calling `/v1.36/info`. Using the + If you omit the version-prefix, the current version of the API (v1.43) is used. + For example, calling `/info` is the same as calling `/v1.43/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, @@ -65,7 +71,11 @@ info: # 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 Base64 encoded (JSON) string with the following structure: + 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: ``` { @@ -76,9 +86,11 @@ info: } ``` - The `serveraddress` is a domain/IP without a protocol. Throughout this structure, double quotes are required. + 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: + If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), + you can just pass this instead of credentials: ``` { @@ -104,7 +116,9 @@ tags: - 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/engine/userguide/networking/) for more information. + Networks are user-defined networks that containers can be attached to. + See the [networking documentation](/network/) + for more information. - name: "Volume" x-displayName: "Volumes" description: | @@ -112,34 +126,46 @@ tags: - name: "Exec" x-displayName: "Exec" description: | - Run new commands inside running containers. See the [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) for more information. + Run new commands inside running containers. Refer to the + [command-line reference](/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`. - 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. See [the swarm mode documentation](https://docs.docker.com/engine/swarm/) for more information. + Engines can be clustered together in a swarm. Refer to the + [swarm mode documentation](/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. + 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. + 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. + 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. + 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. + 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" @@ -155,6 +181,7 @@ definitions: IP: type: "string" format: "ip-address" + description: "Host IP address that the container's port is mapped to" PrivatePort: type: "integer" format: "uint16" @@ -167,7 +194,7 @@ definitions: Type: type: "string" x-nullable: false - enum: ["tcp", "udp"] + enum: ["tcp", "udp", "sctp"] example: PrivatePort: 8080 PublicPort: 80 @@ -175,24 +202,74 @@ definitions: MountPoint: type: "object" - description: "A mount point inside a container" + 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" @@ -209,6 +286,43 @@ definitions: 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: @@ -237,11 +351,15 @@ definitions: - `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" @@ -262,6 +380,14 @@ definitions: - "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 VolumeOptions: description: "Optional configuration for the `volume` type." type: "object" @@ -301,26 +427,31 @@ definitions: RestartPolicy: description: | - The behavior to apply when the container exits. The default is not to restart. + 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. + 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" + 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)" @@ -328,7 +459,9 @@ definitions: properties: # Applicable to all platforms CpuShares: - description: "An integer value representing this container's relative CPU weight versus other containers." + description: | + An integer value representing this container's relative CPU weight + versus other containers. type: "integer" Memory: description: "Memory limit in bytes." @@ -337,7 +470,11 @@ definitions: 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." + 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)." @@ -346,7 +483,11 @@ definitions: maximum: 1000 BlkioWeightDevice: description: | - Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. + Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` type: "array" items: type: "object" @@ -358,25 +499,41 @@ definitions: minimum: 0 BlkioDeviceReadBps: description: | - Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + 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}]`. + 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}]`. + 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}]`. + Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` type: "array" items: $ref: "#/definitions/ThrottleDevice" @@ -385,23 +542,31 @@ definitions: type: "integer" format: "int64" CpuQuota: - description: "Microseconds of CPU time that the container can get in a CPU period." + 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." + 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." + 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`)" + 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." + 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." @@ -414,12 +579,19 @@ definitions: items: type: "string" example: "c 13:* rwm" - DiskQuota: - description: "Disk limit (in bytes)." - type: "integer" - format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." + 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: @@ -427,29 +599,47 @@ definitions: type: "integer" format: "int64" MemorySwap: - description: "Total memory limit (memory + swap). Set as `-1` to enable unlimited swap." + 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." + description: | + Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. type: "integer" format: "int64" minimum: 0 maximum: 100 - NanoCPUs: + 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 -1 for unlimited." + 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}`" + A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` type: "array" items: type: "object" @@ -468,14 +658,18 @@ definitions: 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. + 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. + 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: @@ -483,12 +677,37 @@ definitions: type: "integer" format: "int64" IOMaximumBandwidth: - description: "Maximum IO in bytes per second for the container system drive (Windows only)" + 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" + description: | + An object describing the resources which can be advertised by a node and + requested by a task. type: "object" properties: NanoCPUs: @@ -503,7 +722,9 @@ definitions: $ref: "#/definitions/GenericResources" GenericResources: - description: "User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`)" + 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" @@ -550,17 +771,95 @@ definitions: 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." + 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." + 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." + 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." + 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" + + 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" @@ -572,12 +871,44 @@ definitions: 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` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `host-src:container-dest:ro` to make the bind mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. - - `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path. + 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: @@ -605,40 +936,82 @@ definitions: 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." + 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." + 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 `[:]`." + 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." + 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." + 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." + 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." @@ -657,43 +1030,49 @@ definitions: 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"]`. + 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." + 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: + 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 + - `"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. + 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`." + 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." + 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: + 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 @@ -706,18 +1085,21 @@ definitions: 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. + 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`. + 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." + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. items: type: "string" StorageOpt: @@ -729,7 +1111,12 @@ definitions: 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" }`. + 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: @@ -737,46 +1124,73 @@ definitions: 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." + description: | + Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. ShmSize: type: "integer" - description: "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB." + 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"}` + 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 - ConsoleSize: - type: "array" - description: "Initial console size, as an `[height, width]` array. (Windows only)" - minItems: 2 - maxItems: 2 - items: - type: "integer" - minimum: 0 Isolation: type: "string" - description: "Isolation technology of the container. (Windows only)" + 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" + description: | + Configuration for a container that is portable between hosts. + + When used as `ContainerConfig` field in an image, `ContainerConfig` is an + optional field containing the configuration of the container that was last + committed when creating the image. + + Previous versions of Docker builder used this field to store build cache, + and it is not in active use anymore. type: "object" properties: Hostname: - description: "The hostname to use for the container, as a valid RFC 1123 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." + description: | + The domain name to use for the container. type: "string" User: description: "The user that commands are run as inside the container." @@ -797,15 +1211,21 @@ definitions: 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." + description: | + Attach standard streams to a TTY, including `stdin` if it is not closed. type: "boolean" default: false OpenStdin: @@ -818,25 +1238,39 @@ definitions: 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. + 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." + 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 of the image to use when creating the container" + 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." + description: | + An object mapping mount point paths inside the container to empty + objects. type: "object" additionalProperties: type: "object" @@ -846,50 +1280,104 @@ definitions: 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`). + 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." type: "string" + x-nullable: true OnBuild: - description: "`ONBUILD` metadata that were defined in the image's `Dockerfile`." + 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." + description: | + Signal to stop a container as a string or unsigned integer. type: "string" - default: "SIGTERM" + 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." + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. type: "array" + x-nullable: true items: type: "string" + example: ["/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. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + example: + # putting an example here, instead of using the example values from + # /definitions/EndpointSettings, because containers/create currently + # does not support attaching to multiple networks, so the example request + # would be confusing if it showed that multiple networks can be contained + # in the EndpointsConfig. + # TODO remove once we support multiple networks on container create (see https://github.com/moby/moby/blob/07e6b843594e061f82baa5fa23c2ff7d536c2a05/daemon/create.go#L323) + 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" NetworkSettings: description: "NetworkSettings exposes the network settings in the API" type: "object" properties: Bridge: - description: Name of the network'a bridge (for example, `docker0`). + description: Name of the network's bridge (for example, `docker0`). type: "string" example: "docker0" SandboxID: @@ -1062,11 +1550,12 @@ definitions: container's port-number and protocol as key in the format `/`, for example, `80/udp`. - If a container's port is mapped for both `tcp` and `udp`, two separate - entries are added to the mapping table. + 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: @@ -1091,7 +1580,6 @@ definitions: PortBinding represents a binding between a host IP address and a host port. type: "object" - x-nullable: true properties: HostIp: description: "Host IP address that the container's port is mapped to." @@ -1103,107 +1591,242 @@ definitions: example: "4443" GraphDriverData: - description: "Information about a container's graph driver." + 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" + } - Image: + 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" - required: - - Id - - Parent - - Comment - - Created - - Container - - DockerVersion - - Author - - Architecture - - Os - - Size - - VirtualSize - - GraphDriver - - RootFS 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. type: "string" x-nullable: false + example: "2022-02-04T21:20:12.497794809Z" Container: + description: | + The ID of the container that was used to create the image. + + Depending on how the image was created, this field may be empty. type: "string" x-nullable: false + example: "65974bc86f1770ae4bff79f651ebdbce166ae9aada632ee3fa9af3a264911735" ContainerConfig: $ref: "#/definitions/ContainerConfig" 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: "20.10.7" 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/ContainerConfig" 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. + + In versions of Docker before v1.10, this field was calculated from + the image itself and all of its parent images. Images are now stored + self-contained, and no longer use a parent-chain, making this field + an equivalent of the Size field. + + > **Deprecated**: this field is kept for backward compatibility, but + > will be removed in API v1.44. type: "integer" format: "int64" - x-nullable: false + example: 1239828 GraphDriver: $ref: "#/definitions/GraphDriverData" 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" - BaseLayer: - 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" required: @@ -1214,46 +1837,122 @@ definitions: - Created - Size - SharedSize - - VirtualSize - 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 sinds 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. + + In versions of Docker before v1.10, this field was calculated from + the image itself and all of its parent images. Images are now stored + self-contained, and no longer use a parent-chain, making this field + an equivalent of the Size field. + + Deprecated: this field is kept for backward compatibility, and will be removed in API v1.44. type: "integer" - x-nullable: false + 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 AuthConfig: type: "object" @@ -1295,18 +1994,22 @@ definitions: 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: | @@ -1318,26 +2021,42 @@ definitions: 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." + 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." + 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 @@ -1345,6 +2064,7 @@ definitions: properties: Size: type: "integer" + format: "int64" default: -1 description: | Amount of disk space used by the volume (in bytes). This information @@ -1354,23 +2074,71 @@ definitions: 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 - example: - Name: "tardis" - Driver: "custom" - Mountpoint: "/var/lib/docker/volumes/tardis" - Status: - hello: "world" + 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: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Scope: "local" - CreatedAt: "2016-06-07T20:31:11.853781916Z" + 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" @@ -1450,19 +2218,34 @@ definitions: type: "string" default: "default" Config: - description: "List of IPAM configuration options, specified as a map: `{\"Subnet\": , \"IPRange\": , \"Gateway\": , \"AuxAddress\": }`" + description: | + List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": , "IPRange": , "Gateway": , "AuxAddress": } + ``` type: "array" items: - type: "object" - additionalProperties: - type: "string" + $ref: "#/definitions/IPAMConfig" Options: description: "Driver-specific options, specified as a map." - type: "array" - items: - type: "object" - additionalProperties: - type: "string" + type: "object" + additionalProperties: + type: "string" + + IPAMConfig: + type: "object" + properties: + Subnet: + type: "string" + IPRange: + type: "string" + Gateway: + type: "string" + AuxiliaryAddresses: + type: "object" + additionalProperties: + type: "string" NetworkContainer: type: "object" @@ -1498,6 +2281,84 @@ definitions: 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" @@ -1514,6 +2375,8 @@ definitions: type: "string" error: type: "string" + errorDetail: + $ref: "#/definitions/ErrorDetail" status: type: "string" progress: @@ -1760,6 +2623,25 @@ definitions: 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" @@ -1773,7 +2655,9 @@ definitions: 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." + description: + True if the plugin is running. False if the plugin is not running, + only installed. type: "boolean" x-nullable: false example: true @@ -1837,7 +2721,7 @@ definitions: Documentation: type: "string" x-nullable: false - example: "https://docs.docker.com/engine/extend/plugins/" + example: "/engine/extend/plugins/" Interface: description: "The interface between Docker and the plugin" x-nullable: false @@ -1854,6 +2738,13 @@ definitions: 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: @@ -1968,13 +2859,16 @@ definitions: 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. + 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: @@ -2143,17 +3037,23 @@ definitions: Name: "vieux/sshfs:latest" TLSInfo: - description: "Information about the issuer of leaf TLS certificates and the trusted root CA certificate" + 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" + 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" + 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" + description: | + The base64-url-safe-encoded raw public key bytes of the issuer. type: "string" example: TrustRoot: | @@ -2249,7 +3149,9 @@ definitions: 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." + 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 @@ -2263,26 +3165,34 @@ definitions: format: "uint64" example: 10000 KeepOldSnapshots: - description: "The number of snapshots to keep beyond the current snapshot." + 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." + 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`. + 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. + 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. + 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. + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. type: "integer" example: 1 Dispatcher: @@ -2291,7 +3201,8 @@ definitions: x-nullable: true properties: HeartbeatPeriod: - description: "The delay for an agent to send a heartbeat to the dispatcher." + description: | + The delay for an agent to send a heartbeat to the dispatcher. type: "integer" format: "int64" example: 5000000000 @@ -2306,36 +3217,53 @@ definitions: format: "int64" example: 7776000000000000 ExternalCAs: - description: "Configuration for forwarding signing requests to an external certificate authority." + 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)." + 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." + 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." + 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)." + 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." + 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." + 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`" + 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: @@ -2343,7 +3271,9 @@ definitions: type: "object" properties: AutoLockManagers: - description: "If set, generate a key and use it to lock data stored on the managers." + description: | + If set, generate a key and use it to lock data stored on the + managers. type: "boolean" example: false TaskDefaults: @@ -2409,9 +3339,37 @@ definitions: TLSInfo: $ref: "#/definitions/TLSInfo" RootRotationInProgress: - description: "Whether there is currently a root CA rotation in progress for the swarm" + 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: | @@ -2444,7 +3402,15 @@ definitions: properties: PluginSpec: type: "object" - description: "Invalid when specified with `ContainerSpec`. *(Experimental release only.)*" + 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." @@ -2458,20 +3424,18 @@ definitions: PluginPrivilege: type: "array" items: - description: "Describes a permission accepted by the user upon installing the plugin." - type: "object" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" + $ref: "#/definitions/PluginPrivilege" ContainerSpec: type: "object" - description: "Invalid when specified with `PluginSpec`." + 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" @@ -2492,10 +3456,13 @@ definitions: items: type: "string" Hostname: - description: "The hostname to use for the container, as a valid RFC 1123 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`." + description: | + A list of environment variables in the form `VAR=value`. type: "array" items: type: "string" @@ -2507,7 +3474,8 @@ definitions: type: "string" Groups: type: "array" - description: "A list of additional groups that the container process will run as." + description: | + A list of additional groups that the container process will run as. items: type: "string" Privileges: @@ -2518,30 +3486,48 @@ definitions: 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. + 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`. + For example, specifying `spec.json` loads + `C:\ProgramData\Docker\CredentialSpecs\spec.json`.


- > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive. + > **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: + 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` and `CredentialSpec.Registry` are mutually exclusive. + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. SELinuxContext: type: "object" description: "SELinux labels of the container" @@ -2571,7 +3557,9 @@ definitions: 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." + description: | + Specification for mounts to be added to containers created as part + of the service. type: "array" items: $ref: "#/definitions/Mount" @@ -2579,7 +3567,9 @@ definitions: description: "Signal to stop the container." type: "string" StopGracePeriod: - description: "Amount of time to wait for the container to terminate before forcefully killing it." + description: | + Amount of time to wait for the container to terminate before + forcefully killing it. type: "integer" format: "int64" HealthCheck: @@ -2596,7 +3586,9 @@ definitions: items: type: "string" DNSConfig: - description: "Specification for DNS related configurations in resolver configuration file (`resolv.conf`)." + description: | + Specification for DNS related configurations in resolver configuration + file (`resolv.conf`). type: "object" properties: Nameservers: @@ -2610,22 +3602,28 @@ definitions: items: type: "string" Options: - description: "A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.)." + 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." + 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." + 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." + description: | + Name represents the final filename in the filesystem. type: "string" UID: description: "UID represents the file UID." @@ -2638,25 +3636,36 @@ definitions: type: "integer" format: "uint32" SecretID: - description: "SecretID represents the ID of the specific secret that we're referencing." + 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. + 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" Configs: - description: "Configs contains references to zero or more configs that will be exposed to the service." + 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." + 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." + description: | + Name represents the final filename in the filesystem. type: "string" UID: description: "UID represents the file UID." @@ -2668,33 +3677,125 @@ definitions: description: "Mode represents the FileMode of the file." type: "integer" format: "uint32" - ConfigID: - description: "ConfigID represents the ID of the specific config that we're referencing." + 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. + 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)" + 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." + 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/ResourceObject" - Reservation: + $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." + description: | + Specification for the restart policy which applies to containers + created as part of this service. type: "object" properties: Condition: @@ -2709,12 +3810,16 @@ definitions: type: "integer" format: "int64" MaxAttempts: - description: "Maximum attempts to restart a given container before giving up (default value is 0, which is ignored)." + 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)." + 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 @@ -2722,7 +3827,27 @@ definitions: type: "object" properties: Constraints: - description: "An array of 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-14.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" @@ -2730,8 +3855,13 @@ definitions: - "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." + 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" @@ -2740,13 +3870,21 @@ definitions: type: "object" properties: SpreadDescriptor: - description: "label descriptor, such as engine.labels.az" + 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 @@ -2757,24 +3895,24 @@ definitions: items: $ref: "#/definitions/Platform" ForceUpdate: - description: "A counter that triggers an update even if no relevant parameters have been changed." + 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." + 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: - type: "object" - properties: - Target: - type: "string" - Aliases: - type: "array" - items: - type: "string" + $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." + 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: @@ -2800,6 +3938,8 @@ definitions: - "shutdown" - "failed" - "rejected" + - "remove" + - "orphaned" Task: type: "object" @@ -2858,6 +3998,12 @@ definitions: type: "integer" 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: @@ -2927,6 +4073,7 @@ definitions: ServiceSpec: description: "User modifiable configuration for a service." + type: object properties: Name: description: "Name of the service." @@ -2950,12 +4097,37 @@ definitions: 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)." + description: | + Maximum number of tasks to be updated in one iteration (0 means + unlimited parallelism). type: "integer" format: "int64" Delay: @@ -2963,22 +4135,32 @@ definitions: type: "integer" format: "int64" FailureAction: - description: "Action to take if an updated task fails to run, or stops running during the update." + 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." + 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." + 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." + 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" @@ -2988,45 +4170,52 @@ definitions: type: "object" properties: Parallelism: - description: "Maximum number of tasks to be rolled back in one iteration (0 means unlimited 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." + 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." + 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." + 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." + 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." + 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: "Array of network names or IDs to attach the service to." + description: "Specifies which networks the service should attach to." type: "array" items: - type: "object" - properties: - Target: - type: "string" - Aliases: - type: "array" - items: - type: "string" + $ref: "#/definitions/NetworkAttachmentConfig" + EndpointSpec: $ref: "#/definitions/EndpointSpec" @@ -3040,6 +4229,7 @@ definitions: enum: - "tcp" - "udp" + - "sctp" TargetPort: description: "The port inside the container." type: "integer" @@ -3052,7 +4242,7 @@ definitions:


- - "ingress" makes the target port accessible on on every node, + - "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 @@ -3070,14 +4260,17 @@ definitions: type: "object" properties: Mode: - description: "The mode of resolution to use for internal load balancing between tasks." + 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." + 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" @@ -3133,6 +4326,61 @@ definitions: 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: @@ -3217,73 +4465,71 @@ definitions: Warning: "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" ContainerSummary: - type: "array" - items: - 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: "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" - Command: - description: "Command to run when starting the container" + 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" - 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: + 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" - 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" - 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/Mount" + 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)." @@ -3321,7 +4567,7 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)) + 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 @@ -3329,7 +4575,16 @@ definitions: type: "string" example: "" Driver: - description: "Name of the secrets driver used to fetch the secret's value from an external secret store" + 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: @@ -3364,9 +4619,16 @@ definitions: type: "string" Data: description: | - Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)) + 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" @@ -3384,6 +4646,212 @@ definitions: 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: "19.03.12" + 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: "19.03.12" + ApiVersion: + description: | + The default (and highest) API version that is supported by the daemon + type: "string" + example: "1.40" + MinAPIVersion: + description: | + The minimum API version that is supported by the daemon + type: "string" + example: "1.12" + 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.13.14" + 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: "4.19.76-linuxkit" + 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: @@ -3458,44 +4926,6 @@ definitions: on Windows. type: "string" example: "/var/lib/docker" - SystemStatus: - description: | - Status information about this node (standalone Swarm API). - -


- - > **Note**: The information returned in this field is only propagated - > by the Swarm standalone API, and is empty (`null`) when using - > built-in swarm mode. - type: "array" - items: - type: "array" - items: - type: "string" - example: - - ["Role", "primary"] - - ["State", "Healthy"] - - ["Strategy", "spread"] - - ["Filters", "health, port, containerslots, dependency, affinity, constraint, whitelist"] - - ["Nodes", "2"] - - [" swarm-agent-00", "192.168.99.102:2376"] - - [" └ ID", "5CT6:FBGO:RVGO:CZL4:PB2K:WCYN:2JSV:KSHH:GGFW:QOPG:6J5Q:IOZ2|192.168.99.102:2376"] - - [" └ Status", "Healthy"] - - [" └ Containers", "1 (1 Running, 0 Paused, 0 Stopped)"] - - [" └ Reserved CPUs", "0 / 1"] - - [" └ Reserved Memory", "0 B / 1.021 GiB"] - - [" └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"] - - [" └ UpdatedAt", "2017-08-09T10:03:46Z"] - - [" └ ServerVersion", "17.06.0-ce"] - - [" swarm-manager", "192.168.99.101:2376"] - - [" └ ID", "TAMD:7LL3:SEF7:LW2W:4Q2X:WVFH:RTXX:JSYS:XY2P:JEHL:ZMJK:JGIW|192.168.99.101:2376"] - - [" └ Status", "Healthy"] - - [" └ Containers", "2 (2 Running, 0 Paused, 0 Stopped)"] - - [" └ Reserved CPUs", "0 / 1"] - - [" └ Reserved Memory", "0 B / 1.021 GiB"] - - [" └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"] - - [" └ UpdatedAt", "2017-08-09T10:04:11Z"] - - [" └ ServerVersion", "17.06.0-ce"] Plugins: $ref: "#/definitions/PluginsInfo" MemoryLimit: @@ -3506,20 +4936,30 @@ definitions: description: "Indicates if the host has memory swap limit support enabled." type: "boolean" example: true - KernelMemory: - description: "Indicates if the host has kernel memory limit support enabled." + 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." + 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." + 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." + description: | + Indicates if CPU Shares limiting is supported by the host. type: "boolean" example: true CPUSet: @@ -3529,6 +4969,10 @@ definitions: 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" @@ -3545,7 +4989,9 @@ definitions: type: "boolean" example: true Debug: - description: "Indicates if the daemon is running in debug-mode / with debug-level logging enabled." + description: | + Indicates if the daemon is running in debug-mode / with debug-level + logging enabled. type: "boolean" example: true NFd: @@ -3576,9 +5022,16 @@ definitions: description: | The driver to use for managing cgroups. type: "string" - enum: ["cgroupfs", "systemd"] + 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" @@ -3598,6 +5051,17 @@ definitions: or "Windows Server 2016 Datacenter" type: "string" example: "Alpine Linux v3.5" + 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: "16.04" OSType: description: | Generic type of the operating system of the host, as returned by the @@ -3626,7 +5090,7 @@ definitions: example: 4 MemTotal: description: | - Total amount of physical memory available on the host, in kilobytes (kB). + Total amount of physical memory available on the host, in bytes. type: "integer" format: "int64" example: 2095882240 @@ -3646,18 +5110,22 @@ definitions: 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://user:pass@proxy.corp.example.com:8080" + 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://user:pass@proxy.corp.example.com:4443" + example: "https://xxxxx:xxxxx@proxy.corp.example.com:4443" NoProxy: description: | Comma-separated list of domain extensions for which no proxy should be @@ -3694,42 +5162,8 @@ definitions: ServerVersion: description: | Version string of the daemon. - - > **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/) - > returns the Swarm version instead of the daemon version, for example - > `swarm/1.2.8`. - type: "string" - example: "17.06.0-ce" - ClusterStore: - description: | - URL of the distributed storage backend. - - - The storage backend is used for multihost networking (to store - network and endpoint information) and by the node discovery mechanism. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - type: "string" - example: "consul://consul.corp.example.com:8600/some/path" - ClusterAdvertise: - description: | - The network endpoint that the Engine advertises for the purpose of - node discovery. ClusterAdvertise is a `host:port` combination on which - the daemon is reachable by other hosts. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. type: "string" - example: "node5.corp.example.com:8000" + example: "24.0.2" Runtimes: description: | List of [OCI compliant](https://github.com/opencontainers/runtime-spec) @@ -3747,10 +5181,10 @@ definitions: $ref: "#/definitions/Runtime" default: runc: - path: "docker-runc" + path: "runc" example: runc: - path: "docker-runc" + path: "runc" runc-master: path: "/go/bin/runc" custom: @@ -3792,7 +5226,7 @@ definitions: - "process" InitBinary: description: | - Name and, optional, path of the the `docker-init` binary. + 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. @@ -3806,20 +5240,62 @@ definitions: $ref: "#/definitions/Commit" SecurityOptions: description: | - List of security features that are enabled on the daemon, such as - apparmor, seccomp, SELinux, and user-namespaces (userns). + 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. - Additional configuration options for each security feature may - be present, and are included as a comma-separated list of key/value - pairs. + These messages can be printed by the client as information to the user. type: "array" items: type: "string" example: - - "name=apparmor" - - "name=seccomp,profile=default" - - "name=selinux" - - "name=userns" + - "WARNING: No memory limit support" + - "WARNING: bridge-nf-call-iptables is disabled" + - "WARNING: bridge-nf-call-ip6tables is disabled" # PluginsInfo is a temp struct holding Plugins name @@ -4010,7 +5486,7 @@ definitions: - "https://registry-3.docker.io/" Secure: description: | - Indicates if the the registry is part of the list of insecure + Indicates if the registry is part of the list of insecure registries. If `false`, the registry is insecure. Insecure registries accept @@ -4143,6 +5619,7 @@ definitions: PeerNode: description: "Represents a peer-node in the swarm" + type: "object" properties: NodeID: description: "Unique identifier of for this node in the swarm." @@ -4152,37 +5629,457 @@ definitions: 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" + paths: /containers/json: get: summary: "List containers" description: | - Returns a list of containers. For details on the format, see [the inspect endpoint](#operation/ContainerInspect). + 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 . + 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" + 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." + 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`." + 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: + 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 ``) @@ -4204,7 +6101,9 @@ paths: 200: description: "no error" schema: - $ref: "#/definitions/ContainerSummary" + type: "array" + items: + $ref: "#/definitions/ContainerSummary" examples: application/json: - Id: "8dfafdbc3a40" @@ -4353,9 +6252,33 @@ paths: parameters: - name: "name" in: "query" - description: "Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`." + 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" - pattern: "/?[a-zA-Z0-9_-]+" + default: "" - name: "body" in: "body" description: "Container to create" @@ -4367,14 +6290,7 @@ paths: HostConfig: $ref: "#/definitions/HostConfig" NetworkingConfig: - description: "This container's networking configuration." - type: "object" - properties: - EndpointsConfig: - description: "A mapping of network name to endpoint configuration for that network." - type: "object" - additionalProperties: - $ref: "#/definitions/EndpointSettings" + $ref: "#/definitions/NetworkingConfig" example: Hostname: "" Domainname: "" @@ -4413,8 +6329,7 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 - NanoCPUs: 500000 + NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 CpuPeriod: 100000 @@ -4436,11 +6351,19 @@ paths: - {} 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: -1 + PidsLimit: 0 PortBindings: 22/tcp: - HostPort: "11022" @@ -4499,36 +6422,18 @@ paths: 201: description: "Container created successfully" schema: - type: "object" - title: "ContainerCreateResponse" - description: "OK response to ContainerCreate operation" - required: [Id, Warnings] - properties: - Id: - description: "The ID of the created container" - type: "string" - x-nullable: false - Warnings: - description: "Warnings encountered when creating the container" - type: "array" - x-nullable: false - items: - type: "string" - examples: - application/json: - Id: "e90e34656806" - Warnings: [] + $ref: "#/definitions/ContainerCreateResponse" 400: description: "bad parameter" schema: $ref: "#/definitions/ErrorResponse" 404: - description: "no such container" + description: "no such image" schema: $ref: "#/definitions/ErrorResponse" examples: application/json: - message: "No such container: c2ada9df5af8" + message: "No such image: c2ada9df5af8" 409: description: "conflict" schema: @@ -4567,54 +6472,9 @@ paths: items: type: "string" State: - description: "The state of the container." - type: "object" - properties: - Status: - description: | - The status of the container. For example, `"running"` or `"exited"`. - type: "string" - enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] - 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 cgroups freezer 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" - Paused: - description: "Whether this container is paused." - type: "boolean" - Restarting: - description: "Whether this container is restarting." - type: "boolean" - OOMKilled: - description: "Whether this container has been killed because it ran out of memory." - type: "boolean" - Dead: - type: "boolean" - Pid: - description: "The process ID of this container" - type: "integer" - ExitCode: - description: "The last exit code of this container" - type: "integer" - Error: - type: "string" - StartedAt: - description: "The time when this container was last started." - type: "string" - FinishedAt: - description: "The time when this container last exited." - type: "string" + $ref: "#/definitions/ContainerState" Image: - description: "The container's image" + description: "The container's image ID" type: "string" ResolvConfPath: type: "string" @@ -4624,15 +6484,14 @@ paths: type: "string" LogPath: type: "string" - Node: - description: "TODO" - type: "object" Name: type: "string" RestartCount: type: "integer" Driver: type: "string" + Platform: + type: "string" MountLabel: type: "string" ProcessLabel: @@ -4640,13 +6499,19 @@ paths: AppArmorProfile: type: "string" ExecIDs: - type: "string" + 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/GraphDriverData" SizeRw: - description: "The size of files that have been created or changed by this container." + description: | + The size of files that have been created or changed by this + container. type: "integer" format: "int64" SizeRootFs: @@ -4678,6 +6543,8 @@ paths: 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: @@ -4697,6 +6564,9 @@ paths: StopTimeout: 10 Created: "2015-01-06T15:47:31.485331387Z" Driver: "devicemapper" + ExecIDs: + - "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca" + - "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" HostConfig: MaximumIOps: 0 MaximumIOBps: 0 @@ -4720,12 +6590,18 @@ paths: 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: "" - LxcConf: [] Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 OomKillDisable: false OomScoreAdj: 500 NetworkMode: "bridge" @@ -4786,6 +6662,14 @@ paths: 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 @@ -4828,7 +6712,9 @@ paths: /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." + description: | + On Unix systems, this is done by running the `ps` command. This endpoint + is not supported on Windows. operationId: "ContainerTop" responses: 200: @@ -4844,7 +6730,9 @@ paths: items: type: "string" Processes: - description: "Each process running in the container, where each is process is an array of values corresponding to the titles" + 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" @@ -4909,18 +6797,22 @@ paths: description: | Get `stdout` and `stderr` logs from a container. - Note: This endpoint works only for containers with the `json-file` or `journald` logging driver. - operationId: "ContainerLogs" - responses: - 101: - description: "logs returned as a stream" - schema: - type: "string" - format: "binary" + 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 string in response body" + 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: @@ -4940,10 +6832,7 @@ paths: type: "string" - name: "follow" in: "query" - description: | - Return the logs as a stream. - - This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). + description: "Keep connection after returning logs." type: "boolean" default: false - name: "stdout" @@ -4973,7 +6862,9 @@ paths: 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." + 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"] @@ -4984,9 +6875,9 @@ paths: Returns which files in a container's filesystem have been added, deleted, or modified. The `Kind` of modification can be one of: - - `0`: Modified - - `1`: Added - - `2`: Deleted + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") operationId: "ContainerChanges" produces: ["application/json"] responses: @@ -4995,22 +6886,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: "ContainerChangeResponseItem" - title: "ContainerChangeResponseItem" - description: "change item in response to ContainerChanges operation" - required: [Path, Kind] - properties: - Path: - description: "Path to file that has changed" - type: "string" - x-nullable: false - Kind: - description: "Kind of change" - type: "integer" - format: "uint8" - enum: [0, 1, 2] - x-nullable: false + $ref: "#/definitions/FilesystemChange" examples: application/json: - Path: "/dev" @@ -5072,13 +6948,29 @@ paths: This endpoint returns a live stream of a container’s resource usage statistics. - The `precpu_stats` is the CPU statistic of last read, which is used - for calculating the CPU usage percentage. It is not the same as the - `cpu_stats` field. + 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 = `lenght(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: @@ -5197,14 +7089,23 @@ paths: type: "string" - name: "stream" in: "query" - description: "Stream the output. If false, the stats will be output once and then it will disconnect." + 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. You must restart the container for the resize to take effect." + description: "Resize the TTY for a container." operationId: "ContainerResize" consumes: - "application/octet-stream" @@ -5232,11 +7133,11 @@ paths: type: "string" - name: "h" in: "query" - description: "Height of the tty session in characters" + description: "Height of the TTY session in characters" type: "integer" - name: "w" in: "query" - description: "Width of the tty session in characters" + description: "Width of the TTY session in characters" type: "integer" tags: ["Container"] /containers/{id}/start: @@ -5248,8 +7149,6 @@ paths: description: "no error" 304: description: "container already started" - schema: - $ref: "#/definitions/ErrorResponse" 404: description: "no such container" schema: @@ -5269,7 +7168,10 @@ paths: 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 `_`." + 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: @@ -5281,8 +7183,6 @@ paths: description: "no error" 304: description: "container already stopped" - schema: - $ref: "#/definitions/ErrorResponse" 404: description: "no such container" schema: @@ -5300,6 +7200,11 @@ paths: 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" @@ -5329,6 +7234,11 @@ paths: 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" @@ -5337,7 +7247,9 @@ paths: /containers/{id}/kill: post: summary: "Kill a container" - description: "Send a POSIX signal to a container, defaulting to killing to the container." + description: | + Send a POSIX signal to a container, defaulting to killing to the + container. operationId: "ContainerKill" responses: 204: @@ -5349,6 +7261,13 @@ paths: 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: @@ -5361,14 +7280,17 @@ paths: type: "string" - name: "signal" in: "query" - description: "Signal to send to the container as an integer or string (e.g. `SIGINT`)" + 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." + description: | + Change various configuration options of a container without having to + recreate it. operationId: "ContainerUpdate" consumes: ["application/json"] produces: ["application/json"] @@ -5423,7 +7345,6 @@ paths: Memory: 314572800 MemorySwap: 514288000 MemoryReservation: 209715200 - KernelMemory: 52428800 RestartPolicy: MaximumRetryCount: 4 Name: "on-failure" @@ -5466,9 +7387,12 @@ paths: post: summary: "Pause a container" description: | - Use the cgroups freezer to suspend all processes in a container. + 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 cgroups freezer the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed. + 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: @@ -5521,15 +7445,20 @@ paths: 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. + 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. + 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. + See the [documentation for the `docker attach` command](/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 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: @@ -5540,9 +7469,11 @@ paths: [STREAM] ``` - After the headers and two new lines, the TCP connection can now be used for raw, bidirectional communication between the client and server. + 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. + 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: @@ -5552,7 +7483,8 @@ paths: Connection: Upgrade ``` - The Docker daemon will respond with a `101 UPGRADED` response, and will similarly follow with the raw stream: + The Docker daemon will respond with a `101 UPGRADED` response, and will + similarly follow with the raw stream: ``` HTTP/1.1 101 UPGRADED @@ -5565,9 +7497,15 @@ paths: ### Stream format - When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), 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. + 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`). + 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: @@ -5581,9 +7519,11 @@ paths: - 1: `stdout` - 2: `stderr` - `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size encoded as big endian. + `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`. + 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: @@ -5595,11 +7535,15 @@ paths: ### 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`. + 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" @@ -5628,21 +7572,28 @@ paths: 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 `_`." + 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. + 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. + 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" + description: | + Stream attached streams from the time the request was made onwards. type: "boolean" default: false - name: "stdin" @@ -5693,7 +7644,10 @@ paths: 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 `_`." + 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" @@ -5731,22 +7685,11 @@ paths: 200: description: "The container has exit." schema: - type: "object" - title: "ContainerWaitResponse" - description: "OK response to ContainerWait operation" - required: [StatusCode] - properties: - StatusCode: - description: "Exit code of the container" - type: "integer" - x-nullable: false - Error: - description: "container waiting error, if any" - type: "object" - properties: - Message: - description: "Details of an error" - type: "string" + $ref: "#/definitions/ContainerWaitResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" 404: description: "no such container" schema: @@ -5766,8 +7709,15 @@ paths: type: "string" - name: "condition" in: "query" - description: "Wait until a container state reaches the given condition, either 'not-running' (default), 'next-exit', or 'removed'." + 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}: @@ -5794,7 +7744,9 @@ paths: $ref: "#/definitions/ErrorResponse" examples: application/json: - message: "You cannot remove a running container: c2ada9df5af8. Stop the container before attempting removal or force remove" + message: | + You cannot remove a running container: c2ada9df5af8. Stop the + container before attempting removal or force remove 500: description: "server error" schema: @@ -5807,7 +7759,7 @@ paths: type: "string" - name: "v" in: "query" - description: "Remove the volumes associated with the container." + description: "Remove anonymous volumes associated with the container." type: "boolean" default: false - name: "force" @@ -5824,7 +7776,10 @@ paths: /containers/{id}/archive: head: summary: "Get information about files in a container" - description: "A response header `X-Docker-Container-Path-Stat` is return containing a base64 - encoded JSON object with some filesystem header information about the path." + 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: @@ -5832,18 +7787,13 @@ paths: headers: X-Docker-Container-Path-Stat: type: "string" - description: "TODO" + description: | + A base64 - encoded JSON object with some filesystem header + information about the path 400: description: "Bad parameter" schema: - allOf: - - $ref: "#/definitions/ErrorResponse" - - type: "object" - properties: - message: - description: "The error message. Either \"must specify path parameter\" (path cannot be empty) or \"not a directory\" (path was asserted to be a directory but exists as a file)." - type: "string" - x-nullable: false + $ref: "#/definitions/ErrorResponse" 404: description: "Container or path does not exist" schema: @@ -5878,14 +7828,7 @@ paths: 400: description: "Bad parameter" schema: - allOf: - - $ref: "#/definitions/ErrorResponse" - - type: "object" - properties: - message: - description: "The error message. Either \"must specify path parameter\" (path cannot be empty) or \"not a directory\" (path was asserted to be a directory but exists as a file)." - type: "string" - x-nullable: false + $ref: "#/definitions/ErrorResponse" 404: description: "Container or path does not exist" schema: @@ -5911,7 +7854,10 @@ paths: 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." + 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: @@ -5921,6 +7867,9 @@ paths: 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: @@ -5949,14 +7898,27 @@ paths: 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." + 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, xz." + 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: @@ -6009,35 +7971,6 @@ paths: type: "array" items: $ref: "#/definitions/ImageSummary" - examples: - application/json: - - Id: "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" - ParentId: "" - RepoTags: - - "ubuntu:12.04" - - "ubuntu:precise" - RepoDigests: - - "ubuntu@sha256:992069aee4016783df6345315302fa59681aae51a8eeb2f889dea59290f21787" - Created: 1474925151 - Size: 103579269 - VirtualSize: 103579269 - SharedSize: 0 - Labels: {} - Containers: 2 - - Id: "sha256:3e314f95dcace0f5e4fd37b10862fe8398e3c60ed36600bc0ca5fda78b087175" - ParentId: "" - RepoTags: - - "ubuntu:12.10" - - "ubuntu:quantal" - RepoDigests: - - "ubuntu@sha256:002fba3e3255af10be97ea26e476692a7ebed0bb074a9ab960b2e7a1526b15d7" - - "ubuntu@sha256:68ea0200f0b90df725d99d823905b04cf844f6039ef60c60bf3e019915017bd3" - Created: 1403128455 - Size: 172064416 - VirtualSize: 172064416 - SharedSize: 0 - Labels: {} - Containers: 5 500: description: "server error" schema: @@ -6051,7 +7984,10 @@ paths: - name: "filters" in: "query" description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: + A JSON encoded value of the filters (a `map[string][]string`) to + process on the images list. + + Available filters: - `before`=(`[:]`, `` or ``) - `dangling=true` @@ -6059,6 +7995,11 @@ paths: - `reference`=(`[:]`) - `since`=(`[:]`, `` or ``) 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." @@ -6071,7 +8012,7 @@ paths: 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 `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](/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. @@ -6159,7 +8100,18 @@ paths: 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. [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)" + 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.](/engine/reference/builder/#arg) type: "string" - name: "shmsize" in: "query" @@ -6175,7 +8127,11 @@ paths: 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 to which this container should connect to." + 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" @@ -6210,6 +8166,16 @@ paths: 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: "" responses: 200: description: "no error" @@ -6228,6 +8194,33 @@ paths: 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" @@ -6235,6 +8228,11 @@ paths: 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" @@ -6282,6 +8280,10 @@ paths: 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" @@ -6290,11 +8292,42 @@ paths: required: false - name: "X-Registry-Auth" in: "header" - description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)" + 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]]" + 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"] @@ -6309,84 +8342,7 @@ paths: 200: description: "No error" schema: - $ref: "#/definitions/Image" - examples: - application/json: - Id: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" - Container: "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a" - Comment: "" - Os: "linux" - Architecture: "amd64" - Parent: "sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c" - ContainerConfig: - Tty: false - Hostname: "e611e15f9c9d" - Domainname: "" - AttachStdout: false - PublishService: "" - AttachStdin: false - OpenStdin: false - StdinOnce: false - NetworkDisabled: false - OnBuild: [] - Image: "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c" - User: "" - WorkingDir: "" - MacAddress: "" - AttachStderr: false - Labels: - com.example.license: "GPL" - com.example.version: "1.0" - com.example.vendor: "Acme" - Env: - - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - Cmd: - - "/bin/sh" - - "-c" - - "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0" - DockerVersion: "1.9.0-dev" - VirtualSize: 188359297 - Size: 0 - Author: "" - Created: "2015-09-10T08:30:53.26995814Z" - GraphDriver: - Name: "aufs" - Data: {} - RepoDigests: - - "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" - RepoTags: - - "example:1.0" - - "example:latest" - - "example:stable" - Config: - Image: "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c" - NetworkDisabled: false - OnBuild: [] - StdinOnce: false - PublishService: "" - AttachStdin: false - OpenStdin: false - Domainname: "" - AttachStdout: false - Tty: false - Hostname: "e611e15f9c9d" - Cmd: - - "/bin/bash" - Env: - - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - Labels: - com.example.vendor: "Acme" - com.example.version: "1.0" - com.example.license: "GPL" - MacAddress: "" - AttachStderr: false - WorkingDir: "" - User: "" - RootFS: - Type: "layers" - Layers: - - "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6" - - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + $ref: "#/definitions/ImageInspect" 404: description: "No such image" schema: @@ -6489,7 +8445,9 @@ paths: 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`. + 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" @@ -6518,7 +8476,11 @@ paths: type: "string" - name: "X-Registry-Auth" in: "header" - description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. type: "string" required: true tags: ["Image"] @@ -6722,7 +8684,9 @@ paths: /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." + 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"] @@ -6748,6 +8712,10 @@ paths: IdentityToken: "9cbaf023786cd7..." 204: description: "No error" + 401: + description: "Auth error" + schema: + $ref: "#/definitions/ErrorResponse" 500: description: "Server error" schema: @@ -6785,63 +8753,7 @@ paths: 200: description: "no error" schema: - type: "object" - title: "SystemVersionResponse" - properties: - Platform: - type: "object" - required: [Name] - properties: - Name: - type: "string" - Components: - type: "array" - items: - type: "object" - x-go-name: ComponentVersion - required: [Name, Version] - properties: - Name: - type: "string" - Version: - type: "string" - x-nullable: false - Details: - type: "object" - x-nullable: true - - Version: - type: "string" - ApiVersion: - type: "string" - MinAPIVersion: - type: "string" - GitCommit: - type: "string" - GoVersion: - type: "string" - Os: - type: "string" - Arch: - type: "string" - KernelVersion: - type: "string" - Experimental: - type: "boolean" - BuildTime: - type: "string" - examples: - application/json: - Version: "17.04.0" - Os: "linux" - KernelVersion: "3.19.0-23-generic" - GoVersion: "go1.7.5" - GitCommit: "deadbee" - Arch: "amd64" - ApiVersion: "1.27" - MinAPIVersion: "1.12" - BuildTime: "2016-06-14T07:09:13.444803460+00:00" - Experimental: true + $ref: "#/definitions/SystemVersion" 500: description: "server error" schema: @@ -6863,9 +8775,81 @@ paths: 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: @@ -6939,13 +8923,13 @@ paths: 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`, and `update` + 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: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, and `untag` + Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` - Volumes report these events: `create`, `mount`, `unmount`, and `destroy` + Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` - Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, and `remove` + Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` The Docker daemon reports these events: `reload` @@ -6957,6 +8941,8 @@ paths: Configs report these events: `create`, `update`, and `remove` + The Builder reports `prune` events + operationId: "SystemEvents" produces: - "application/json" @@ -6964,44 +8950,7 @@ paths: 200: description: "no error" schema: - type: "object" - title: "SystemEventsResponse" - properties: - Type: - description: "The type of object emitting the event" - type: "string" - Action: - description: "The type of event" - type: "string" - Actor: - type: "object" - properties: - ID: - description: "The ID of the object emitting the event" - type: "string" - Attributes: - description: "Various key/value attributes of the object, depending on its type" - type: "object" - additionalProperties: - type: "string" - time: - description: "Timestamp of event" - type: "integer" - timeNano: - description: "Timestamp of event, with nanosecond accuracy" - type: "integer" - format: "int64" - examples: - application/json: - Type: "container" - Action: "create" - Actor: - ID: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" - Attributes: - com.example.some-label: "some-label-value" - image: "alpine" - name: "my-container" - time: 1461943101 + $ref: "#/definitions/EventMessage" 400: description: "bad parameter" schema: @@ -7066,6 +9015,10 @@ paths: type: "array" items: $ref: "#/definitions/Volume" + BuildCache: + type: "array" + items: + $ref: "#/definitions/BuildCache" example: LayersSize: 1092588 Images: @@ -7125,10 +9078,43 @@ paths: 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: @@ -7181,11 +9167,16 @@ paths: get: summary: "Export several images" description: | - Get a tarball containing all images and metadata for several image repositories. + 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 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). + For details on the format, see the [export image endpoint](#operation/ImageGet). operationId: "ImageGetAll" produces: - "application/x-tar" @@ -7213,7 +9204,7 @@ paths: description: | Load a set of images and tags into a repository. - For details on the format, see [the export image endpoint](#operation/ImageGet). + For details on the format, see the [export image endpoint](#operation/ImageGet). operationId: "ImageLoad" consumes: - "application/x-tar" @@ -7274,6 +9265,7 @@ paths: description: "Exec configuration" schema: type: "object" + title: "ExecConfig" properties: AttachStdin: type: "boolean" @@ -7284,14 +9276,27 @@ paths: 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 `_`." + 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\", ...]`." + description: | + A list of environment variables in the form `["VAR=value", ...]`. type: "array" items: type: "string" @@ -7306,10 +9311,14 @@ paths: 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`." + 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." + description: | + The working directory for the exec process inside the container. example: AttachStdin: false AttachStdout: true @@ -7331,12 +9340,16 @@ paths: /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." + 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" @@ -7353,6 +9366,7 @@ paths: in: "body" schema: type: "object" + title: "ExecStartConfig" properties: Detach: type: "boolean" @@ -7360,9 +9374,19 @@ paths: 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: false + Tty: true + ConsoleSize: [80, 64] - name: "id" in: "path" description: "Exec instance ID" @@ -7372,15 +9396,25 @@ paths: /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." + 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: - 201: + 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" @@ -7478,39 +9512,7 @@ paths: 200: description: "Summary volume data that matches the query" schema: - type: "object" - title: "VolumeListResponse" - required: [Volumes, Warnings] - properties: - Volumes: - type: "array" - x-nullable: false - description: "List of volumes" - items: - $ref: "#/definitions/Volume" - Warnings: - type: "array" - x-nullable: false - description: "Warnings that occurred when fetching the list of volumes" - items: - type: "string" - - examples: - application/json: - Volumes: - - CreatedAt: "2017-07-19T12:00:26Z" - Name: "tardis" - Driver: "local" - Mountpoint: "/var/lib/docker/volumes/tardis" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Scope: "local" - Options: - device: "tmpfs" - o: "size=100m,uid=1000" - type: "tmpfs" - Warnings: [] + $ref: "#/definitions/VolumeListResponse" 500: description: "Server error" schema: @@ -7555,33 +9557,7 @@ paths: required: true description: "Volume configuration" schema: - type: "object" - properties: - Name: - description: "The new volume's name. If not specified, Docker generates a name." - type: "string" - x-nullable: false - Driver: - description: "Name of the volume driver to use." - type: "string" - default: "local" - x-nullable: false - 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" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - example: - Name: "tardis" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Driver: "custom" + $ref: "#/definitions/VolumeCreateOptions" tags: ["Volume"] /volumes/{name}: @@ -7610,6 +9586,64 @@ paths: 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." @@ -7641,6 +9675,7 @@ paths: type: "boolean" default: false tags: ["Volume"] + /volumes/prune: post: summary: "Delete unused volumes" @@ -7655,6 +9690,7 @@ paths: 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: @@ -7681,10 +9717,12 @@ paths: get: summary: "List networks" description: | - Returns a list of networks. For details on the format, see [the network inspect endpoint](#operation/NetworkInspect). + 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. + 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" @@ -7754,8 +9792,15 @@ paths: - name: "filters" in: "query" description: | - JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available 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. @@ -7869,13 +9914,21 @@ paths: required: true schema: type: "object" + title: "NetworkCreateRequest" required: ["Name"] properties: Name: description: "The network's name." type: "string" CheckDuplicate: - description: "Check for networks with duplicate names. Since Network is primarily keyed based on a random ID and not on the name, and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, there is no guaranteed way to check for duplicates. CheckDuplicate is there to provide a best effort checking of any networks which has the same name but it is not guaranteed to catch all name collisions." + description: | + Check for networks with duplicate names. Since Network is + primarily keyed based on a random ID and not on the name, and + network name is strictly a user-friendly alias to the network + which is uniquely identified using ID, there is no guaranteed + way to check for duplicates. CheckDuplicate is there to provide + a best effort checking of any networks which has the same name + but it is not guaranteed to catch all name collisions. type: "boolean" Driver: description: "Name of the network driver plugin to use." @@ -7885,10 +9938,14 @@ paths: 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." + description: | + Globally scoped network is manually attachable by regular + containers from workers in swarm mode. type: "boolean" Ingress: - description: "Ingress network is the network which provides the routing-mesh in swarm mode." + description: | + Ingress network is the network which provides the routing-mesh + in swarm mode. type: "boolean" IPAM: description: "Optional custom IP scheme for the network." @@ -7968,6 +10025,7 @@ paths: required: true schema: type: "object" + title: "NetworkConnectRequest" properties: Container: type: "string" @@ -8014,13 +10072,16 @@ paths: required: true schema: type: "object" + title: "NetworkDisconnectRequest" properties: Container: type: "string" - description: "The ID or name of the container to disconnect from the network." + 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." + description: | + Force the container to disconnect from the network. tags: ["Network"] /networks/prune: post: @@ -8077,7 +10138,10 @@ paths: in: "query" type: "string" description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the plugin list. Available filters: + A JSON encoded value of the filters (a `map[string][]string`) to + process on the plugin list. + + Available filters: - `capability=` - `enable=|` @@ -8093,18 +10157,7 @@ paths: schema: type: "array" items: - description: "Describes a permission the user has to accept upon installing the plugin." - type: "object" - title: "PluginPrivilegeItem" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" + $ref: "#/definitions/PluginPrivilege" example: - Name: "network" Description: "" @@ -8125,7 +10178,9 @@ paths: parameters: - name: "remote" in: "query" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. required: true type: "string" tags: @@ -8136,7 +10191,8 @@ paths: 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). + 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: @@ -8165,24 +10221,19 @@ paths: type: "string" - name: "X-Registry-Auth" in: "header" - description: "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)" + 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: - description: "Describes a permission accepted by the user upon installing the plugin." - type: "object" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" + $ref: "#/definitions/PluginPrivilege" example: - Name: "network" Description: "" @@ -8217,7 +10268,9 @@ paths: parameters: - name: "name" in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. required: true type: "string" tags: ["Plugin"] @@ -8241,12 +10294,16 @@ paths: parameters: - name: "name" in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." + 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." + 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"] @@ -8268,7 +10325,9 @@ paths: parameters: - name: "name" in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. required: true type: "string" - name: "timeout" @@ -8295,9 +10354,17 @@ paths: parameters: - name: "name" in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." + 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: @@ -8317,7 +10384,9 @@ paths: parameters: - name: "name" in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. required: true type: "string" - name: "remote" @@ -8330,24 +10399,19 @@ paths: type: "string" - name: "X-Registry-Auth" in: "header" - description: "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)" + 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: - description: "Describes a permission accepted by the user upon installing the plugin." - type: "object" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" + $ref: "#/definitions/PluginPrivilege" example: - Name: "network" Description: "" @@ -8378,7 +10442,9 @@ paths: parameters: - name: "name" in: "query" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. required: true type: "string" - name: "tarContext" @@ -8397,7 +10463,9 @@ paths: parameters: - name: "name" in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. required: true type: "string" responses: @@ -8421,7 +10489,9 @@ paths: parameters: - name: "name" in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. required: true type: "string" - name: "body" @@ -8473,6 +10543,7 @@ paths: - `label=` - `membership=`(`accepted`|`pending`)` - `name=` + - `node.label=` - `role=`(`manager`|`worker`)` type: "string" tags: ["Node"] @@ -8569,7 +10640,9 @@ paths: $ref: "#/definitions/NodeSpec" - name: "version" in: "query" - description: "The version number of the node object being updated. This is required to avoid conflicting writes." + description: | + The version number of the node object being updated. This is required + to avoid conflicting writes. type: "integer" format: "int64" required: true @@ -8628,31 +10701,71 @@ paths: 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." + 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." + 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. + 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: {} @@ -8687,27 +10800,43 @@ paths: 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)." + 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." + 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. + 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. + 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: "string" + 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" @@ -8735,7 +10864,9 @@ paths: $ref: "#/definitions/ErrorResponse" parameters: - name: "force" - description: "Force leave swarm, even if this is the last manager or that it will break the cluster." + description: | + Force leave swarm, even if this is the last manager or that it will + break the cluster. in: "query" type: "boolean" default: false @@ -8767,7 +10898,9 @@ paths: $ref: "#/definitions/SwarmSpec" - name: "version" in: "query" - description: "The version number of the swarm object being updated. This is required to avoid conflicting writes." + description: | + The version number of the swarm object being updated. This is + required to avoid conflicting writes. type: "integer" format: "int64" required: true @@ -8828,6 +10961,7 @@ paths: required: true schema: type: "object" + title: "SwarmUnlockRequest" properties: UnlockKey: description: "The swarm's unlock key." @@ -8870,12 +11004,20 @@ paths: in: "query" type: "string" description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the services list. Available 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=` + - name: "status" + in: "query" + type: "boolean" + description: | + Include service status, with count of running and desired tasks. tags: ["Service"] /services/create: post: @@ -8998,7 +11140,12 @@ paths: foo: "bar" - name: "X-Registry-Auth" in: "header" - description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)" + 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}: @@ -9134,21 +11281,37 @@ paths: - name: "version" in: "query" - description: "The version number of the service object being updated. This is required to avoid conflicting writes." + 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" - description: "If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials. The valid values are `spec` and `previous-spec`." + 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" - 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." - name: "X-Registry-Auth" in: "header" - description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. type: "string" tags: ["Service"] @@ -9156,23 +11319,21 @@ paths: get: summary: "Get service logs" description: | - Get `stdout` and `stderr` logs from a service. + Get `stdout` and `stderr` logs from a service. See also + [`/containers/{id}/logs`](#operation/ContainerLogs). - **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers. - operationId: "ServiceLogs" + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. produces: - "application/vnd.docker.raw-stream" - - "application/json" + - "application/vnd.docker.multiplexed-stream" + operationId: "ServiceLogs" responses: - 101: - description: "logs returned as a stream" - schema: - type: "string" - format: "binary" 200: - description: "logs returned as a string in response body" + description: "logs returned as a stream in response body" schema: type: "string" + format: "binary" 404: description: "no such service" schema: @@ -9201,10 +11362,7 @@ paths: default: false - name: "follow" in: "query" - description: | - Return the logs as a stream. - - This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). + description: "Keep connection after returning logs." type: "boolean" default: false - name: "stdout" @@ -9229,7 +11387,9 @@ paths: 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." + 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"] @@ -9370,7 +11530,10 @@ paths: in: "query" type: "string" description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the tasks list. Available 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=` @@ -9414,22 +11577,20 @@ paths: 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 `json-file` or `journald` logging drivers. + **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/json" + - "application/vnd.docker.multiplexed-stream" responses: - 101: - description: "logs returned as a stream" - schema: - type: "string" - format: "binary" 200: - description: "logs returned as a string in response body" + description: "logs returned as a stream in response body" schema: type: "string" + format: "binary" 404: description: "no such task" schema: @@ -9458,10 +11619,7 @@ paths: default: false - name: "follow" in: "query" - description: | - Return the logs as a stream. - - This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). + description: "Keep connection after returning logs." type: "boolean" default: false - name: "stdout" @@ -9486,9 +11644,12 @@ paths: 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." + 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" @@ -9539,7 +11700,10 @@ paths: in: "query" type: "string" description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available 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` @@ -9696,10 +11860,15 @@ paths: 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." + 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." + description: | + The version number of the secret object being updated. This is + required to avoid conflicting writes. type: "integer" format: "int64" required: true @@ -9738,7 +11907,10 @@ paths: in: "query" type: "string" description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the configs list. Available 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` @@ -9882,10 +12054,15 @@ paths: 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." + 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." + description: | + The version number of the config object being updated. This is + required to avoid conflicting writes. type: "integer" format: "int64" required: true @@ -9893,7 +12070,8 @@ paths: /distribution/{name}/json: get: summary: "Get image information from the registry" - description: "Return image digest and platform information by contacting the registry." + description: | + Return image digest and platform information by contacting the registry. operationId: "DistributionInspect" produces: - "application/json" @@ -9901,65 +12079,7 @@ paths: 200: description: "descriptor and platform information" schema: - type: "object" - x-go-name: DistributionInspect - title: "DistributionInspectResponse" - required: [Descriptor, Platforms] - properties: - Descriptor: - type: "object" - description: "A descriptor struct containing digest, media type, and size" - properties: - MediaType: - type: "string" - Size: - type: "integer" - format: "int64" - Digest: - type: "string" - URLs: - type: "array" - items: - type: "string" - Platforms: - type: "array" - description: "An array containing all platforms supported by the image" - items: - type: "object" - properties: - Architecture: - type: "string" - OS: - type: "string" - OSVersion: - type: "string" - OSFeatures: - type: "array" - items: - type: "string" - Variant: - type: "string" - Features: - type: "array" - items: - type: "string" - examples: - application/json: - Descriptor: - MediaType: "application/vnd.docker.distribution.manifest.v2+json" - Digest: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" - Size: 3987495 - URLs: - - "" - Platforms: - - Architecture: "amd64" - OS: "linux" - OSVersion: "" - OSFeatures: - - "" - Variant: "" - Features: - - "" + $ref: "#/definitions/DistributionInspect" 401: description: "Failed authentication or no image found" schema: @@ -9982,14 +12102,13 @@ paths: 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. - - > **Note**: This endpoint is *experimental* and only available if the daemon is started with experimental - > features enabled. The specifications for this endpoint may still change in a future version of the API. + 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. + 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: @@ -9999,7 +12118,8 @@ paths: Connection: Upgrade ``` - The Docker daemon will respond with a `101 UPGRADED` response follow with the raw stream: + The Docker daemon responds with a `101 UPGRADED` response follow with + the raw stream: ``` HTTP/1.1 101 UPGRADED @@ -10020,4 +12140,4 @@ paths: description: "server error" schema: $ref: "#/definitions/ErrorResponse" - tags: ["Session (experimental)"] + tags: ["Session"] diff --git a/src/Client.php b/src/Client.php index 322a543a..be97b2ea 100644 --- a/src/Client.php +++ b/src/Client.php @@ -1,166 +1,187 @@ executePsr7Endpoint(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_-]+`. - * } - * - * @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\ContainersCreatePostResponse201|\Psr\Http\Message\ResponseInterface - */ - public function containerCreate(\Docker\API\Model\ContainersCreatePostBody $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerCreate($body, $queryParameters), $fetch); + * 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 . + + * + * @param array $queryParameters { + * @var bool $all Return all containers. By default, only running containers are shown. + + * @var int $limit Return this number of most recently created containers, including + non-running ones. + + * @var bool $size Return the size of container as fields `SizeRw` and `SizeRootFs`. + + * @var string $filters 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 ``) + + * } + * @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 = array(), 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 = array(), 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 { - * + * @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->executePsr7Endpoint(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->executePsr7Endpoint(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 return the logs as a stream - - * @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->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerLogs($id, $queryParameters), $fetch); - } - - /** - * Returns which files in a container's filesystem have been added, deleted,. + public function containerInspect(string $id, array $queryParameters = array(), 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 = array(), 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 = array(), 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 - - `1`: Added - - `2`: Deleted - - * - * @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\ContainersIdChangesGetResponse200Item[]|\Psr\Http\Message\ResponseInterface - */ + + - `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->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerChanges($id), $fetch); + 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 $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 * @@ -168,202 +189,211 @@ public function containerChanges(string $id, string $fetch = self::FETCH_OBJECT) */ public function containerExport(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerExport($id), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerExport($id), $fetch); } - /** - * This endpoint returns a live stream of a container’s resource usage. + * This endpoint returns a live stream of a container’s resource usage statistics. - - The `precpu_stats` is the CPU statistic of last read, which is used - for calculating the CPU usage percentage. It is not the same as the - `cpu_stats` field. - + + 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. - - * - * @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. - * } - * - * @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->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerStats($id, $queryParameters), $fetch); - } - - /** - * Resize the TTY for a container. You must restart the container for the resize to take effect. - * - * @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 + + 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 = `lenght(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 = array(), 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) + public function containerResize(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerResize($id, $queryParameters), $fetch); + 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|\Docker\API\Model\ErrorResponse|\Psr\Http\Message\ResponseInterface - */ - public function containerStart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + * + * + * @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 = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerStart($id, $queryParameters), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerStart($id, $queryParameters), $fetch); } - /** - * @param string $id ID or name of the container - * @param array $queryParameters { + * * + * @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|\Docker\API\Model\ErrorResponse|\Psr\Http\Message\ResponseInterface + * @return null|\Psr\Http\Message\ResponseInterface */ - public function containerStop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerStop(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerStop($id, $queryParameters), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerStop($id, $queryParameters), $fetch); } - /** - * @param string $id ID or name of the container - * @param array $queryParameters { + * * + * @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->executePsr7Endpoint(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\ContainerKillInternalServerErrorException - * - * @return null|\Psr\Http\Message\ResponseInterface - */ - public function containerKill(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executePsr7Endpoint(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 containerRestart(string $id, array $queryParameters = array(), 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 = array(), 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->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerUpdate($id, $update), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerUpdate($id, $update), $fetch); } - /** - * @param string $id ID or name of the container - * @param array $queryParameters { + * * + * @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->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerRename($id, $queryParameters), $fetch); - } - - /** - * Use the cgroups freezer 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 cgroups freezer 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 containerRename(string $id, array $queryParameters = array(), 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->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerPause($id), $fetch); + 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 $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 * @@ -371,169 +401,194 @@ public function containerPause(string $id, string $fetch = self::FETCH_OBJECT) */ public function containerUnpause(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerUnpause($id), $fetch); + 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. - + * 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](/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 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. - + + 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: - + + 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 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`). - + + 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`. - + + `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 - - * @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->executePsr7Endpoint(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->executePsr7Endpoint(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, either 'not-running' (default), 'next-exit', or 'removed'. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerWaitNotFoundException - * @throws \Docker\API\Exception\ContainerWaitInternalServerErrorException - * - * @return null|\Docker\API\Model\ContainersIdWaitPostResponse200|\Psr\Http\Message\ResponseInterface - */ - public function containerWait(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerWait($id, $queryParameters), $fetch); - } - - /** - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var bool $v remove the volumes associated with the container - * @var bool $force if the container is running, kill it before removing it + + 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 = array(), 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 = array(), 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 = array(), 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 @@ -541,291 +596,357 @@ public function containerWait(string $id, array $queryParameters = [], string $f * * @return null|\Psr\Http\Message\ResponseInterface */ - public function containerDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerDelete(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerDelete($id, $queryParameters), $fetch); + 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 { - * + * @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) + public function containerArchive(string $id, array $queryParameters = array(), 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 = array(), 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 = array(), 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 = array(), 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 ``) + + * @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. + * } + * @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 = array(), 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](/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.](/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 + * } + * @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: + + ``` { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerArchive($id, $queryParameters), $fetch); + "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(), array $headerParameters = array(), 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 = array(), string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\BuildPrune($queryParameters), $fetch); + } + /** + * Create an image by either pulling it from a registry or importing it. + * + * @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(), array $headerParameters = array(), string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageCreate($inputImage, $queryParameters, $headerParameters), $fetch); } - /** - * A response header `X-Docker-Container-Path-Stat` is return 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. - * } + * 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 * - * @throws \Docker\API\Exception\ContainerArchiveInfoBadRequestException - * @throws \Docker\API\Exception\ContainerArchiveInfoNotFoundException - * @throws \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException - * - * @return null|\Psr\Http\Message\ResponseInterface + * @return null|\Docker\API\Model\ImageInspect|\Psr\Http\Message\ResponseInterface */ - public function containerArchiveInfo(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function imageInspect(string $name, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerArchiveInfo($id, $queryParameters), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageInspect($name), $fetch); } - /** - * Upload a tar archive to be extracted to a path in the filesystem of container id. - * - * @param string $id ID or name of the container - * @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 $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. - * } + * 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 * - * @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 + * @return null|\Docker\API\Model\ImagesNameHistoryGetResponse200Item[]|\Psr\Http\Message\ResponseInterface */ - public function putContainerArchive(string $id, string $inputStream, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function imageHistory(string $name, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PutContainerArchive($id, $inputStream, $queryParameters), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageHistory($name), $fetch); } - /** - * @param array $queryParameters { - * - * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`) - - * } - * @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->executePsr7Endpoint(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: - - * @var bool $digests Show digest information as a `RepoDigests` field on each image. - * } - * - * @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->executePsr7Endpoint(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. [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 to which this container should connect to. - * @var string $platform Platform in the format os[/arch[/variant]] - * } - * - * @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 - - * } - * @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->executePsr7Endpoint(new \Docker\API\Endpoint\ImageBuild($inputStream, $queryParameters, $headerParameters), $fetch); - } - - /** - * @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(string $fetch = self::FETCH_OBJECT) - { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\BuildPrune(), $fetch); - } - - /** - * Create an image by either pulling it from a registry or importing it. - * - * @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 $platform Platform in the format os[/arch[/variant]] - * } - * - * @param array $headerParameters { - * - * @var string $X-Registry-Auth A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication) - * } - * - * @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->executePsr7Endpoint(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\Image|\Psr\Http\Message\ResponseInterface - */ - public function imageInspect(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executePsr7Endpoint(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->executePsr7Endpoint(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`. - + * 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 image name or ID - * @param array $queryParameters { - * - * @var string $tag The tag to associate with the image on the registry. - * } - * - * @param array $headerParameters { - * - * @var string $X-Registry-Auth A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication) - * } - * - * @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->executePsr7Endpoint(new \Docker\API\Endpoint\ImagePush($name, $queryParameters, $headerParameters), $fetch); + + * + * @param string $name Image name or ID. + * @param array $queryParameters { + * @var string $tag The tag to associate with the image on the registry. + * } + * @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(), array $headerParameters = array(), 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 { - * + * @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 @@ -833,134 +954,139 @@ public function imagePush(string $name, array $queryParameters = [], array $head * * @return null|\Psr\Http\Message\ResponseInterface */ - public function imageTag(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function imageTag(string $name, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageTag($name, $queryParameters), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageTag($name, $queryParameters), $fetch); } - /** - * Remove an image, along with any untagged parent images that were. + * 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->executePsr7Endpoint(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: - - * } - * @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->executePsr7Endpoint(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: - + + * + * @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 = array(), 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-automated=(true|false)` + - `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 = array(), 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` - * } - * @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->executePsr7Endpoint(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\SystemAuthInternalServerErrorException - * - * @return null|\Docker\API\Model\AuthPostResponse200|\Psr\Http\Message\ResponseInterface - */ + (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 = array(), 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->executePsr7Endpoint(new \Docker\API\Endpoint\SystemAuth($authConfig), $fetch); + 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->executePsr7Endpoint(new \Docker\API\Endpoint\SystemInfo(), $fetch); + 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\VersionGetResponse200|\Psr\Http\Message\ResponseInterface + * @return null|\Docker\API\Model\SystemVersion|\Psr\Http\Message\ResponseInterface */ public function systemVersion(string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemVersion(), $fetch); + 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->executePsr7Endpoint(new \Docker\API\Endpoint\SystemPing(), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\SystemPing(), $fetch); } - /** - * @param \Docker\API\Model\ContainerConfig $containerConfig The container configuration - * @param array $queryParameters { + * @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 @@ -969,91 +1095,105 @@ public function systemPing(string $fetch = self::FETCH_OBJECT) * @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) + public function imageCommit(\Docker\API\Model\ContainerConfig $containerConfig, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageCommit($containerConfig, $queryParameters), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageCommit($containerConfig, $queryParameters), $fetch); } - /** - * Stream real-time events from the server. - + * 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`, and `update` - - Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, and `untag` - - Volumes report these events: `create`, `mount`, `unmount`, and `destroy` - - Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, and `remove` - + + 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: `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 = array(), string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\SystemEvents($queryParameters), $fetch); + } + /** + * * * @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: - + * @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\SystemEventsBadRequestException - * @throws \Docker\API\Exception\SystemEventsInternalServerErrorException - * - * @return null|\Docker\API\Model\EventsGetResponse200|\Psr\Http\Message\ResponseInterface - */ - public function systemEvents(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemEvents($queryParameters), $fetch); - } - - /** - * @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(string $fetch = self::FETCH_OBJECT) + public function systemDataUsage(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemDataUsage(), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\SystemDataUsage($queryParameters), $fetch); } - /** - * Get a tarball containing all images and metadata for a repository. - + * 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": { @@ -1061,74 +1201,68 @@ public function systemDataUsage(string $fetch = self::FETCH_OBJECT) } } ``` - - * - * @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 - */ + + * + * @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->executePsr7Endpoint(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->executePsr7Endpoint(new \Docker\API\Endpoint\ImageGetAll($queryParameters), $fetch); + 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 = array(), 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 = array(), string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new \Docker\API\Endpoint\ImageLoad($imagesTarball, $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->executePsr7Endpoint(new \Docker\API\Endpoint\ImageLoad($imagesTarball, $queryParameters), $fetch); - } - /** * Run a command inside a running container. * - * @param string $id ID or name of 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) - * + * @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 @@ -1137,53 +1271,52 @@ public function imageLoad($imagesTarball, array $queryParameters = [], string $f */ public function containerExec(string $id, \Docker\API\Model\ContainersIdExecPostBody $execConfig, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(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 - */ + 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->executePsr7Endpoint(new \Docker\API\Endpoint\ExecStart($id, $execStartConfig), $fetch); + 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\ExecResizeNotFoundException - * - * @return null|\Psr\Http\Message\ResponseInterface - */ - public function execResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + * 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 = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ExecResize($id, $queryParameters), $fetch); + 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 $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 * @@ -1191,64 +1324,70 @@ public function execResize(string $id, array $queryParameters = [], string $fetc */ public function execInspect(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ExecInspect($id), $fetch); + 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 - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\VolumeListInternalServerErrorException - * - * @return null|\Docker\API\Model\VolumesGetResponse200|\Psr\Http\Message\ResponseInterface - */ - public function volumeList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + * + * + * @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 = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumeList($queryParameters), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\VolumeList($queryParameters), $fetch); } - /** - * @param \Docker\API\Model\VolumesCreatePostBody $volumeConfig Volume configuration - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * * + * @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\VolumesCreatePostBody $volumeConfig, string $fetch = self::FETCH_OBJECT) + public function volumeCreate(\Docker\API\Model\VolumeCreateOptions $volumeConfig, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumeCreate($volumeConfig), $fetch); + 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 { - * + * @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) + public function volumeDelete(string $name, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumeDelete($name, $queryParameters), $fetch); + 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) + * * + * @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 * @@ -1256,53 +1395,94 @@ public function volumeDelete(string $name, array $queryParameters = [], string $ */ public function volumeInspect(string $name, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumeInspect($name), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`) - - * } - * @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->executePsr7Endpoint(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: - - * } + 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 = array(), 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 = array(), 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 = array(), 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\NetworkListInternalServerErrorException - * - * @return null|\Docker\API\Model\Network[]|\Psr\Http\Message\ResponseInterface - */ - public function networkList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executePsr7Endpoint(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 @@ -1311,345 +1491,372 @@ public function networkList(array $queryParameters = [], string $fetch = self::F */ public function networkDelete(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkDelete($id), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkDelete($id), $fetch); } - /** - * @param string $id Network ID or name - * @param array $queryParameters { + * * + * @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) + public function networkInspect(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkInspect($id, $queryParameters), $fetch); + 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) + * * + * @param \Docker\API\Model\NetworksCreatePostBody $networkConfig Network configuration + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * @throws \Docker\API\Exception\NetworkCreateForbiddenException * @throws \Docker\API\Exception\NetworkCreateNotFoundException * @throws \Docker\API\Exception\NetworkCreateInternalServerErrorException * - * @return null|\Docker\API\Model\NetworksCreatePostResponse201|\Psr\Http\Message\ResponseInterface - */ - public function networkCreate(\Docker\API\Model\NetworksCreatePostBody $networkConfig, string $fetch = self::FETCH_OBJECT) - { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkCreate($networkConfig), $fetch); - } - - /** - * @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\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->executePsr7Endpoint(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->executePsr7Endpoint(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`) - - * } - * @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->executePsr7Endpoint(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: - - * } - * @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->executePsr7Endpoint(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\PluginsPrivilegesGetResponse200Item[]|\Psr\Http\Message\ResponseInterface - */ - public function getPluginPrivileges(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executePsr7Endpoint(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 array $body - * @param array $queryParameters { - * - * @var string $remote remote reference for plugin to install - - * @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 base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication) - * } - * - * @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->executePsr7Endpoint(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->executePsr7Endpoint(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->executePsr7Endpoint(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->executePsr7Endpoint(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 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, string $fetch = self::FETCH_OBJECT) - { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginDisable($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 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 base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication) - * } - * - * @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->executePsr7Endpoint(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 + * @return null|\Docker\API\Model\NetworksCreatePostResponse201|\Psr\Http\Message\ResponseInterface */ - public function pluginCreate($tarContext, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function networkCreate(\Docker\API\Model\NetworksCreatePostBody $networkConfig, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginCreate($tarContext, $queryParameters), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkCreate($networkConfig), $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 $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\PluginPushNotFoundException - * @throws \Docker\API\Exception\PluginPushInternalServerErrorException + * @throws \Docker\API\Exception\NetworkConnectForbiddenException + * @throws \Docker\API\Exception\NetworkConnectNotFoundException + * @throws \Docker\API\Exception\NetworkConnectInternalServerErrorException * * @return null|\Psr\Http\Message\ResponseInterface */ - public function pluginPush(string $name, string $fetch = self::FETCH_OBJECT) + public function networkConnect(string $id, \Docker\API\Model\NetworksIdConnectPostBody $container, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginPush($name), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkConnect($id, $container), $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 + * @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 = array(), 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 = array(), 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 = array(), 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(), array $headerParameters = array(), 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 = array(), 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 = array(), 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 = array(), 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(), array $headerParameters = array(), 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 = array(), 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->executePsr7Endpoint(new \Docker\API\Endpoint\PluginSet($name, $body), $fetch); - } - - /** + 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 = array(), 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 string $filters filters to process on the nodes list, encoded as JSON (a `map[string][]string`) - - * } - * @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->executePsr7Endpoint(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) + public function nodeDelete(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NodeDelete($id, $queryParameters), $fetch); + 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) + * * + * @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 @@ -1658,34 +1865,32 @@ public function nodeDelete(string $id, array $queryParameters = [], string $fetc */ public function nodeInspect(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NodeInspect($id), $fetch); + 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) + * + * + * @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 = array(), string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NodeUpdate($id, $body, $queryParameters), $fetch); + 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 @@ -1694,13 +1899,13 @@ public function nodeUpdate(string $id, \Docker\API\Model\NodeSpec $body, array $ */ public function swarmInspect(string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmInspect(), $fetch); + 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) + * * + * @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 @@ -1709,13 +1914,13 @@ public function swarmInspect(string $fetch = self::FETCH_OBJECT) */ public function swarmInit(\Docker\API\Model\SwarmInitPostBody $body, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmInit($body), $fetch); + 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) + * * + * @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 @@ -1724,53 +1929,51 @@ public function swarmInit(\Docker\API\Model\SwarmInitPostBody $body, string $fet */ public function swarmJoin(\Docker\API\Model\SwarmJoinPostBody $body, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(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->executePsr7Endpoint(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->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmUpdate($body, $queryParameters), $fetch); + 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 = array(), 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 = array(), 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 * @@ -1778,13 +1981,13 @@ public function swarmUpdate(\Docker\API\Model\SwarmSpec $body, array $queryParam */ public function swarmUnlockkey(string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmUnlockkey(), $fetch); + 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) + * * + * @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 * @@ -1792,53 +1995,65 @@ public function swarmUnlockkey(string $fetch = self::FETCH_OBJECT) */ public function swarmUnlock(\Docker\API\Model\SwarmUnlockPostBody $body, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(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: - - * } - * @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->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceList($queryParameters), $fetch); - } - - /** - * @param \Docker\API\Model\ServicesCreatePostBody $body - * @param array $headerParameters { - * - * @var string $X-Registry-Auth A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication) - * } - * - * @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\ServicesCreatePostResponse201|\Psr\Http\Message\ResponseInterface - */ - public function serviceCreate(\Docker\API\Model\ServicesCreatePostBody $body, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceCreate($body, $headerParameters), $fetch); - } - - /** - * @param string $id ID or name of service + 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 = array(), 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\ServicesCreatePostResponse201|\Psr\Http\Message\ResponseInterface + */ + public function serviceCreate(\Docker\API\Model\ServicesCreatePostBody $body, array $headerParameters = array(), 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 @@ -1847,112 +2062,129 @@ public function serviceCreate(\Docker\API\Model\ServicesCreatePostBody $body, ar */ public function serviceDelete(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceDelete($id), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceDelete($id), $fetch); } - /** - * @param string $id ID or name of service - * @param array $queryParameters { + * * + * @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->executePsr7Endpoint(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. - * @var string $registryAuthFrom If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials. The valid values are `spec` and `previous-spec`. - * @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 base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication) - * } - * - * @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->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceUpdate($id, $body, $queryParameters, $headerParameters), $fetch); - } - - /** - * Get `stdout` and `stderr` logs from a service. - - **Note**: This endpoint works only for services with the `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 return the logs as a stream - - * @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->executePsr7Endpoint(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: - - * } - * @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->executePsr7Endpoint(new \Docker\API\Endpoint\TaskList($queryParameters), $fetch); - } - - /** - * @param string $id ID of the task + public function serviceInspect(string $id, array $queryParameters = array(), 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(), array $headerParameters = array(), 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 = array(), 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 = array(), 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 @@ -1961,63 +2193,69 @@ public function taskList(array $queryParameters = [], string $fetch = self::FETC */ public function taskInspect(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\TaskInspect($id), $fetch); - } - - /** - * Get `stdout` and `stderr` logs from a task. - - **Note**: This endpoint works only for services with the `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 return the logs as a stream - - * @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->executePsr7Endpoint(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: - - * } + 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 = array(), 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 = array(), 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\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->executePsr7Endpoint(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 @@ -2026,13 +2264,13 @@ public function secretList(array $queryParameters = [], string $fetch = self::FE */ public function secretCreate(\Docker\API\Model\SecretsCreatePostBody $body, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SecretCreate($body), $fetch); + 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) + * * + * @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 @@ -2041,13 +2279,13 @@ public function secretCreate(\Docker\API\Model\SecretsCreatePostBody $body, stri */ public function secretDelete(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SecretDelete($id), $fetch); + 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) + * * + * @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 @@ -2056,53 +2294,63 @@ public function secretDelete(string $id, string $fetch = self::FETCH_OBJECT) */ public function secretInspect(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(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->executePsr7Endpoint(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: - - * } + 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 = array(), 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 = array(), 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\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->executePsr7Endpoint(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 @@ -2111,13 +2359,13 @@ public function configList(array $queryParameters = [], string $fetch = self::FE */ public function configCreate(\Docker\API\Model\ConfigsCreatePostBody $body, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigCreate($body), $fetch); + 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) + * * + * @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 @@ -2126,13 +2374,13 @@ public function configCreate(\Docker\API\Model\ConfigsCreatePostBody $body, stri */ public function configDelete(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigDelete($id), $fetch); + 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) + * * + * @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 @@ -2141,50 +2389,49 @@ public function configDelete(string $id, string $fetch = self::FETCH_OBJECT) */ public function configInspect(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(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->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigUpdate($id, $body, $queryParameters), $fetch); + 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 = array(), 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 $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\DistributionNameJsonGetResponse200|\Psr\Http\Message\ResponseInterface + * @return null|\Docker\API\Model\DistributionInspect|\Psr\Http\Message\ResponseInterface */ public function distributionInspect(string $name, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\DistributionInspect($name), $fetch); + 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 * @@ -2192,22 +2439,25 @@ public function distributionInspect(string $name, string $fetch = self::FETCH_OB */ public function session(string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\Session(), $fetch); + return $this->executeEndpoint(new \Docker\API\Endpoint\Session(), $fetch); } - - public static function create($httpClient = null) + public static function create($httpClient = null, array $additionalPlugins = array(), array $additionalNormalizers = array()) { if (null === $httpClient) { - $httpClient = \Http\Discovery\HttpClientDiscovery::find(); - $plugins = []; - $uri = \Http\Discovery\UriFactoryDiscovery::find()->createUri('v1.36'); - $plugins[] = new \Http\Client\Common\Plugin\AddPathPlugin($uri); + $httpClient = \Http\Discovery\Psr18ClientDiscovery::find(); + $plugins = array(); + if (count($additionalPlugins) > 0) { + $plugins = array_merge($plugins, $additionalPlugins); + } $httpClient = new \Http\Client\Common\PluginClient($httpClient, $plugins); } - $messageFactory = \Http\Discovery\MessageFactoryDiscovery::find(); - $streamFactory = \Http\Discovery\StreamFactoryDiscovery::find(); - $serializer = new \Symfony\Component\Serializer\Serializer(\Docker\API\Normalizer\NormalizerFactory::create(), [new \Symfony\Component\Serializer\Encoder\JsonEncoder(new \Symfony\Component\Serializer\Encoder\JsonEncode(), new \Symfony\Component\Serializer\Encoder\JsonDecode())]); - - return new static($httpClient, $messageFactory, $serializer, $streamFactory); + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $streamFactory = \Http\Discovery\Psr17FactoryDiscovery::findStreamFactory(); + $normalizers = array(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, array(new \Symfony\Component\Serializer\Encoder\JsonEncoder(new \Symfony\Component\Serializer\Encoder\JsonEncode(), new \Symfony\Component\Serializer\Encoder\JsonDecode(array('json_decode_associative' => true))))); + return new static($httpClient, $requestFactory, $serializer, $streamFactory); } -} +} \ No newline at end of file diff --git a/src/ClientAsync.php b/src/ClientAsync.php deleted file mode 100644 index 8ae78372..00000000 --- a/src/ClientAsync.php +++ /dev/null @@ -1,2207 +0,0 @@ - - */ - public function containerList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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_-]+`. - * } - * - * @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 \Amp\Promise - */ - public function containerCreate(\Docker\API\Model\ContainersCreatePostBody $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function containerInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function containerTop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 return the logs as a stream - - * @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 \Amp\Promise - */ - public function containerLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 - - `1`: Added - - `2`: Deleted - - * - * @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 \Amp\Promise - */ - public function containerChanges(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function containerExport(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 last read, which is used - for calculating the CPU usage percentage. It is not the same as 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. - - * - * @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. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerStatsNotFoundException - * @throws \Docker\API\Exception\ContainerStatsInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerStats(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerStats($id, $queryParameters), $fetch); - } - - /** - * Resize the TTY for a container. You must restart the container for the resize to take effect. - * - * @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 \Amp\Promise - */ - public function containerResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function containerStart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerStart($id, $queryParameters), $fetch); - } - - /** - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @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 \Amp\Promise - */ - public function containerStop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerStop($id, $queryParameters), $fetch); - } - - /** - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @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 \Amp\Promise - */ - public function containerRestart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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\ContainerKillInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerKill(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function containerUpdate(string $id, \Docker\API\Model\ContainersIdUpdatePostBody $update, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function containerRename(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerRename($id, $queryParameters), $fetch); - } - - /** - * Use the cgroups freezer 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 cgroups freezer 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 \Amp\Promise - */ - public function containerPause(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function containerUnpause(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 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 - - * @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 \Amp\Promise - */ - public function containerAttach(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function containerAttachWebsocket(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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, either 'not-running' (default), 'next-exit', or 'removed'. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerWaitNotFoundException - * @throws \Docker\API\Exception\ContainerWaitInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerWait(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerWait($id, $queryParameters), $fetch); - } - - /** - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var bool $v remove the 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 \Amp\Promise - */ - public function containerDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function containerArchive(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerArchive($id, $queryParameters), $fetch); - } - - /** - * A response header `X-Docker-Container-Path-Stat` is return 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 \Amp\Promise - */ - public function containerArchiveInfo(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerArchiveInfo($id, $queryParameters), $fetch); - } - - /** - * Upload a tar archive to be extracted to a path in the filesystem of container id. - * - * @param string $id ID or name of the container - * @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 $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. - * } - * - * @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 \Amp\Promise - */ - public function putContainerArchive(string $id, string $inputStream, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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`) - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerPruneInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerPrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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: - - * @var bool $digests Show digest information as a `RepoDigests` field on each image. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageListInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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. [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 to which this container should connect to. - * @var string $platform Platform in the format os[/arch[/variant]] - * } - * - * @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 - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageBuildBadRequestException - * @throws \Docker\API\Exception\ImageBuildInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageBuild($inputStream, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageBuild($inputStream, $queryParameters, $headerParameters), $fetch); - } - - /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\BuildPruneInternalServerErrorException - * - * @return \Amp\Promise - */ - public function buildPrune(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\BuildPrune(), $fetch); - } - - /** - * Create an image by either pulling it from a registry or importing it. - * - * @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 $platform Platform in the format os[/arch[/variant]] - * } - * - * @param array $headerParameters { - * - * @var string $X-Registry-Auth A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageCreateNotFoundException - * @throws \Docker\API\Exception\ImageCreateInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageCreate(string $inputImage, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function imageInspect(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function imageHistory(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 image name or ID - * @param array $queryParameters { - * - * @var string $tag The tag to associate with the image on the registry. - * } - * - * @param array $headerParameters { - * - * @var string $X-Registry-Auth A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImagePushNotFoundException - * @throws \Docker\API\Exception\ImagePushInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imagePush(string $name, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function imageTag(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function imageDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageSearchInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageSearch(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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` - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImagePruneInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imagePrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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\SystemAuthInternalServerErrorException - * - * @return \Amp\Promise - */ - public function systemAuth(\Docker\API\Model\AuthConfig $authConfig, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function systemInfo(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SystemInfo(), $fetch); - } - - /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SystemVersionInternalServerErrorException - * - * @return \Amp\Promise - */ - public function systemVersion(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SystemVersion(), $fetch); - } - - /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SystemPingInternalServerErrorException - * - * @return \Amp\Promise - */ - public function systemPing(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SystemPing(), $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 \Amp\Promise - */ - public function imageCommit(\Docker\API\Model\ContainerConfig $containerConfig, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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`, and `update` - - Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, and `untag` - - Volumes report these events: `create`, `mount`, `unmount`, and `destroy` - - Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, and `remove` - - 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` - - * - * @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: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SystemEventsBadRequestException - * @throws \Docker\API\Exception\SystemEventsInternalServerErrorException - * - * @return \Amp\Promise - */ - public function systemEvents(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SystemEvents($queryParameters), $fetch); - } - - /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SystemDataUsageInternalServerErrorException - * - * @return \Amp\Promise - */ - public function systemDataUsage(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SystemDataUsage(), $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 \Amp\Promise - */ - public function imageGet(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function imageGetAll(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function imageLoad($imagesTarball, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function containerExec(string $id, \Docker\API\Model\ContainersIdExecPostBody $execConfig, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function execStart(string $id, \Docker\API\Model\ExecIdStartPostBody $execStartConfig, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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\ExecResizeNotFoundException - * - * @return \Amp\Promise - */ - public function execResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function execInspect(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ExecInspect($id), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\VolumeListInternalServerErrorException - * - * @return \Amp\Promise - */ - public function volumeList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\VolumeList($queryParameters), $fetch); - } - - /** - * @param \Docker\API\Model\VolumesCreatePostBody $volumeConfig Volume configuration - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\VolumeCreateInternalServerErrorException - * - * @return \Amp\Promise - */ - public function volumeCreate(\Docker\API\Model\VolumesCreatePostBody $volumeConfig, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function volumeDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function volumeInspect(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\VolumeInspect($name), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`) - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\VolumePruneInternalServerErrorException - * - * @return \Amp\Promise - */ - public function volumePrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NetworkListInternalServerErrorException - * - * @return \Amp\Promise - */ - public function networkList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function networkDelete(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function networkInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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\NetworkCreateForbiddenException - * @throws \Docker\API\Exception\NetworkCreateNotFoundException - * @throws \Docker\API\Exception\NetworkCreateInternalServerErrorException - * - * @return \Amp\Promise - */ - public function networkCreate(\Docker\API\Model\NetworksCreatePostBody $networkConfig, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\NetworkCreate($networkConfig), $fetch); - } - - /** - * @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\NetworkConnectForbiddenException - * @throws \Docker\API\Exception\NetworkConnectNotFoundException - * @throws \Docker\API\Exception\NetworkConnectInternalServerErrorException - * - * @return \Amp\Promise - */ - public function networkConnect(string $id, \Docker\API\Model\NetworksIdConnectPostBody $container, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function networkDisconnect(string $id, \Docker\API\Model\NetworksIdDisconnectPostBody $container, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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`) - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NetworkPruneInternalServerErrorException - * - * @return \Amp\Promise - */ - public function networkPrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginListInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function getPluginPrivileges(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 array $body - * @param array $queryParameters { - * - * @var string $remote remote reference for plugin to install - - * @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 base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginPullInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginPull(array $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function pluginInspect(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function pluginDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function pluginEnable(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginDisableNotFoundException - * @throws \Docker\API\Exception\PluginDisableInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginDisable(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\PluginDisable($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 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 base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginUpgradeNotFoundException - * @throws \Docker\API\Exception\PluginUpgradeInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginUpgrade(string $name, array $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function pluginCreate($tarContext, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function pluginPush(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function pluginSet(string $name, array $body, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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`) - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NodeListInternalServerErrorException - * @throws \Docker\API\Exception\NodeListServiceUnavailableException - * - * @return \Amp\Promise - */ - public function nodeList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function nodeDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function nodeInspect(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function nodeUpdate(string $id, \Docker\API\Model\NodeSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function swarmInspect(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function swarmInit(\Docker\API\Model\SwarmInitPostBody $body, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function swarmJoin(\Docker\API\Model\SwarmJoinPostBody $body, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function swarmLeave(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function swarmUpdate(\Docker\API\Model\SwarmSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function swarmUnlockkey(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function swarmUnlock(\Docker\API\Model\SwarmUnlockPostBody $body, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ServiceListInternalServerErrorException - * @throws \Docker\API\Exception\ServiceListServiceUnavailableException - * - * @return \Amp\Promise - */ - public function serviceList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ServiceList($queryParameters), $fetch); - } - - /** - * @param \Docker\API\Model\ServicesCreatePostBody $body - * @param array $headerParameters { - * - * @var string $X-Registry-Auth A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication) - * } - * - * @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 \Amp\Promise - */ - public function serviceCreate(\Docker\API\Model\ServicesCreatePostBody $body, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function serviceDelete(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function serviceInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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. - * @var string $registryAuthFrom If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials. The valid values are `spec` and `previous-spec`. - * @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 base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication) - * } - * - * @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 \Amp\Promise - */ - public function serviceUpdate(string $id, \Docker\API\Model\ServicesIdUpdatePostBody $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ServiceUpdate($id, $body, $queryParameters, $headerParameters), $fetch); - } - - /** - * Get `stdout` and `stderr` logs from a service. - - **Note**: This endpoint works only for services with the `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 return the logs as a stream - - * @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 \Amp\Promise - */ - public function serviceLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\TaskListInternalServerErrorException - * @throws \Docker\API\Exception\TaskListServiceUnavailableException - * - * @return \Amp\Promise - */ - public function taskList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function taskInspect(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\TaskInspect($id), $fetch); - } - - /** - * Get `stdout` and `stderr` logs from a task. - - **Note**: This endpoint works only for services with the `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 return the logs as a stream - - * @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 \Amp\Promise - */ - public function taskLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SecretListInternalServerErrorException - * @throws \Docker\API\Exception\SecretListServiceUnavailableException - * - * @return \Amp\Promise - */ - public function secretList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function secretCreate(\Docker\API\Model\SecretsCreatePostBody $body, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function secretDelete(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function secretInspect(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function secretUpdate(string $id, \Docker\API\Model\SecretSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ConfigListInternalServerErrorException - * @throws \Docker\API\Exception\ConfigListServiceUnavailableException - * - * @return \Amp\Promise - */ - public function configList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function configCreate(\Docker\API\Model\ConfigsCreatePostBody $body, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function configDelete(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function configInspect(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function configUpdate(string $id, \Docker\API\Model\ConfigSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function distributionInspect(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(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 \Amp\Promise - */ - public function session(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\Session(), $fetch); - } - - public static function create($httpClient = null) - { - if (null === $httpClient) { - $httpClient = new \Amp\Artax\DefaultClient(); - } - $serializer = new \Symfony\Component\Serializer\Serializer(\Docker\API\Normalizer\NormalizerFactory::create(), [new \Symfony\Component\Serializer\Encoder\JsonEncoder(new \Symfony\Component\Serializer\Encoder\JsonEncode(), new \Symfony\Component\Serializer\Encoder\JsonDecode())]); - - return new static($httpClient, $serializer); - } -} diff --git a/src/Endpoint/BuildPrune.php b/src/Endpoint/BuildPrune.php index 84c6a8e9..58a1cf82 100644 --- a/src/Endpoint/BuildPrune.php +++ b/src/Endpoint/BuildPrune.php @@ -1,39 +1,63 @@ ` 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 = array()) + { + $this->queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/build/prune'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); + } + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(array('keep-storage', 'all', 'filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('keep-storage', array('int')); + $optionsResolver->addAllowedTypes('all', array('bool')); + $optionsResolver->addAllowedTypes('filters', array('string')); + return $optionsResolver; } - /** * {@inheritdoc} * @@ -41,13 +65,19 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\BuildPrunePostResponse200 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\BuildPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ConfigCreate.php b/src/Endpoint/ConfigCreate.php index 9b067cb7..686f5e83 100644 --- a/src/Endpoint/ConfigCreate.php +++ b/src/Endpoint/ConfigCreate.php @@ -1,47 +1,35 @@ body = $body; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/configs/create'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -51,19 +39,25 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\IdResponse */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ConfigCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ConfigDelete.php b/src/Endpoint/ConfigDelete.php index f38822ca..fb441f91 100644 --- a/src/Endpoint/ConfigDelete.php +++ b/src/Endpoint/ConfigDelete.php @@ -1,69 +1,64 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'DELETE'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/configs/{id}'); + return str_replace(array('{id}'), array($this->id), '/configs/{id}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ConfigDeleteNotFoundException * @throws \Docker\API\Exception\ConfigDeleteInternalServerErrorException * @throws \Docker\API\Exception\ConfigDeleteServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ConfigDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ConfigInspect.php b/src/Endpoint/ConfigInspect.php index c9b66c27..259a46d1 100644 --- a/src/Endpoint/ConfigInspect.php +++ b/src/Endpoint/ConfigInspect.php @@ -1,49 +1,36 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/configs/{id}'); + return str_replace(array('{id}'), array($this->id), '/configs/{id}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -53,19 +40,25 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\Config */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ConfigInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ConfigList.php b/src/Endpoint/ConfigList.php index c3d77a78..68d5fa6c 100644 --- a/src/Endpoint/ConfigList.php +++ b/src/Endpoint/ConfigList.php @@ -1,67 +1,55 @@ ` - `label= or label==value` - `name=` - `names=` - - * } - */ - public function __construct(array $queryParameters = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/configs'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -70,16 +58,22 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\Config[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ConfigListServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ConfigUpdate.php b/src/Endpoint/ConfigUpdate.php index b0901cc6..c6c8ebe3 100644 --- a/src/Endpoint/ConfigUpdate.php +++ b/src/Endpoint/ConfigUpdate.php @@ -1,67 +1,56 @@ id = $id; $this->body = $body; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/configs/{id}/update'); + return str_replace(array('{id}'), array($this->id), '/configs/{id}/update'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['version']); - $optionsResolver->setRequired(['version']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('version', ['int']); - + $optionsResolver->setDefined(array('version')); + $optionsResolver->setRequired(array('version')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('version', array('int')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -69,23 +58,31 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * @throws \Docker\API\Exception\ConfigUpdateNotFoundException * @throws \Docker\API\Exception\ConfigUpdateInternalServerErrorException * @throws \Docker\API\Exception\ConfigUpdateServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ConfigUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerArchive.php b/src/Endpoint/ContainerArchive.php index 5493836d..c15b5bda 100644 --- a/src/Endpoint/ContainerArchive.php +++ b/src/Endpoint/ContainerArchive.php @@ -1,87 +1,77 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/archive'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/archive'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['path']); - $optionsResolver->setRequired(['path']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('path', ['string']); - + $optionsResolver->setDefined(array('path')); + $optionsResolver->setRequired(array('path')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('path', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerArchiveBadRequestException * @throws \Docker\API\Exception\ContainerArchiveNotFoundException * @throws \Docker\API\Exception\ContainerArchiveInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\ContainersIdArchiveGetResponse400', 'json')); + 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')); + 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')); + throw new \Docker\API\Exception\ContainerArchiveInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerArchiveInfo.php b/src/Endpoint/ContainerArchiveInfo.php index b22b55bc..ef3ae7f3 100644 --- a/src/Endpoint/ContainerArchiveInfo.php +++ b/src/Endpoint/ContainerArchiveInfo.php @@ -1,87 +1,80 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'HEAD'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/archive'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/archive'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['path']); - $optionsResolver->setRequired(['path']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('path', ['string']); - + $optionsResolver->setDefined(array('path')); + $optionsResolver->setRequired(array('path')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('path', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerArchiveInfoBadRequestException * @throws \Docker\API\Exception\ContainerArchiveInfoNotFoundException * @throws \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\ContainersIdArchiveHeadResponse400', 'json')); + 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')); + 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')); + throw new \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerAttach.php b/src/Endpoint/ContainerAttach.php index 58cee509..fe6eba84 100644 --- a/src/Endpoint/ContainerAttach.php +++ b/src/Endpoint/ContainerAttach.php @@ -1,162 +1,178 @@ ` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. - * @var bool $logs replay previous logs from the container - - * @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 = []) + + 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` + * } + */ + public function __construct(string $id, array $queryParameters = array()) { $this->id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/attach'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/attach'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + 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->setAllowedTypes('detachKeys', ['string']); - $optionsResolver->setAllowedTypes('logs', ['bool']); - $optionsResolver->setAllowedTypes('stream', ['bool']); - $optionsResolver->setAllowedTypes('stdin', ['bool']); - $optionsResolver->setAllowedTypes('stdout', ['bool']); - $optionsResolver->setAllowedTypes('stderr', ['bool']); - + $optionsResolver->setDefined(array('detachKeys', 'logs', 'stream', 'stdin', 'stdout', 'stderr')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('logs' => false, 'stream' => false, 'stdin' => false, 'stdout' => false, 'stderr' => false)); + $optionsResolver->addAllowedTypes('detachKeys', array('string')); + $optionsResolver->addAllowedTypes('logs', array('bool')); + $optionsResolver->addAllowedTypes('stream', array('bool')); + $optionsResolver->addAllowedTypes('stdin', array('bool')); + $optionsResolver->addAllowedTypes('stdout', array('bool')); + $optionsResolver->addAllowedTypes('stderr', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerAttachBadRequestException * @throws \Docker\API\Exception\ContainerAttachNotFoundException * @throws \Docker\API\Exception\ContainerAttachInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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; } @@ -164,13 +180,17 @@ protected function transformResponseBody(string $body, int $status, \Symfony\Com return null; } if (400 === $status) { - throw new \Docker\API\Exception\ContainerAttachBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + 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')); + 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')); + throw new \Docker\API\Exception\ContainerAttachInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerAttachWebsocket.php b/src/Endpoint/ContainerAttachWebsocket.php index 9c110b74..ef3c0c80 100644 --- a/src/Endpoint/ContainerAttachWebsocket.php +++ b/src/Endpoint/ContainerAttachWebsocket.php @@ -1,84 +1,75 @@ ` 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 = []) + * + * + * @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` + * } + */ + public function __construct(string $id, array $queryParameters = array()) { $this->id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/attach/ws'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/attach/ws'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + 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->setAllowedTypes('detachKeys', ['string']); - $optionsResolver->setAllowedTypes('logs', ['bool']); - $optionsResolver->setAllowedTypes('stream', ['bool']); - $optionsResolver->setAllowedTypes('stdin', ['bool']); - $optionsResolver->setAllowedTypes('stdout', ['bool']); - $optionsResolver->setAllowedTypes('stderr', ['bool']); - + $optionsResolver->setDefined(array('detachKeys', 'logs', 'stream', 'stdin', 'stdout', 'stderr')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('logs' => false, 'stream' => false, 'stdin' => false, 'stdout' => false, 'stderr' => false)); + $optionsResolver->addAllowedTypes('detachKeys', array('string')); + $optionsResolver->addAllowedTypes('logs', array('bool')); + $optionsResolver->addAllowedTypes('stream', array('bool')); + $optionsResolver->addAllowedTypes('stdin', array('bool')); + $optionsResolver->addAllowedTypes('stdout', array('bool')); + $optionsResolver->addAllowedTypes('stderr', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerAttachWebsocketBadRequestException * @throws \Docker\API\Exception\ContainerAttachWebsocketNotFoundException * @throws \Docker\API\Exception\ContainerAttachWebsocketInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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; } @@ -86,13 +77,17 @@ protected function transformResponseBody(string $body, int $status, \Symfony\Com return null; } if (400 === $status) { - throw new \Docker\API\Exception\ContainerAttachWebsocketBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + 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')); + 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')); + throw new \Docker\API\Exception\ContainerAttachWebsocketInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerChanges.php b/src/Endpoint/ContainerChanges.php index 482ce93e..1dc5dd44 100644 --- a/src/Endpoint/ContainerChanges.php +++ b/src/Endpoint/ContainerChanges.php @@ -1,75 +1,66 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/changes'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/changes'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerChangesNotFoundException * @throws \Docker\API\Exception\ContainerChangesInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersIdChangesGetResponse200Item[] + * @return null|\Docker\API\Model\FilesystemChange[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\ContainersIdChangesGetResponse200Item[]', 'json'); + 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')); + 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')); + throw new \Docker\API\Exception\ContainerChangesInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerCreate.php b/src/Endpoint/ContainerCreate.php index c45860de..855482e6 100644 --- a/src/Endpoint/ContainerCreate.php +++ b/src/Endpoint/ContainerCreate.php @@ -1,63 +1,68 @@ body = $body; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/containers/create'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['name']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('name', ['string']); - + $optionsResolver->setDefined(array('name', 'platform')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('platform' => '')); + $optionsResolver->addAllowedTypes('name', array('string')); + $optionsResolver->addAllowedTypes('platform', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -66,24 +71,30 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * @throws \Docker\API\Exception\ContainerCreateConflictException * @throws \Docker\API\Exception\ContainerCreateInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersCreatePostResponse201 + * @return null|\Docker\API\Model\ContainerCreateResponse */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\ContainersCreatePostResponse201', 'json'); + 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')); + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ContainerCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerDelete.php b/src/Endpoint/ContainerDelete.php index efcdb335..d1ac1ed4 100644 --- a/src/Endpoint/ContainerDelete.php +++ b/src/Endpoint/ContainerDelete.php @@ -1,69 +1,53 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'DELETE'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + 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->setAllowedTypes('v', ['bool']); - $optionsResolver->setAllowedTypes('force', ['bool']); - $optionsResolver->setAllowedTypes('link', ['bool']); - + $optionsResolver->setDefined(array('v', 'force', 'link')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('v' => false, 'force' => false, 'link' => false)); + $optionsResolver->addAllowedTypes('v', array('bool')); + $optionsResolver->addAllowedTypes('force', array('bool')); + $optionsResolver->addAllowedTypes('link', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -71,23 +55,31 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * @throws \Docker\API\Exception\ContainerDeleteNotFoundException * @throws \Docker\API\Exception\ContainerDeleteConflictException * @throws \Docker\API\Exception\ContainerDeleteInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ContainerDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerExec.php b/src/Endpoint/ContainerExec.php index 5be5a86c..237c6aea 100644 --- a/src/Endpoint/ContainerExec.php +++ b/src/Endpoint/ContainerExec.php @@ -1,23 +1,14 @@ id = $id; $this->body = $execConfig; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/exec'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/exec'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -57,19 +42,25 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\IdResponse */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ContainerExecInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerExport.php b/src/Endpoint/ContainerExport.php index 991925e4..01421931 100644 --- a/src/Endpoint/ContainerExport.php +++ b/src/Endpoint/ContainerExport.php @@ -1,19 +1,10 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/export'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/export'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerExportNotFoundException * @throws \Docker\API\Exception\ContainerExportInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ContainerExportInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerInspect.php b/src/Endpoint/ContainerInspect.php index ce173197..66419d07 100644 --- a/src/Endpoint/ContainerInspect.php +++ b/src/Endpoint/ContainerInspect.php @@ -1,67 +1,49 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/json'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/json'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['size']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['size' => false]); - $optionsResolver->setAllowedTypes('size', ['bool']); - + $optionsResolver->setDefined(array('size')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('size' => false)); + $optionsResolver->addAllowedTypes('size', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -70,16 +52,22 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\ContainersIdJsonGetResponse200 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ContainerInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerKill.php b/src/Endpoint/ContainerKill.php index d2f6dd53..daadb7f3 100644 --- a/src/Endpoint/ContainerKill.php +++ b/src/Endpoint/ContainerKill.php @@ -1,83 +1,80 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/kill'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/kill'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['signal']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['signal' => 'SIGKILL']); - $optionsResolver->setAllowedTypes('signal', ['string']); - + $optionsResolver->setDefined(array('signal')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('signal' => 'SIGKILL')); + $optionsResolver->addAllowedTypes('signal', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerKillNotFoundException + * @throws \Docker\API\Exception\ContainerKillConflictException * @throws \Docker\API\Exception\ContainerKillInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ContainerKillInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerList.php b/src/Endpoint/ContainerList.php index c0ba2029..791e67f8 100644 --- a/src/Endpoint/ContainerList.php +++ b/src/Endpoint/ContainerList.php @@ -1,31 +1,32 @@ [:]`, ``, or ``) - `before`=(`` or ``) - `expose`=(`[/]`|`/[]`) @@ -41,68 +42,66 @@ class ContainerList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements - `since`=(`` or ``) - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) - `volume`=(`` or ``) - - * } - */ - public function __construct(array $queryParameters = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/containers/json'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + 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->setAllowedTypes('all', ['bool']); - $optionsResolver->setAllowedTypes('limit', ['int']); - $optionsResolver->setAllowedTypes('size', ['bool']); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('all', 'limit', 'size', 'filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('all' => false, 'size' => false)); + $optionsResolver->addAllowedTypes('all', array('bool')); + $optionsResolver->addAllowedTypes('limit', array('int')); + $optionsResolver->addAllowedTypes('size', array('bool')); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerListBadRequestException * @throws \Docker\API\Exception\ContainerListInternalServerErrorException * - * @return null|\Docker\API\Model\ContainerSummaryItem[] + * @return null|\Docker\API\Model\ContainerSummary[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\ContainerSummaryItem[]', 'json'); + 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')); + 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')); + throw new \Docker\API\Exception\ContainerListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerLogs.php b/src/Endpoint/ContainerLogs.php index 3417eb62..242b4c90 100644 --- a/src/Endpoint/ContainerLogs.php +++ b/src/Endpoint/ContainerLogs.php @@ -1,102 +1,91 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/logs'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/logs'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + 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->setAllowedTypes('follow', ['bool']); - $optionsResolver->setAllowedTypes('stdout', ['bool']); - $optionsResolver->setAllowedTypes('stderr', ['bool']); - $optionsResolver->setAllowedTypes('since', ['int']); - $optionsResolver->setAllowedTypes('until', ['int']); - $optionsResolver->setAllowedTypes('timestamps', ['bool']); - $optionsResolver->setAllowedTypes('tail', ['string']); - + $optionsResolver->setDefined(array('follow', 'stdout', 'stderr', 'since', 'until', 'timestamps', 'tail')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('follow' => false, 'stdout' => false, 'stderr' => false, 'since' => 0, 'until' => 0, 'timestamps' => false, 'tail' => 'all')); + $optionsResolver->addAllowedTypes('follow', array('bool')); + $optionsResolver->addAllowedTypes('stdout', array('bool')); + $optionsResolver->addAllowedTypes('stderr', array('bool')); + $optionsResolver->addAllowedTypes('since', array('int')); + $optionsResolver->addAllowedTypes('until', array('int')); + $optionsResolver->addAllowedTypes('timestamps', array('bool')); + $optionsResolver->addAllowedTypes('tail', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerLogsNotFoundException * @throws \Docker\API\Exception\ContainerLogsInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (101 === $status) { - return json_decode($body); - } + $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')); + 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')); + throw new \Docker\API\Exception\ContainerLogsInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerPause.php b/src/Endpoint/ContainerPause.php index df6d1a96..16f1148b 100644 --- a/src/Endpoint/ContainerPause.php +++ b/src/Endpoint/ContainerPause.php @@ -1,70 +1,66 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/pause'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/pause'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerPauseNotFoundException * @throws \Docker\API\Exception\ContainerPauseInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ContainerPauseInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerPrune.php b/src/Endpoint/ContainerPrune.php index 81077452..54749abe 100644 --- a/src/Endpoint/ContainerPrune.php +++ b/src/Endpoint/ContainerPrune.php @@ -1,66 +1,51 @@ ` 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 = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/containers/prune'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -68,13 +53,19 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\ContainersPrunePostResponse200 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\ContainerPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerRename.php b/src/Endpoint/ContainerRename.php index 35075301..22148336 100644 --- a/src/Endpoint/ContainerRename.php +++ b/src/Endpoint/ContainerRename.php @@ -1,85 +1,77 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/rename'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/rename'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['name']); - $optionsResolver->setRequired(['name']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('name', ['string']); - + $optionsResolver->setDefined(array('name')); + $optionsResolver->setRequired(array('name')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('name', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerRenameNotFoundException * @throws \Docker\API\Exception\ContainerRenameConflictException * @throws \Docker\API\Exception\ContainerRenameInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ContainerRenameInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerResize.php b/src/Endpoint/ContainerResize.php index 4d7d09d0..8d697cf3 100644 --- a/src/Endpoint/ContainerResize.php +++ b/src/Endpoint/ContainerResize.php @@ -1,85 +1,75 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/resize'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/resize'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['h', 'w']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('h', ['int']); - $optionsResolver->setAllowedTypes('w', ['int']); - + $optionsResolver->setDefined(array('h', 'w')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('h', array('int')); + $optionsResolver->addAllowedTypes('w', array('int')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerResizeNotFoundException * @throws \Docker\API\Exception\ContainerResizeInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ContainerResizeInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerRestart.php b/src/Endpoint/ContainerRestart.php index dff828c1..42bf9614 100644 --- a/src/Endpoint/ContainerRestart.php +++ b/src/Endpoint/ContainerRestart.php @@ -1,81 +1,75 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/restart'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/restart'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['t']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('t', ['int']); - + $optionsResolver->setDefined(array('signal', 't')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('signal', array('string')); + $optionsResolver->addAllowedTypes('t', array('int')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerRestartNotFoundException * @throws \Docker\API\Exception\ContainerRestartInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ContainerRestartInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerStart.php b/src/Endpoint/ContainerStart.php index f9e6adcf..06be5bed 100644 --- a/src/Endpoint/ContainerStart.php +++ b/src/Endpoint/ContainerStart.php @@ -1,86 +1,79 @@ ` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. - * } - */ - public function __construct(string $id, array $queryParameters = []) + * + * + * @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 `_`. + + * } + */ + public function __construct(string $id, array $queryParameters = array()) { $this->id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/start'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/start'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['detachKeys']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('detachKeys', ['string']); - + $optionsResolver->setDefined(array('detachKeys')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('detachKeys', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerStartNotFoundException * @throws \Docker\API\Exception\ContainerStartInternalServerErrorException * - * @return null|\Docker\API\Model\ErrorResponse + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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 $serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'); + return null; } if (404 === $status) { - throw new \Docker\API\Exception\ContainerStartNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + 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')); + throw new \Docker\API\Exception\ContainerStartInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerStats.php b/src/Endpoint/ContainerStats.php index dad2dd66..51b0adf5 100644 --- a/src/Endpoint/ContainerStats.php +++ b/src/Endpoint/ContainerStats.php @@ -1,93 +1,105 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/stats'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/stats'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['stream']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['stream' => true]); - $optionsResolver->setAllowedTypes('stream', ['bool']); - + $optionsResolver->setDefined(array('stream', 'one-shot')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('stream' => true, 'one-shot' => false)); + $optionsResolver->addAllowedTypes('stream', array('bool')); + $optionsResolver->addAllowedTypes('one-shot', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerStatsNotFoundException * @throws \Docker\API\Exception\ContainerStatsInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ContainerStatsInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerStop.php b/src/Endpoint/ContainerStop.php index 4e555178..487c236b 100644 --- a/src/Endpoint/ContainerStop.php +++ b/src/Endpoint/ContainerStop.php @@ -1,86 +1,78 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/stop'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/stop'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['t']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('t', ['int']); - + $optionsResolver->setDefined(array('signal', 't')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('signal', array('string')); + $optionsResolver->addAllowedTypes('t', array('int')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerStopNotFoundException * @throws \Docker\API\Exception\ContainerStopInternalServerErrorException * - * @return null|\Docker\API\Model\ErrorResponse + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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 $serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'); + return null; } if (404 === $status) { - throw new \Docker\API\Exception\ContainerStopNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + 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')); + throw new \Docker\API\Exception\ContainerStopInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerTop.php b/src/Endpoint/ContainerTop.php index 8f96821f..49a4e405 100644 --- a/src/Endpoint/ContainerTop.php +++ b/src/Endpoint/ContainerTop.php @@ -1,67 +1,51 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/top'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/top'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['ps_args']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['ps_args' => '-ef']); - $optionsResolver->setAllowedTypes('ps_args', ['string']); - + $optionsResolver->setDefined(array('ps_args')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('ps_args' => '-ef')); + $optionsResolver->addAllowedTypes('ps_args', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -70,16 +54,22 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\ContainersIdTopGetResponse200 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ContainerTopInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerUnpause.php b/src/Endpoint/ContainerUnpause.php index ea206c97..a779bbbc 100644 --- a/src/Endpoint/ContainerUnpause.php +++ b/src/Endpoint/ContainerUnpause.php @@ -1,19 +1,10 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/unpause'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/unpause'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ContainerUnpauseNotFoundException * @throws \Docker\API\Exception\ContainerUnpauseInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ContainerUnpauseInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerUpdate.php b/src/Endpoint/ContainerUpdate.php index a0373b83..ff01860b 100644 --- a/src/Endpoint/ContainerUpdate.php +++ b/src/Endpoint/ContainerUpdate.php @@ -1,53 +1,40 @@ id = $id; $this->body = $update; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/update'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/update'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -56,16 +43,22 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\ContainersIdUpdatePostResponse200 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ContainerUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ContainerWait.php b/src/Endpoint/ContainerWait.php index 29d5f9cc..b42cbb04 100644 --- a/src/Endpoint/ContainerWait.php +++ b/src/Endpoint/ContainerWait.php @@ -1,85 +1,80 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/wait'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/wait'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['condition']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['condition' => 'not-running']); - $optionsResolver->setAllowedTypes('condition', ['string']); - + $optionsResolver->setDefined(array('condition')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('condition' => 'not-running')); + $optionsResolver->addAllowedTypes('condition', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * + * @throws \Docker\API\Exception\ContainerWaitBadRequestException * @throws \Docker\API\Exception\ContainerWaitNotFoundException * @throws \Docker\API\Exception\ContainerWaitInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersIdWaitPostResponse200 + * @return null|\Docker\API\Model\ContainerWaitResponse */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\ContainersIdWaitPostResponse200', 'json'); + 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')); + 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')); + throw new \Docker\API\Exception\ContainerWaitInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/DistributionInspect.php b/src/Endpoint/DistributionInspect.php index 5c0449c0..107c9585 100644 --- a/src/Endpoint/DistributionInspect.php +++ b/src/Endpoint/DistributionInspect.php @@ -1,19 +1,10 @@ name = $name; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/distribution/{name}/json'); + return str_replace(array('{name}'), array($this->name), '/distribution/{name}/json'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\DistributionInspectUnauthorizedException * @throws \Docker\API\Exception\DistributionInspectInternalServerErrorException * - * @return null|\Docker\API\Model\DistributionNameJsonGetResponse200 + * @return null|\Docker\API\Model\DistributionInspect */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\DistributionNameJsonGetResponse200', 'json'); + 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')); + 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')); + throw new \Docker\API\Exception\DistributionInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ExecInspect.php b/src/Endpoint/ExecInspect.php index ad074fc5..bd6c0bcb 100644 --- a/src/Endpoint/ExecInspect.php +++ b/src/Endpoint/ExecInspect.php @@ -1,19 +1,10 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/exec/{id}/json'); + return str_replace(array('{id}'), array($this->id), '/exec/{id}/json'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -54,16 +39,22 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\ExecIdJsonGetResponse200 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ExecInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ExecResize.php b/src/Endpoint/ExecResize.php index 61c1d42d..3da506b6 100644 --- a/src/Endpoint/ExecResize.php +++ b/src/Endpoint/ExecResize.php @@ -1,81 +1,81 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/exec/{id}/resize'); + return str_replace(array('{id}'), array($this->id), '/exec/{id}/resize'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['h', 'w']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('h', ['int']); - $optionsResolver->setAllowedTypes('w', ['int']); - + $optionsResolver->setDefined(array('h', 'w')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('h', array('int')); + $optionsResolver->addAllowedTypes('w', array('int')); return $optionsResolver; } - /** * {@inheritdoc} * + * @throws \Docker\API\Exception\ExecResizeBadRequestException * @throws \Docker\API\Exception\ExecResizeNotFoundException + * @throws \Docker\API\Exception\ExecResizeInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (201 === $status) { + $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')); + 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 array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ExecStart.php b/src/Endpoint/ExecStart.php index f3246d8b..bba0c25d 100644 --- a/src/Endpoint/ExecStart.php +++ b/src/Endpoint/ExecStart.php @@ -1,69 +1,65 @@ id = $id; $this->body = $execStartConfig; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/exec/{id}/start'); + return str_replace(array('{id}'), array($this->id), '/exec/{id}/start'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ExecStartNotFoundException * @throws \Docker\API\Exception\ExecStartConflictException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ExecStartConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/GetPluginPrivileges.php b/src/Endpoint/GetPluginPrivileges.php index e88a1589..ad72e12b 100644 --- a/src/Endpoint/GetPluginPrivileges.php +++ b/src/Endpoint/GetPluginPrivileges.php @@ -1,75 +1,68 @@ queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/plugins/privileges'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['remote']); - $optionsResolver->setRequired(['remote']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('remote', ['string']); - + $optionsResolver->setDefined(array('remote')); + $optionsResolver->setRequired(array('remote')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('remote', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\GetPluginPrivilegesInternalServerErrorException * - * @return null|\Docker\API\Model\PluginsPrivilegesGetResponse200Item[] + * @return null|\Docker\API\Model\PluginPrivilege[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\PluginsPrivilegesGetResponse200Item[]', 'json'); + 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')); + throw new \Docker\API\Exception\GetPluginPrivilegesInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImageBuild.php b/src/Endpoint/ImageBuild.php index c8311bea..e99c0a42 100644 --- a/src/Endpoint/ImageBuild.php +++ b/src/Endpoint/ImageBuild.php @@ -1,61 +1,61 @@ `. Any other value is taken as a custom network's name to which this container should connect to. - * @var string $platform Platform in the format os[/arch[/variant]] - * } - * - * @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 - + + * + * @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.](/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 + * } + * @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": { @@ -68,100 +68,100 @@ class ImageBuild extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Ja } } ``` - + 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 = []) + + * } + */ + public function __construct($inputStream, array $queryParameters = array(), array $headerParameters = array()) { $this->body = $inputStream; $this->queryParameters = $queryParameters; $this->headerParameters = $headerParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/build'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], $this->body]; + return array(array(), $this->body); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + 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']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['dockerfile' => 'Dockerfile', 'q' => false, 'nocache' => false, 'rm' => true, 'forcerm' => false, 'platform' => '']); - $optionsResolver->setAllowedTypes('dockerfile', ['string']); - $optionsResolver->setAllowedTypes('t', ['string']); - $optionsResolver->setAllowedTypes('extrahosts', ['string']); - $optionsResolver->setAllowedTypes('remote', ['string']); - $optionsResolver->setAllowedTypes('q', ['bool']); - $optionsResolver->setAllowedTypes('nocache', ['bool']); - $optionsResolver->setAllowedTypes('cachefrom', ['string']); - $optionsResolver->setAllowedTypes('pull', ['string']); - $optionsResolver->setAllowedTypes('rm', ['bool']); - $optionsResolver->setAllowedTypes('forcerm', ['bool']); - $optionsResolver->setAllowedTypes('memory', ['int']); - $optionsResolver->setAllowedTypes('memswap', ['int']); - $optionsResolver->setAllowedTypes('cpushares', ['int']); - $optionsResolver->setAllowedTypes('cpusetcpus', ['string']); - $optionsResolver->setAllowedTypes('cpuperiod', ['int']); - $optionsResolver->setAllowedTypes('cpuquota', ['int']); - $optionsResolver->setAllowedTypes('buildargs', ['string']); - $optionsResolver->setAllowedTypes('shmsize', ['int']); - $optionsResolver->setAllowedTypes('squash', ['bool']); - $optionsResolver->setAllowedTypes('labels', ['string']); - $optionsResolver->setAllowedTypes('networkmode', ['string']); - $optionsResolver->setAllowedTypes('platform', ['string']); - + $optionsResolver->setDefined(array('dockerfile', 't', 'extrahosts', 'remote', 'q', 'nocache', 'cachefrom', 'pull', 'rm', 'forcerm', 'memory', 'memswap', 'cpushares', 'cpusetcpus', 'cpuperiod', 'cpuquota', 'buildargs', 'shmsize', 'squash', 'labels', 'networkmode', 'platform', 'target', 'outputs')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('dockerfile' => 'Dockerfile', 'q' => false, 'nocache' => false, 'rm' => true, 'forcerm' => false, 'platform' => '', 'target' => '', 'outputs' => '')); + $optionsResolver->addAllowedTypes('dockerfile', array('string')); + $optionsResolver->addAllowedTypes('t', array('string')); + $optionsResolver->addAllowedTypes('extrahosts', array('string')); + $optionsResolver->addAllowedTypes('remote', array('string')); + $optionsResolver->addAllowedTypes('q', array('bool')); + $optionsResolver->addAllowedTypes('nocache', array('bool')); + $optionsResolver->addAllowedTypes('cachefrom', array('string')); + $optionsResolver->addAllowedTypes('pull', array('string')); + $optionsResolver->addAllowedTypes('rm', array('bool')); + $optionsResolver->addAllowedTypes('forcerm', array('bool')); + $optionsResolver->addAllowedTypes('memory', array('int')); + $optionsResolver->addAllowedTypes('memswap', array('int')); + $optionsResolver->addAllowedTypes('cpushares', array('int')); + $optionsResolver->addAllowedTypes('cpusetcpus', array('string')); + $optionsResolver->addAllowedTypes('cpuperiod', array('int')); + $optionsResolver->addAllowedTypes('cpuquota', array('int')); + $optionsResolver->addAllowedTypes('buildargs', array('string')); + $optionsResolver->addAllowedTypes('shmsize', array('int')); + $optionsResolver->addAllowedTypes('squash', array('bool')); + $optionsResolver->addAllowedTypes('labels', array('string')); + $optionsResolver->addAllowedTypes('networkmode', array('string')); + $optionsResolver->addAllowedTypes('platform', array('string')); + $optionsResolver->addAllowedTypes('target', array('string')); + $optionsResolver->addAllowedTypes('outputs', array('string')); return $optionsResolver; } - - protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\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->setAllowedTypes('Content-type', ['string']); - $optionsResolver->setAllowedTypes('X-Registry-Config', ['string']); - + $optionsResolver->setDefined(array('Content-type', 'X-Registry-Config')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('Content-type' => 'application/x-tar')); + $optionsResolver->addAllowedTypes('Content-type', array('string')); + $optionsResolver->addAllowedTypes('X-Registry-Config', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ImageBuildBadRequestException * @throws \Docker\API\Exception\ImageBuildInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ImageBuildInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImageCommit.php b/src/Endpoint/ImageCommit.php index 87dc1d45..037fad05 100644 --- a/src/Endpoint/ImageCommit.php +++ b/src/Endpoint/ImageCommit.php @@ -1,21 +1,14 @@ body = $containerConfig; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/commit'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + 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->setAllowedTypes('container', ['string']); - $optionsResolver->setAllowedTypes('repo', ['string']); - $optionsResolver->setAllowedTypes('tag', ['string']); - $optionsResolver->setAllowedTypes('comment', ['string']); - $optionsResolver->setAllowedTypes('author', ['string']); - $optionsResolver->setAllowedTypes('pause', ['bool']); - $optionsResolver->setAllowedTypes('changes', ['string']); - + $optionsResolver->setDefined(array('container', 'repo', 'tag', 'comment', 'author', 'pause', 'changes')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('pause' => true)); + $optionsResolver->addAllowedTypes('container', array('string')); + $optionsResolver->addAllowedTypes('repo', array('string')); + $optionsResolver->addAllowedTypes('tag', array('string')); + $optionsResolver->addAllowedTypes('comment', array('string')); + $optionsResolver->addAllowedTypes('author', array('string')); + $optionsResolver->addAllowedTypes('pause', array('bool')); + $optionsResolver->addAllowedTypes('changes', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -78,16 +63,22 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\IdResponse */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ImageCommitInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImageCreate.php b/src/Endpoint/ImageCreate.php index a221cc50..6ea1b3b8 100644 --- a/src/Endpoint/ImageCreate.php +++ b/src/Endpoint/ImageCreate.php @@ -1,106 +1,122 @@ body = $inputImage; $this->queryParameters = $queryParameters; $this->headerParameters = $headerParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/images/create'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], $this->body]; + return array(array(), $this->body); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['fromImage', 'fromSrc', 'repo', 'tag', 'platform']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['platform' => '']); - $optionsResolver->setAllowedTypes('fromImage', ['string']); - $optionsResolver->setAllowedTypes('fromSrc', ['string']); - $optionsResolver->setAllowedTypes('repo', ['string']); - $optionsResolver->setAllowedTypes('tag', ['string']); - $optionsResolver->setAllowedTypes('platform', ['string']); - + $optionsResolver->setDefined(array('fromImage', 'fromSrc', 'repo', 'tag', 'message', 'changes', 'platform')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('platform' => '')); + $optionsResolver->addAllowedTypes('fromImage', array('string')); + $optionsResolver->addAllowedTypes('fromSrc', array('string')); + $optionsResolver->addAllowedTypes('repo', array('string')); + $optionsResolver->addAllowedTypes('tag', array('string')); + $optionsResolver->addAllowedTypes('message', array('string')); + $optionsResolver->addAllowedTypes('changes', array('array')); + $optionsResolver->addAllowedTypes('platform', array('string')); return $optionsResolver; } - - protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getHeadersOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getHeadersOptionsResolver(); - $optionsResolver->setDefined(['X-Registry-Auth']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('X-Registry-Auth', ['string']); - + $optionsResolver->setDefined(array('X-Registry-Auth')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('X-Registry-Auth', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ImageCreateNotFoundException * @throws \Docker\API\Exception\ImageCreateInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ImageCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImageDelete.php b/src/Endpoint/ImageDelete.php index 71aeee21..0ae2ba76 100644 --- a/src/Endpoint/ImageDelete.php +++ b/src/Endpoint/ImageDelete.php @@ -1,74 +1,56 @@ name = $name; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'DELETE'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/images/{name}'); + return str_replace(array('{name}'), array($this->name), '/images/{name}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['force', 'noprune']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['force' => false, 'noprune' => false]); - $optionsResolver->setAllowedTypes('force', ['bool']); - $optionsResolver->setAllowedTypes('noprune', ['bool']); - + $optionsResolver->setDefined(array('force', 'noprune')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('force' => false, 'noprune' => false)); + $optionsResolver->addAllowedTypes('force', array('bool')); + $optionsResolver->addAllowedTypes('noprune', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -78,19 +60,25 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\ImageDeleteResponseItem[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ImageDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImageGet.php b/src/Endpoint/ImageGet.php index 2ce7c245..335b44d2 100644 --- a/src/Endpoint/ImageGet.php +++ b/src/Endpoint/ImageGet.php @@ -1,36 +1,27 @@ name = $name; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/images/{name}/get'); + return str_replace(array('{name}'), array($this->name), '/images/{name}/get'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ImageGetInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\ImageGetInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImageGetAll.php b/src/Endpoint/ImageGetAll.php index 5912131e..d685c12f 100644 --- a/src/Endpoint/ImageGetAll.php +++ b/src/Endpoint/ImageGetAll.php @@ -1,80 +1,76 @@ queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/images/get'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['names']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('names', ['array']); - + $optionsResolver->setDefined(array('names')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('names', array('array')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ImageGetAllInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\ImageGetAllInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImageHistory.php b/src/Endpoint/ImageHistory.php index c55e9050..9bf142fe 100644 --- a/src/Endpoint/ImageHistory.php +++ b/src/Endpoint/ImageHistory.php @@ -1,19 +1,10 @@ name = $name; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/images/{name}/history'); + return str_replace(array('{name}'), array($this->name), '/images/{name}/history'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -54,16 +39,22 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\ImagesNameHistoryGetResponse200Item[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ImageHistoryInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImageInspect.php b/src/Endpoint/ImageInspect.php index a77652d8..c341b5c6 100644 --- a/src/Endpoint/ImageInspect.php +++ b/src/Endpoint/ImageInspect.php @@ -1,19 +1,10 @@ name = $name; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/images/{name}/json'); + return str_replace(array('{name}'), array($this->name), '/images/{name}/json'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ImageInspectNotFoundException * @throws \Docker\API\Exception\ImageInspectInternalServerErrorException * - * @return null|\Docker\API\Model\Image + * @return null|\Docker\API\Model\ImageInspect */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\Image', 'json'); + 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')); + 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')); + throw new \Docker\API\Exception\ImageInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImageList.php b/src/Endpoint/ImageList.php index 88711b39..3b37927d 100644 --- a/src/Endpoint/ImageList.php +++ b/src/Endpoint/ImageList.php @@ -1,68 +1,62 @@ [:]`, `` or ``) + - `dangling=true` + - `label=key` or `label="key=value"` of an image label + - `reference`=(`[:]`) + - `since`=(`[:]`, `` or ``) + + * @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. + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/images/json'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['all', 'filters', 'digests']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['all' => false, 'digests' => false]); - $optionsResolver->setAllowedTypes('all', ['bool']); - $optionsResolver->setAllowedTypes('filters', ['string']); - $optionsResolver->setAllowedTypes('digests', ['bool']); - + $optionsResolver->setDefined(array('all', 'filters', 'shared-size', 'digests')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('all' => false, 'shared-size' => false, 'digests' => false)); + $optionsResolver->addAllowedTypes('all', array('bool')); + $optionsResolver->addAllowedTypes('filters', array('string')); + $optionsResolver->addAllowedTypes('shared-size', array('bool')); + $optionsResolver->addAllowedTypes('digests', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -70,13 +64,19 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\ImageSummary[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\ImageListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImageLoad.php b/src/Endpoint/ImageLoad.php index 39ceed44..3d6d9401 100644 --- a/src/Endpoint/ImageLoad.php +++ b/src/Endpoint/ImageLoad.php @@ -1,80 +1,71 @@ body = $imagesTarball; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/images/load'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], $this->body]; + return array(array(), $this->body); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['quiet']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['quiet' => false]); - $optionsResolver->setAllowedTypes('quiet', ['bool']); - + $optionsResolver->setDefined(array('quiet')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('quiet' => false)); + $optionsResolver->addAllowedTypes('quiet', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ImageLoadInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\ImageLoadInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImagePrune.php b/src/Endpoint/ImagePrune.php index 46826a1c..afdadf75 100644 --- a/src/Endpoint/ImagePrune.php +++ b/src/Endpoint/ImagePrune.php @@ -1,68 +1,53 @@ ` 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 = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/images/prune'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -70,13 +55,19 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\ImagesPrunePostResponse200 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\ImagePruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImagePush.php b/src/Endpoint/ImagePush.php index 0dac31bc..fcc02d93 100644 --- a/src/Endpoint/ImagePush.php +++ b/src/Endpoint/ImagePush.php @@ -1,105 +1,97 @@ name = $name; $this->queryParameters = $queryParameters; $this->headerParameters = $headerParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/images/{name}/push'); + return str_replace(array('{name}'), array($this->name), '/images/{name}/push'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['tag']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('tag', ['string']); - + $optionsResolver->setDefined(array('tag')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('tag', array('string')); return $optionsResolver; } - - protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getHeadersOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getHeadersOptionsResolver(); - $optionsResolver->setDefined(['X-Registry-Auth']); - $optionsResolver->setRequired(['X-Registry-Auth']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('X-Registry-Auth', ['string']); - + $optionsResolver->setDefined(array('X-Registry-Auth')); + $optionsResolver->setRequired(array('X-Registry-Auth')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('X-Registry-Auth', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ImagePushNotFoundException * @throws \Docker\API\Exception\ImagePushInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ImagePushInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImageSearch.php b/src/Endpoint/ImageSearch.php index 0144491e..5b567894 100644 --- a/src/Endpoint/ImageSearch.php +++ b/src/Endpoint/ImageSearch.php @@ -1,72 +1,55 @@ ` Matches images that has at least 'number' stars. - - * } - */ - public function __construct(array $queryParameters = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/images/search'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['term', 'limit', 'filters']); - $optionsResolver->setRequired(['term']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('term', ['string']); - $optionsResolver->setAllowedTypes('limit', ['int']); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('term', 'limit', 'filters')); + $optionsResolver->setRequired(array('term')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('term', array('string')); + $optionsResolver->addAllowedTypes('limit', array('int')); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -74,13 +57,19 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\ImagesSearchGetResponse200Item[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\ImageSearchInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ImageTag.php b/src/Endpoint/ImageTag.php index a5ca0e42..06d532cf 100644 --- a/src/Endpoint/ImageTag.php +++ b/src/Endpoint/ImageTag.php @@ -1,69 +1,51 @@ name = $name; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/images/{name}/tag'); + return str_replace(array('{name}'), array($this->name), '/images/{name}/tag'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['repo', 'tag']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('repo', ['string']); - $optionsResolver->setAllowedTypes('tag', ['string']); - + $optionsResolver->setDefined(array('repo', 'tag')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('repo', array('string')); + $optionsResolver->addAllowedTypes('tag', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -71,23 +53,31 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * @throws \Docker\API\Exception\ImageTagNotFoundException * @throws \Docker\API\Exception\ImageTagConflictException * @throws \Docker\API\Exception\ImageTagInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ImageTagInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/NetworkConnect.php b/src/Endpoint/NetworkConnect.php index 6b458851..98e2ff16 100644 --- a/src/Endpoint/NetworkConnect.php +++ b/src/Endpoint/NetworkConnect.php @@ -1,71 +1,66 @@ id = $id; $this->body = $container; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/networks/{id}/connect'); + return str_replace(array('{id}'), array($this->id), '/networks/{id}/connect'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\NetworkConnectForbiddenException * @throws \Docker\API\Exception\NetworkConnectNotFoundException * @throws \Docker\API\Exception\NetworkConnectInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\NetworkConnectForbiddenException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + 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')); + 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')); + throw new \Docker\API\Exception\NetworkConnectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/NetworkCreate.php b/src/Endpoint/NetworkCreate.php index 0159216d..f854f572 100644 --- a/src/Endpoint/NetworkCreate.php +++ b/src/Endpoint/NetworkCreate.php @@ -1,47 +1,35 @@ body = $networkConfig; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/networks/create'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -51,19 +39,25 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\NetworksCreatePostResponse201 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\NetworksCreatePostResponse201', 'json'); } if (403 === $status) { - throw new \Docker\API\Exception\NetworkCreateForbiddenException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + 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')); + 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')); + throw new \Docker\API\Exception\NetworkCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/NetworkDelete.php b/src/Endpoint/NetworkDelete.php index 2be6b005..f630673f 100644 --- a/src/Endpoint/NetworkDelete.php +++ b/src/Endpoint/NetworkDelete.php @@ -1,69 +1,64 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'DELETE'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/networks/{id}'); + return str_replace(array('{id}'), array($this->id), '/networks/{id}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\NetworkDeleteForbiddenException * @throws \Docker\API\Exception\NetworkDeleteNotFoundException * @throws \Docker\API\Exception\NetworkDeleteInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\NetworkDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/NetworkDisconnect.php b/src/Endpoint/NetworkDisconnect.php index 7edfaedf..4bbea7cc 100644 --- a/src/Endpoint/NetworkDisconnect.php +++ b/src/Endpoint/NetworkDisconnect.php @@ -1,71 +1,66 @@ id = $id; $this->body = $container; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/networks/{id}/disconnect'); + return str_replace(array('{id}'), array($this->id), '/networks/{id}/disconnect'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\NetworkDisconnectForbiddenException * @throws \Docker\API\Exception\NetworkDisconnectNotFoundException * @throws \Docker\API\Exception\NetworkDisconnectInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\NetworkDisconnectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/NetworkInspect.php b/src/Endpoint/NetworkInspect.php index c7341688..59cb92ea 100644 --- a/src/Endpoint/NetworkInspect.php +++ b/src/Endpoint/NetworkInspect.php @@ -1,67 +1,51 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/networks/{id}'); + return str_replace(array('{id}'), array($this->id), '/networks/{id}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['verbose', 'scope']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['verbose' => false]); - $optionsResolver->setAllowedTypes('verbose', ['bool']); - $optionsResolver->setAllowedTypes('scope', ['string']); - + $optionsResolver->setDefined(array('verbose', 'scope')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('verbose' => false)); + $optionsResolver->addAllowedTypes('verbose', array('bool')); + $optionsResolver->addAllowedTypes('scope', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -70,16 +54,22 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\Network */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\NetworkInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/NetworkList.php b/src/Endpoint/NetworkList.php index bf5062b9..b046da0d 100644 --- a/src/Endpoint/NetworkList.php +++ b/src/Endpoint/NetworkList.php @@ -1,75 +1,67 @@ ` 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 = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/networks'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -77,13 +69,19 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\Network[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\NetworkListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/NetworkPrune.php b/src/Endpoint/NetworkPrune.php index 0d85e4da..0baaf92a 100644 --- a/src/Endpoint/NetworkPrune.php +++ b/src/Endpoint/NetworkPrune.php @@ -1,66 +1,51 @@ ` 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 = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/networks/prune'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -68,13 +53,19 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\NetworksPrunePostResponse200 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\NetworkPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/NodeDelete.php b/src/Endpoint/NodeDelete.php index ed67744c..4eac36f4 100644 --- a/src/Endpoint/NodeDelete.php +++ b/src/Endpoint/NodeDelete.php @@ -1,85 +1,77 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'DELETE'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/nodes/{id}'); + return str_replace(array('{id}'), array($this->id), '/nodes/{id}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['force']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['force' => false]); - $optionsResolver->setAllowedTypes('force', ['bool']); - + $optionsResolver->setDefined(array('force')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('force' => false)); + $optionsResolver->addAllowedTypes('force', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\NodeDeleteNotFoundException * @throws \Docker\API\Exception\NodeDeleteInternalServerErrorException * @throws \Docker\API\Exception\NodeDeleteServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\NodeDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/NodeInspect.php b/src/Endpoint/NodeInspect.php index f34b7791..1bfd94f8 100644 --- a/src/Endpoint/NodeInspect.php +++ b/src/Endpoint/NodeInspect.php @@ -1,49 +1,36 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/nodes/{id}'); + return str_replace(array('{id}'), array($this->id), '/nodes/{id}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -53,19 +40,25 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\Node */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\NodeInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/NodeList.php b/src/Endpoint/NodeList.php index 0f5cb07f..4c42c7d1 100644 --- a/src/Endpoint/NodeList.php +++ b/src/Endpoint/NodeList.php @@ -1,69 +1,55 @@ ` - `label=` - `membership=`(`accepted`|`pending`)` - `name=` + - `node.label=` - `role=`(`manager`|`worker`)` - - * } - */ - public function __construct(array $queryParameters = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/nodes'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -72,16 +58,22 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\Node[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\NodeListServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/NodeUpdate.php b/src/Endpoint/NodeUpdate.php index 98298014..a3083f21 100644 --- a/src/Endpoint/NodeUpdate.php +++ b/src/Endpoint/NodeUpdate.php @@ -1,67 +1,53 @@ id = $id; $this->body = $body; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/nodes/{id}/update'); + return str_replace(array('{id}'), array($this->id), '/nodes/{id}/update'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['version']); - $optionsResolver->setRequired(['version']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('version', ['int']); - + $optionsResolver->setDefined(array('version')); + $optionsResolver->setRequired(array('version')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('version', array('int')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -69,23 +55,31 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * @throws \Docker\API\Exception\NodeUpdateNotFoundException * @throws \Docker\API\Exception\NodeUpdateInternalServerErrorException * @throws \Docker\API\Exception\NodeUpdateServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\NodeUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/PluginCreate.php b/src/Endpoint/PluginCreate.php index ff9deb17..24aaecd8 100644 --- a/src/Endpoint/PluginCreate.php +++ b/src/Endpoint/PluginCreate.php @@ -1,75 +1,70 @@ body = $tarContext; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/plugins/create'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], $this->body]; + return array(array(), $this->body); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['name']); - $optionsResolver->setRequired(['name']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('name', ['string']); - + $optionsResolver->setDefined(array('name')); + $optionsResolver->setRequired(array('name')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('name', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\PluginCreateInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\PluginCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/PluginDelete.php b/src/Endpoint/PluginDelete.php index 99fd3dd5..c32b8511 100644 --- a/src/Endpoint/PluginDelete.php +++ b/src/Endpoint/PluginDelete.php @@ -1,65 +1,53 @@ name = $name; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'DELETE'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/plugins/{name}'); + return str_replace(array('{name}'), array($this->name), '/plugins/{name}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['force']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['force' => false]); - $optionsResolver->setAllowedTypes('force', ['bool']); - + $optionsResolver->setDefined(array('force')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('force' => false)); + $optionsResolver->addAllowedTypes('force', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -68,16 +56,22 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\Plugin */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\PluginDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/PluginDisable.php b/src/Endpoint/PluginDisable.php index b5479c9c..cd972563 100644 --- a/src/Endpoint/PluginDisable.php +++ b/src/Endpoint/PluginDisable.php @@ -1,65 +1,76 @@ name = $name; + $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/plugins/{name}/disable'); + return str_replace(array('{name}'), array($this->name), '/plugins/{name}/disable'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); + } + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(array('force')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('force', array('bool')); + return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\PluginDisableNotFoundException * @throws \Docker\API\Exception\PluginDisableInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\PluginDisableInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/PluginEnable.php b/src/Endpoint/PluginEnable.php index 62aaf0ea..14605db4 100644 --- a/src/Endpoint/PluginEnable.php +++ b/src/Endpoint/PluginEnable.php @@ -1,81 +1,75 @@ name = $name; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/plugins/{name}/enable'); + return str_replace(array('{name}'), array($this->name), '/plugins/{name}/enable'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['timeout']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['timeout' => 0]); - $optionsResolver->setAllowedTypes('timeout', ['int']); - + $optionsResolver->setDefined(array('timeout')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('timeout' => 0)); + $optionsResolver->addAllowedTypes('timeout', array('int')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\PluginEnableNotFoundException * @throws \Docker\API\Exception\PluginEnableInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\PluginEnableInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/PluginInspect.php b/src/Endpoint/PluginInspect.php index c28717c8..22106945 100644 --- a/src/Endpoint/PluginInspect.php +++ b/src/Endpoint/PluginInspect.php @@ -1,49 +1,37 @@ name = $name; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/plugins/{name}/json'); + return str_replace(array('{name}'), array($this->name), '/plugins/{name}/json'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -52,16 +40,22 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\Plugin */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\PluginInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/PluginList.php b/src/Endpoint/PluginList.php index 95ed0bab..06028b2f 100644 --- a/src/Endpoint/PluginList.php +++ b/src/Endpoint/PluginList.php @@ -1,67 +1,53 @@ ` - `enable=|` - - * } - */ - public function __construct(array $queryParameters = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/plugins'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -69,13 +55,19 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\Plugin[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\PluginListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/PluginPull.php b/src/Endpoint/PluginPull.php index c31377b9..32e73368 100644 --- a/src/Endpoint/PluginPull.php +++ b/src/Endpoint/PluginPull.php @@ -1,101 +1,96 @@ body = $body; $this->queryParameters = $queryParameters; $this->headerParameters = $headerParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/plugins/pull'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['remote', 'name']); - $optionsResolver->setRequired(['remote']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('remote', ['string']); - $optionsResolver->setAllowedTypes('name', ['string']); - + $optionsResolver->setDefined(array('remote', 'name')); + $optionsResolver->setRequired(array('remote')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('remote', array('string')); + $optionsResolver->addAllowedTypes('name', array('string')); return $optionsResolver; } - - protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getHeadersOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getHeadersOptionsResolver(); - $optionsResolver->setDefined(['X-Registry-Auth']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('X-Registry-Auth', ['string']); - + $optionsResolver->setDefined(array('X-Registry-Auth')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('X-Registry-Auth', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\PluginPullInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\PluginPullInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/PluginPush.php b/src/Endpoint/PluginPush.php index b77f81f4..8f2e5f9c 100644 --- a/src/Endpoint/PluginPush.php +++ b/src/Endpoint/PluginPush.php @@ -1,67 +1,61 @@ name = $name; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/plugins/{name}/push'); + return str_replace(array('{name}'), array($this->name), '/plugins/{name}/push'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\PluginPushNotFoundException * @throws \Docker\API\Exception\PluginPushInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\PluginPushInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/PluginSet.php b/src/Endpoint/PluginSet.php index affed2af..efc400a1 100644 --- a/src/Endpoint/PluginSet.php +++ b/src/Endpoint/PluginSet.php @@ -1,67 +1,64 @@ name = $name; $this->body = $body; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/plugins/{name}/set'); + return str_replace(array('{name}'), array($this->name), '/plugins/{name}/set'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\PluginSetNotFoundException * @throws \Docker\API\Exception\PluginSetInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\PluginSetInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/PluginUpgrade.php b/src/Endpoint/PluginUpgrade.php index 20b04d2e..0b6c03a1 100644 --- a/src/Endpoint/PluginUpgrade.php +++ b/src/Endpoint/PluginUpgrade.php @@ -1,103 +1,98 @@ name = $name; $this->body = $body; $this->queryParameters = $queryParameters; $this->headerParameters = $headerParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/plugins/{name}/upgrade'); + return str_replace(array('{name}'), array($this->name), '/plugins/{name}/upgrade'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['remote']); - $optionsResolver->setRequired(['remote']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('remote', ['string']); - + $optionsResolver->setDefined(array('remote')); + $optionsResolver->setRequired(array('remote')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('remote', array('string')); return $optionsResolver; } - - protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getHeadersOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getHeadersOptionsResolver(); - $optionsResolver->setDefined(['X-Registry-Auth']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('X-Registry-Auth', ['string']); - + $optionsResolver->setDefined(array('X-Registry-Auth')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('X-Registry-Auth', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\PluginUpgradeNotFoundException * @throws \Docker\API\Exception\PluginUpgradeInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\PluginUpgradeInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/PutContainerArchive.php b/src/Endpoint/PutContainerArchive.php index ac635b81..8f18e701 100644 --- a/src/Endpoint/PutContainerArchive.php +++ b/src/Endpoint/PutContainerArchive.php @@ -1,71 +1,66 @@ id = $id; $this->body = $inputStream; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'PUT'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/containers/{id}/archive'); + return str_replace(array('{id}'), array($this->id), '/containers/{id}/archive'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], $this->body]; + return array(array(), $this->body); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['path', 'noOverwriteDirNonDir']); - $optionsResolver->setRequired(['path']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('path', ['string']); - $optionsResolver->setAllowedTypes('noOverwriteDirNonDir', ['string']); - + $optionsResolver->setDefined(array('path', 'noOverwriteDirNonDir', 'copyUIDGID')); + $optionsResolver->setRequired(array('path')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('path', array('string')); + $optionsResolver->addAllowedTypes('noOverwriteDirNonDir', array('string')); + $optionsResolver->addAllowedTypes('copyUIDGID', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -73,23 +68,31 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * @throws \Docker\API\Exception\PutContainerArchiveForbiddenException * @throws \Docker\API\Exception\PutContainerArchiveNotFoundException * @throws \Docker\API\Exception\PutContainerArchiveInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\PutContainerArchiveInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SecretCreate.php b/src/Endpoint/SecretCreate.php index a5a10ea1..5a3efc70 100644 --- a/src/Endpoint/SecretCreate.php +++ b/src/Endpoint/SecretCreate.php @@ -1,47 +1,35 @@ body = $body; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/secrets/create'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -51,19 +39,25 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\IdResponse */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\SecretCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SecretDelete.php b/src/Endpoint/SecretDelete.php index cdd5bedc..f55e7a66 100644 --- a/src/Endpoint/SecretDelete.php +++ b/src/Endpoint/SecretDelete.php @@ -1,69 +1,64 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'DELETE'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/secrets/{id}'); + return str_replace(array('{id}'), array($this->id), '/secrets/{id}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\SecretDeleteNotFoundException * @throws \Docker\API\Exception\SecretDeleteInternalServerErrorException * @throws \Docker\API\Exception\SecretDeleteServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\SecretDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SecretInspect.php b/src/Endpoint/SecretInspect.php index 414c4400..216363b4 100644 --- a/src/Endpoint/SecretInspect.php +++ b/src/Endpoint/SecretInspect.php @@ -1,49 +1,36 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/secrets/{id}'); + return str_replace(array('{id}'), array($this->id), '/secrets/{id}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -53,19 +40,25 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\Secret */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\SecretInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SecretList.php b/src/Endpoint/SecretList.php index ef02b995..fb304175 100644 --- a/src/Endpoint/SecretList.php +++ b/src/Endpoint/SecretList.php @@ -1,67 +1,55 @@ ` - `label= or label==value` - `name=` - `names=` - - * } - */ - public function __construct(array $queryParameters = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/secrets'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -70,16 +58,22 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\Secret[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\SecretListServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SecretUpdate.php b/src/Endpoint/SecretUpdate.php index 132fd7f8..48da717f 100644 --- a/src/Endpoint/SecretUpdate.php +++ b/src/Endpoint/SecretUpdate.php @@ -1,67 +1,56 @@ id = $id; $this->body = $body; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/secrets/{id}/update'); + return str_replace(array('{id}'), array($this->id), '/secrets/{id}/update'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['version']); - $optionsResolver->setRequired(['version']); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('version', ['int']); - + $optionsResolver->setDefined(array('version')); + $optionsResolver->setRequired(array('version')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('version', array('int')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -69,23 +58,31 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * @throws \Docker\API\Exception\SecretUpdateNotFoundException * @throws \Docker\API\Exception\SecretUpdateInternalServerErrorException * @throws \Docker\API\Exception\SecretUpdateServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\SecretUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ServiceCreate.php b/src/Endpoint/ServiceCreate.php index d0d9e8fe..4d0ffc5f 100644 --- a/src/Endpoint/ServiceCreate.php +++ b/src/Endpoint/ServiceCreate.php @@ -1,63 +1,53 @@ body = $body; $this->headerParameters = $headerParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/services/create'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getHeadersOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getHeadersOptionsResolver(); - $optionsResolver->setDefined(['X-Registry-Auth']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('X-Registry-Auth', ['string']); - + $optionsResolver->setDefined(array('X-Registry-Auth')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('X-Registry-Auth', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -69,25 +59,31 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * * @return null|\Docker\API\Model\ServicesCreatePostResponse201 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\ServicesCreatePostResponse201', 'json'); } if (400 === $status) { - throw new \Docker\API\Exception\ServiceCreateBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + 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')); + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ServiceCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ServiceDelete.php b/src/Endpoint/ServiceDelete.php index c71a698b..55adfff5 100644 --- a/src/Endpoint/ServiceDelete.php +++ b/src/Endpoint/ServiceDelete.php @@ -1,69 +1,64 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'DELETE'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/services/{id}'); + return str_replace(array('{id}'), array($this->id), '/services/{id}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ServiceDeleteNotFoundException * @throws \Docker\API\Exception\ServiceDeleteInternalServerErrorException * @throws \Docker\API\Exception\ServiceDeleteServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ServiceDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ServiceInspect.php b/src/Endpoint/ServiceInspect.php index 8f3cf424..b0c5b4b2 100644 --- a/src/Endpoint/ServiceInspect.php +++ b/src/Endpoint/ServiceInspect.php @@ -1,65 +1,49 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/services/{id}'); + return str_replace(array('{id}'), array($this->id), '/services/{id}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['insertDefaults']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['insertDefaults' => false]); - $optionsResolver->setAllowedTypes('insertDefaults', ['bool']); - + $optionsResolver->setDefined(array('insertDefaults')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('insertDefaults' => false)); + $optionsResolver->addAllowedTypes('insertDefaults', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -69,19 +53,25 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\Service */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ServiceInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ServiceList.php b/src/Endpoint/ServiceList.php index 1198877c..8f6dda84 100644 --- a/src/Endpoint/ServiceList.php +++ b/src/Endpoint/ServiceList.php @@ -1,67 +1,58 @@ ` - `label=` - `mode=["replicated"|"global"]` - `name=` - - * } - */ - public function __construct(array $queryParameters = []) + + * @var bool $status Include service status, with count of running and desired tasks. + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/services'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('filters', 'status')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('filters', array('string')); + $optionsResolver->addAllowedTypes('status', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -70,16 +61,22 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\Service[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\ServiceListServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ServiceLogs.php b/src/Endpoint/ServiceLogs.php index b385458c..0d1dfd6b 100644 --- a/src/Endpoint/ServiceLogs.php +++ b/src/Endpoint/ServiceLogs.php @@ -1,106 +1,96 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/services/{id}/logs'); + return str_replace(array('{id}'), array($this->id), '/services/{id}/logs'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + 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->setAllowedTypes('details', ['bool']); - $optionsResolver->setAllowedTypes('follow', ['bool']); - $optionsResolver->setAllowedTypes('stdout', ['bool']); - $optionsResolver->setAllowedTypes('stderr', ['bool']); - $optionsResolver->setAllowedTypes('since', ['int']); - $optionsResolver->setAllowedTypes('timestamps', ['bool']); - $optionsResolver->setAllowedTypes('tail', ['string']); - + $optionsResolver->setDefined(array('details', 'follow', 'stdout', 'stderr', 'since', 'timestamps', 'tail')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('details' => false, 'follow' => false, 'stdout' => false, 'stderr' => false, 'since' => 0, 'timestamps' => false, 'tail' => 'all')); + $optionsResolver->addAllowedTypes('details', array('bool')); + $optionsResolver->addAllowedTypes('follow', array('bool')); + $optionsResolver->addAllowedTypes('stdout', array('bool')); + $optionsResolver->addAllowedTypes('stderr', array('bool')); + $optionsResolver->addAllowedTypes('since', array('int')); + $optionsResolver->addAllowedTypes('timestamps', array('bool')); + $optionsResolver->addAllowedTypes('tail', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\ServiceLogsNotFoundException * @throws \Docker\API\Exception\ServiceLogsInternalServerErrorException * @throws \Docker\API\Exception\ServiceLogsServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (101 === $status) { - return json_decode($body); - } + $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')); + 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')); + 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')); + throw new \Docker\API\Exception\ServiceLogsServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/ServiceUpdate.php b/src/Endpoint/ServiceUpdate.php index 480d5dfb..44719234 100644 --- a/src/Endpoint/ServiceUpdate.php +++ b/src/Endpoint/ServiceUpdate.php @@ -1,88 +1,83 @@ id = $id; $this->body = $body; $this->queryParameters = $queryParameters; $this->headerParameters = $headerParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/services/{id}/update'); + return str_replace(array('{id}'), array($this->id), '/services/{id}/update'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['version', 'registryAuthFrom', 'rollback']); - $optionsResolver->setRequired(['version']); - $optionsResolver->setDefaults(['registryAuthFrom' => 'spec']); - $optionsResolver->setAllowedTypes('version', ['int']); - $optionsResolver->setAllowedTypes('registryAuthFrom', ['string']); - $optionsResolver->setAllowedTypes('rollback', ['string']); - + $optionsResolver->setDefined(array('version', 'registryAuthFrom', 'rollback')); + $optionsResolver->setRequired(array('version')); + $optionsResolver->setDefaults(array('registryAuthFrom' => 'spec')); + $optionsResolver->addAllowedTypes('version', array('int')); + $optionsResolver->addAllowedTypes('registryAuthFrom', array('string')); + $optionsResolver->addAllowedTypes('rollback', array('string')); return $optionsResolver; } - - protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getHeadersOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getHeadersOptionsResolver(); - $optionsResolver->setDefined(['X-Registry-Auth']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('X-Registry-Auth', ['string']); - + $optionsResolver->setDefined(array('X-Registry-Auth')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('X-Registry-Auth', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -93,22 +88,28 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * * @return null|\Docker\API\Model\ServiceUpdateResponse */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\ServiceUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/Session.php b/src/Endpoint/Session.php index c5f36a19..8e058451 100644 --- a/src/Endpoint/Session.php +++ b/src/Endpoint/Session.php @@ -1,55 +1,50 @@ ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\SessionBadRequestException * @throws \Docker\API\Exception\SessionInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\SessionInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SwarmInit.php b/src/Endpoint/SwarmInit.php index 51fe9941..4e3ba81a 100644 --- a/src/Endpoint/SwarmInit.php +++ b/src/Endpoint/SwarmInit.php @@ -1,67 +1,63 @@ body = $body; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/swarm/init'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\SwarmInitBadRequestException * @throws \Docker\API\Exception\SwarmInitInternalServerErrorException * @throws \Docker\API\Exception\SwarmInitServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\SwarmInitServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SwarmInspect.php b/src/Endpoint/SwarmInspect.php index aa2e64c9..d28b1e8a 100644 --- a/src/Endpoint/SwarmInspect.php +++ b/src/Endpoint/SwarmInspect.php @@ -1,39 +1,26 @@ ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -43,19 +30,25 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\Swarm */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\SwarmInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SwarmJoin.php b/src/Endpoint/SwarmJoin.php index e0ce9ee2..9d3b8d97 100644 --- a/src/Endpoint/SwarmJoin.php +++ b/src/Endpoint/SwarmJoin.php @@ -1,67 +1,63 @@ body = $body; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/swarm/join'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\SwarmJoinBadRequestException * @throws \Docker\API\Exception\SwarmJoinInternalServerErrorException * @throws \Docker\API\Exception\SwarmJoinServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\SwarmJoinServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SwarmLeave.php b/src/Endpoint/SwarmLeave.php index 3a5fc51c..69e1abec 100644 --- a/src/Endpoint/SwarmLeave.php +++ b/src/Endpoint/SwarmLeave.php @@ -1,77 +1,72 @@ queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/swarm/leave'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['force']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['force' => false]); - $optionsResolver->setAllowedTypes('force', ['bool']); - + $optionsResolver->setDefined(array('force')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('force' => false)); + $optionsResolver->addAllowedTypes('force', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\SwarmLeaveInternalServerErrorException * @throws \Docker\API\Exception\SwarmLeaveServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\SwarmLeaveServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SwarmUnlock.php b/src/Endpoint/SwarmUnlock.php index c4044947..dca6fcf6 100644 --- a/src/Endpoint/SwarmUnlock.php +++ b/src/Endpoint/SwarmUnlock.php @@ -1,63 +1,59 @@ body = $body; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/swarm/unlock'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\SwarmUnlockInternalServerErrorException * @throws \Docker\API\Exception\SwarmUnlockServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\SwarmUnlockServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SwarmUnlockkey.php b/src/Endpoint/SwarmUnlockkey.php index 30f48457..0af17d70 100644 --- a/src/Endpoint/SwarmUnlockkey.php +++ b/src/Endpoint/SwarmUnlockkey.php @@ -1,39 +1,26 @@ ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -42,16 +29,22 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\SwarmUnlockkeyGetResponse200 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\SwarmUnlockkeyServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SwarmUpdate.php b/src/Endpoint/SwarmUpdate.php index 5401525b..286da289 100644 --- a/src/Endpoint/SwarmUpdate.php +++ b/src/Endpoint/SwarmUpdate.php @@ -1,89 +1,84 @@ body = $body; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/swarm/update'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + 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->setAllowedTypes('version', ['int']); - $optionsResolver->setAllowedTypes('rotateWorkerToken', ['bool']); - $optionsResolver->setAllowedTypes('rotateManagerToken', ['bool']); - $optionsResolver->setAllowedTypes('rotateManagerUnlockKey', ['bool']); - + $optionsResolver->setDefined(array('version', 'rotateWorkerToken', 'rotateManagerToken', 'rotateManagerUnlockKey')); + $optionsResolver->setRequired(array('version')); + $optionsResolver->setDefaults(array('rotateWorkerToken' => false, 'rotateManagerToken' => false, 'rotateManagerUnlockKey' => false)); + $optionsResolver->addAllowedTypes('version', array('int')); + $optionsResolver->addAllowedTypes('rotateWorkerToken', array('bool')); + $optionsResolver->addAllowedTypes('rotateManagerToken', array('bool')); + $optionsResolver->addAllowedTypes('rotateManagerUnlockKey', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\SwarmUpdateBadRequestException * @throws \Docker\API\Exception\SwarmUpdateInternalServerErrorException * @throws \Docker\API\Exception\SwarmUpdateServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\SwarmUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SystemAuth.php b/src/Endpoint/SystemAuth.php index e1a94c42..08bc8ce1 100644 --- a/src/Endpoint/SystemAuth.php +++ b/src/Endpoint/SystemAuth.php @@ -1,66 +1,64 @@ body = $authConfig; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/auth'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * + * @throws \Docker\API\Exception\SystemAuthUnauthorizedException * @throws \Docker\API\Exception\SystemAuthInternalServerErrorException * * @return null|\Docker\API\Model\AuthPostResponse200 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\SystemAuthInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SystemDataUsage.php b/src/Endpoint/SystemDataUsage.php index c0da2fbc..82e73a62 100644 --- a/src/Endpoint/SystemDataUsage.php +++ b/src/Endpoint/SystemDataUsage.php @@ -1,39 +1,46 @@ queryParameters = $queryParameters; + } + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/system/df'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); + } + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(array('type')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('type', array('array')); + return $optionsResolver; } - /** * {@inheritdoc} * @@ -41,13 +48,19 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\SystemDfGetResponse200 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\SystemDataUsageInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SystemEvents.php b/src/Endpoint/SystemEvents.php index f81aac71..8eb9b9e8 100644 --- a/src/Endpoint/SystemEvents.php +++ b/src/Endpoint/SystemEvents.php @@ -1,47 +1,40 @@ ` config name or ID - `container=` container name or ID - `daemon=` daemon name or ID @@ -56,67 +49,65 @@ class SystemEvents extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \ - `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 = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/events'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['since', 'until', 'filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('since', ['string']); - $optionsResolver->setAllowedTypes('until', ['string']); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('since', 'until', 'filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('since', array('string')); + $optionsResolver->addAllowedTypes('until', array('string')); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\SystemEventsBadRequestException * @throws \Docker\API\Exception\SystemEventsInternalServerErrorException * - * @return null|\Docker\API\Model\EventsGetResponse200 + * @return null|\Docker\API\Model\EventMessage */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\EventsGetResponse200', 'json'); + 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')); + 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')); + throw new \Docker\API\Exception\SystemEventsInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SystemInfo.php b/src/Endpoint/SystemInfo.php index 3b43e14a..43d9231f 100644 --- a/src/Endpoint/SystemInfo.php +++ b/src/Endpoint/SystemInfo.php @@ -1,39 +1,26 @@ ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -41,13 +28,19 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\SystemInfo */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\SystemInfoInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SystemPing.php b/src/Endpoint/SystemPing.php index 9a7edcb6..27b7d139 100644 --- a/src/Endpoint/SystemPing.php +++ b/src/Endpoint/SystemPing.php @@ -1,51 +1,46 @@ ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\SystemPingInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\SystemPingInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SystemPingHead.php b/src/Endpoint/SystemPingHead.php new file mode 100644 index 00000000..8069437a --- /dev/null +++ b/src/Endpoint/SystemPingHead.php @@ -0,0 +1,46 @@ + array('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 array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/SystemVersion.php b/src/Endpoint/SystemVersion.php index b0461b01..20828e0f 100644 --- a/src/Endpoint/SystemVersion.php +++ b/src/Endpoint/SystemVersion.php @@ -1,53 +1,46 @@ ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\SystemVersionInternalServerErrorException * - * @return null|\Docker\API\Model\VersionGetResponse200 + * @return null|\Docker\API\Model\SystemVersion */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\VersionGetResponse200', 'json'); + 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')); + throw new \Docker\API\Exception\SystemVersionInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/TaskInspect.php b/src/Endpoint/TaskInspect.php index 97d97512..7916b666 100644 --- a/src/Endpoint/TaskInspect.php +++ b/src/Endpoint/TaskInspect.php @@ -1,49 +1,36 @@ id = $id; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/tasks/{id}'); + return str_replace(array('{id}'), array($this->id), '/tasks/{id}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -53,19 +40,25 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\Task */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\TaskInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/TaskList.php b/src/Endpoint/TaskList.php index 9142a5d9..248e38b8 100644 --- a/src/Endpoint/TaskList.php +++ b/src/Endpoint/TaskList.php @@ -1,69 +1,57 @@ ` - `label=key` or `label="key=value"` - `name=` - `node=` - `service=` - - * } - */ - public function __construct(array $queryParameters = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/tasks'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -72,16 +60,22 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\Task[] */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\TaskListServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/TaskLogs.php b/src/Endpoint/TaskLogs.php index be0ddc4b..9b57452b 100644 --- a/src/Endpoint/TaskLogs.php +++ b/src/Endpoint/TaskLogs.php @@ -1,106 +1,96 @@ id = $id; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{id}'], [$this->id], '/tasks/{id}/logs'); + return str_replace(array('{id}'), array($this->id), '/tasks/{id}/logs'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + 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->setAllowedTypes('details', ['bool']); - $optionsResolver->setAllowedTypes('follow', ['bool']); - $optionsResolver->setAllowedTypes('stdout', ['bool']); - $optionsResolver->setAllowedTypes('stderr', ['bool']); - $optionsResolver->setAllowedTypes('since', ['int']); - $optionsResolver->setAllowedTypes('timestamps', ['bool']); - $optionsResolver->setAllowedTypes('tail', ['string']); - + $optionsResolver->setDefined(array('details', 'follow', 'stdout', 'stderr', 'since', 'timestamps', 'tail')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('details' => false, 'follow' => false, 'stdout' => false, 'stderr' => false, 'since' => 0, 'timestamps' => false, 'tail' => 'all')); + $optionsResolver->addAllowedTypes('details', array('bool')); + $optionsResolver->addAllowedTypes('follow', array('bool')); + $optionsResolver->addAllowedTypes('stdout', array('bool')); + $optionsResolver->addAllowedTypes('stderr', array('bool')); + $optionsResolver->addAllowedTypes('since', array('int')); + $optionsResolver->addAllowedTypes('timestamps', array('bool')); + $optionsResolver->addAllowedTypes('tail', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\TaskLogsNotFoundException * @throws \Docker\API\Exception\TaskLogsInternalServerErrorException * @throws \Docker\API\Exception\TaskLogsServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (101 === $status) { - return json_decode($body); - } + $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')); + 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')); + 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')); + throw new \Docker\API\Exception\TaskLogsServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/VolumeCreate.php b/src/Endpoint/VolumeCreate.php index 14d409a8..602c500c 100644 --- a/src/Endpoint/VolumeCreate.php +++ b/src/Endpoint/VolumeCreate.php @@ -1,47 +1,35 @@ body = $volumeConfig; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/volumes/create'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { return $this->getSerializedBody($serializer); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -49,13 +37,19 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\Volume */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\VolumeCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/VolumeDelete.php b/src/Endpoint/VolumeDelete.php index 447268e9..bbbac7f0 100644 --- a/src/Endpoint/VolumeDelete.php +++ b/src/Endpoint/VolumeDelete.php @@ -1,87 +1,77 @@ name = $name; $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'DELETE'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/volumes/{name}'); + return str_replace(array('{name}'), array($this->name), '/volumes/{name}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['force']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['force' => false]); - $optionsResolver->setAllowedTypes('force', ['bool']); - + $optionsResolver->setDefined(array('force')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array('force' => false)); + $optionsResolver->addAllowedTypes('force', array('bool')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\VolumeDeleteNotFoundException * @throws \Docker\API\Exception\VolumeDeleteConflictException * @throws \Docker\API\Exception\VolumeDeleteInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + 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')); + throw new \Docker\API\Exception\VolumeDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/VolumeInspect.php b/src/Endpoint/VolumeInspect.php index 2e5decb4..8355ccf3 100644 --- a/src/Endpoint/VolumeInspect.php +++ b/src/Endpoint/VolumeInspect.php @@ -1,49 +1,36 @@ name = $name; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { - return str_replace(['{name}'], [$this->name], '/volumes/{name}'); + return str_replace(array('{name}'), array($this->name), '/volumes/{name}'); } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - /** * {@inheritdoc} * @@ -52,16 +39,22 @@ public function getExtraHeaders(): array * * @return null|\Docker\API\Model\Volume */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + 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')); + throw new \Docker\API\Exception\VolumeInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/VolumeList.php b/src/Endpoint/VolumeList.php index de7b3e87..ba9d9a07 100644 --- a/src/Endpoint/VolumeList.php +++ b/src/Endpoint/VolumeList.php @@ -1,23 +1,16 @@ ` 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 @@ -26,61 +19,59 @@ class VolumeList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Ja - `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 = []) + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'GET'; } - - public function getUri(): string + public function getUri() : string { return '/volumes'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * * @throws \Docker\API\Exception\VolumeListInternalServerErrorException * - * @return null|\Docker\API\Model\VolumesGetResponse200 + * @return null|\Docker\API\Model\VolumeListResponse */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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\\VolumesGetResponse200', 'json'); + 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')); + throw new \Docker\API\Exception\VolumeListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/VolumePrune.php b/src/Endpoint/VolumePrune.php index f885f71a..c7045bc9 100644 --- a/src/Endpoint/VolumePrune.php +++ b/src/Endpoint/VolumePrune.php @@ -1,65 +1,51 @@ `, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. - - * } - */ - public function __construct(array $queryParameters = []) + - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + + * } + */ + public function __construct(array $queryParameters = array()) { $this->queryParameters = $queryParameters; } - - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - - public function getMethod(): string + use \Docker\API\Runtime\Client\EndpointTrait; + public function getMethod() : string { return 'POST'; } - - public function getUri(): string + public function getUri() : string { return '/volumes/prune'; } - - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array { - return [[], null]; + return array(array(), null); } - - public function getExtraHeaders(): array + public function getExtraHeaders() : array { - return ['Accept' => ['application/json']]; + return array('Accept' => array('application/json')); } - - protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); - $optionsResolver->setRequired([]); - $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); - + $optionsResolver->setDefined(array('filters')); + $optionsResolver->setRequired(array()); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('filters', array('string')); return $optionsResolver; } - /** * {@inheritdoc} * @@ -67,13 +53,19 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return null|\Docker\API\Model\VolumesPrunePostResponse200 */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + 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')); + throw new \Docker\API\Exception\VolumePruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } -} + public function getAuthenticationScopes() : array + { + return array(); + } +} \ No newline at end of file diff --git a/src/Endpoint/VolumeUpdate.php b/src/Endpoint/VolumeUpdate.php new file mode 100644 index 00000000..e0265019 --- /dev/null +++ b/src/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(array('{name}'), array($this->name), '/volumes/{name}'); + } + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + { + return $this->getSerializedBody($serializer); + } + public function getExtraHeaders() : array + { + return array('Accept' => array('application/json')); + } + protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(array('version')); + $optionsResolver->setRequired(array('version')); + $optionsResolver->setDefaults(array()); + $optionsResolver->addAllowedTypes('version', array('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 array(); + } +} \ No newline at end of file diff --git a/src/Exception/ApiException.php b/src/Exception/ApiException.php index ea409aa8..78d25f80 100644 --- a/src/Exception/ApiException.php +++ b/src/Exception/ApiException.php @@ -1,15 +1,7 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ClientException.php b/src/Exception/ClientException.php index 3017d5b1..dcb9abdf 100644 --- a/src/Exception/ClientException.php +++ b/src/Exception/ClientException.php @@ -1,15 +1,7 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigCreateInternalServerErrorException.php b/src/Exception/ConfigCreateInternalServerErrorException.php index ac2b4ab0..042f8d3b 100644 --- a/src/Exception/ConfigCreateInternalServerErrorException.php +++ b/src/Exception/ConfigCreateInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigCreateServiceUnavailableException.php b/src/Exception/ConfigCreateServiceUnavailableException.php index d5c7a313..7fba772d 100644 --- a/src/Exception/ConfigCreateServiceUnavailableException.php +++ b/src/Exception/ConfigCreateServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigDeleteInternalServerErrorException.php b/src/Exception/ConfigDeleteInternalServerErrorException.php index abebc0a7..f007c657 100644 --- a/src/Exception/ConfigDeleteInternalServerErrorException.php +++ b/src/Exception/ConfigDeleteInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigDeleteNotFoundException.php b/src/Exception/ConfigDeleteNotFoundException.php index d24e6516..3fce300c 100644 --- a/src/Exception/ConfigDeleteNotFoundException.php +++ b/src/Exception/ConfigDeleteNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigDeleteServiceUnavailableException.php b/src/Exception/ConfigDeleteServiceUnavailableException.php index 13c5a59e..89622b72 100644 --- a/src/Exception/ConfigDeleteServiceUnavailableException.php +++ b/src/Exception/ConfigDeleteServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigInspectInternalServerErrorException.php b/src/Exception/ConfigInspectInternalServerErrorException.php index d3d29a10..9775785e 100644 --- a/src/Exception/ConfigInspectInternalServerErrorException.php +++ b/src/Exception/ConfigInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigInspectNotFoundException.php b/src/Exception/ConfigInspectNotFoundException.php index 39c59bf0..04927c1f 100644 --- a/src/Exception/ConfigInspectNotFoundException.php +++ b/src/Exception/ConfigInspectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigInspectServiceUnavailableException.php b/src/Exception/ConfigInspectServiceUnavailableException.php index 9e6e3a26..4ee0af4e 100644 --- a/src/Exception/ConfigInspectServiceUnavailableException.php +++ b/src/Exception/ConfigInspectServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigListInternalServerErrorException.php b/src/Exception/ConfigListInternalServerErrorException.php index 319d2144..11ccce04 100644 --- a/src/Exception/ConfigListInternalServerErrorException.php +++ b/src/Exception/ConfigListInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigListServiceUnavailableException.php b/src/Exception/ConfigListServiceUnavailableException.php index 8b0c9c45..fdc59fdf 100644 --- a/src/Exception/ConfigListServiceUnavailableException.php +++ b/src/Exception/ConfigListServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigUpdateBadRequestException.php b/src/Exception/ConfigUpdateBadRequestException.php index 6c742b65..7d632858 100644 --- a/src/Exception/ConfigUpdateBadRequestException.php +++ b/src/Exception/ConfigUpdateBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigUpdateInternalServerErrorException.php b/src/Exception/ConfigUpdateInternalServerErrorException.php index f6c1e460..8f0d4719 100644 --- a/src/Exception/ConfigUpdateInternalServerErrorException.php +++ b/src/Exception/ConfigUpdateInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigUpdateNotFoundException.php b/src/Exception/ConfigUpdateNotFoundException.php index c931ce46..a6972a41 100644 --- a/src/Exception/ConfigUpdateNotFoundException.php +++ b/src/Exception/ConfigUpdateNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConfigUpdateServiceUnavailableException.php b/src/Exception/ConfigUpdateServiceUnavailableException.php index e77c4856..b1eac58f 100644 --- a/src/Exception/ConfigUpdateServiceUnavailableException.php +++ b/src/Exception/ConfigUpdateServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ConflictException.php b/src/Exception/ConflictException.php new file mode 100644 index 00000000..ac1e03e5 --- /dev/null +++ b/src/Exception/ConflictException.php @@ -0,0 +1,11 @@ +containersIdArchiveGetResponse400 = $containersIdArchiveGetResponse400; + parent::__construct('Bad parameter'); + $this->errorResponse = $errorResponse; + $this->response = $response; } - - public function getContainersIdArchiveGetResponse400() + public function getErrorResponse() : \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse() : \Psr\Http\Message\ResponseInterface { - return $this->containersIdArchiveGetResponse400; + return $this->response; } -} +} \ No newline at end of file diff --git a/src/Exception/ContainerArchiveInfoBadRequestException.php b/src/Exception/ContainerArchiveInfoBadRequestException.php index 1d0c44ee..b33780a6 100644 --- a/src/Exception/ContainerArchiveInfoBadRequestException.php +++ b/src/Exception/ContainerArchiveInfoBadRequestException.php @@ -1,27 +1,29 @@ containersIdArchiveHeadResponse400 = $containersIdArchiveHeadResponse400; + parent::__construct('Bad parameter'); + $this->errorResponse = $errorResponse; + $this->response = $response; } - - public function getContainersIdArchiveHeadResponse400() + public function getErrorResponse() : \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + public function getResponse() : \Psr\Http\Message\ResponseInterface { - return $this->containersIdArchiveHeadResponse400; + return $this->response; } -} +} \ No newline at end of file diff --git a/src/Exception/ContainerArchiveInfoInternalServerErrorException.php b/src/Exception/ContainerArchiveInfoInternalServerErrorException.php index a5c20a7f..b82327aa 100644 --- a/src/Exception/ContainerArchiveInfoInternalServerErrorException.php +++ b/src/Exception/ContainerArchiveInfoInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerArchiveInfoNotFoundException.php b/src/Exception/ContainerArchiveInfoNotFoundException.php index a7af81c8..019484cf 100644 --- a/src/Exception/ContainerArchiveInfoNotFoundException.php +++ b/src/Exception/ContainerArchiveInfoNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerArchiveInternalServerErrorException.php b/src/Exception/ContainerArchiveInternalServerErrorException.php index 0d479cc4..43958300 100644 --- a/src/Exception/ContainerArchiveInternalServerErrorException.php +++ b/src/Exception/ContainerArchiveInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerArchiveNotFoundException.php b/src/Exception/ContainerArchiveNotFoundException.php index 2392dc29..e6a11d68 100644 --- a/src/Exception/ContainerArchiveNotFoundException.php +++ b/src/Exception/ContainerArchiveNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerAttachBadRequestException.php b/src/Exception/ContainerAttachBadRequestException.php index 9fcc5689..a0834fb9 100644 --- a/src/Exception/ContainerAttachBadRequestException.php +++ b/src/Exception/ContainerAttachBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerAttachInternalServerErrorException.php b/src/Exception/ContainerAttachInternalServerErrorException.php index ad69be16..0eb6861a 100644 --- a/src/Exception/ContainerAttachInternalServerErrorException.php +++ b/src/Exception/ContainerAttachInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerAttachNotFoundException.php b/src/Exception/ContainerAttachNotFoundException.php index b6a1ea5e..196467ca 100644 --- a/src/Exception/ContainerAttachNotFoundException.php +++ b/src/Exception/ContainerAttachNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerAttachWebsocketBadRequestException.php b/src/Exception/ContainerAttachWebsocketBadRequestException.php index c342efe6..fced0b40 100644 --- a/src/Exception/ContainerAttachWebsocketBadRequestException.php +++ b/src/Exception/ContainerAttachWebsocketBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerAttachWebsocketInternalServerErrorException.php b/src/Exception/ContainerAttachWebsocketInternalServerErrorException.php index 841b4007..af49cbc8 100644 --- a/src/Exception/ContainerAttachWebsocketInternalServerErrorException.php +++ b/src/Exception/ContainerAttachWebsocketInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerAttachWebsocketNotFoundException.php b/src/Exception/ContainerAttachWebsocketNotFoundException.php index dad1d11b..bd05f71c 100644 --- a/src/Exception/ContainerAttachWebsocketNotFoundException.php +++ b/src/Exception/ContainerAttachWebsocketNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerChangesInternalServerErrorException.php b/src/Exception/ContainerChangesInternalServerErrorException.php index 0e4400ab..63d0c05d 100644 --- a/src/Exception/ContainerChangesInternalServerErrorException.php +++ b/src/Exception/ContainerChangesInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerChangesNotFoundException.php b/src/Exception/ContainerChangesNotFoundException.php index 5679e24a..9ab47961 100644 --- a/src/Exception/ContainerChangesNotFoundException.php +++ b/src/Exception/ContainerChangesNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerCreateBadRequestException.php b/src/Exception/ContainerCreateBadRequestException.php index ace2b69b..f84c6204 100644 --- a/src/Exception/ContainerCreateBadRequestException.php +++ b/src/Exception/ContainerCreateBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerCreateConflictException.php b/src/Exception/ContainerCreateConflictException.php index 1ddc23b7..f3f29018 100644 --- a/src/Exception/ContainerCreateConflictException.php +++ b/src/Exception/ContainerCreateConflictException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerCreateInternalServerErrorException.php b/src/Exception/ContainerCreateInternalServerErrorException.php index 1b064c9a..0adef4e6 100644 --- a/src/Exception/ContainerCreateInternalServerErrorException.php +++ b/src/Exception/ContainerCreateInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerCreateNotFoundException.php b/src/Exception/ContainerCreateNotFoundException.php index a2fbafd8..90068415 100644 --- a/src/Exception/ContainerCreateNotFoundException.php +++ b/src/Exception/ContainerCreateNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerDeleteBadRequestException.php b/src/Exception/ContainerDeleteBadRequestException.php index 0438ebc6..02e03b93 100644 --- a/src/Exception/ContainerDeleteBadRequestException.php +++ b/src/Exception/ContainerDeleteBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerDeleteConflictException.php b/src/Exception/ContainerDeleteConflictException.php index 5f7578ed..a6d1d76e 100644 --- a/src/Exception/ContainerDeleteConflictException.php +++ b/src/Exception/ContainerDeleteConflictException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerDeleteInternalServerErrorException.php b/src/Exception/ContainerDeleteInternalServerErrorException.php index 334ec94f..5e145f0d 100644 --- a/src/Exception/ContainerDeleteInternalServerErrorException.php +++ b/src/Exception/ContainerDeleteInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerDeleteNotFoundException.php b/src/Exception/ContainerDeleteNotFoundException.php index 323f3591..69ff44ef 100644 --- a/src/Exception/ContainerDeleteNotFoundException.php +++ b/src/Exception/ContainerDeleteNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerExecConflictException.php b/src/Exception/ContainerExecConflictException.php index 026db850..e64cef6e 100644 --- a/src/Exception/ContainerExecConflictException.php +++ b/src/Exception/ContainerExecConflictException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerExecInternalServerErrorException.php b/src/Exception/ContainerExecInternalServerErrorException.php index 0354f3c5..390a46a6 100644 --- a/src/Exception/ContainerExecInternalServerErrorException.php +++ b/src/Exception/ContainerExecInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerExecNotFoundException.php b/src/Exception/ContainerExecNotFoundException.php index 9055de1f..cf0a5409 100644 --- a/src/Exception/ContainerExecNotFoundException.php +++ b/src/Exception/ContainerExecNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerExportInternalServerErrorException.php b/src/Exception/ContainerExportInternalServerErrorException.php index ebbccd56..e7192996 100644 --- a/src/Exception/ContainerExportInternalServerErrorException.php +++ b/src/Exception/ContainerExportInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerExportNotFoundException.php b/src/Exception/ContainerExportNotFoundException.php index 096d443c..f9b6bbb6 100644 --- a/src/Exception/ContainerExportNotFoundException.php +++ b/src/Exception/ContainerExportNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerInspectInternalServerErrorException.php b/src/Exception/ContainerInspectInternalServerErrorException.php index 893f5f4d..fc1605dd 100644 --- a/src/Exception/ContainerInspectInternalServerErrorException.php +++ b/src/Exception/ContainerInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerInspectNotFoundException.php b/src/Exception/ContainerInspectNotFoundException.php index 22e3ef10..c486fd8d 100644 --- a/src/Exception/ContainerInspectNotFoundException.php +++ b/src/Exception/ContainerInspectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerKillConflictException.php b/src/Exception/ContainerKillConflictException.php new file mode 100644 index 00000000..3f57e839 --- /dev/null +++ b/src/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/src/Exception/ContainerKillInternalServerErrorException.php b/src/Exception/ContainerKillInternalServerErrorException.php index a1111060..82b4c071 100644 --- a/src/Exception/ContainerKillInternalServerErrorException.php +++ b/src/Exception/ContainerKillInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerKillNotFoundException.php b/src/Exception/ContainerKillNotFoundException.php index 3bd06151..88d557ea 100644 --- a/src/Exception/ContainerKillNotFoundException.php +++ b/src/Exception/ContainerKillNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerListBadRequestException.php b/src/Exception/ContainerListBadRequestException.php index e189a259..936fc148 100644 --- a/src/Exception/ContainerListBadRequestException.php +++ b/src/Exception/ContainerListBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerListInternalServerErrorException.php b/src/Exception/ContainerListInternalServerErrorException.php index f255417e..123eb7bc 100644 --- a/src/Exception/ContainerListInternalServerErrorException.php +++ b/src/Exception/ContainerListInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerLogsInternalServerErrorException.php b/src/Exception/ContainerLogsInternalServerErrorException.php index 846aae6b..b139fea5 100644 --- a/src/Exception/ContainerLogsInternalServerErrorException.php +++ b/src/Exception/ContainerLogsInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerLogsNotFoundException.php b/src/Exception/ContainerLogsNotFoundException.php index fe467647..6ba9c05c 100644 --- a/src/Exception/ContainerLogsNotFoundException.php +++ b/src/Exception/ContainerLogsNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerPauseInternalServerErrorException.php b/src/Exception/ContainerPauseInternalServerErrorException.php index 90c2b85f..a9bfca8f 100644 --- a/src/Exception/ContainerPauseInternalServerErrorException.php +++ b/src/Exception/ContainerPauseInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerPauseNotFoundException.php b/src/Exception/ContainerPauseNotFoundException.php index 108e9257..5a39b96b 100644 --- a/src/Exception/ContainerPauseNotFoundException.php +++ b/src/Exception/ContainerPauseNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerPruneInternalServerErrorException.php b/src/Exception/ContainerPruneInternalServerErrorException.php index 7691c98c..856dddaa 100644 --- a/src/Exception/ContainerPruneInternalServerErrorException.php +++ b/src/Exception/ContainerPruneInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerRenameConflictException.php b/src/Exception/ContainerRenameConflictException.php index d464b525..1b6fe4c8 100644 --- a/src/Exception/ContainerRenameConflictException.php +++ b/src/Exception/ContainerRenameConflictException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerRenameInternalServerErrorException.php b/src/Exception/ContainerRenameInternalServerErrorException.php index 10ffd9f3..d744875c 100644 --- a/src/Exception/ContainerRenameInternalServerErrorException.php +++ b/src/Exception/ContainerRenameInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerRenameNotFoundException.php b/src/Exception/ContainerRenameNotFoundException.php index 83165e99..006eb96d 100644 --- a/src/Exception/ContainerRenameNotFoundException.php +++ b/src/Exception/ContainerRenameNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerResizeInternalServerErrorException.php b/src/Exception/ContainerResizeInternalServerErrorException.php index 7fb31823..179d6a4f 100644 --- a/src/Exception/ContainerResizeInternalServerErrorException.php +++ b/src/Exception/ContainerResizeInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerResizeNotFoundException.php b/src/Exception/ContainerResizeNotFoundException.php index 0c33f3c1..3eca0e9a 100644 --- a/src/Exception/ContainerResizeNotFoundException.php +++ b/src/Exception/ContainerResizeNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerRestartInternalServerErrorException.php b/src/Exception/ContainerRestartInternalServerErrorException.php index 8d75e61e..4076508d 100644 --- a/src/Exception/ContainerRestartInternalServerErrorException.php +++ b/src/Exception/ContainerRestartInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerRestartNotFoundException.php b/src/Exception/ContainerRestartNotFoundException.php index ec90d095..0dc2979b 100644 --- a/src/Exception/ContainerRestartNotFoundException.php +++ b/src/Exception/ContainerRestartNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerStartInternalServerErrorException.php b/src/Exception/ContainerStartInternalServerErrorException.php index 2cfbda9d..18440dc3 100644 --- a/src/Exception/ContainerStartInternalServerErrorException.php +++ b/src/Exception/ContainerStartInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerStartNotFoundException.php b/src/Exception/ContainerStartNotFoundException.php index 6d2f5d59..bf7a13c5 100644 --- a/src/Exception/ContainerStartNotFoundException.php +++ b/src/Exception/ContainerStartNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerStatsInternalServerErrorException.php b/src/Exception/ContainerStatsInternalServerErrorException.php index 18df6565..4145c0fe 100644 --- a/src/Exception/ContainerStatsInternalServerErrorException.php +++ b/src/Exception/ContainerStatsInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerStatsNotFoundException.php b/src/Exception/ContainerStatsNotFoundException.php index 4de7cd1f..b0779cc4 100644 --- a/src/Exception/ContainerStatsNotFoundException.php +++ b/src/Exception/ContainerStatsNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerStopInternalServerErrorException.php b/src/Exception/ContainerStopInternalServerErrorException.php index 83d821fb..4b74c115 100644 --- a/src/Exception/ContainerStopInternalServerErrorException.php +++ b/src/Exception/ContainerStopInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerStopNotFoundException.php b/src/Exception/ContainerStopNotFoundException.php index 91644695..f250b41a 100644 --- a/src/Exception/ContainerStopNotFoundException.php +++ b/src/Exception/ContainerStopNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerTopInternalServerErrorException.php b/src/Exception/ContainerTopInternalServerErrorException.php index 67143d1a..a6018ea6 100644 --- a/src/Exception/ContainerTopInternalServerErrorException.php +++ b/src/Exception/ContainerTopInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerTopNotFoundException.php b/src/Exception/ContainerTopNotFoundException.php index d0897e38..adeda2b9 100644 --- a/src/Exception/ContainerTopNotFoundException.php +++ b/src/Exception/ContainerTopNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerUnpauseInternalServerErrorException.php b/src/Exception/ContainerUnpauseInternalServerErrorException.php index c7ec4ff5..fafab6ae 100644 --- a/src/Exception/ContainerUnpauseInternalServerErrorException.php +++ b/src/Exception/ContainerUnpauseInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerUnpauseNotFoundException.php b/src/Exception/ContainerUnpauseNotFoundException.php index a1c3a36b..9ff79256 100644 --- a/src/Exception/ContainerUnpauseNotFoundException.php +++ b/src/Exception/ContainerUnpauseNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerUpdateInternalServerErrorException.php b/src/Exception/ContainerUpdateInternalServerErrorException.php index e3e670a0..ec2479b9 100644 --- a/src/Exception/ContainerUpdateInternalServerErrorException.php +++ b/src/Exception/ContainerUpdateInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerUpdateNotFoundException.php b/src/Exception/ContainerUpdateNotFoundException.php index 919fc5f8..2971450c 100644 --- a/src/Exception/ContainerUpdateNotFoundException.php +++ b/src/Exception/ContainerUpdateNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerWaitBadRequestException.php b/src/Exception/ContainerWaitBadRequestException.php new file mode 100644 index 00000000..5ac76588 --- /dev/null +++ b/src/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/src/Exception/ContainerWaitInternalServerErrorException.php b/src/Exception/ContainerWaitInternalServerErrorException.php index 2c7c6126..263b6c46 100644 --- a/src/Exception/ContainerWaitInternalServerErrorException.php +++ b/src/Exception/ContainerWaitInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ContainerWaitNotFoundException.php b/src/Exception/ContainerWaitNotFoundException.php index 5345bb94..a97c118e 100644 --- a/src/Exception/ContainerWaitNotFoundException.php +++ b/src/Exception/ContainerWaitNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/DistributionInspectInternalServerErrorException.php b/src/Exception/DistributionInspectInternalServerErrorException.php index 9983e8d8..53d03da6 100644 --- a/src/Exception/DistributionInspectInternalServerErrorException.php +++ b/src/Exception/DistributionInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/DistributionInspectUnauthorizedException.php b/src/Exception/DistributionInspectUnauthorizedException.php index a466a58a..cf303106 100644 --- a/src/Exception/DistributionInspectUnauthorizedException.php +++ b/src/Exception/DistributionInspectUnauthorizedException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ExecInspectInternalServerErrorException.php b/src/Exception/ExecInspectInternalServerErrorException.php index 41f9cdc0..1705da92 100644 --- a/src/Exception/ExecInspectInternalServerErrorException.php +++ b/src/Exception/ExecInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ExecInspectNotFoundException.php b/src/Exception/ExecInspectNotFoundException.php index c871832a..6821f7d7 100644 --- a/src/Exception/ExecInspectNotFoundException.php +++ b/src/Exception/ExecInspectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ExecResizeBadRequestException.php b/src/Exception/ExecResizeBadRequestException.php new file mode 100644 index 00000000..0fb8fde2 --- /dev/null +++ b/src/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/src/Exception/ExecResizeInternalServerErrorException.php b/src/Exception/ExecResizeInternalServerErrorException.php new file mode 100644 index 00000000..d3342a69 --- /dev/null +++ b/src/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/src/Exception/ExecResizeNotFoundException.php b/src/Exception/ExecResizeNotFoundException.php index 94068f7c..dd2d36a3 100644 --- a/src/Exception/ExecResizeNotFoundException.php +++ b/src/Exception/ExecResizeNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ExecStartConflictException.php b/src/Exception/ExecStartConflictException.php index 139bcbdd..b1228bd0 100644 --- a/src/Exception/ExecStartConflictException.php +++ b/src/Exception/ExecStartConflictException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ExecStartNotFoundException.php b/src/Exception/ExecStartNotFoundException.php index d6f211a6..748e467e 100644 --- a/src/Exception/ExecStartNotFoundException.php +++ b/src/Exception/ExecStartNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ForbiddenException.php b/src/Exception/ForbiddenException.php new file mode 100644 index 00000000..988311b3 --- /dev/null +++ b/src/Exception/ForbiddenException.php @@ -0,0 +1,11 @@ +errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageBuildBadRequestException.php b/src/Exception/ImageBuildBadRequestException.php index d5a4916e..b235c588 100644 --- a/src/Exception/ImageBuildBadRequestException.php +++ b/src/Exception/ImageBuildBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageBuildInternalServerErrorException.php b/src/Exception/ImageBuildInternalServerErrorException.php index 32785c53..c535d78e 100644 --- a/src/Exception/ImageBuildInternalServerErrorException.php +++ b/src/Exception/ImageBuildInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageCommitInternalServerErrorException.php b/src/Exception/ImageCommitInternalServerErrorException.php index df5dd02a..cd1c6ed4 100644 --- a/src/Exception/ImageCommitInternalServerErrorException.php +++ b/src/Exception/ImageCommitInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageCommitNotFoundException.php b/src/Exception/ImageCommitNotFoundException.php index 99242695..24315320 100644 --- a/src/Exception/ImageCommitNotFoundException.php +++ b/src/Exception/ImageCommitNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageCreateInternalServerErrorException.php b/src/Exception/ImageCreateInternalServerErrorException.php index 32ff9e96..846e04d6 100644 --- a/src/Exception/ImageCreateInternalServerErrorException.php +++ b/src/Exception/ImageCreateInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageCreateNotFoundException.php b/src/Exception/ImageCreateNotFoundException.php index ec26fae0..5e759713 100644 --- a/src/Exception/ImageCreateNotFoundException.php +++ b/src/Exception/ImageCreateNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageDeleteConflictException.php b/src/Exception/ImageDeleteConflictException.php index 3c97afd1..677448d8 100644 --- a/src/Exception/ImageDeleteConflictException.php +++ b/src/Exception/ImageDeleteConflictException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageDeleteInternalServerErrorException.php b/src/Exception/ImageDeleteInternalServerErrorException.php index fdd4a230..486ad03c 100644 --- a/src/Exception/ImageDeleteInternalServerErrorException.php +++ b/src/Exception/ImageDeleteInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageDeleteNotFoundException.php b/src/Exception/ImageDeleteNotFoundException.php index a5191b77..3e425e63 100644 --- a/src/Exception/ImageDeleteNotFoundException.php +++ b/src/Exception/ImageDeleteNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageGetAllInternalServerErrorException.php b/src/Exception/ImageGetAllInternalServerErrorException.php index d0369d64..f82cfa3a 100644 --- a/src/Exception/ImageGetAllInternalServerErrorException.php +++ b/src/Exception/ImageGetAllInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageGetInternalServerErrorException.php b/src/Exception/ImageGetInternalServerErrorException.php index c6b3e18e..e04277fc 100644 --- a/src/Exception/ImageGetInternalServerErrorException.php +++ b/src/Exception/ImageGetInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageHistoryInternalServerErrorException.php b/src/Exception/ImageHistoryInternalServerErrorException.php index b91a1942..4d3851f9 100644 --- a/src/Exception/ImageHistoryInternalServerErrorException.php +++ b/src/Exception/ImageHistoryInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageHistoryNotFoundException.php b/src/Exception/ImageHistoryNotFoundException.php index ccef36fe..3b7d70f9 100644 --- a/src/Exception/ImageHistoryNotFoundException.php +++ b/src/Exception/ImageHistoryNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageInspectInternalServerErrorException.php b/src/Exception/ImageInspectInternalServerErrorException.php index 64232e74..71e9da81 100644 --- a/src/Exception/ImageInspectInternalServerErrorException.php +++ b/src/Exception/ImageInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageInspectNotFoundException.php b/src/Exception/ImageInspectNotFoundException.php index d97ae7b7..a52e851c 100644 --- a/src/Exception/ImageInspectNotFoundException.php +++ b/src/Exception/ImageInspectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageListInternalServerErrorException.php b/src/Exception/ImageListInternalServerErrorException.php index 2684780c..4ddf2ede 100644 --- a/src/Exception/ImageListInternalServerErrorException.php +++ b/src/Exception/ImageListInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageLoadInternalServerErrorException.php b/src/Exception/ImageLoadInternalServerErrorException.php index 9eadb976..e9685c4d 100644 --- a/src/Exception/ImageLoadInternalServerErrorException.php +++ b/src/Exception/ImageLoadInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImagePruneInternalServerErrorException.php b/src/Exception/ImagePruneInternalServerErrorException.php index f4572552..553c0b58 100644 --- a/src/Exception/ImagePruneInternalServerErrorException.php +++ b/src/Exception/ImagePruneInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImagePushInternalServerErrorException.php b/src/Exception/ImagePushInternalServerErrorException.php index adc44464..fafc0349 100644 --- a/src/Exception/ImagePushInternalServerErrorException.php +++ b/src/Exception/ImagePushInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImagePushNotFoundException.php b/src/Exception/ImagePushNotFoundException.php index f8d4baf8..ed1696de 100644 --- a/src/Exception/ImagePushNotFoundException.php +++ b/src/Exception/ImagePushNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageSearchInternalServerErrorException.php b/src/Exception/ImageSearchInternalServerErrorException.php index 83d7aac3..f4049630 100644 --- a/src/Exception/ImageSearchInternalServerErrorException.php +++ b/src/Exception/ImageSearchInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageTagBadRequestException.php b/src/Exception/ImageTagBadRequestException.php index 1a67a368..e481ebce 100644 --- a/src/Exception/ImageTagBadRequestException.php +++ b/src/Exception/ImageTagBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageTagConflictException.php b/src/Exception/ImageTagConflictException.php index 8ed29ed4..f606225f 100644 --- a/src/Exception/ImageTagConflictException.php +++ b/src/Exception/ImageTagConflictException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageTagInternalServerErrorException.php b/src/Exception/ImageTagInternalServerErrorException.php index fae6f38c..13cccc53 100644 --- a/src/Exception/ImageTagInternalServerErrorException.php +++ b/src/Exception/ImageTagInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ImageTagNotFoundException.php b/src/Exception/ImageTagNotFoundException.php index f96e768e..8eb3c242 100644 --- a/src/Exception/ImageTagNotFoundException.php +++ b/src/Exception/ImageTagNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/InternalServerErrorException.php b/src/Exception/InternalServerErrorException.php new file mode 100644 index 00000000..5a5a47ef --- /dev/null +++ b/src/Exception/InternalServerErrorException.php @@ -0,0 +1,11 @@ +errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkConnectInternalServerErrorException.php b/src/Exception/NetworkConnectInternalServerErrorException.php index 146400c4..0a03aa32 100644 --- a/src/Exception/NetworkConnectInternalServerErrorException.php +++ b/src/Exception/NetworkConnectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkConnectNotFoundException.php b/src/Exception/NetworkConnectNotFoundException.php index 47241092..84ed1fd8 100644 --- a/src/Exception/NetworkConnectNotFoundException.php +++ b/src/Exception/NetworkConnectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkCreateForbiddenException.php b/src/Exception/NetworkCreateForbiddenException.php index 19adcf5f..d3ec2404 100644 --- a/src/Exception/NetworkCreateForbiddenException.php +++ b/src/Exception/NetworkCreateForbiddenException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkCreateInternalServerErrorException.php b/src/Exception/NetworkCreateInternalServerErrorException.php index b375495c..d767b6aa 100644 --- a/src/Exception/NetworkCreateInternalServerErrorException.php +++ b/src/Exception/NetworkCreateInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkCreateNotFoundException.php b/src/Exception/NetworkCreateNotFoundException.php index aa10cb56..fd3c175d 100644 --- a/src/Exception/NetworkCreateNotFoundException.php +++ b/src/Exception/NetworkCreateNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkDeleteForbiddenException.php b/src/Exception/NetworkDeleteForbiddenException.php index 04af0f9a..e3712ac0 100644 --- a/src/Exception/NetworkDeleteForbiddenException.php +++ b/src/Exception/NetworkDeleteForbiddenException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkDeleteInternalServerErrorException.php b/src/Exception/NetworkDeleteInternalServerErrorException.php index 6ddef07b..48ab00a8 100644 --- a/src/Exception/NetworkDeleteInternalServerErrorException.php +++ b/src/Exception/NetworkDeleteInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkDeleteNotFoundException.php b/src/Exception/NetworkDeleteNotFoundException.php index 71a1669d..a71d5262 100644 --- a/src/Exception/NetworkDeleteNotFoundException.php +++ b/src/Exception/NetworkDeleteNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkDisconnectForbiddenException.php b/src/Exception/NetworkDisconnectForbiddenException.php index 30b4af63..0762564a 100644 --- a/src/Exception/NetworkDisconnectForbiddenException.php +++ b/src/Exception/NetworkDisconnectForbiddenException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkDisconnectInternalServerErrorException.php b/src/Exception/NetworkDisconnectInternalServerErrorException.php index 7ba0f62a..28b8dd46 100644 --- a/src/Exception/NetworkDisconnectInternalServerErrorException.php +++ b/src/Exception/NetworkDisconnectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkDisconnectNotFoundException.php b/src/Exception/NetworkDisconnectNotFoundException.php index a42d5551..25aeb1c3 100644 --- a/src/Exception/NetworkDisconnectNotFoundException.php +++ b/src/Exception/NetworkDisconnectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkInspectInternalServerErrorException.php b/src/Exception/NetworkInspectInternalServerErrorException.php index 761c5186..10374471 100644 --- a/src/Exception/NetworkInspectInternalServerErrorException.php +++ b/src/Exception/NetworkInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkInspectNotFoundException.php b/src/Exception/NetworkInspectNotFoundException.php index 44b1f4f4..626cf686 100644 --- a/src/Exception/NetworkInspectNotFoundException.php +++ b/src/Exception/NetworkInspectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkListInternalServerErrorException.php b/src/Exception/NetworkListInternalServerErrorException.php index ead2ef4f..b9cd5e64 100644 --- a/src/Exception/NetworkListInternalServerErrorException.php +++ b/src/Exception/NetworkListInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NetworkPruneInternalServerErrorException.php b/src/Exception/NetworkPruneInternalServerErrorException.php index ed76d14b..133dc675 100644 --- a/src/Exception/NetworkPruneInternalServerErrorException.php +++ b/src/Exception/NetworkPruneInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NodeDeleteInternalServerErrorException.php b/src/Exception/NodeDeleteInternalServerErrorException.php index 40c173ff..bd874995 100644 --- a/src/Exception/NodeDeleteInternalServerErrorException.php +++ b/src/Exception/NodeDeleteInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NodeDeleteNotFoundException.php b/src/Exception/NodeDeleteNotFoundException.php index e75989a3..2956e4bc 100644 --- a/src/Exception/NodeDeleteNotFoundException.php +++ b/src/Exception/NodeDeleteNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NodeDeleteServiceUnavailableException.php b/src/Exception/NodeDeleteServiceUnavailableException.php index c481fe70..3c3450cd 100644 --- a/src/Exception/NodeDeleteServiceUnavailableException.php +++ b/src/Exception/NodeDeleteServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NodeInspectInternalServerErrorException.php b/src/Exception/NodeInspectInternalServerErrorException.php index 468177cd..a98ec1df 100644 --- a/src/Exception/NodeInspectInternalServerErrorException.php +++ b/src/Exception/NodeInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NodeInspectNotFoundException.php b/src/Exception/NodeInspectNotFoundException.php index 9b408a8c..f2edce50 100644 --- a/src/Exception/NodeInspectNotFoundException.php +++ b/src/Exception/NodeInspectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NodeInspectServiceUnavailableException.php b/src/Exception/NodeInspectServiceUnavailableException.php index 8d00f68e..830ebdad 100644 --- a/src/Exception/NodeInspectServiceUnavailableException.php +++ b/src/Exception/NodeInspectServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NodeListInternalServerErrorException.php b/src/Exception/NodeListInternalServerErrorException.php index b1e64aa1..d9c3590d 100644 --- a/src/Exception/NodeListInternalServerErrorException.php +++ b/src/Exception/NodeListInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NodeListServiceUnavailableException.php b/src/Exception/NodeListServiceUnavailableException.php index 85f119d0..fcb931de 100644 --- a/src/Exception/NodeListServiceUnavailableException.php +++ b/src/Exception/NodeListServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NodeUpdateBadRequestException.php b/src/Exception/NodeUpdateBadRequestException.php index f5c8c667..48ed9926 100644 --- a/src/Exception/NodeUpdateBadRequestException.php +++ b/src/Exception/NodeUpdateBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NodeUpdateInternalServerErrorException.php b/src/Exception/NodeUpdateInternalServerErrorException.php index 8cbf3434..54a78566 100644 --- a/src/Exception/NodeUpdateInternalServerErrorException.php +++ b/src/Exception/NodeUpdateInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NodeUpdateNotFoundException.php b/src/Exception/NodeUpdateNotFoundException.php index e75d12ee..8a980062 100644 --- a/src/Exception/NodeUpdateNotFoundException.php +++ b/src/Exception/NodeUpdateNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NodeUpdateServiceUnavailableException.php b/src/Exception/NodeUpdateServiceUnavailableException.php index 83305db8..36c03dd9 100644 --- a/src/Exception/NodeUpdateServiceUnavailableException.php +++ b/src/Exception/NodeUpdateServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/NotFoundException.php b/src/Exception/NotFoundException.php new file mode 100644 index 00000000..6a9bea3d --- /dev/null +++ b/src/Exception/NotFoundException.php @@ -0,0 +1,11 @@ +errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginDeleteInternalServerErrorException.php b/src/Exception/PluginDeleteInternalServerErrorException.php index 4bfa0abe..bb199c45 100644 --- a/src/Exception/PluginDeleteInternalServerErrorException.php +++ b/src/Exception/PluginDeleteInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginDeleteNotFoundException.php b/src/Exception/PluginDeleteNotFoundException.php index f394a2f5..b6b6eba5 100644 --- a/src/Exception/PluginDeleteNotFoundException.php +++ b/src/Exception/PluginDeleteNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginDisableInternalServerErrorException.php b/src/Exception/PluginDisableInternalServerErrorException.php index 623d3307..dc756f9e 100644 --- a/src/Exception/PluginDisableInternalServerErrorException.php +++ b/src/Exception/PluginDisableInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginDisableNotFoundException.php b/src/Exception/PluginDisableNotFoundException.php index 2512cb6e..5ad3f6f0 100644 --- a/src/Exception/PluginDisableNotFoundException.php +++ b/src/Exception/PluginDisableNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginEnableInternalServerErrorException.php b/src/Exception/PluginEnableInternalServerErrorException.php index 0b33283e..65f777e3 100644 --- a/src/Exception/PluginEnableInternalServerErrorException.php +++ b/src/Exception/PluginEnableInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginEnableNotFoundException.php b/src/Exception/PluginEnableNotFoundException.php index 54f6d609..ddac2838 100644 --- a/src/Exception/PluginEnableNotFoundException.php +++ b/src/Exception/PluginEnableNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginInspectInternalServerErrorException.php b/src/Exception/PluginInspectInternalServerErrorException.php index d401e7de..c9810a98 100644 --- a/src/Exception/PluginInspectInternalServerErrorException.php +++ b/src/Exception/PluginInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginInspectNotFoundException.php b/src/Exception/PluginInspectNotFoundException.php index dca1a60b..da8534c2 100644 --- a/src/Exception/PluginInspectNotFoundException.php +++ b/src/Exception/PluginInspectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginListInternalServerErrorException.php b/src/Exception/PluginListInternalServerErrorException.php index 33f70ded..8906812d 100644 --- a/src/Exception/PluginListInternalServerErrorException.php +++ b/src/Exception/PluginListInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginPullInternalServerErrorException.php b/src/Exception/PluginPullInternalServerErrorException.php index 92759e52..9ab0bd20 100644 --- a/src/Exception/PluginPullInternalServerErrorException.php +++ b/src/Exception/PluginPullInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginPushInternalServerErrorException.php b/src/Exception/PluginPushInternalServerErrorException.php index ab8bafd4..8f6b09c5 100644 --- a/src/Exception/PluginPushInternalServerErrorException.php +++ b/src/Exception/PluginPushInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginPushNotFoundException.php b/src/Exception/PluginPushNotFoundException.php index f7751ccc..9a65bd96 100644 --- a/src/Exception/PluginPushNotFoundException.php +++ b/src/Exception/PluginPushNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginSetInternalServerErrorException.php b/src/Exception/PluginSetInternalServerErrorException.php index 81c74218..079e3baa 100644 --- a/src/Exception/PluginSetInternalServerErrorException.php +++ b/src/Exception/PluginSetInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginSetNotFoundException.php b/src/Exception/PluginSetNotFoundException.php index 6de73319..ffa235c9 100644 --- a/src/Exception/PluginSetNotFoundException.php +++ b/src/Exception/PluginSetNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginUpgradeInternalServerErrorException.php b/src/Exception/PluginUpgradeInternalServerErrorException.php index 08b0a8ef..8c7b1515 100644 --- a/src/Exception/PluginUpgradeInternalServerErrorException.php +++ b/src/Exception/PluginUpgradeInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PluginUpgradeNotFoundException.php b/src/Exception/PluginUpgradeNotFoundException.php index a14c7bd1..2a5d2377 100644 --- a/src/Exception/PluginUpgradeNotFoundException.php +++ b/src/Exception/PluginUpgradeNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PutContainerArchiveBadRequestException.php b/src/Exception/PutContainerArchiveBadRequestException.php index dcdbcd1d..66a7d386 100644 --- a/src/Exception/PutContainerArchiveBadRequestException.php +++ b/src/Exception/PutContainerArchiveBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PutContainerArchiveForbiddenException.php b/src/Exception/PutContainerArchiveForbiddenException.php index acfb8d71..86af4e01 100644 --- a/src/Exception/PutContainerArchiveForbiddenException.php +++ b/src/Exception/PutContainerArchiveForbiddenException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PutContainerArchiveInternalServerErrorException.php b/src/Exception/PutContainerArchiveInternalServerErrorException.php index a512fea2..de502022 100644 --- a/src/Exception/PutContainerArchiveInternalServerErrorException.php +++ b/src/Exception/PutContainerArchiveInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/PutContainerArchiveNotFoundException.php b/src/Exception/PutContainerArchiveNotFoundException.php index 393fa843..6ee820bd 100644 --- a/src/Exception/PutContainerArchiveNotFoundException.php +++ b/src/Exception/PutContainerArchiveNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretCreateConflictException.php b/src/Exception/SecretCreateConflictException.php index 08e88bf1..eb7e4824 100644 --- a/src/Exception/SecretCreateConflictException.php +++ b/src/Exception/SecretCreateConflictException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretCreateInternalServerErrorException.php b/src/Exception/SecretCreateInternalServerErrorException.php index e6abe7fa..371659f8 100644 --- a/src/Exception/SecretCreateInternalServerErrorException.php +++ b/src/Exception/SecretCreateInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretCreateServiceUnavailableException.php b/src/Exception/SecretCreateServiceUnavailableException.php index 521e3cb4..e39fc8cc 100644 --- a/src/Exception/SecretCreateServiceUnavailableException.php +++ b/src/Exception/SecretCreateServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretDeleteInternalServerErrorException.php b/src/Exception/SecretDeleteInternalServerErrorException.php index e0f4fda5..9f60cc0e 100644 --- a/src/Exception/SecretDeleteInternalServerErrorException.php +++ b/src/Exception/SecretDeleteInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretDeleteNotFoundException.php b/src/Exception/SecretDeleteNotFoundException.php index de1991f7..ca32c121 100644 --- a/src/Exception/SecretDeleteNotFoundException.php +++ b/src/Exception/SecretDeleteNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretDeleteServiceUnavailableException.php b/src/Exception/SecretDeleteServiceUnavailableException.php index 573431a6..c54671db 100644 --- a/src/Exception/SecretDeleteServiceUnavailableException.php +++ b/src/Exception/SecretDeleteServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretInspectInternalServerErrorException.php b/src/Exception/SecretInspectInternalServerErrorException.php index 990a65f2..319a0a1d 100644 --- a/src/Exception/SecretInspectInternalServerErrorException.php +++ b/src/Exception/SecretInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretInspectNotFoundException.php b/src/Exception/SecretInspectNotFoundException.php index 6d65d60a..83378eca 100644 --- a/src/Exception/SecretInspectNotFoundException.php +++ b/src/Exception/SecretInspectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretInspectServiceUnavailableException.php b/src/Exception/SecretInspectServiceUnavailableException.php index 45b9462e..201f6997 100644 --- a/src/Exception/SecretInspectServiceUnavailableException.php +++ b/src/Exception/SecretInspectServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretListInternalServerErrorException.php b/src/Exception/SecretListInternalServerErrorException.php index d6627ace..08821868 100644 --- a/src/Exception/SecretListInternalServerErrorException.php +++ b/src/Exception/SecretListInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretListServiceUnavailableException.php b/src/Exception/SecretListServiceUnavailableException.php index 18f0b2e3..aa2b9f4b 100644 --- a/src/Exception/SecretListServiceUnavailableException.php +++ b/src/Exception/SecretListServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretUpdateBadRequestException.php b/src/Exception/SecretUpdateBadRequestException.php index d7be7395..75579dff 100644 --- a/src/Exception/SecretUpdateBadRequestException.php +++ b/src/Exception/SecretUpdateBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretUpdateInternalServerErrorException.php b/src/Exception/SecretUpdateInternalServerErrorException.php index e860a6df..65816a94 100644 --- a/src/Exception/SecretUpdateInternalServerErrorException.php +++ b/src/Exception/SecretUpdateInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretUpdateNotFoundException.php b/src/Exception/SecretUpdateNotFoundException.php index e12d75bf..ccdaef43 100644 --- a/src/Exception/SecretUpdateNotFoundException.php +++ b/src/Exception/SecretUpdateNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SecretUpdateServiceUnavailableException.php b/src/Exception/SecretUpdateServiceUnavailableException.php index f5dc42ac..3e483a33 100644 --- a/src/Exception/SecretUpdateServiceUnavailableException.php +++ b/src/Exception/SecretUpdateServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServerException.php b/src/Exception/ServerException.php index 9e0cffda..6c2c3fff 100644 --- a/src/Exception/ServerException.php +++ b/src/Exception/ServerException.php @@ -1,15 +1,7 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceCreateConflictException.php b/src/Exception/ServiceCreateConflictException.php index 7d74ab7b..6a2ff932 100644 --- a/src/Exception/ServiceCreateConflictException.php +++ b/src/Exception/ServiceCreateConflictException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceCreateForbiddenException.php b/src/Exception/ServiceCreateForbiddenException.php index 533cdff0..a6287fd6 100644 --- a/src/Exception/ServiceCreateForbiddenException.php +++ b/src/Exception/ServiceCreateForbiddenException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceCreateInternalServerErrorException.php b/src/Exception/ServiceCreateInternalServerErrorException.php index 4aa39bc9..e81fa9be 100644 --- a/src/Exception/ServiceCreateInternalServerErrorException.php +++ b/src/Exception/ServiceCreateInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceCreateServiceUnavailableException.php b/src/Exception/ServiceCreateServiceUnavailableException.php index f8995939..4a13c69c 100644 --- a/src/Exception/ServiceCreateServiceUnavailableException.php +++ b/src/Exception/ServiceCreateServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceDeleteInternalServerErrorException.php b/src/Exception/ServiceDeleteInternalServerErrorException.php index b6a11cc4..528330fc 100644 --- a/src/Exception/ServiceDeleteInternalServerErrorException.php +++ b/src/Exception/ServiceDeleteInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceDeleteNotFoundException.php b/src/Exception/ServiceDeleteNotFoundException.php index b3ffe5ed..6e480c39 100644 --- a/src/Exception/ServiceDeleteNotFoundException.php +++ b/src/Exception/ServiceDeleteNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceDeleteServiceUnavailableException.php b/src/Exception/ServiceDeleteServiceUnavailableException.php index 2f530dd8..2123c75b 100644 --- a/src/Exception/ServiceDeleteServiceUnavailableException.php +++ b/src/Exception/ServiceDeleteServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceInspectInternalServerErrorException.php b/src/Exception/ServiceInspectInternalServerErrorException.php index c945498b..e96d77c7 100644 --- a/src/Exception/ServiceInspectInternalServerErrorException.php +++ b/src/Exception/ServiceInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceInspectNotFoundException.php b/src/Exception/ServiceInspectNotFoundException.php index d8fb3309..e3d50eaf 100644 --- a/src/Exception/ServiceInspectNotFoundException.php +++ b/src/Exception/ServiceInspectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceInspectServiceUnavailableException.php b/src/Exception/ServiceInspectServiceUnavailableException.php index e1866f77..dd94368c 100644 --- a/src/Exception/ServiceInspectServiceUnavailableException.php +++ b/src/Exception/ServiceInspectServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceListInternalServerErrorException.php b/src/Exception/ServiceListInternalServerErrorException.php index fc1cd1e3..3e473c79 100644 --- a/src/Exception/ServiceListInternalServerErrorException.php +++ b/src/Exception/ServiceListInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceListServiceUnavailableException.php b/src/Exception/ServiceListServiceUnavailableException.php index c83de6a0..bfa1e62e 100644 --- a/src/Exception/ServiceListServiceUnavailableException.php +++ b/src/Exception/ServiceListServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceLogsInternalServerErrorException.php b/src/Exception/ServiceLogsInternalServerErrorException.php index ced82992..5a9b58b6 100644 --- a/src/Exception/ServiceLogsInternalServerErrorException.php +++ b/src/Exception/ServiceLogsInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceLogsNotFoundException.php b/src/Exception/ServiceLogsNotFoundException.php index 21082f0c..08546d5a 100644 --- a/src/Exception/ServiceLogsNotFoundException.php +++ b/src/Exception/ServiceLogsNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceLogsServiceUnavailableException.php b/src/Exception/ServiceLogsServiceUnavailableException.php index a669558f..4aa29ff7 100644 --- a/src/Exception/ServiceLogsServiceUnavailableException.php +++ b/src/Exception/ServiceLogsServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceUnavailableException.php b/src/Exception/ServiceUnavailableException.php new file mode 100644 index 00000000..2d036d1d --- /dev/null +++ b/src/Exception/ServiceUnavailableException.php @@ -0,0 +1,11 @@ +errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceUpdateInternalServerErrorException.php b/src/Exception/ServiceUpdateInternalServerErrorException.php index e51ef8fb..8533ebc2 100644 --- a/src/Exception/ServiceUpdateInternalServerErrorException.php +++ b/src/Exception/ServiceUpdateInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceUpdateNotFoundException.php b/src/Exception/ServiceUpdateNotFoundException.php index 35524460..a19c5161 100644 --- a/src/Exception/ServiceUpdateNotFoundException.php +++ b/src/Exception/ServiceUpdateNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/ServiceUpdateServiceUnavailableException.php b/src/Exception/ServiceUpdateServiceUnavailableException.php index 740e29ac..1ae2e015 100644 --- a/src/Exception/ServiceUpdateServiceUnavailableException.php +++ b/src/Exception/ServiceUpdateServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SessionBadRequestException.php b/src/Exception/SessionBadRequestException.php index 8f84716c..fed0ed05 100644 --- a/src/Exception/SessionBadRequestException.php +++ b/src/Exception/SessionBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SessionInternalServerErrorException.php b/src/Exception/SessionInternalServerErrorException.php index 18bec0a5..56be5cbc 100644 --- a/src/Exception/SessionInternalServerErrorException.php +++ b/src/Exception/SessionInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmInitBadRequestException.php b/src/Exception/SwarmInitBadRequestException.php index b960c08b..eeccfda8 100644 --- a/src/Exception/SwarmInitBadRequestException.php +++ b/src/Exception/SwarmInitBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmInitInternalServerErrorException.php b/src/Exception/SwarmInitInternalServerErrorException.php index ede2438c..50c1d000 100644 --- a/src/Exception/SwarmInitInternalServerErrorException.php +++ b/src/Exception/SwarmInitInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmInitServiceUnavailableException.php b/src/Exception/SwarmInitServiceUnavailableException.php index 66777ca7..728091d4 100644 --- a/src/Exception/SwarmInitServiceUnavailableException.php +++ b/src/Exception/SwarmInitServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmInspectInternalServerErrorException.php b/src/Exception/SwarmInspectInternalServerErrorException.php index 5d80932a..a8290480 100644 --- a/src/Exception/SwarmInspectInternalServerErrorException.php +++ b/src/Exception/SwarmInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmInspectNotFoundException.php b/src/Exception/SwarmInspectNotFoundException.php index dbaba42d..a61ab8cf 100644 --- a/src/Exception/SwarmInspectNotFoundException.php +++ b/src/Exception/SwarmInspectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmInspectServiceUnavailableException.php b/src/Exception/SwarmInspectServiceUnavailableException.php index afdee1ee..d600b8f4 100644 --- a/src/Exception/SwarmInspectServiceUnavailableException.php +++ b/src/Exception/SwarmInspectServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmJoinBadRequestException.php b/src/Exception/SwarmJoinBadRequestException.php index 14b00bf0..ba509915 100644 --- a/src/Exception/SwarmJoinBadRequestException.php +++ b/src/Exception/SwarmJoinBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmJoinInternalServerErrorException.php b/src/Exception/SwarmJoinInternalServerErrorException.php index 935b706c..f64ae004 100644 --- a/src/Exception/SwarmJoinInternalServerErrorException.php +++ b/src/Exception/SwarmJoinInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmJoinServiceUnavailableException.php b/src/Exception/SwarmJoinServiceUnavailableException.php index feea00fb..6228d6bc 100644 --- a/src/Exception/SwarmJoinServiceUnavailableException.php +++ b/src/Exception/SwarmJoinServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmLeaveInternalServerErrorException.php b/src/Exception/SwarmLeaveInternalServerErrorException.php index 967aa3a6..5cced7ad 100644 --- a/src/Exception/SwarmLeaveInternalServerErrorException.php +++ b/src/Exception/SwarmLeaveInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmLeaveServiceUnavailableException.php b/src/Exception/SwarmLeaveServiceUnavailableException.php index 9b96fc9a..db839064 100644 --- a/src/Exception/SwarmLeaveServiceUnavailableException.php +++ b/src/Exception/SwarmLeaveServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmUnlockInternalServerErrorException.php b/src/Exception/SwarmUnlockInternalServerErrorException.php index a8831555..1db6eee6 100644 --- a/src/Exception/SwarmUnlockInternalServerErrorException.php +++ b/src/Exception/SwarmUnlockInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmUnlockServiceUnavailableException.php b/src/Exception/SwarmUnlockServiceUnavailableException.php index 648d5b14..d9e07ff6 100644 --- a/src/Exception/SwarmUnlockServiceUnavailableException.php +++ b/src/Exception/SwarmUnlockServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmUnlockkeyInternalServerErrorException.php b/src/Exception/SwarmUnlockkeyInternalServerErrorException.php index ddb3de0e..9674b00d 100644 --- a/src/Exception/SwarmUnlockkeyInternalServerErrorException.php +++ b/src/Exception/SwarmUnlockkeyInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmUnlockkeyServiceUnavailableException.php b/src/Exception/SwarmUnlockkeyServiceUnavailableException.php index 66abfac2..65c80592 100644 --- a/src/Exception/SwarmUnlockkeyServiceUnavailableException.php +++ b/src/Exception/SwarmUnlockkeyServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmUpdateBadRequestException.php b/src/Exception/SwarmUpdateBadRequestException.php index 3f872a7e..59a5af10 100644 --- a/src/Exception/SwarmUpdateBadRequestException.php +++ b/src/Exception/SwarmUpdateBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmUpdateInternalServerErrorException.php b/src/Exception/SwarmUpdateInternalServerErrorException.php index a0c8e263..85989127 100644 --- a/src/Exception/SwarmUpdateInternalServerErrorException.php +++ b/src/Exception/SwarmUpdateInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SwarmUpdateServiceUnavailableException.php b/src/Exception/SwarmUpdateServiceUnavailableException.php index b74a4dbf..fd7bf3e5 100644 --- a/src/Exception/SwarmUpdateServiceUnavailableException.php +++ b/src/Exception/SwarmUpdateServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SystemAuthInternalServerErrorException.php b/src/Exception/SystemAuthInternalServerErrorException.php index 8e1575d7..89ba3681 100644 --- a/src/Exception/SystemAuthInternalServerErrorException.php +++ b/src/Exception/SystemAuthInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SystemAuthUnauthorizedException.php b/src/Exception/SystemAuthUnauthorizedException.php new file mode 100644 index 00000000..f3d3c121 --- /dev/null +++ b/src/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/src/Exception/SystemDataUsageInternalServerErrorException.php b/src/Exception/SystemDataUsageInternalServerErrorException.php index 4c642bc6..9a1d8bf4 100644 --- a/src/Exception/SystemDataUsageInternalServerErrorException.php +++ b/src/Exception/SystemDataUsageInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SystemEventsBadRequestException.php b/src/Exception/SystemEventsBadRequestException.php index 58b02f1c..62dd71d5 100644 --- a/src/Exception/SystemEventsBadRequestException.php +++ b/src/Exception/SystemEventsBadRequestException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SystemEventsInternalServerErrorException.php b/src/Exception/SystemEventsInternalServerErrorException.php index 79e1e32b..bfd1f2aa 100644 --- a/src/Exception/SystemEventsInternalServerErrorException.php +++ b/src/Exception/SystemEventsInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SystemInfoInternalServerErrorException.php b/src/Exception/SystemInfoInternalServerErrorException.php index e10e8463..445f1a7e 100644 --- a/src/Exception/SystemInfoInternalServerErrorException.php +++ b/src/Exception/SystemInfoInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SystemPingHeadInternalServerErrorException.php b/src/Exception/SystemPingHeadInternalServerErrorException.php new file mode 100644 index 00000000..101fd9cc --- /dev/null +++ b/src/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/src/Exception/SystemPingInternalServerErrorException.php b/src/Exception/SystemPingInternalServerErrorException.php index f0323684..36ba155c 100644 --- a/src/Exception/SystemPingInternalServerErrorException.php +++ b/src/Exception/SystemPingInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/SystemVersionInternalServerErrorException.php b/src/Exception/SystemVersionInternalServerErrorException.php index e4e97f57..46fb8abe 100644 --- a/src/Exception/SystemVersionInternalServerErrorException.php +++ b/src/Exception/SystemVersionInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/TaskInspectInternalServerErrorException.php b/src/Exception/TaskInspectInternalServerErrorException.php index a20b97d8..f32f423b 100644 --- a/src/Exception/TaskInspectInternalServerErrorException.php +++ b/src/Exception/TaskInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/TaskInspectNotFoundException.php b/src/Exception/TaskInspectNotFoundException.php index 618a9bb8..cc65a1cd 100644 --- a/src/Exception/TaskInspectNotFoundException.php +++ b/src/Exception/TaskInspectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/TaskInspectServiceUnavailableException.php b/src/Exception/TaskInspectServiceUnavailableException.php index 100ac563..394f0672 100644 --- a/src/Exception/TaskInspectServiceUnavailableException.php +++ b/src/Exception/TaskInspectServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/TaskListInternalServerErrorException.php b/src/Exception/TaskListInternalServerErrorException.php index d99f548e..df998cd3 100644 --- a/src/Exception/TaskListInternalServerErrorException.php +++ b/src/Exception/TaskListInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/TaskListServiceUnavailableException.php b/src/Exception/TaskListServiceUnavailableException.php index a174d19d..7b820739 100644 --- a/src/Exception/TaskListServiceUnavailableException.php +++ b/src/Exception/TaskListServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/TaskLogsInternalServerErrorException.php b/src/Exception/TaskLogsInternalServerErrorException.php index ef886c23..f8ca774b 100644 --- a/src/Exception/TaskLogsInternalServerErrorException.php +++ b/src/Exception/TaskLogsInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/TaskLogsNotFoundException.php b/src/Exception/TaskLogsNotFoundException.php index fd8bd261..6a68dd07 100644 --- a/src/Exception/TaskLogsNotFoundException.php +++ b/src/Exception/TaskLogsNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/TaskLogsServiceUnavailableException.php b/src/Exception/TaskLogsServiceUnavailableException.php index e17c168c..61a765dc 100644 --- a/src/Exception/TaskLogsServiceUnavailableException.php +++ b/src/Exception/TaskLogsServiceUnavailableException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/UnauthorizedException.php b/src/Exception/UnauthorizedException.php new file mode 100644 index 00000000..2209b5de --- /dev/null +++ b/src/Exception/UnauthorizedException.php @@ -0,0 +1,11 @@ +errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/VolumeDeleteConflictException.php b/src/Exception/VolumeDeleteConflictException.php index 17bf126b..03b1d7f6 100644 --- a/src/Exception/VolumeDeleteConflictException.php +++ b/src/Exception/VolumeDeleteConflictException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/VolumeDeleteInternalServerErrorException.php b/src/Exception/VolumeDeleteInternalServerErrorException.php index a3bf54b3..8903b511 100644 --- a/src/Exception/VolumeDeleteInternalServerErrorException.php +++ b/src/Exception/VolumeDeleteInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/VolumeDeleteNotFoundException.php b/src/Exception/VolumeDeleteNotFoundException.php index 5f2423a1..71fbb0a5 100644 --- a/src/Exception/VolumeDeleteNotFoundException.php +++ b/src/Exception/VolumeDeleteNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/VolumeInspectInternalServerErrorException.php b/src/Exception/VolumeInspectInternalServerErrorException.php index 9f1af985..7108e4e9 100644 --- a/src/Exception/VolumeInspectInternalServerErrorException.php +++ b/src/Exception/VolumeInspectInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/VolumeInspectNotFoundException.php b/src/Exception/VolumeInspectNotFoundException.php index eb924fe3..c01ea31f 100644 --- a/src/Exception/VolumeInspectNotFoundException.php +++ b/src/Exception/VolumeInspectNotFoundException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/VolumeListInternalServerErrorException.php b/src/Exception/VolumeListInternalServerErrorException.php index f8644e69..08e7aaaa 100644 --- a/src/Exception/VolumeListInternalServerErrorException.php +++ b/src/Exception/VolumeListInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/VolumePruneInternalServerErrorException.php b/src/Exception/VolumePruneInternalServerErrorException.php index b25daf92..83993cfb 100644 --- a/src/Exception/VolumePruneInternalServerErrorException.php +++ b/src/Exception/VolumePruneInternalServerErrorException.php @@ -1,27 +1,29 @@ errorResponse = $errorResponse; + $this->response = $response; } - - public function getErrorResponse() + 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/src/Exception/VolumeUpdateBadRequestException.php b/src/Exception/VolumeUpdateBadRequestException.php new file mode 100644 index 00000000..a9961194 --- /dev/null +++ b/src/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/src/Exception/VolumeUpdateInternalServerErrorException.php b/src/Exception/VolumeUpdateInternalServerErrorException.php new file mode 100644 index 00000000..a9e99c58 --- /dev/null +++ b/src/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/src/Exception/VolumeUpdateNotFoundException.php b/src/Exception/VolumeUpdateNotFoundException.php new file mode 100644 index 00000000..0b5d3891 --- /dev/null +++ b/src/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/src/Exception/VolumeUpdateServiceUnavailableException.php b/src/Exception/VolumeUpdateServiceUnavailableException.php new file mode 100644 index 00000000..ad660064 --- /dev/null +++ b/src/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/src/Model/Address.php b/src/Model/Address.php index 9e38b190..fb523713 100644 --- a/src/Model/Address.php +++ b/src/Model/Address.php @@ -1,75 +1,71 @@ initialized); + } /** * IP address. * - * @var string + * @var string|null */ protected $addr; /** * Mask length of the IP address. * - * @var int + * @var int|null */ protected $prefixLen; - /** * IP address. * - * @return string + * @return string|null */ - public function getAddr(): ?string + public function getAddr() : ?string { return $this->addr; } - /** * IP address. * - * @param string $addr + * @param string|null $addr * * @return self */ - public function setAddr(?string $addr): self + public function setAddr(?string $addr) : self { + $this->initialized['addr'] = true; $this->addr = $addr; - return $this; } - /** * Mask length of the IP address. * - * @return int + * @return int|null */ - public function getPrefixLen(): ?int + public function getPrefixLen() : ?int { return $this->prefixLen; } - /** * Mask length of the IP address. * - * @param int $prefixLen + * @param int|null $prefixLen * * @return self */ - public function setPrefixLen(?int $prefixLen): 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/src/Model/AuthConfig.php b/src/Model/AuthConfig.php index 3a548a52..a5626a84 100644 --- a/src/Model/AuthConfig.php +++ b/src/Model/AuthConfig.php @@ -1,111 +1,127 @@ 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; - /** - * @return string + * + * + * @return string|null */ - public function getUsername(): ?string + public function getUsername() : ?string { return $this->username; } - /** - * @param string $username + * + * + * @param string|null $username * * @return self */ - public function setUsername(?string $username): self + public function setUsername(?string $username) : self { + $this->initialized['username'] = true; $this->username = $username; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getPassword(): ?string + public function getPassword() : ?string { return $this->password; } - /** - * @param string $password + * + * + * @param string|null $password * * @return self */ - public function setPassword(?string $password): self + public function setPassword(?string $password) : self { + $this->initialized['password'] = true; $this->password = $password; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getEmail(): ?string + public function getEmail() : ?string { return $this->email; } - /** - * @param string $email + * + * + * @param string|null $email * * @return self */ - public function setEmail(?string $email): self + public function setEmail(?string $email) : self { + $this->initialized['email'] = true; $this->email = $email; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getServeraddress(): ?string + public function getServeraddress() : ?string { return $this->serveraddress; } - /** - * @param string $serveraddress + * + * + * @param string|null $serveraddress * * @return self */ - public function setServeraddress(?string $serveraddress): self + public function setServeraddress(?string $serveraddress) : self { + $this->initialized['serveraddress'] = true; $this->serveraddress = $serveraddress; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/AuthPostResponse200.php b/src/Model/AuthPostResponse200.php index 2d253338..34164e46 100644 --- a/src/Model/AuthPostResponse200.php +++ b/src/Model/AuthPostResponse200.php @@ -1,75 +1,71 @@ initialized); + } + /** + * The status of the authentication * - * @var string + * @var string|null */ protected $status; /** - * An opaque token used to authenticate a user after a successful login. + * An opaque token used to authenticate a user after a successful login * - * @var string + * @var string|null */ protected $identityToken; - /** - * The status of the authentication. + * The status of the authentication * - * @return string + * @return string|null */ - public function getStatus(): ?string + public function getStatus() : ?string { return $this->status; } - /** - * The status of the authentication. + * The status of the authentication * - * @param string $status + * @param string|null $status * * @return self */ - public function setStatus(?string $status): 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. + * An opaque token used to authenticate a user after a successful login * - * @return string + * @return string|null */ - public function getIdentityToken(): ?string + public function getIdentityToken() : ?string { return $this->identityToken; } - /** - * An opaque token used to authenticate a user after a successful login. + * An opaque token used to authenticate a user after a successful login * - * @param string $identityToken + * @param string|null $identityToken * * @return self */ - public function setIdentityToken(?string $identityToken): 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/src/Model/BuildCache.php b/src/Model/BuildCache.php new file mode 100644 index 00000000..1db23d5e --- /dev/null +++ b/src/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 string[]|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 string[]|null + */ + public function getParents() : ?array + { + return $this->parents; + } + /** + * List of parent build cache record IDs. + * + * @param string[]|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/src/Model/BuildInfo.php b/src/Model/BuildInfo.php index 59fd204d..79b87b28 100644 --- a/src/Model/BuildInfo.php +++ b/src/Model/BuildInfo.php @@ -1,213 +1,239 @@ 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; /** - * Image ID or Digest. + * Image ID or Digest * - * @var ImageID + * @var ImageID|null */ protected $aux; - /** - * @return string + * + * + * @return string|null */ - public function getId(): ?string + public function getId() : ?string { return $this->id; } - /** - * @param string $id + * + * + * @param string|null $id * * @return self */ - public function setId(?string $id): self + public function setId(?string $id) : self { + $this->initialized['id'] = true; $this->id = $id; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getStream(): ?string + public function getStream() : ?string { return $this->stream; } - /** - * @param string $stream + * + * + * @param string|null $stream * * @return self */ - public function setStream(?string $stream): self + public function setStream(?string $stream) : self { + $this->initialized['stream'] = true; $this->stream = $stream; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getError(): ?string + public function getError() : ?string { return $this->error; } - /** - * @param string $error + * + * + * @param string|null $error * * @return self */ - public function setError(?string $error): self + public function setError(?string $error) : self { + $this->initialized['error'] = true; $this->error = $error; - return $this; } - /** - * @return ErrorDetail + * + * + * @return ErrorDetail|null */ - public function getErrorDetail(): ?ErrorDetail + public function getErrorDetail() : ?ErrorDetail { return $this->errorDetail; } - /** - * @param ErrorDetail $errorDetail + * + * + * @param ErrorDetail|null $errorDetail * * @return self */ - public function setErrorDetail(?ErrorDetail $errorDetail): self + public function setErrorDetail(?ErrorDetail $errorDetail) : self { + $this->initialized['errorDetail'] = true; $this->errorDetail = $errorDetail; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getStatus(): ?string + public function getStatus() : ?string { return $this->status; } - /** - * @param string $status + * + * + * @param string|null $status * * @return self */ - public function setStatus(?string $status): self + public function setStatus(?string $status) : self { + $this->initialized['status'] = true; $this->status = $status; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getProgress(): ?string + public function getProgress() : ?string { return $this->progress; } - /** - * @param string $progress + * + * + * @param string|null $progress * * @return self */ - public function setProgress(?string $progress): self + public function setProgress(?string $progress) : self { + $this->initialized['progress'] = true; $this->progress = $progress; - return $this; } - /** - * @return ProgressDetail + * + * + * @return ProgressDetail|null */ - public function getProgressDetail(): ?ProgressDetail + public function getProgressDetail() : ?ProgressDetail { return $this->progressDetail; } - /** - * @param ProgressDetail $progressDetail + * + * + * @param ProgressDetail|null $progressDetail * * @return self */ - public function setProgressDetail(?ProgressDetail $progressDetail): self + public function setProgressDetail(?ProgressDetail $progressDetail) : self { + $this->initialized['progressDetail'] = true; $this->progressDetail = $progressDetail; - return $this; } - /** - * Image ID or Digest. + * Image ID or Digest * - * @return ImageID + * @return ImageID|null */ - public function getAux(): ?ImageID + public function getAux() : ?ImageID { return $this->aux; } - /** - * Image ID or Digest. + * Image ID or Digest * - * @param ImageID $aux + * @param ImageID|null $aux * * @return self */ - public function setAux(?ImageID $aux): 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/src/Model/BuildPrunePostResponse200.php b/src/Model/BuildPrunePostResponse200.php index 20e1970e..b1b4e00b 100644 --- a/src/Model/BuildPrunePostResponse200.php +++ b/src/Model/BuildPrunePostResponse200.php @@ -1,45 +1,71 @@ initialized); + } + /** + * * - * @var int + * @var string[]|null + */ + protected $cachesDeleted; + /** + * Disk space reclaimed in bytes + * + * @var int|null */ protected $spaceReclaimed; - /** - * Disk space reclaimed in bytes. + * * - * @return int + * @return string[]|null */ - public function getSpaceReclaimed(): ?int + public function getCachesDeleted() : ?array + { + return $this->cachesDeleted; + } + /** + * + * + * @param string[]|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. + * Disk space reclaimed in bytes * - * @param int $spaceReclaimed + * @param int|null $spaceReclaimed * * @return self */ - public function setSpaceReclaimed(?int $spaceReclaimed): 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/src/Model/ClusterInfo.php b/src/Model/ClusterInfo.php index 17998136..fd1912bc 100644 --- a/src/Model/ClusterInfo.php +++ b/src/Model/ClusterInfo.php @@ -1,258 +1,364 @@ initialized); + } /** * The ID of the swarm. * - * @var string + * @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 - */ + * 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. + * 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 - */ + + * + * @var string|null + */ protected $createdAt; /** - * Date and time at which the swarm was last updated in. + * 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 - */ + + * + * @var string|null + */ protected $updatedAt; /** * User modifiable swarm configuration. * - * @var SwarmSpec + * @var SwarmSpec|null */ protected $spec; /** - * Information about the issuer of leaf TLS certificates and the trusted root CA certificate. - * - * @var TLSInfo - */ + * 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. + * Whether there is currently a root CA rotation in progress for the swarm * - * @var bool + * @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 string[]|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 + * @return string|null */ - public function getID(): ?string + public function getID() : ?string { return $this->iD; } - /** * The ID of the swarm. * - * @param string $iD + * @param string|null $iD * * @return self */ - public function setID(?string $iD): 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 - */ - public function getVersion(): ?ObjectVersion + * 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 $version - * - * @return self - */ - public function setVersion(?ObjectVersion $version): self + * 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. + * 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 - */ - public function getCreatedAt(): ?string + + * + * @return string|null + */ + public function getCreatedAt() : ?string { return $this->createdAt; } - /** - * Date and time at which the swarm was initialised in. + * 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 $createdAt - * - * @return self - */ - public function setCreatedAt(?string $createdAt): self + + * + * @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. + * 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 - */ - public function getUpdatedAt(): ?string + + * + * @return string|null + */ + public function getUpdatedAt() : ?string { return $this->updatedAt; } - /** - * Date and time at which the swarm was last updated in. + * 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 $updatedAt - * - * @return self - */ - public function setUpdatedAt(?string $updatedAt): self + + * + * @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 + * @return SwarmSpec|null */ - public function getSpec(): ?SwarmSpec + public function getSpec() : ?SwarmSpec { return $this->spec; } - /** * User modifiable swarm configuration. * - * @param SwarmSpec $spec + * @param SwarmSpec|null $spec * * @return self */ - public function setSpec(?SwarmSpec $spec): 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 - */ - public function getTLSInfo(): ?TLSInfo + * 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 $tLSInfo - * - * @return self - */ - public function setTLSInfo(?TLSInfo $tLSInfo): self + * 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. + * Whether there is currently a root CA rotation in progress for the swarm * - * @return bool + * @return bool|null */ - public function getRootRotationInProgress(): ?bool + public function getRootRotationInProgress() : ?bool { return $this->rootRotationInProgress; } - /** - * Whether there is currently a root CA rotation in progress for the swarm. + * Whether there is currently a root CA rotation in progress for the swarm * - * @param bool $rootRotationInProgress + * @param bool|null $rootRotationInProgress * * @return self */ - public function setRootRotationInProgress(?bool $rootRotationInProgress): 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 string[]|null + */ + public function getDefaultAddrPool() : ?array + { + return $this->defaultAddrPool; + } + /** + * Default Address Pool specifies default subnet pools for global scope + networks. + + * + * @param string[]|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/src/Model/ClusterVolume.php b/src/Model/ClusterVolume.php new file mode 100644 index 00000000..2cb11922 --- /dev/null +++ b/src/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 ClusterVolumePublishStatusItem[]|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 ClusterVolumePublishStatusItem[]|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 ClusterVolumePublishStatusItem[]|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/src/Model/ClusterVolumeInfo.php b/src/Model/ClusterVolumeInfo.php new file mode 100644 index 00000000..a685ba4f --- /dev/null +++ b/src/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 array[]|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 array[]|null + */ + public function getAccessibleTopology() : ?array + { + return $this->accessibleTopology; + } + /** + * The topology this volume is actually accessible from. + * + * @param array[]|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/src/Model/ClusterVolumePublishStatusItem.php b/src/Model/ClusterVolumePublishStatusItem.php new file mode 100644 index 00000000..fe026ed6 --- /dev/null +++ b/src/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/src/Model/ClusterVolumeSpec.php b/src/Model/ClusterVolumeSpec.php new file mode 100644 index 00000000..b30f047c --- /dev/null +++ b/src/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/src/Model/ClusterVolumeSpecAccessMode.php b/src/Model/ClusterVolumeSpecAccessMode.php new file mode 100644 index 00000000..51f6839c --- /dev/null +++ b/src/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 ClusterVolumeSpecAccessModeSecretsItem[]|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 ClusterVolumeSpecAccessModeSecretsItem[]|null + */ + public function getSecrets() : ?array + { + return $this->secrets; + } + /** + * Swarm Secrets that are passed to the CSI storage plugin when + operating on this volume. + + * + * @param ClusterVolumeSpecAccessModeSecretsItem[]|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/src/Model/ClusterVolumeSpecAccessModeAccessibilityRequirements.php b/src/Model/ClusterVolumeSpecAccessModeAccessibilityRequirements.php new file mode 100644 index 00000000..375436bf --- /dev/null +++ b/src/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 array[]|null + */ + protected $requisite; + /** + * A list of topologies that the volume should attempt to be + provisioned in. + + * + * @var array[]|null + */ + protected $preferred; + /** + * A list of required topologies, at least one of which the + volume must be accessible from. + + * + * @return array[]|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 array[]|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 array[]|null + */ + public function getPreferred() : ?array + { + return $this->preferred; + } + /** + * A list of topologies that the volume should attempt to be + provisioned in. + + * + * @param array[]|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/src/Model/ClusterVolumeSpecAccessModeCapacityRange.php b/src/Model/ClusterVolumeSpecAccessModeCapacityRange.php new file mode 100644 index 00000000..3933289b --- /dev/null +++ b/src/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/src/Model/ClusterVolumeSpecAccessModeSecretsItem.php b/src/Model/ClusterVolumeSpecAccessModeSecretsItem.php new file mode 100644 index 00000000..58ea9898 --- /dev/null +++ b/src/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/src/Model/Commit.php b/src/Model/Commit.php index eade836d..a7bdb378 100644 --- a/src/Model/Commit.php +++ b/src/Model/Commit.php @@ -1,75 +1,71 @@ initialized); + } /** * Actual commit ID of external tool. * - * @var string + * @var string|null */ protected $iD; /** * Commit ID of external tool expected by dockerd as set at build time. * - * @var string + * @var string|null */ protected $expected; - /** * Actual commit ID of external tool. * - * @return string + * @return string|null */ - public function getID(): ?string + public function getID() : ?string { return $this->iD; } - /** * Actual commit ID of external tool. * - * @param string $iD + * @param string|null $iD * * @return self */ - public function setID(?string $iD): 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 + * @return string|null */ - public function getExpected(): ?string + public function getExpected() : ?string { return $this->expected; } - /** * Commit ID of external tool expected by dockerd as set at build time. * - * @param string $expected + * @param string|null $expected * * @return self */ - public function setExpected(?string $expected): 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/src/Model/Config.php b/src/Model/Config.php index c21e24af..9113a5d7 100644 --- a/src/Model/Config.php +++ b/src/Model/Config.php @@ -1,162 +1,185 @@ 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 + * @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 + * + * + * @var string|null */ protected $createdAt; /** - * @var string + * + * + * @var string|null */ protected $updatedAt; /** - * @var ConfigSpec + * + * + * @var ConfigSpec|null */ protected $spec; - /** - * @return string + * + * + * @return string|null */ - public function getID(): ?string + public function getID() : ?string { return $this->iD; } - /** - * @param string $iD + * + * + * @param string|null $iD * * @return self */ - public function setID(?string $iD): 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 - */ - public function getVersion(): ?ObjectVersion + * 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 $version - * - * @return self - */ - public function setVersion(?ObjectVersion $version): self + * 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 + * + * + * @return string|null */ - public function getCreatedAt(): ?string + public function getCreatedAt() : ?string { return $this->createdAt; } - /** - * @param string $createdAt + * + * + * @param string|null $createdAt * * @return self */ - public function setCreatedAt(?string $createdAt): self + public function setCreatedAt(?string $createdAt) : self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getUpdatedAt(): ?string + public function getUpdatedAt() : ?string { return $this->updatedAt; } - /** - * @param string $updatedAt + * + * + * @param string|null $updatedAt * * @return self */ - public function setUpdatedAt(?string $updatedAt): self + public function setUpdatedAt(?string $updatedAt) : self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; - return $this; } - /** - * @return ConfigSpec + * + * + * @return ConfigSpec|null */ - public function getSpec(): ?ConfigSpec + public function getSpec() : ?ConfigSpec { return $this->spec; } - /** - * @param ConfigSpec $spec + * + * + * @param ConfigSpec|null $spec * * @return self */ - public function setSpec(?ConfigSpec $spec): 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/src/Model/ConfigSpec.php b/src/Model/ConfigSpec.php index 088e9364..54fadea0 100644 --- a/src/Model/ConfigSpec.php +++ b/src/Model/ConfigSpec.php @@ -1,111 +1,133 @@ initialized); + } /** * User-defined name of the config. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). + * 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 string + * @var Driver|null */ - protected $data; - + protected $templating; /** * User-defined name of the config. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * User-defined name of the config. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): 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-3.2)). + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) config data. - - * - * @return string - */ - public function getData(): ?string + + * + * @return string|null + */ + public function getData() : ?string { return $this->data; } - /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). + * 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 string $data + * @param Driver|null $templating * * @return self */ - public function setData(?string $data): self + public function setTemplating(?Driver $templating) : self { - $this->data = $data; - + $this->initialized['templating'] = true; + $this->templating = $templating; return $this; } -} +} \ No newline at end of file diff --git a/src/Model/ConfigsCreatePostBody.php b/src/Model/ConfigsCreatePostBody.php index b6a30b5b..bf992785 100644 --- a/src/Model/ConfigsCreatePostBody.php +++ b/src/Model/ConfigsCreatePostBody.php @@ -1,111 +1,133 @@ initialized); + } /** * User-defined name of the config. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). + * 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 string + * @var Driver|null */ - protected $data; - + protected $templating; /** * User-defined name of the config. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * User-defined name of the config. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): 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-3.2)). + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) config data. - - * - * @return string - */ - public function getData(): ?string + + * + * @return string|null + */ + public function getData() : ?string { return $this->data; } - /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). + * 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 string $data + * @param Driver|null $templating * * @return self */ - public function setData(?string $data): self + public function setTemplating(?Driver $templating) : self { - $this->data = $data; - + $this->initialized['templating'] = true; + $this->templating = $templating; return $this; } -} +} \ No newline at end of file diff --git a/src/Model/ContainerConfig.php b/src/Model/ContainerConfig.php index 38d9ca5b..454658da 100644 --- a/src/Model/ContainerConfig.php +++ b/src/Model/ContainerConfig.php @@ -1,783 +1,760 @@ initialized); + } /** * The hostname to use for the container, as a valid RFC 1123 hostname. * - * @var string + * @var string|null */ protected $hostname; /** * The domain name to use for the container. * - * @var string + * @var string|null */ protected $domainname; /** * The user that commands are run as inside the container. * - * @var string + * @var string|null */ protected $user; /** * Whether to attach to `stdin`. * - * @var bool + * @var bool|null */ - protected $attachStdin; + protected $attachStdin = false; /** * Whether to attach to `stdout`. * - * @var bool + * @var bool|null */ - protected $attachStdout; + protected $attachStdout = true; /** * Whether to attach to `stderr`. * - * @var bool + * @var bool|null */ - protected $attachStderr; + protected $attachStderr = true; /** - * An object mapping ports to an empty object in the form:. - - `{"/": {}}` - - * - * @var mixed[] - */ + * 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 + * @var bool|null */ - protected $tty; + protected $tty = false; /** - * Open `stdin`. + * Open `stdin` * - * @var bool + * @var bool|null */ - protected $openStdin; + protected $openStdin = false; /** - * Close `stdin` after one attached client disconnects. + * Close `stdin` after one attached client disconnects * - * @var bool + * @var bool|null */ - protected $stdinOnce; + 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 string[] - */ + * 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 string[]|null + */ protected $env; /** * Command to run specified as a string or an array of strings. * - * @var string[] + * @var string[]|null */ protected $cmd; /** * A test to perform to check that the container is healthy. * - * @var HealthConfig + * @var HealthConfig|null */ protected $healthcheck; /** - * Command is already escaped (Windows only). + * Command is already escaped (Windows only) * - * @var bool + * @var bool|null */ - protected $argsEscaped; + protected $argsEscaped = false; /** - * The name of the image to use when creating the container. - * - * @var string - */ + * 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 mixed[] - */ + * 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 + * @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 string[] - */ + * 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 string[]|null + */ protected $entrypoint; /** * Disable networking for the container. * - * @var bool + * @var bool|null */ protected $networkDisabled; /** * MAC address of the container. * - * @var string + * @var string|null */ protected $macAddress; /** * `ONBUILD` metadata that were defined in the image's `Dockerfile`. * - * @var string[] + * @var string[]|null */ protected $onBuild; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * Signal to stop a container as a string or unsigned integer. * - * @var string + * @var string|null */ protected $stopSignal; /** * Timeout to stop a container in seconds. * - * @var int + * @var int|null */ - protected $stopTimeout; + protected $stopTimeout = 10; /** * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. * - * @var string[] + * @var string[]|null */ protected $shell; - /** * The hostname to use for the container, as a valid RFC 1123 hostname. * - * @return string + * @return string|null */ - public function getHostname(): ?string + public function getHostname() : ?string { return $this->hostname; } - /** * The hostname to use for the container, as a valid RFC 1123 hostname. * - * @param string $hostname + * @param string|null $hostname * * @return self */ - public function setHostname(?string $hostname): 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 + * @return string|null */ - public function getDomainname(): ?string + public function getDomainname() : ?string { return $this->domainname; } - /** * The domain name to use for the container. * - * @param string $domainname + * @param string|null $domainname * * @return self */ - public function setDomainname(?string $domainname): 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 + * @return string|null */ - public function getUser(): ?string + public function getUser() : ?string { return $this->user; } - /** * The user that commands are run as inside the container. * - * @param string $user + * @param string|null $user * * @return self */ - public function setUser(?string $user): self + public function setUser(?string $user) : self { + $this->initialized['user'] = true; $this->user = $user; - return $this; } - /** * Whether to attach to `stdin`. * - * @return bool + * @return bool|null */ - public function getAttachStdin(): ?bool + public function getAttachStdin() : ?bool { return $this->attachStdin; } - /** * Whether to attach to `stdin`. * - * @param bool $attachStdin + * @param bool|null $attachStdin * * @return self */ - public function setAttachStdin(?bool $attachStdin): self + public function setAttachStdin(?bool $attachStdin) : self { + $this->initialized['attachStdin'] = true; $this->attachStdin = $attachStdin; - return $this; } - /** * Whether to attach to `stdout`. * - * @return bool + * @return bool|null */ - public function getAttachStdout(): ?bool + public function getAttachStdout() : ?bool { return $this->attachStdout; } - /** * Whether to attach to `stdout`. * - * @param bool $attachStdout + * @param bool|null $attachStdout * * @return self */ - public function setAttachStdout(?bool $attachStdout): self + public function setAttachStdout(?bool $attachStdout) : self { + $this->initialized['attachStdout'] = true; $this->attachStdout = $attachStdout; - return $this; } - /** * Whether to attach to `stderr`. * - * @return bool + * @return bool|null */ - public function getAttachStderr(): ?bool + public function getAttachStderr() : ?bool { return $this->attachStderr; } - /** * Whether to attach to `stderr`. * - * @param bool $attachStderr + * @param bool|null $attachStderr * * @return self */ - public function setAttachStderr(?bool $attachStderr): 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 mixed[] - */ - public function getExposedPorts(): ?\ArrayObject + * 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 mixed[] $exposedPorts - * - * @return self - */ - public function setExposedPorts(?\ArrayObject $exposedPorts): self + * 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 + * @return bool|null */ - public function getTty(): ?bool + public function getTty() : ?bool { return $this->tty; } - /** * Attach standard streams to a TTY, including `stdin` if it is not closed. * - * @param bool $tty + * @param bool|null $tty * * @return self */ - public function setTty(?bool $tty): self + public function setTty(?bool $tty) : self { + $this->initialized['tty'] = true; $this->tty = $tty; - return $this; } - /** - * Open `stdin`. + * Open `stdin` * - * @return bool + * @return bool|null */ - public function getOpenStdin(): ?bool + public function getOpenStdin() : ?bool { return $this->openStdin; } - /** - * Open `stdin`. + * Open `stdin` * - * @param bool $openStdin + * @param bool|null $openStdin * * @return self */ - public function setOpenStdin(?bool $openStdin): self + public function setOpenStdin(?bool $openStdin) : self { + $this->initialized['openStdin'] = true; $this->openStdin = $openStdin; - return $this; } - /** - * Close `stdin` after one attached client disconnects. + * Close `stdin` after one attached client disconnects * - * @return bool + * @return bool|null */ - public function getStdinOnce(): ?bool + public function getStdinOnce() : ?bool { return $this->stdinOnce; } - /** - * Close `stdin` after one attached client disconnects. + * Close `stdin` after one attached client disconnects * - * @param bool $stdinOnce + * @param bool|null $stdinOnce * * @return self */ - public function setStdinOnce(?bool $stdinOnce): 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 string[] - */ - public function getEnv(): ?array + * 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 string[]|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 string[] $env - * - * @return self - */ - public function setEnv(?array $env): self + * 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 string[]|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 string[] + * @return string[]|null */ - public function getCmd(): ?array + public function getCmd() : ?array { return $this->cmd; } - /** * Command to run specified as a string or an array of strings. * - * @param string[] $cmd + * @param string[]|null $cmd * * @return self */ - public function setCmd(?array $cmd): 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 + * @return HealthConfig|null */ - public function getHealthcheck(): ?HealthConfig + public function getHealthcheck() : ?HealthConfig { return $this->healthcheck; } - /** * A test to perform to check that the container is healthy. * - * @param HealthConfig $healthcheck + * @param HealthConfig|null $healthcheck * * @return self */ - public function setHealthcheck(?HealthConfig $healthcheck): self + public function setHealthcheck(?HealthConfig $healthcheck) : self { + $this->initialized['healthcheck'] = true; $this->healthcheck = $healthcheck; - return $this; } - /** - * Command is already escaped (Windows only). + * Command is already escaped (Windows only) * - * @return bool + * @return bool|null */ - public function getArgsEscaped(): ?bool + public function getArgsEscaped() : ?bool { return $this->argsEscaped; } - /** - * Command is already escaped (Windows only). + * Command is already escaped (Windows only) * - * @param bool $argsEscaped + * @param bool|null $argsEscaped * * @return self */ - public function setArgsEscaped(?bool $argsEscaped): self + public function setArgsEscaped(?bool $argsEscaped) : self { + $this->initialized['argsEscaped'] = true; $this->argsEscaped = $argsEscaped; - return $this; } - /** - * The name of the image to use when creating the container. - * - * @return string - */ - public function getImage(): ?string + * 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 of the image to use when creating the container. - * - * @param string $image - * - * @return self - */ - public function setImage(?string $image): self + * 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 mixed[] - */ - public function getVolumes(): ?\ArrayObject + * 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 mixed[] $volumes - * - * @return self - */ - public function setVolumes(?\ArrayObject $volumes): self + * 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 + * @return string|null */ - public function getWorkingDir(): ?string + public function getWorkingDir() : ?string { return $this->workingDir; } - /** * The working directory for commands to run in. * - * @param string $workingDir + * @param string|null $workingDir * * @return self */ - public function setWorkingDir(?string $workingDir): 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 string[] - */ - public function getEntrypoint(): ?array + * 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 string[]|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 string[] $entrypoint - * - * @return self - */ - public function setEntrypoint(?array $entrypoint): self - { + * 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 string[]|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 + * @return bool|null */ - public function getNetworkDisabled(): ?bool + public function getNetworkDisabled() : ?bool { return $this->networkDisabled; } - /** * Disable networking for the container. * - * @param bool $networkDisabled + * @param bool|null $networkDisabled * * @return self */ - public function setNetworkDisabled(?bool $networkDisabled): self + public function setNetworkDisabled(?bool $networkDisabled) : self { + $this->initialized['networkDisabled'] = true; $this->networkDisabled = $networkDisabled; - return $this; } - /** * MAC address of the container. * - * @return string + * @return string|null */ - public function getMacAddress(): ?string + public function getMacAddress() : ?string { return $this->macAddress; } - /** * MAC address of the container. * - * @param string $macAddress + * @param string|null $macAddress * * @return self */ - public function setMacAddress(?string $macAddress): 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 string[] + * @return string[]|null */ - public function getOnBuild(): ?array + public function getOnBuild() : ?array { return $this->onBuild; } - /** * `ONBUILD` metadata that were defined in the image's `Dockerfile`. * - * @param string[] $onBuild + * @param string[]|null $onBuild * * @return self */ - public function setOnBuild(?array $onBuild): self + public function setOnBuild(?array $onBuild) : self { + $this->initialized['onBuild'] = true; $this->onBuild = $onBuild; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): 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 + * @return string|null */ - public function getStopSignal(): ?string + public function getStopSignal() : ?string { return $this->stopSignal; } - /** * Signal to stop a container as a string or unsigned integer. * - * @param string $stopSignal + * @param string|null $stopSignal * * @return self */ - public function setStopSignal(?string $stopSignal): 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 + * @return int|null */ - public function getStopTimeout(): ?int + public function getStopTimeout() : ?int { return $this->stopTimeout; } - /** * Timeout to stop a container in seconds. * - * @param int $stopTimeout + * @param int|null $stopTimeout * * @return self */ - public function setStopTimeout(?int $stopTimeout): 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 string[] + * @return string[]|null */ - public function getShell(): ?array + public function getShell() : ?array { return $this->shell; } - /** * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. * - * @param string[] $shell + * @param string[]|null $shell * * @return self */ - public function setShell(?array $shell): 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/src/Model/ContainerCreateResponse.php b/src/Model/ContainerCreateResponse.php new file mode 100644 index 00000000..beb73b41 --- /dev/null +++ b/src/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 string[]|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 string[]|null + */ + public function getWarnings() : ?array + { + return $this->warnings; + } + /** + * Warnings encountered when creating the container + * + * @param string[]|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/src/Model/ContainerState.php b/src/Model/ContainerState.php new file mode 100644 index 00000000..f9baad6b --- /dev/null +++ b/src/Model/ContainerState.php @@ -0,0 +1,393 @@ +initialized); + } + /** + * String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + + * + * @var string|null + */ + protected $status; + /** + * 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 $paused; + /** + * 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|null + */ + protected $dead; + /** + * The process ID of this container + * + * @var int|null + */ + protected $pid; + /** + * The last exit code of this container + * + * @var int|null + */ + protected $exitCode; + /** + * + * + * @var string|null + */ + protected $error; + /** + * The time when this container was last started. + * + * @var string|null + */ + protected $startedAt; + /** + * The time when this container last exited. + * + * @var string|null + */ + protected $finishedAt; + /** + * Health stores information about the container's healthcheck results. + * + * @var Health|null + */ + 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->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; + } + /** + * 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 setPaused(?bool $paused) : self + { + $this->initialized['paused'] = true; + $this->paused = $paused; + return $this; + } + /** + * Whether this container is restarting. + * + * @return bool|null + */ + public function getRestarting() : ?bool + { + return $this->restarting; + } + /** + * Whether this container is restarting. + * + * @param bool|null $restarting + * + * @return self + */ + public function setRestarting(?bool $restarting) : self + { + $this->initialized['restarting'] = true; + $this->restarting = $restarting; + return $this; + } + /** + * 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 getDead() : ?bool + { + return $this->dead; + } + /** + * + * + * @param bool|null $dead + * + * @return self + */ + public function setDead(?bool $dead) : self + { + $this->initialized['dead'] = true; + $this->dead = $dead; + return $this; + } + /** + * The process ID of this container + * + * @return int|null + */ + public function getPid() : ?int + { + return $this->pid; + } + /** + * The process ID of this container + * + * @param int|null $pid + * + * @return self + */ + public function setPid(?int $pid) : self + { + $this->initialized['pid'] = true; + $this->pid = $pid; + return $this; + } + /** + * The last exit code of this container + * + * @return int|null + */ + public function getExitCode() : ?int + { + return $this->exitCode; + } + /** + * The last exit code of this container + * + * @param int|null $exitCode + * + * @return self + */ + public function setExitCode(?int $exitCode) : self + { + $this->initialized['exitCode'] = true; + $this->exitCode = $exitCode; + 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; + } + /** + * The time when this container was last started. + * + * @return string|null + */ + public function getStartedAt() : ?string + { + return $this->startedAt; + } + /** + * The time when this container was last started. + * + * @param string|null $startedAt + * + * @return self + */ + public function setStartedAt(?string $startedAt) : self + { + $this->initialized['startedAt'] = true; + $this->startedAt = $startedAt; + return $this; + } + /** + * The time when this container last exited. + * + * @return string|null + */ + public function getFinishedAt() : ?string + { + return $this->finishedAt; + } + /** + * The time when this container last exited. + * + * @param string|null $finishedAt + * + * @return self + */ + public function setFinishedAt(?string $finishedAt) : self + { + $this->initialized['finishedAt'] = true; + $this->finishedAt = $finishedAt; + return $this; + } + /** + * Health stores information about the container's healthcheck results. + * + * @return Health|null + */ + public function getHealth() : ?Health + { + return $this->health; + } + /** + * Health stores information about the container's healthcheck results. + * + * @param Health|null $health + * + * @return self + */ + public function setHealth(?Health $health) : self + { + $this->initialized['health'] = true; + $this->health = $health; + return $this; + } +} \ No newline at end of file diff --git a/src/Model/ContainerSummary.php b/src/Model/ContainerSummary.php new file mode 100644 index 00000000..e426778c --- /dev/null +++ b/src/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 string[]|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 Port[]|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 MountPoint[]|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 string[]|null + */ + public function getNames() : ?array + { + return $this->names; + } + /** + * The names that this container has been given + * + * @param string[]|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 Port[]|null + */ + public function getPorts() : ?array + { + return $this->ports; + } + /** + * The ports exposed by this container + * + * @param Port[]|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 MountPoint[]|null + */ + public function getMounts() : ?array + { + return $this->mounts; + } + /** + * + * + * @param MountPoint[]|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/src/Model/ContainerSummaryHostConfig.php b/src/Model/ContainerSummaryHostConfig.php new file mode 100644 index 00000000..6f0a7f89 --- /dev/null +++ b/src/Model/ContainerSummaryHostConfig.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $networkMode; + /** + * + * + * @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; + } +} \ No newline at end of file diff --git a/src/Model/ContainerSummaryItem.php b/src/Model/ContainerSummaryItem.php deleted file mode 100644 index 25dc46bb..00000000 --- a/src/Model/ContainerSummaryItem.php +++ /dev/null @@ -1,453 +0,0 @@ -id; - } - - /** - * The ID of this container. - * - * @param string $id - * - * @return self - */ - public function setId(?string $id): self - { - $this->id = $id; - - return $this; - } - - /** - * The names that this container has been given. - * - * @return string[] - */ - public function getNames(): ?array - { - return $this->names; - } - - /** - * The names that this container has been given. - * - * @param string[] $names - * - * @return self - */ - public function setNames(?array $names): self - { - $this->names = $names; - - return $this; - } - - /** - * The name of the image used when creating this container. - * - * @return string - */ - public function getImage(): ?string - { - return $this->image; - } - - /** - * The name of the image used when creating this container. - * - * @param string $image - * - * @return self - */ - public function setImage(?string $image): self - { - $this->image = $image; - - return $this; - } - - /** - * The ID of the image that this container was created from. - * - * @return string - */ - public function getImageID(): ?string - { - return $this->imageID; - } - - /** - * The ID of the image that this container was created from. - * - * @param string $imageID - * - * @return self - */ - public function setImageID(?string $imageID): self - { - $this->imageID = $imageID; - - return $this; - } - - /** - * Command to run when starting the container. - * - * @return string - */ - public function getCommand(): ?string - { - return $this->command; - } - - /** - * Command to run when starting the container. - * - * @param string $command - * - * @return self - */ - public function setCommand(?string $command): self - { - $this->command = $command; - - return $this; - } - - /** - * When the container was created. - * - * @return int - */ - public function getCreated(): ?int - { - return $this->created; - } - - /** - * When the container was created. - * - * @param int $created - * - * @return self - */ - public function setCreated(?int $created): self - { - $this->created = $created; - - return $this; - } - - /** - * The ports exposed by this container. - * - * @return Port[] - */ - public function getPorts(): ?array - { - return $this->ports; - } - - /** - * The ports exposed by this container. - * - * @param Port[] $ports - * - * @return self - */ - public function setPorts(?array $ports): self - { - $this->ports = $ports; - - return $this; - } - - /** - * The size of files that have been created or changed by this container. - * - * @return int - */ - public function getSizeRw(): ?int - { - return $this->sizeRw; - } - - /** - * The size of files that have been created or changed by this container. - * - * @param int $sizeRw - * - * @return self - */ - public function setSizeRw(?int $sizeRw): self - { - $this->sizeRw = $sizeRw; - - return $this; - } - - /** - * The total size of all the files in this container. - * - * @return int - */ - public function getSizeRootFs(): ?int - { - return $this->sizeRootFs; - } - - /** - * The total size of all the files in this container. - * - * @param int $sizeRootFs - * - * @return self - */ - public function setSizeRootFs(?int $sizeRootFs): self - { - $this->sizeRootFs = $sizeRootFs; - - return $this; - } - - /** - * User-defined key/value metadata. - * - * @return string[] - */ - public function getLabels(): ?\ArrayObject - { - return $this->labels; - } - - /** - * User-defined key/value metadata. - * - * @param string[] $labels - * - * @return self - */ - public function setLabels(?\ArrayObject $labels): self - { - $this->labels = $labels; - - return $this; - } - - /** - * The state of this container (e.g. `Exited`). - * - * @return string - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * The state of this container (e.g. `Exited`). - * - * @param string $state - * - * @return self - */ - public function setState(?string $state): self - { - $this->state = $state; - - return $this; - } - - /** - * Additional human-readable status of this container (e.g. `Exit 0`). - * - * @return string - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Additional human-readable status of this container (e.g. `Exit 0`). - * - * @param string $status - * - * @return self - */ - public function setStatus(?string $status): self - { - $this->status = $status; - - return $this; - } - - /** - * @return ContainerSummaryItemHostConfig - */ - public function getHostConfig(): ?ContainerSummaryItemHostConfig - { - return $this->hostConfig; - } - - /** - * @param ContainerSummaryItemHostConfig $hostConfig - * - * @return self - */ - public function setHostConfig(?ContainerSummaryItemHostConfig $hostConfig): self - { - $this->hostConfig = $hostConfig; - - return $this; - } - - /** - * A summary of the container's network settings. - * - * @return ContainerSummaryItemNetworkSettings - */ - public function getNetworkSettings(): ?ContainerSummaryItemNetworkSettings - { - return $this->networkSettings; - } - - /** - * A summary of the container's network settings. - * - * @param ContainerSummaryItemNetworkSettings $networkSettings - * - * @return self - */ - public function setNetworkSettings(?ContainerSummaryItemNetworkSettings $networkSettings): self - { - $this->networkSettings = $networkSettings; - - return $this; - } - - /** - * @return Mount[] - */ - public function getMounts(): ?array - { - return $this->mounts; - } - - /** - * @param Mount[] $mounts - * - * @return self - */ - public function setMounts(?array $mounts): self - { - $this->mounts = $mounts; - - return $this; - } -} diff --git a/src/Model/ContainerSummaryItemHostConfig.php b/src/Model/ContainerSummaryItemHostConfig.php deleted file mode 100644 index 1c660342..00000000 --- a/src/Model/ContainerSummaryItemHostConfig.php +++ /dev/null @@ -1,39 +0,0 @@ -networkMode; - } - - /** - * @param string $networkMode - * - * @return self - */ - public function setNetworkMode(?string $networkMode): self - { - $this->networkMode = $networkMode; - - return $this; - } -} diff --git a/src/Model/ContainerSummaryItemNetworkSettings.php b/src/Model/ContainerSummaryItemNetworkSettings.php deleted file mode 100644 index 0cc61e24..00000000 --- a/src/Model/ContainerSummaryItemNetworkSettings.php +++ /dev/null @@ -1,39 +0,0 @@ -networks; - } - - /** - * @param EndpointSettings[] $networks - * - * @return self - */ - public function setNetworks(?\ArrayObject $networks): self - { - $this->networks = $networks; - - return $this; - } -} diff --git a/src/Model/ContainerSummaryNetworkSettings.php b/src/Model/ContainerSummaryNetworkSettings.php new file mode 100644 index 00000000..7008ce98 --- /dev/null +++ b/src/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/src/Model/ContainerWaitExitError.php b/src/Model/ContainerWaitExitError.php new file mode 100644 index 00000000..916aeb57 --- /dev/null +++ b/src/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/src/Model/ContainerWaitResponse.php b/src/Model/ContainerWaitResponse.php new file mode 100644 index 00000000..aac631cd --- /dev/null +++ b/src/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/src/Model/ContainersCreatePostBody.php b/src/Model/ContainersCreatePostBody.php index 8bcca83c..0697cf10 100644 --- a/src/Model/ContainersCreatePostBody.php +++ b/src/Model/ContainersCreatePostBody.php @@ -1,843 +1,828 @@ initialized); + } /** * The hostname to use for the container, as a valid RFC 1123 hostname. * - * @var string + * @var string|null */ protected $hostname; /** * The domain name to use for the container. * - * @var string + * @var string|null */ protected $domainname; /** * The user that commands are run as inside the container. * - * @var string + * @var string|null */ protected $user; /** * Whether to attach to `stdin`. * - * @var bool + * @var bool|null */ - protected $attachStdin; + protected $attachStdin = false; /** * Whether to attach to `stdout`. * - * @var bool + * @var bool|null */ - protected $attachStdout; + protected $attachStdout = true; /** * Whether to attach to `stderr`. * - * @var bool + * @var bool|null */ - protected $attachStderr; + protected $attachStderr = true; /** - * An object mapping ports to an empty object in the form:. - - `{"/": {}}` - - * - * @var mixed[] - */ + * 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 + * @var bool|null */ - protected $tty; + protected $tty = false; /** - * Open `stdin`. + * Open `stdin` * - * @var bool + * @var bool|null */ - protected $openStdin; + protected $openStdin = false; /** - * Close `stdin` after one attached client disconnects. + * Close `stdin` after one attached client disconnects * - * @var bool + * @var bool|null */ - protected $stdinOnce; + 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 string[] - */ + * 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 string[]|null + */ protected $env; /** * Command to run specified as a string or an array of strings. * - * @var string[] + * @var string[]|null */ protected $cmd; /** * A test to perform to check that the container is healthy. * - * @var HealthConfig + * @var HealthConfig|null */ protected $healthcheck; /** - * Command is already escaped (Windows only). + * Command is already escaped (Windows only) * - * @var bool + * @var bool|null */ - protected $argsEscaped; + protected $argsEscaped = false; /** - * The name of the image to use when creating the container. - * - * @var string - */ + * 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 mixed[] - */ + * 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 + * @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 string[] - */ + * 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 string[]|null + */ protected $entrypoint; /** * Disable networking for the container. * - * @var bool + * @var bool|null */ protected $networkDisabled; /** * MAC address of the container. * - * @var string + * @var string|null */ protected $macAddress; /** * `ONBUILD` metadata that were defined in the image's `Dockerfile`. * - * @var string[] + * @var string[]|null */ protected $onBuild; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * Signal to stop a container as a string or unsigned integer. * - * @var string + * @var string|null */ protected $stopSignal; /** * Timeout to stop a container in seconds. * - * @var int + * @var int|null */ - protected $stopTimeout; + protected $stopTimeout = 10; /** * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. * - * @var string[] + * @var string[]|null */ protected $shell; /** - * Container configuration that depends on the host we are running on. + * Container configuration that depends on the host we are running on * - * @var HostConfig + * @var HostConfig|null */ protected $hostConfig; /** - * This container's networking configuration. - * - * @var ContainersCreatePostBodyNetworkingConfig - */ + * 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 + * @return string|null */ - public function getHostname(): ?string + public function getHostname() : ?string { return $this->hostname; } - /** * The hostname to use for the container, as a valid RFC 1123 hostname. * - * @param string $hostname + * @param string|null $hostname * * @return self */ - public function setHostname(?string $hostname): 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 + * @return string|null */ - public function getDomainname(): ?string + public function getDomainname() : ?string { return $this->domainname; } - /** * The domain name to use for the container. * - * @param string $domainname + * @param string|null $domainname * * @return self */ - public function setDomainname(?string $domainname): 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 + * @return string|null */ - public function getUser(): ?string + public function getUser() : ?string { return $this->user; } - /** * The user that commands are run as inside the container. * - * @param string $user + * @param string|null $user * * @return self */ - public function setUser(?string $user): self + public function setUser(?string $user) : self { + $this->initialized['user'] = true; $this->user = $user; - return $this; } - /** * Whether to attach to `stdin`. * - * @return bool + * @return bool|null */ - public function getAttachStdin(): ?bool + public function getAttachStdin() : ?bool { return $this->attachStdin; } - /** * Whether to attach to `stdin`. * - * @param bool $attachStdin + * @param bool|null $attachStdin * * @return self */ - public function setAttachStdin(?bool $attachStdin): self + public function setAttachStdin(?bool $attachStdin) : self { + $this->initialized['attachStdin'] = true; $this->attachStdin = $attachStdin; - return $this; } - /** * Whether to attach to `stdout`. * - * @return bool + * @return bool|null */ - public function getAttachStdout(): ?bool + public function getAttachStdout() : ?bool { return $this->attachStdout; } - /** * Whether to attach to `stdout`. * - * @param bool $attachStdout + * @param bool|null $attachStdout * * @return self */ - public function setAttachStdout(?bool $attachStdout): self + public function setAttachStdout(?bool $attachStdout) : self { + $this->initialized['attachStdout'] = true; $this->attachStdout = $attachStdout; - return $this; } - /** * Whether to attach to `stderr`. * - * @return bool + * @return bool|null */ - public function getAttachStderr(): ?bool + public function getAttachStderr() : ?bool { return $this->attachStderr; } - /** * Whether to attach to `stderr`. * - * @param bool $attachStderr + * @param bool|null $attachStderr * * @return self */ - public function setAttachStderr(?bool $attachStderr): 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 mixed[] - */ - public function getExposedPorts(): ?\ArrayObject + * 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 mixed[] $exposedPorts - * - * @return self - */ - public function setExposedPorts(?\ArrayObject $exposedPorts): self + * 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 + * @return bool|null */ - public function getTty(): ?bool + public function getTty() : ?bool { return $this->tty; } - /** * Attach standard streams to a TTY, including `stdin` if it is not closed. * - * @param bool $tty + * @param bool|null $tty * * @return self */ - public function setTty(?bool $tty): self + public function setTty(?bool $tty) : self { + $this->initialized['tty'] = true; $this->tty = $tty; - return $this; } - /** - * Open `stdin`. + * Open `stdin` * - * @return bool + * @return bool|null */ - public function getOpenStdin(): ?bool + public function getOpenStdin() : ?bool { return $this->openStdin; } - /** - * Open `stdin`. + * Open `stdin` * - * @param bool $openStdin + * @param bool|null $openStdin * * @return self */ - public function setOpenStdin(?bool $openStdin): self + public function setOpenStdin(?bool $openStdin) : self { + $this->initialized['openStdin'] = true; $this->openStdin = $openStdin; - return $this; } - /** - * Close `stdin` after one attached client disconnects. + * Close `stdin` after one attached client disconnects * - * @return bool + * @return bool|null */ - public function getStdinOnce(): ?bool + public function getStdinOnce() : ?bool { return $this->stdinOnce; } - /** - * Close `stdin` after one attached client disconnects. + * Close `stdin` after one attached client disconnects * - * @param bool $stdinOnce + * @param bool|null $stdinOnce * * @return self */ - public function setStdinOnce(?bool $stdinOnce): 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 string[] - */ - public function getEnv(): ?array + * 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 string[]|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 string[] $env - * - * @return self - */ - public function setEnv(?array $env): self + * 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 string[]|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 string[] + * @return string[]|null */ - public function getCmd(): ?array + public function getCmd() : ?array { return $this->cmd; } - /** * Command to run specified as a string or an array of strings. * - * @param string[] $cmd + * @param string[]|null $cmd * * @return self */ - public function setCmd(?array $cmd): 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 + * @return HealthConfig|null */ - public function getHealthcheck(): ?HealthConfig + public function getHealthcheck() : ?HealthConfig { return $this->healthcheck; } - /** * A test to perform to check that the container is healthy. * - * @param HealthConfig $healthcheck + * @param HealthConfig|null $healthcheck * * @return self */ - public function setHealthcheck(?HealthConfig $healthcheck): self + public function setHealthcheck(?HealthConfig $healthcheck) : self { + $this->initialized['healthcheck'] = true; $this->healthcheck = $healthcheck; - return $this; } - /** - * Command is already escaped (Windows only). + * Command is already escaped (Windows only) * - * @return bool + * @return bool|null */ - public function getArgsEscaped(): ?bool + public function getArgsEscaped() : ?bool { return $this->argsEscaped; } - /** - * Command is already escaped (Windows only). + * Command is already escaped (Windows only) * - * @param bool $argsEscaped + * @param bool|null $argsEscaped * * @return self */ - public function setArgsEscaped(?bool $argsEscaped): self + public function setArgsEscaped(?bool $argsEscaped) : self { + $this->initialized['argsEscaped'] = true; $this->argsEscaped = $argsEscaped; - return $this; } - /** - * The name of the image to use when creating the container. - * - * @return string - */ - public function getImage(): ?string + * 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 of the image to use when creating the container. - * - * @param string $image - * - * @return self - */ - public function setImage(?string $image): self + * 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 mixed[] - */ - public function getVolumes(): ?\ArrayObject + * 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 mixed[] $volumes - * - * @return self - */ - public function setVolumes(?\ArrayObject $volumes): self + * 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 + * @return string|null */ - public function getWorkingDir(): ?string + public function getWorkingDir() : ?string { return $this->workingDir; } - /** * The working directory for commands to run in. * - * @param string $workingDir + * @param string|null $workingDir * * @return self */ - public function setWorkingDir(?string $workingDir): 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 string[] - */ - public function getEntrypoint(): ?array + * 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 string[]|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 string[] $entrypoint - * - * @return self - */ - public function setEntrypoint(?array $entrypoint): self - { + * 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 string[]|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 + * @return bool|null */ - public function getNetworkDisabled(): ?bool + public function getNetworkDisabled() : ?bool { return $this->networkDisabled; } - /** * Disable networking for the container. * - * @param bool $networkDisabled + * @param bool|null $networkDisabled * * @return self */ - public function setNetworkDisabled(?bool $networkDisabled): self + public function setNetworkDisabled(?bool $networkDisabled) : self { + $this->initialized['networkDisabled'] = true; $this->networkDisabled = $networkDisabled; - return $this; } - /** * MAC address of the container. * - * @return string + * @return string|null */ - public function getMacAddress(): ?string + public function getMacAddress() : ?string { return $this->macAddress; } - /** * MAC address of the container. * - * @param string $macAddress + * @param string|null $macAddress * * @return self */ - public function setMacAddress(?string $macAddress): 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 string[] + * @return string[]|null */ - public function getOnBuild(): ?array + public function getOnBuild() : ?array { return $this->onBuild; } - /** * `ONBUILD` metadata that were defined in the image's `Dockerfile`. * - * @param string[] $onBuild + * @param string[]|null $onBuild * * @return self */ - public function setOnBuild(?array $onBuild): self + public function setOnBuild(?array $onBuild) : self { + $this->initialized['onBuild'] = true; $this->onBuild = $onBuild; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): 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 + * @return string|null */ - public function getStopSignal(): ?string + public function getStopSignal() : ?string { return $this->stopSignal; } - /** * Signal to stop a container as a string or unsigned integer. * - * @param string $stopSignal + * @param string|null $stopSignal * * @return self */ - public function setStopSignal(?string $stopSignal): 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 + * @return int|null */ - public function getStopTimeout(): ?int + public function getStopTimeout() : ?int { return $this->stopTimeout; } - /** * Timeout to stop a container in seconds. * - * @param int $stopTimeout + * @param int|null $stopTimeout * * @return self */ - public function setStopTimeout(?int $stopTimeout): 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 string[] + * @return string[]|null */ - public function getShell(): ?array + public function getShell() : ?array { return $this->shell; } - /** * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. * - * @param string[] $shell + * @param string[]|null $shell * * @return self */ - public function setShell(?array $shell): 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. + * Container configuration that depends on the host we are running on * - * @return HostConfig + * @return HostConfig|null */ - public function getHostConfig(): ?HostConfig + public function getHostConfig() : ?HostConfig { return $this->hostConfig; } - /** - * Container configuration that depends on the host we are running on. + * Container configuration that depends on the host we are running on * - * @param HostConfig $hostConfig + * @param HostConfig|null $hostConfig * * @return self */ - public function setHostConfig(?HostConfig $hostConfig): self + public function setHostConfig(?HostConfig $hostConfig) : self { + $this->initialized['hostConfig'] = true; $this->hostConfig = $hostConfig; - return $this; } - /** - * This container's networking configuration. - * - * @return ContainersCreatePostBodyNetworkingConfig - */ - public function getNetworkingConfig(): ?ContainersCreatePostBodyNetworkingConfig + * 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; } - /** - * This container's networking configuration. - * - * @param ContainersCreatePostBodyNetworkingConfig $networkingConfig - * - * @return self - */ - public function setNetworkingConfig(?ContainersCreatePostBodyNetworkingConfig $networkingConfig): self + * 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/src/Model/ContainersCreatePostBodyNetworkingConfig.php b/src/Model/ContainersCreatePostBodyNetworkingConfig.php deleted file mode 100644 index 3897a05c..00000000 --- a/src/Model/ContainersCreatePostBodyNetworkingConfig.php +++ /dev/null @@ -1,45 +0,0 @@ -endpointsConfig; - } - - /** - * A mapping of network name to endpoint configuration for that network. - * - * @param EndpointSettings[] $endpointsConfig - * - * @return self - */ - public function setEndpointsConfig(?\ArrayObject $endpointsConfig): self - { - $this->endpointsConfig = $endpointsConfig; - - return $this; - } -} diff --git a/src/Model/ContainersCreatePostResponse201.php b/src/Model/ContainersCreatePostResponse201.php deleted file mode 100644 index fc3b1732..00000000 --- a/src/Model/ContainersCreatePostResponse201.php +++ /dev/null @@ -1,75 +0,0 @@ -id; - } - - /** - * The ID of the created container. - * - * @param string $id - * - * @return self - */ - public function setId(?string $id): self - { - $this->id = $id; - - return $this; - } - - /** - * Warnings encountered when creating the container. - * - * @return string[] - */ - public function getWarnings(): ?array - { - return $this->warnings; - } - - /** - * Warnings encountered when creating the container. - * - * @param string[] $warnings - * - * @return self - */ - public function setWarnings(?array $warnings): self - { - $this->warnings = $warnings; - - return $this; - } -} diff --git a/src/Model/ContainersIdArchiveGetResponse400.php b/src/Model/ContainersIdArchiveGetResponse400.php deleted file mode 100644 index 491f9ef4..00000000 --- a/src/Model/ContainersIdArchiveGetResponse400.php +++ /dev/null @@ -1,45 +0,0 @@ -message; - } - - /** - * The error message. Either "must specify path parameter" (path cannot be empty) or "not a directory" (path was asserted to be a directory but exists as a file). - * - * @param string $message - * - * @return self - */ - public function setMessage(?string $message): self - { - $this->message = $message; - - return $this; - } -} diff --git a/src/Model/ContainersIdArchiveHeadResponse400.php b/src/Model/ContainersIdArchiveHeadResponse400.php deleted file mode 100644 index 02baa159..00000000 --- a/src/Model/ContainersIdArchiveHeadResponse400.php +++ /dev/null @@ -1,45 +0,0 @@ -message; - } - - /** - * The error message. Either "must specify path parameter" (path cannot be empty) or "not a directory" (path was asserted to be a directory but exists as a file). - * - * @param string $message - * - * @return self - */ - public function setMessage(?string $message): self - { - $this->message = $message; - - return $this; - } -} diff --git a/src/Model/ContainersIdChangesGetResponse200Item.php b/src/Model/ContainersIdChangesGetResponse200Item.php deleted file mode 100644 index 50a4dc23..00000000 --- a/src/Model/ContainersIdChangesGetResponse200Item.php +++ /dev/null @@ -1,75 +0,0 @@ -path; - } - - /** - * Path to file that has changed. - * - * @param string $path - * - * @return self - */ - public function setPath(?string $path): self - { - $this->path = $path; - - return $this; - } - - /** - * Kind of change. - * - * @return int - */ - public function getKind(): ?int - { - return $this->kind; - } - - /** - * Kind of change. - * - * @param int $kind - * - * @return self - */ - public function setKind(?int $kind): self - { - $this->kind = $kind; - - return $this; - } -} diff --git a/src/Model/ContainersIdExecPostBody.php b/src/Model/ContainersIdExecPostBody.php index ea7b344b..57feef70 100644 --- a/src/Model/ContainersIdExecPostBody.php +++ b/src/Model/ContainersIdExecPostBody.php @@ -1,315 +1,341 @@ initialized); + } /** * Attach to `stdin` of the exec command. * - * @var bool + * @var bool|null */ protected $attachStdin; /** * Attach to `stdout` of the exec command. * - * @var bool + * @var bool|null */ protected $attachStdout; /** * Attach to `stderr` of the exec command. * - * @var bool + * @var bool|null */ protected $attachStderr; /** - * Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + * Initial console size, as an `[height, width]` array. * - * @var string + * @var int[]|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 + * @var bool|null */ protected $tty; /** * A list of environment variables in the form `["VAR=value", ...]`. * - * @var string[] + * @var string[]|null */ protected $env; /** * Command to run, as a string or array of strings. * - * @var string[] + * @var string[]|null */ protected $cmd; /** * Runs the exec process with extended privileges. * - * @var bool + * @var bool|null */ - protected $privileged; + 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 - */ + * 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 + * @var string|null */ protected $workingDir; - /** * Attach to `stdin` of the exec command. * - * @return bool + * @return bool|null */ - public function getAttachStdin(): ?bool + public function getAttachStdin() : ?bool { return $this->attachStdin; } - /** * Attach to `stdin` of the exec command. * - * @param bool $attachStdin + * @param bool|null $attachStdin * * @return self */ - public function setAttachStdin(?bool $attachStdin): 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 + * @return bool|null */ - public function getAttachStdout(): ?bool + public function getAttachStdout() : ?bool { return $this->attachStdout; } - /** * Attach to `stdout` of the exec command. * - * @param bool $attachStdout + * @param bool|null $attachStdout * * @return self */ - public function setAttachStdout(?bool $attachStdout): 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 + * @return bool|null */ - public function getAttachStderr(): ?bool + public function getAttachStderr() : ?bool { return $this->attachStderr; } - /** * Attach to `stderr` of the exec command. * - * @param bool $attachStderr + * @param bool|null $attachStderr * * @return self */ - public function setAttachStderr(?bool $attachStderr): self + public function setAttachStderr(?bool $attachStderr) : self { + $this->initialized['attachStderr'] = true; $this->attachStderr = $attachStderr; - 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 `_`. + * Initial console size, as an `[height, width]` array. * - * @return string + * @return int[]|null */ - public function getDetachKeys(): ?string + public function getConsoleSize() : ?array { - return $this->detachKeys; + return $this->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 `_`. + * Initial console size, as an `[height, width]` array. * - * @param string $detachKeys + * @param int[]|null $consoleSize * * @return self */ - public function setDetachKeys(?string $detachKeys): 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 + * @return bool|null */ - public function getTty(): ?bool + public function getTty() : ?bool { return $this->tty; } - /** * Allocate a pseudo-TTY. * - * @param bool $tty + * @param bool|null $tty * * @return self */ - public function setTty(?bool $tty): 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 string[] + * @return string[]|null */ - public function getEnv(): ?array + public function getEnv() : ?array { return $this->env; } - /** * A list of environment variables in the form `["VAR=value", ...]`. * - * @param string[] $env + * @param string[]|null $env * * @return self */ - public function setEnv(?array $env): 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 string[] + * @return string[]|null */ - public function getCmd(): ?array + public function getCmd() : ?array { return $this->cmd; } - /** * Command to run, as a string or array of strings. * - * @param string[] $cmd + * @param string[]|null $cmd * * @return self */ - public function setCmd(?array $cmd): 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 + * @return bool|null */ - public function getPrivileged(): ?bool + public function getPrivileged() : ?bool { return $this->privileged; } - /** * Runs the exec process with extended privileges. * - * @param bool $privileged + * @param bool|null $privileged * * @return self */ - public function setPrivileged(?bool $privileged): 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 - */ - public function getUser(): ?string + * 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 $user - * - * @return self - */ - public function setUser(?string $user): self + * 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 + * @return string|null */ - public function getWorkingDir(): ?string + public function getWorkingDir() : ?string { return $this->workingDir; } - /** * The working directory for the exec process inside the container. * - * @param string $workingDir + * @param string|null $workingDir * * @return self */ - public function setWorkingDir(?string $workingDir): 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/src/Model/ContainersIdJsonGetResponse200.php b/src/Model/ContainersIdJsonGetResponse200.php index 465e3c8f..330d68a6 100644 --- a/src/Model/ContainersIdJsonGetResponse200.php +++ b/src/Model/ContainersIdJsonGetResponse200.php @@ -1,693 +1,757 @@ initialized); + } + /** + * The ID of the container * - * @var string + * @var string|null */ protected $id; /** - * The time the container was created. + * The time the container was created * - * @var string + * @var string|null */ protected $created; /** - * The path to the command being run. + * The path to the command being run * - * @var string + * @var string|null */ protected $path; /** - * The arguments to the command being run. + * The arguments to the command being run * - * @var string[] + * @var string[]|null */ protected $args; /** - * The state of the container. - * - * @var ContainersIdJsonGetResponse200State - */ + * 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. + * The container's image ID * - * @var string + * @var string|null */ protected $image; /** - * @var string + * + * + * @var string|null */ protected $resolvConfPath; /** - * @var string + * + * + * @var string|null */ protected $hostnamePath; /** - * @var string + * + * + * @var string|null */ protected $hostsPath; /** - * @var string + * + * + * @var string|null */ protected $logPath; /** - * TODO. + * * - * @var mixed - */ - protected $node; - /** - * @var string + * @var string|null */ protected $name; /** - * @var int + * + * + * @var int|null */ protected $restartCount; /** - * @var string + * + * + * @var string|null */ protected $driver; /** - * @var string + * + * + * @var string|null + */ + protected $platform; + /** + * + * + * @var string|null */ protected $mountLabel; /** - * @var string + * + * + * @var string|null */ protected $processLabel; /** - * @var string + * + * + * @var string|null */ protected $appArmorProfile; /** - * @var string + * IDs of exec instances that are running in the container. + * + * @var string[]|null */ protected $execIDs; /** - * Container configuration that depends on the host we are running on. + * Container configuration that depends on the host we are running on * - * @var HostConfig + * @var HostConfig|null */ protected $hostConfig; /** - * Information about a container's graph driver. - * - * @var GraphDriverData - */ + * Information about the storage driver used to store the container's and + image's filesystem. + + * + * @var GraphDriverData|null + */ protected $graphDriver; /** - * The size of files that have been created or changed by this container. - * - * @var int - */ + * 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 + * @var int|null */ protected $sizeRootFs; /** - * @var MountPoint[] + * + * + * @var MountPoint[]|null */ protected $mounts; /** - * Configuration for a container that is portable between hosts. - * - * @var ContainerConfig - */ + * Configuration for a container that is portable between hosts. + + When used as `ContainerConfig` field in an image, `ContainerConfig` is an + optional field containing the configuration of the container that was last + committed when creating the image. + + Previous versions of Docker builder used this field to store build cache, + and it is not in active use anymore. + + * + * @var ContainerConfig|null + */ protected $config; /** - * NetworkSettings exposes the network settings in the API. + * NetworkSettings exposes the network settings in the API * - * @var NetworkSettings + * @var NetworkSettings|null */ protected $networkSettings; - /** - * The ID of the container. + * The ID of the container * - * @return string + * @return string|null */ - public function getId(): ?string + public function getId() : ?string { return $this->id; } - /** - * The ID of the container. + * The ID of the container * - * @param string $id + * @param string|null $id * * @return self */ - public function setId(?string $id): self + public function setId(?string $id) : self { + $this->initialized['id'] = true; $this->id = $id; - return $this; } - /** - * The time the container was created. + * The time the container was created * - * @return string + * @return string|null */ - public function getCreated(): ?string + public function getCreated() : ?string { return $this->created; } - /** - * The time the container was created. + * The time the container was created * - * @param string $created + * @param string|null $created * * @return self */ - public function setCreated(?string $created): self + public function setCreated(?string $created) : self { + $this->initialized['created'] = true; $this->created = $created; - return $this; } - /** - * The path to the command being run. + * The path to the command being run * - * @return string + * @return string|null */ - public function getPath(): ?string + public function getPath() : ?string { return $this->path; } - /** - * The path to the command being run. + * The path to the command being run * - * @param string $path + * @param string|null $path * * @return self */ - public function setPath(?string $path): self + public function setPath(?string $path) : self { + $this->initialized['path'] = true; $this->path = $path; - return $this; } - /** - * The arguments to the command being run. + * The arguments to the command being run * - * @return string[] + * @return string[]|null */ - public function getArgs(): ?array + public function getArgs() : ?array { return $this->args; } - /** - * The arguments to the command being run. + * The arguments to the command being run * - * @param string[] $args + * @param string[]|null $args * * @return self */ - public function setArgs(?array $args): self + public function setArgs(?array $args) : self { + $this->initialized['args'] = true; $this->args = $args; - return $this; } - /** - * The state of the container. - * - * @return ContainersIdJsonGetResponse200State - */ - public function getState(): ?ContainersIdJsonGetResponse200State + * 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; } - /** - * The state of the container. - * - * @param ContainersIdJsonGetResponse200State $state - * - * @return self - */ - public function setState(?ContainersIdJsonGetResponse200State $state): self + * 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. + * The container's image ID * - * @return string + * @return string|null */ - public function getImage(): ?string + public function getImage() : ?string { return $this->image; } - /** - * The container's image. + * The container's image ID * - * @param string $image + * @param string|null $image * * @return self */ - public function setImage(?string $image): self + public function setImage(?string $image) : self { + $this->initialized['image'] = true; $this->image = $image; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getResolvConfPath(): ?string + public function getResolvConfPath() : ?string { return $this->resolvConfPath; } - /** - * @param string $resolvConfPath + * + * + * @param string|null $resolvConfPath * * @return self */ - public function setResolvConfPath(?string $resolvConfPath): self + public function setResolvConfPath(?string $resolvConfPath) : self { + $this->initialized['resolvConfPath'] = true; $this->resolvConfPath = $resolvConfPath; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getHostnamePath(): ?string + public function getHostnamePath() : ?string { return $this->hostnamePath; } - /** - * @param string $hostnamePath + * + * + * @param string|null $hostnamePath * * @return self */ - public function setHostnamePath(?string $hostnamePath): self + public function setHostnamePath(?string $hostnamePath) : self { + $this->initialized['hostnamePath'] = true; $this->hostnamePath = $hostnamePath; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getHostsPath(): ?string + public function getHostsPath() : ?string { return $this->hostsPath; } - /** - * @param string $hostsPath + * + * + * @param string|null $hostsPath * * @return self */ - public function setHostsPath(?string $hostsPath): self + public function setHostsPath(?string $hostsPath) : self { + $this->initialized['hostsPath'] = true; $this->hostsPath = $hostsPath; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getLogPath(): ?string + public function getLogPath() : ?string { return $this->logPath; } - /** - * @param string $logPath + * + * + * @param string|null $logPath * * @return self */ - public function setLogPath(?string $logPath): self + public function setLogPath(?string $logPath) : self { + $this->initialized['logPath'] = true; $this->logPath = $logPath; - return $this; } - /** - * TODO. + * * - * @return mixed + * @return string|null */ - public function getNode() + public function getName() : ?string { - return $this->node; + return $this->name; } - /** - * TODO. + * * - * @param mixed $node + * @param string|null $name * * @return self */ - public function setNode($node): self + public function setName(?string $name) : self { - $this->node = $node; - + $this->initialized['name'] = true; + $this->name = $name; return $this; } - /** - * @return string + * + * + * @return int|null */ - public function getName(): ?string + public function getRestartCount() : ?int { - return $this->name; + return $this->restartCount; } - /** - * @param string $name + * + * + * @param int|null $restartCount * * @return self */ - public function setName(?string $name): self + public function setRestartCount(?int $restartCount) : self { - $this->name = $name; - + $this->initialized['restartCount'] = true; + $this->restartCount = $restartCount; return $this; } - /** - * @return int + * + * + * @return string|null */ - public function getRestartCount(): ?int + public function getDriver() : ?string { - return $this->restartCount; + return $this->driver; } - /** - * @param int $restartCount + * + * + * @param string|null $driver * * @return self */ - public function setRestartCount(?int $restartCount): self + public function setDriver(?string $driver) : self { - $this->restartCount = $restartCount; - + $this->initialized['driver'] = true; + $this->driver = $driver; return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getDriver(): ?string + public function getPlatform() : ?string { - return $this->driver; + return $this->platform; } - /** - * @param string $driver + * + * + * @param string|null $platform * * @return self */ - public function setDriver(?string $driver): self + public function setPlatform(?string $platform) : self { - $this->driver = $driver; - + $this->initialized['platform'] = true; + $this->platform = $platform; return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getMountLabel(): ?string + public function getMountLabel() : ?string { return $this->mountLabel; } - /** - * @param string $mountLabel + * + * + * @param string|null $mountLabel * * @return self */ - public function setMountLabel(?string $mountLabel): self + public function setMountLabel(?string $mountLabel) : self { + $this->initialized['mountLabel'] = true; $this->mountLabel = $mountLabel; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getProcessLabel(): ?string + public function getProcessLabel() : ?string { return $this->processLabel; } - /** - * @param string $processLabel + * + * + * @param string|null $processLabel * * @return self */ - public function setProcessLabel(?string $processLabel): self + public function setProcessLabel(?string $processLabel) : self { + $this->initialized['processLabel'] = true; $this->processLabel = $processLabel; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getAppArmorProfile(): ?string + public function getAppArmorProfile() : ?string { return $this->appArmorProfile; } - /** - * @param string $appArmorProfile + * + * + * @param string|null $appArmorProfile * * @return self */ - public function setAppArmorProfile(?string $appArmorProfile): self + public function setAppArmorProfile(?string $appArmorProfile) : self { + $this->initialized['appArmorProfile'] = true; $this->appArmorProfile = $appArmorProfile; - return $this; } - /** - * @return string + * IDs of exec instances that are running in the container. + * + * @return string[]|null */ - public function getExecIDs(): ?string + public function getExecIDs() : ?array { return $this->execIDs; } - /** - * @param string $execIDs + * IDs of exec instances that are running in the container. + * + * @param string[]|null $execIDs * * @return self */ - public function setExecIDs(?string $execIDs): 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. + * Container configuration that depends on the host we are running on * - * @return HostConfig + * @return HostConfig|null */ - public function getHostConfig(): ?HostConfig + public function getHostConfig() : ?HostConfig { return $this->hostConfig; } - /** - * Container configuration that depends on the host we are running on. + * Container configuration that depends on the host we are running on * - * @param HostConfig $hostConfig + * @param HostConfig|null $hostConfig * * @return self */ - public function setHostConfig(?HostConfig $hostConfig): self + public function setHostConfig(?HostConfig $hostConfig) : self { + $this->initialized['hostConfig'] = true; $this->hostConfig = $hostConfig; - return $this; } - /** - * Information about a container's graph driver. - * - * @return GraphDriverData - */ - public function getGraphDriver(): ?GraphDriverData + * Information about the storage driver used to store the container's and + image's filesystem. + + * + * @return GraphDriverData|null + */ + public function getGraphDriver() : ?GraphDriverData { return $this->graphDriver; } - /** - * Information about a container's graph driver. - * - * @param GraphDriverData $graphDriver - * - * @return self - */ - public function setGraphDriver(?GraphDriverData $graphDriver): self + * Information about the storage driver used to store the container's and + image's filesystem. + + * + * @param GraphDriverData|null $graphDriver + * + * @return self + */ + public function setGraphDriver(?GraphDriverData $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 - */ - public function getSizeRw(): ?int + * 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 $sizeRw - * - * @return self - */ - public function setSizeRw(?int $sizeRw): self + * 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 + * @return int|null */ - public function getSizeRootFs(): ?int + public function getSizeRootFs() : ?int { return $this->sizeRootFs; } - /** * The total size of all the files in this container. * - * @param int $sizeRootFs + * @param int|null $sizeRootFs * * @return self */ - public function setSizeRootFs(?int $sizeRootFs): self + public function setSizeRootFs(?int $sizeRootFs) : self { + $this->initialized['sizeRootFs'] = true; $this->sizeRootFs = $sizeRootFs; - return $this; } - /** - * @return MountPoint[] + * + * + * @return MountPoint[]|null */ - public function getMounts(): ?array + public function getMounts() : ?array { return $this->mounts; } - /** - * @param MountPoint[] $mounts + * + * + * @param MountPoint[]|null $mounts * * @return self */ - public function setMounts(?array $mounts): 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 - */ - public function getConfig(): ?ContainerConfig + * Configuration for a container that is portable between hosts. + + When used as `ContainerConfig` field in an image, `ContainerConfig` is an + optional field containing the configuration of the container that was last + committed when creating the image. + + Previous versions of Docker builder used this field to store build cache, + and it is not in active use anymore. + + * + * @return ContainerConfig|null + */ + public function getConfig() : ?ContainerConfig { return $this->config; } - /** - * Configuration for a container that is portable between hosts. - * - * @param ContainerConfig $config - * - * @return self - */ - public function setConfig(?ContainerConfig $config): self - { + * Configuration for a container that is portable between hosts. + + When used as `ContainerConfig` field in an image, `ContainerConfig` is an + optional field containing the configuration of the container that was last + committed when creating the image. + + Previous versions of Docker builder used this field to store build cache, + and it is not in active use anymore. + + * + * @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. + * NetworkSettings exposes the network settings in the API * - * @return NetworkSettings + * @return NetworkSettings|null */ - public function getNetworkSettings(): ?NetworkSettings + public function getNetworkSettings() : ?NetworkSettings { return $this->networkSettings; } - /** - * NetworkSettings exposes the network settings in the API. + * NetworkSettings exposes the network settings in the API * - * @param NetworkSettings $networkSettings + * @param NetworkSettings|null $networkSettings * * @return self */ - public function setNetworkSettings(?NetworkSettings $networkSettings): 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/src/Model/ContainersIdJsonGetResponse200State.php b/src/Model/ContainersIdJsonGetResponse200State.php deleted file mode 100644 index 33555608..00000000 --- a/src/Model/ContainersIdJsonGetResponse200State.php +++ /dev/null @@ -1,363 +0,0 @@ -status; - } - - /** - * The status of the container. For example, `"running"` or `"exited"`. - * - * @param string $status - * - * @return self - */ - public function setStatus(?string $status): self - { - $this->status = $status; - - return $this; - } - - /** - * 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 cgroups freezer 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 - */ - 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 cgroups freezer 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 $running - * - * @return self - */ - public function setRunning(?bool $running): self - { - $this->running = $running; - - return $this; - } - - /** - * Whether this container is paused. - * - * @return bool - */ - public function getPaused(): ?bool - { - return $this->paused; - } - - /** - * Whether this container is paused. - * - * @param bool $paused - * - * @return self - */ - public function setPaused(?bool $paused): self - { - $this->paused = $paused; - - return $this; - } - - /** - * Whether this container is restarting. - * - * @return bool - */ - public function getRestarting(): ?bool - { - return $this->restarting; - } - - /** - * Whether this container is restarting. - * - * @param bool $restarting - * - * @return self - */ - public function setRestarting(?bool $restarting): self - { - $this->restarting = $restarting; - - return $this; - } - - /** - * Whether this container has been killed because it ran out of memory. - * - * @return bool - */ - public function getOOMKilled(): ?bool - { - return $this->oOMKilled; - } - - /** - * Whether this container has been killed because it ran out of memory. - * - * @param bool $oOMKilled - * - * @return self - */ - public function setOOMKilled(?bool $oOMKilled): self - { - $this->oOMKilled = $oOMKilled; - - return $this; - } - - /** - * @return bool - */ - public function getDead(): ?bool - { - return $this->dead; - } - - /** - * @param bool $dead - * - * @return self - */ - public function setDead(?bool $dead): self - { - $this->dead = $dead; - - return $this; - } - - /** - * The process ID of this container. - * - * @return int - */ - public function getPid(): ?int - { - return $this->pid; - } - - /** - * The process ID of this container. - * - * @param int $pid - * - * @return self - */ - public function setPid(?int $pid): self - { - $this->pid = $pid; - - return $this; - } - - /** - * The last exit code of this container. - * - * @return int - */ - public function getExitCode(): ?int - { - return $this->exitCode; - } - - /** - * The last exit code of this container. - * - * @param int $exitCode - * - * @return self - */ - public function setExitCode(?int $exitCode): self - { - $this->exitCode = $exitCode; - - return $this; - } - - /** - * @return string - */ - public function getError(): ?string - { - return $this->error; - } - - /** - * @param string $error - * - * @return self - */ - public function setError(?string $error): self - { - $this->error = $error; - - return $this; - } - - /** - * The time when this container was last started. - * - * @return string - */ - public function getStartedAt(): ?string - { - return $this->startedAt; - } - - /** - * The time when this container was last started. - * - * @param string $startedAt - * - * @return self - */ - public function setStartedAt(?string $startedAt): self - { - $this->startedAt = $startedAt; - - return $this; - } - - /** - * The time when this container last exited. - * - * @return string - */ - public function getFinishedAt(): ?string - { - return $this->finishedAt; - } - - /** - * The time when this container last exited. - * - * @param string $finishedAt - * - * @return self - */ - public function setFinishedAt(?string $finishedAt): self - { - $this->finishedAt = $finishedAt; - - return $this; - } -} diff --git a/src/Model/ContainersIdTopGetResponse200.php b/src/Model/ContainersIdTopGetResponse200.php index f30f7d33..639d7fff 100644 --- a/src/Model/ContainersIdTopGetResponse200.php +++ b/src/Model/ContainersIdTopGetResponse200.php @@ -1,75 +1,77 @@ initialized); + } /** - * Each process running in the container, where each is process is an array of values corresponding to the titles. + * The ps column titles * - * @var string[][] + * @var string[]|null */ + protected $titles; + /** + * Each process running in the container, where each is process + is an array of values corresponding to the titles. + + * + * @var string[][]|null + */ protected $processes; - /** - * The ps column titles. + * The ps column titles * - * @return string[] + * @return string[]|null */ - public function getTitles(): ?array + public function getTitles() : ?array { return $this->titles; } - /** - * The ps column titles. + * The ps column titles * - * @param string[] $titles + * @param string[]|null $titles * * @return self */ - public function setTitles(?array $titles): 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 string[][] - */ - public function getProcesses(): ?array + * Each process running in the container, where each is process + is an array of values corresponding to the titles. + + * + * @return string[][]|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 string[][] $processes - * - * @return self - */ - public function setProcesses(?array $processes): self + * Each process running in the container, where each is process + is an array of values corresponding to the titles. + + * + * @param string[][]|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/src/Model/ContainersIdUpdatePostBody.php b/src/Model/ContainersIdUpdatePostBody.php index 6f04d9b6..db0e971c 100644 --- a/src/Model/ContainersIdUpdatePostBody.php +++ b/src/Model/ContainersIdUpdatePostBody.php @@ -1,972 +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 + * @var int|null */ - protected $memory; + 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 - */ + * 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 + * @var int|null */ protected $blkioWeight; /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. - * - * @var ResourcesBlkioWeightDeviceItem[] - */ + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @var ResourcesBlkioWeightDeviceItem[]|null + */ protected $blkioWeightDevice; /** - * Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - * - * @var ThrottleDevice[] - */ + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var ThrottleDevice[]|null + */ protected $blkioDeviceReadBps; /** - * Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - * - * @var ThrottleDevice[] - */ + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var ThrottleDevice[]|null + */ protected $blkioDeviceWriteBps; /** - * Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - * - * @var ThrottleDevice[] - */ + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var ThrottleDevice[]|null + */ protected $blkioDeviceReadIOps; /** - * Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - * - * @var ThrottleDevice[] - */ + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var ThrottleDevice[]|null + */ protected $blkioDeviceWriteIOps; /** * The length of a CPU period in microseconds. * - * @var int + * @var int|null */ protected $cpuPeriod; /** * Microseconds of CPU time that the container can get in a CPU period. * - * @var int + * @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 - */ + * 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 - */ + * 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 + * @var string|null */ protected $cpusetCpus; /** - * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. - * - * @var string - */ + * 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 DeviceMapping[] + * @var DeviceMapping[]|null */ protected $devices; /** - * a list of cgroup rules to apply to the container. + * a list of cgroup rules to apply to the container * - * @var string[] + * @var string[]|null */ protected $deviceCgroupRules; /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @var int + * @var DeviceRequest[]|null */ - protected $diskQuota; + protected $deviceRequests; /** - * Kernel memory limit in bytes. - * - * @var int - */ - protected $kernelMemory; + * 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 + * @var int|null */ protected $memoryReservation; /** - * Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. - * - * @var int - */ + * 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 - */ + * 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 + * @var int|null */ - protected $nanoCPUs; + protected $nanoCpus; /** * Disable OOM Killer for the container. * - * @var bool + * @var bool|null */ protected $oomKillDisable; /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @var int - */ + * 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 ResourcesUlimitsItem[] - */ + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @var ResourcesUlimitsItem[]|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 - */ + * 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 - */ + * 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). + * Maximum IOps for the container system drive (Windows only) * - * @var int + * @var int|null */ protected $iOMaximumIOps; /** - * Maximum IO in bytes per second for the container system drive (Windows only). - * - * @var int - */ + * 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 - */ + * 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 - */ - public function getCpuShares(): ?int + * 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 $cpuShares - * - * @return self - */ - public function setCpuShares(?int $cpuShares): self + * 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 + * @return int|null */ - public function getMemory(): ?int + public function getMemory() : ?int { return $this->memory; } - /** * Memory limit in bytes. * - * @param int $memory + * @param int|null $memory * * @return self */ - public function setMemory(?int $memory): 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 - */ - public function getCgroupParent(): ?string + * 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 $cgroupParent - * - * @return self - */ - public function setCgroupParent(?string $cgroupParent): self + * 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 + * @return int|null */ - public function getBlkioWeight(): ?int + public function getBlkioWeight() : ?int { return $this->blkioWeight; } - /** * Block IO weight (relative weight). * - * @param int $blkioWeight + * @param int|null $blkioWeight * * @return self */ - public function setBlkioWeight(?int $blkioWeight): 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 ResourcesBlkioWeightDeviceItem[] - */ - public function getBlkioWeightDevice(): ?array + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @return ResourcesBlkioWeightDeviceItem[]|null + */ + public function getBlkioWeightDevice() : ?array { return $this->blkioWeightDevice; } - /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. - * - * @param ResourcesBlkioWeightDeviceItem[] $blkioWeightDevice - * - * @return self - */ - public function setBlkioWeightDevice(?array $blkioWeightDevice): self + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @param ResourcesBlkioWeightDeviceItem[]|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 ThrottleDevice[] - */ - public function getBlkioDeviceReadBps(): ?array + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return ThrottleDevice[]|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 ThrottleDevice[] $blkioDeviceReadBps - * - * @return self - */ - public function setBlkioDeviceReadBps(?array $blkioDeviceReadBps): self + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param ThrottleDevice[]|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 ThrottleDevice[] - */ - public function getBlkioDeviceWriteBps(): ?array + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return ThrottleDevice[]|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 ThrottleDevice[] $blkioDeviceWriteBps - * - * @return self - */ - public function setBlkioDeviceWriteBps(?array $blkioDeviceWriteBps): self + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param ThrottleDevice[]|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 ThrottleDevice[] - */ - public function getBlkioDeviceReadIOps(): ?array + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return ThrottleDevice[]|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 ThrottleDevice[] $blkioDeviceReadIOps - * - * @return self - */ - public function setBlkioDeviceReadIOps(?array $blkioDeviceReadIOps): self + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param ThrottleDevice[]|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 ThrottleDevice[] - */ - public function getBlkioDeviceWriteIOps(): ?array + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return ThrottleDevice[]|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 ThrottleDevice[] $blkioDeviceWriteIOps - * - * @return self - */ - public function setBlkioDeviceWriteIOps(?array $blkioDeviceWriteIOps): self + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param ThrottleDevice[]|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 + * @return int|null */ - public function getCpuPeriod(): ?int + public function getCpuPeriod() : ?int { return $this->cpuPeriod; } - /** * The length of a CPU period in microseconds. * - * @param int $cpuPeriod + * @param int|null $cpuPeriod * * @return self */ - public function setCpuPeriod(?int $cpuPeriod): 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 + * @return int|null */ - public function getCpuQuota(): ?int + public function getCpuQuota() : ?int { return $this->cpuQuota; } - /** * Microseconds of CPU time that the container can get in a CPU period. * - * @param int $cpuQuota + * @param int|null $cpuQuota * * @return self */ - public function setCpuQuota(?int $cpuQuota): 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 - */ - public function getCpuRealtimePeriod(): ?int + * 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 $cpuRealtimePeriod - * - * @return self - */ - public function setCpuRealtimePeriod(?int $cpuRealtimePeriod): self + * 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 - */ - public function getCpuRealtimeRuntime(): ?int + * 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 $cpuRealtimeRuntime - * - * @return self - */ - public function setCpuRealtimeRuntime(?int $cpuRealtimeRuntime): self + * 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 + * @return string|null */ - public function getCpusetCpus(): ?string + public function getCpusetCpus() : ?string { return $this->cpusetCpus; } - /** * CPUs in which to allow execution (e.g., `0-3`, `0,1`). * - * @param string $cpusetCpus + * @param string|null $cpusetCpus * * @return self */ - public function setCpusetCpus(?string $cpusetCpus): 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 - */ - public function getCpusetMems(): ?string + * 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 $cpusetMems - * - * @return self - */ - public function setCpusetMems(?string $cpusetMems): self + * 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 DeviceMapping[] + * @return DeviceMapping[]|null */ - public function getDevices(): ?array + public function getDevices() : ?array { return $this->devices; } - /** * A list of devices to add to the container. * - * @param DeviceMapping[] $devices + * @param DeviceMapping[]|null $devices * * @return self */ - public function setDevices(?array $devices): 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. + * a list of cgroup rules to apply to the container * - * @return string[] + * @return string[]|null */ - public function getDeviceCgroupRules(): ?array + public function getDeviceCgroupRules() : ?array { return $this->deviceCgroupRules; } - /** - * a list of cgroup rules to apply to the container. + * a list of cgroup rules to apply to the container * - * @param string[] $deviceCgroupRules + * @param string[]|null $deviceCgroupRules * * @return self */ - public function setDeviceCgroupRules(?array $deviceCgroupRules): self + public function setDeviceCgroupRules(?array $deviceCgroupRules) : self { + $this->initialized['deviceCgroupRules'] = true; $this->deviceCgroupRules = $deviceCgroupRules; - return $this; } - /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @return int + * @return DeviceRequest[]|null */ - public function getDiskQuota(): ?int + public function getDeviceRequests() : ?array { - return $this->diskQuota; + return $this->deviceRequests; } - /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @param int $diskQuota + * @param DeviceRequest[]|null $deviceRequests * * @return self */ - public function setDiskQuota(?int $diskQuota): self + public function setDeviceRequests(?array $deviceRequests) : self { - $this->diskQuota = $diskQuota; - + $this->initialized['deviceRequests'] = true; + $this->deviceRequests = $deviceRequests; return $this; } - /** - * Kernel memory limit in bytes. - * - * @return int - */ - public function getKernelMemory(): ?int + * 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->kernelMemory; + return $this->kernelMemoryTCP; } - /** - * Kernel memory limit in bytes. - * - * @param int $kernelMemory - * - * @return self - */ - public function setKernelMemory(?int $kernelMemory): self + * 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->kernelMemory = $kernelMemory; - + $this->initialized['kernelMemoryTCP'] = true; + $this->kernelMemoryTCP = $kernelMemoryTCP; return $this; } - /** * Memory soft limit in bytes. * - * @return int + * @return int|null */ - public function getMemoryReservation(): ?int + public function getMemoryReservation() : ?int { return $this->memoryReservation; } - /** * Memory soft limit in bytes. * - * @param int $memoryReservation + * @param int|null $memoryReservation * * @return self */ - public function setMemoryReservation(?int $memoryReservation): 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 - */ - public function getMemorySwap(): ?int + * 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 $memorySwap - * - * @return self - */ - public function setMemorySwap(?int $memorySwap): self + * 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 - */ - public function getMemorySwappiness(): ?int + * 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 $memorySwappiness - * - * @return self - */ - public function setMemorySwappiness(?int $memorySwappiness): self + * 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 + * @return int|null */ - public function getNanoCPUs(): ?int + public function getNanoCpus() : ?int { - return $this->nanoCPUs; + return $this->nanoCpus; } - /** * CPU quota in units of 10-9 CPUs. * - * @param int $nanoCPUs + * @param int|null $nanoCpus * * @return self */ - public function setNanoCPUs(?int $nanoCPUs): self + public function setNanoCpus(?int $nanoCpus) : self { - $this->nanoCPUs = $nanoCPUs; - + $this->initialized['nanoCpus'] = true; + $this->nanoCpus = $nanoCpus; return $this; } - /** * Disable OOM Killer for the container. * - * @return bool + * @return bool|null */ - public function getOomKillDisable(): ?bool + public function getOomKillDisable() : ?bool { return $this->oomKillDisable; } - /** * Disable OOM Killer for the container. * - * @param bool $oomKillDisable + * @param bool|null $oomKillDisable * * @return self */ - public function setOomKillDisable(?bool $oomKillDisable): self + public function setOomKillDisable(?bool $oomKillDisable) : self { + $this->initialized['oomKillDisable'] = true; $this->oomKillDisable = $oomKillDisable; - return $this; } - /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @return int - */ - public function getPidsLimit(): ?int + * 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 -1 for unlimited. - * - * @param int $pidsLimit - * - * @return self - */ - public function setPidsLimit(?int $pidsLimit): self + * 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 ResourcesUlimitsItem[] - */ - public function getUlimits(): ?array + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @return ResourcesUlimitsItem[]|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 ResourcesUlimitsItem[] $ulimits - * - * @return self - */ - public function setUlimits(?array $ulimits): self + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @param ResourcesUlimitsItem[]|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 - */ - public function getCpuCount(): ?int + * 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 $cpuCount - * - * @return self - */ - public function setCpuCount(?int $cpuCount): self + * 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 - */ - public function getCpuPercent(): ?int + * 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 $cpuPercent - * - * @return self - */ - public function setCpuPercent(?int $cpuPercent): self + * 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). + * Maximum IOps for the container system drive (Windows only) * - * @return int + * @return int|null */ - public function getIOMaximumIOps(): ?int + public function getIOMaximumIOps() : ?int { return $this->iOMaximumIOps; } - /** - * Maximum IOps for the container system drive (Windows only). + * Maximum IOps for the container system drive (Windows only) * - * @param int $iOMaximumIOps + * @param int|null $iOMaximumIOps * * @return self */ - public function setIOMaximumIOps(?int $iOMaximumIOps): 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 - */ - public function getIOMaximumBandwidth(): ?int + * 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 $iOMaximumBandwidth - * - * @return self - */ - public function setIOMaximumBandwidth(?int $iOMaximumBandwidth): self + * 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 - */ - public function getRestartPolicy(): ?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. + + * + * @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 $restartPolicy - * - * @return self - */ - public function setRestartPolicy(?RestartPolicy $restartPolicy): self + * 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/src/Model/ContainersIdUpdatePostResponse200.php b/src/Model/ContainersIdUpdatePostResponse200.php index 2a571bad..9566216f 100644 --- a/src/Model/ContainersIdUpdatePostResponse200.php +++ b/src/Model/ContainersIdUpdatePostResponse200.php @@ -1,39 +1,43 @@ initialized); + } + /** + * + * + * @var string[]|null */ protected $warnings; - /** - * @return string[] + * + * + * @return string[]|null */ - public function getWarnings(): ?array + public function getWarnings() : ?array { return $this->warnings; } - /** - * @param string[] $warnings + * + * + * @param string[]|null $warnings * * @return self */ - public function setWarnings(?array $warnings): 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/src/Model/ContainersIdWaitPostResponse200.php b/src/Model/ContainersIdWaitPostResponse200.php deleted file mode 100644 index d5b4badc..00000000 --- a/src/Model/ContainersIdWaitPostResponse200.php +++ /dev/null @@ -1,75 +0,0 @@ -statusCode; - } - - /** - * Exit code of the container. - * - * @param int $statusCode - * - * @return self - */ - public function setStatusCode(?int $statusCode): self - { - $this->statusCode = $statusCode; - - return $this; - } - - /** - * container waiting error, if any. - * - * @return ContainersIdWaitPostResponse200Error - */ - public function getError(): ?ContainersIdWaitPostResponse200Error - { - return $this->error; - } - - /** - * container waiting error, if any. - * - * @param ContainersIdWaitPostResponse200Error $error - * - * @return self - */ - public function setError(?ContainersIdWaitPostResponse200Error $error): self - { - $this->error = $error; - - return $this; - } -} diff --git a/src/Model/ContainersIdWaitPostResponse200Error.php b/src/Model/ContainersIdWaitPostResponse200Error.php deleted file mode 100644 index 16d049cf..00000000 --- a/src/Model/ContainersIdWaitPostResponse200Error.php +++ /dev/null @@ -1,45 +0,0 @@ -message; - } - - /** - * Details of an error. - * - * @param string $message - * - * @return self - */ - public function setMessage(?string $message): self - { - $this->message = $message; - - return $this; - } -} diff --git a/src/Model/ContainersPrunePostResponse200.php b/src/Model/ContainersPrunePostResponse200.php index da940589..2ab2dafa 100644 --- a/src/Model/ContainersPrunePostResponse200.php +++ b/src/Model/ContainersPrunePostResponse200.php @@ -1,75 +1,71 @@ initialized); + } + /** + * Container IDs that were deleted * - * @var string[] + * @var string[]|null */ protected $containersDeleted; /** - * Disk space reclaimed in bytes. + * Disk space reclaimed in bytes * - * @var int + * @var int|null */ protected $spaceReclaimed; - /** - * Container IDs that were deleted. + * Container IDs that were deleted * - * @return string[] + * @return string[]|null */ - public function getContainersDeleted(): ?array + public function getContainersDeleted() : ?array { return $this->containersDeleted; } - /** - * Container IDs that were deleted. + * Container IDs that were deleted * - * @param string[] $containersDeleted + * @param string[]|null $containersDeleted * * @return self */ - public function setContainersDeleted(?array $containersDeleted): self + public function setContainersDeleted(?array $containersDeleted) : self { + $this->initialized['containersDeleted'] = true; $this->containersDeleted = $containersDeleted; - return $this; } - /** - * Disk space reclaimed in bytes. + * Disk space reclaimed in bytes * - * @return int + * @return int|null */ - public function getSpaceReclaimed(): ?int + public function getSpaceReclaimed() : ?int { return $this->spaceReclaimed; } - /** - * Disk space reclaimed in bytes. + * Disk space reclaimed in bytes * - * @param int $spaceReclaimed + * @param int|null $spaceReclaimed * * @return self */ - public function setSpaceReclaimed(?int $spaceReclaimed): 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/src/Model/CreateImageInfo.php b/src/Model/CreateImageInfo.php index b0f00aed..b51d82f4 100644 --- a/src/Model/CreateImageInfo.php +++ b/src/Model/CreateImageInfo.php @@ -1,135 +1,183 @@ 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(): ?string + public function getId() : ?string { return $this->id; } - /** - * @param string $id + * + * + * @param string|null $id * * @return self */ - public function setId(?string $id): self + public function setId(?string $id) : self { + $this->initialized['id'] = true; $this->id = $id; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getError(): ?string + public function getError() : ?string { return $this->error; } - /** - * @param string $error + * + * + * @param string|null $error * * @return self */ - public function setError(?string $error): self + 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 setErrorDetail(?ErrorDetail $errorDetail) : self + { + $this->initialized['errorDetail'] = true; + $this->errorDetail = $errorDetail; + return $this; + } + /** + * + * + * @return string|null */ - public function getStatus(): ?string + public function getStatus() : ?string { return $this->status; } - /** - * @param string $status + * + * + * @param string|null $status * * @return self */ - public function setStatus(?string $status): self + public function setStatus(?string $status) : self { + $this->initialized['status'] = true; $this->status = $status; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getProgress(): ?string + public function getProgress() : ?string { return $this->progress; } - /** - * @param string $progress + * + * + * @param string|null $progress * * @return self */ - public function setProgress(?string $progress): self + public function setProgress(?string $progress) : self { + $this->initialized['progress'] = true; $this->progress = $progress; - return $this; } - /** - * @return ProgressDetail + * + * + * @return ProgressDetail|null */ - public function getProgressDetail(): ?ProgressDetail + public function getProgressDetail() : ?ProgressDetail { return $this->progressDetail; } - /** - * @param ProgressDetail $progressDetail + * + * + * @param ProgressDetail|null $progressDetail * * @return self */ - public function setProgressDetail(?ProgressDetail $progressDetail): self + public function setProgressDetail(?ProgressDetail $progressDetail) : self { + $this->initialized['progressDetail'] = true; $this->progressDetail = $progressDetail; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/DeviceMapping.php b/src/Model/DeviceMapping.php index cf6b7677..94e17c56 100644 --- a/src/Model/DeviceMapping.php +++ b/src/Model/DeviceMapping.php @@ -1,87 +1,99 @@ initialized); + } + /** + * + * + * @var string|null */ protected $pathOnHost; /** - * @var string + * + * + * @var string|null */ protected $pathInContainer; /** - * @var string + * + * + * @var string|null */ protected $cgroupPermissions; - /** - * @return string + * + * + * @return string|null */ - public function getPathOnHost(): ?string + public function getPathOnHost() : ?string { return $this->pathOnHost; } - /** - * @param string $pathOnHost + * + * + * @param string|null $pathOnHost * * @return self */ - public function setPathOnHost(?string $pathOnHost): self + public function setPathOnHost(?string $pathOnHost) : self { + $this->initialized['pathOnHost'] = true; $this->pathOnHost = $pathOnHost; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getPathInContainer(): ?string + public function getPathInContainer() : ?string { return $this->pathInContainer; } - /** - * @param string $pathInContainer + * + * + * @param string|null $pathInContainer * * @return self */ - public function setPathInContainer(?string $pathInContainer): self + public function setPathInContainer(?string $pathInContainer) : self { + $this->initialized['pathInContainer'] = true; $this->pathInContainer = $pathInContainer; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getCgroupPermissions(): ?string + public function getCgroupPermissions() : ?string { return $this->cgroupPermissions; } - /** - * @param string $cgroupPermissions + * + * + * @param string|null $cgroupPermissions * * @return self */ - public function setCgroupPermissions(?string $cgroupPermissions): 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/src/Model/DeviceRequest.php b/src/Model/DeviceRequest.php new file mode 100644 index 00000000..cfbb1218 --- /dev/null +++ b/src/Model/DeviceRequest.php @@ -0,0 +1,161 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $driver; + /** + * + * + * @var int|null + */ + protected $count; + /** + * + * + * @var string[]|null + */ + protected $deviceIDs; + /** + * A list of capabilities; an OR list of AND lists of capabilities. + * + * @var string[][]|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 string[]|null + */ + public function getDeviceIDs() : ?array + { + return $this->deviceIDs; + } + /** + * + * + * @param string[]|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 string[][]|null + */ + public function getCapabilities() : ?array + { + return $this->capabilities; + } + /** + * A list of capabilities; an OR list of AND lists of capabilities. + * + * @param string[][]|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/src/Model/DistributionInspect.php b/src/Model/DistributionInspect.php new file mode 100644 index 00000000..d16fb43a --- /dev/null +++ b/src/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 OCIPlatform[]|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 OCIPlatform[]|null + */ + public function getPlatforms() : ?array + { + return $this->platforms; + } + /** + * An array containing all platforms supported by the image. + * + * @param OCIPlatform[]|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/src/Model/DistributionNameJsonGetResponse200.php b/src/Model/DistributionNameJsonGetResponse200.php deleted file mode 100644 index 9fa678d2..00000000 --- a/src/Model/DistributionNameJsonGetResponse200.php +++ /dev/null @@ -1,75 +0,0 @@ -descriptor; - } - - /** - * A descriptor struct containing digest, media type, and size. - * - * @param DistributionNameJsonGetResponse200Descriptor $descriptor - * - * @return self - */ - public function setDescriptor(?DistributionNameJsonGetResponse200Descriptor $descriptor): self - { - $this->descriptor = $descriptor; - - return $this; - } - - /** - * An array containing all platforms supported by the image. - * - * @return DistributionNameJsonGetResponse200PlatformsItem[] - */ - public function getPlatforms(): ?array - { - return $this->platforms; - } - - /** - * An array containing all platforms supported by the image. - * - * @param DistributionNameJsonGetResponse200PlatformsItem[] $platforms - * - * @return self - */ - public function setPlatforms(?array $platforms): self - { - $this->platforms = $platforms; - - return $this; - } -} diff --git a/src/Model/DistributionNameJsonGetResponse200Descriptor.php b/src/Model/DistributionNameJsonGetResponse200Descriptor.php deleted file mode 100644 index b7e53fa7..00000000 --- a/src/Model/DistributionNameJsonGetResponse200Descriptor.php +++ /dev/null @@ -1,111 +0,0 @@ -mediaType; - } - - /** - * @param string $mediaType - * - * @return self - */ - public function setMediaType(?string $mediaType): self - { - $this->mediaType = $mediaType; - - return $this; - } - - /** - * @return int - */ - public function getSize(): ?int - { - return $this->size; - } - - /** - * @param int $size - * - * @return self - */ - public function setSize(?int $size): self - { - $this->size = $size; - - return $this; - } - - /** - * @return string - */ - public function getDigest(): ?string - { - return $this->digest; - } - - /** - * @param string $digest - * - * @return self - */ - public function setDigest(?string $digest): self - { - $this->digest = $digest; - - return $this; - } - - /** - * @return string[] - */ - public function getURLs(): ?array - { - return $this->uRLs; - } - - /** - * @param string[] $uRLs - * - * @return self - */ - public function setURLs(?array $uRLs): self - { - $this->uRLs = $uRLs; - - return $this; - } -} diff --git a/src/Model/DistributionNameJsonGetResponse200PlatformsItem.php b/src/Model/DistributionNameJsonGetResponse200PlatformsItem.php deleted file mode 100644 index 5e94bcab..00000000 --- a/src/Model/DistributionNameJsonGetResponse200PlatformsItem.php +++ /dev/null @@ -1,159 +0,0 @@ -architecture; - } - - /** - * @param string $architecture - * - * @return self - */ - public function setArchitecture(?string $architecture): self - { - $this->architecture = $architecture; - - return $this; - } - - /** - * @return string - */ - public function getOS(): ?string - { - return $this->oS; - } - - /** - * @param string $oS - * - * @return self - */ - public function setOS(?string $oS): self - { - $this->oS = $oS; - - return $this; - } - - /** - * @return string - */ - public function getOSVersion(): ?string - { - return $this->oSVersion; - } - - /** - * @param string $oSVersion - * - * @return self - */ - public function setOSVersion(?string $oSVersion): self - { - $this->oSVersion = $oSVersion; - - return $this; - } - - /** - * @return string[] - */ - public function getOSFeatures(): ?array - { - return $this->oSFeatures; - } - - /** - * @param string[] $oSFeatures - * - * @return self - */ - public function setOSFeatures(?array $oSFeatures): self - { - $this->oSFeatures = $oSFeatures; - - return $this; - } - - /** - * @return string - */ - public function getVariant(): ?string - { - return $this->variant; - } - - /** - * @param string $variant - * - * @return self - */ - public function setVariant(?string $variant): self - { - $this->variant = $variant; - - return $this; - } - - /** - * @return string[] - */ - public function getFeatures(): ?array - { - return $this->features; - } - - /** - * @param string[] $features - * - * @return self - */ - public function setFeatures(?array $features): self - { - $this->features = $features; - - return $this; - } -} diff --git a/src/Model/Driver.php b/src/Model/Driver.php index 2b1340d7..7f671878 100644 --- a/src/Model/Driver.php +++ b/src/Model/Driver.php @@ -1,75 +1,71 @@ initialized); + } /** * Name of the driver. * - * @var string + * @var string|null */ protected $name; /** * Key/value map of driver-specific options. * - * @var string[] + * @var array|null */ protected $options; - /** * Name of the driver. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Name of the driver. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * Key/value map of driver-specific options. * - * @return string[] + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions() : ?iterable { return $this->options; } - /** * Key/value map of driver-specific options. * - * @param string[] $options + * @param array|null $options * * @return self */ - public function setOptions(?\ArrayObject $options): 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/src/Model/EndpointIPAMConfig.php b/src/Model/EndpointIPAMConfig.php index 720ab45e..5a4d13c2 100644 --- a/src/Model/EndpointIPAMConfig.php +++ b/src/Model/EndpointIPAMConfig.php @@ -1,87 +1,99 @@ initialized); + } + /** + * + * + * @var string|null */ protected $iPv4Address; /** - * @var string + * + * + * @var string|null */ protected $iPv6Address; /** - * @var string[] + * + * + * @var string[]|null */ protected $linkLocalIPs; - /** - * @return string + * + * + * @return string|null */ - public function getIPv4Address(): ?string + public function getIPv4Address() : ?string { return $this->iPv4Address; } - /** - * @param string $iPv4Address + * + * + * @param string|null $iPv4Address * * @return self */ - public function setIPv4Address(?string $iPv4Address): self + public function setIPv4Address(?string $iPv4Address) : self { + $this->initialized['iPv4Address'] = true; $this->iPv4Address = $iPv4Address; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getIPv6Address(): ?string + public function getIPv6Address() : ?string { return $this->iPv6Address; } - /** - * @param string $iPv6Address + * + * + * @param string|null $iPv6Address * * @return self */ - public function setIPv6Address(?string $iPv6Address): self + public function setIPv6Address(?string $iPv6Address) : self { + $this->initialized['iPv6Address'] = true; $this->iPv6Address = $iPv6Address; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getLinkLocalIPs(): ?array + public function getLinkLocalIPs() : ?array { return $this->linkLocalIPs; } - /** - * @param string[] $linkLocalIPs + * + * + * @param string[]|null $linkLocalIPs * * @return self */ - public function setLinkLocalIPs(?array $linkLocalIPs): self + public function setLinkLocalIPs(?array $linkLocalIPs) : self { + $this->initialized['linkLocalIPs'] = true; $this->linkLocalIPs = $linkLocalIPs; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/EndpointPortConfig.php b/src/Model/EndpointPortConfig.php index d27f64d8..e511a188 100644 --- a/src/Model/EndpointPortConfig.php +++ b/src/Model/EndpointPortConfig.php @@ -1,180 +1,182 @@ initialized); + } + /** + * + * + * @var string|null */ protected $name; /** - * @var string + * + * + * @var string|null */ protected $protocol; /** * The port inside the container. * - * @var int + * @var int|null */ protected $targetPort; /** * The port on the swarm hosts. * - * @var int + * @var int|null */ protected $publishedPort; /** - * The mode in which port is published. - + * The mode in which port is published. +


- - - "ingress" makes the target port accessible on on every node, + + - "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 - */ - protected $publishMode; - + + * + * @var string|null + */ + protected $publishMode = 'ingress'; /** - * @return string + * + * + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** - * @param string $name + * + * + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getProtocol(): ?string + public function getProtocol() : ?string { return $this->protocol; } - /** - * @param string $protocol + * + * + * @param string|null $protocol * * @return self */ - public function setProtocol(?string $protocol): self + public function setProtocol(?string $protocol) : self { + $this->initialized['protocol'] = true; $this->protocol = $protocol; - return $this; } - /** * The port inside the container. * - * @return int + * @return int|null */ - public function getTargetPort(): ?int + public function getTargetPort() : ?int { return $this->targetPort; } - /** * The port inside the container. * - * @param int $targetPort + * @param int|null $targetPort * * @return self */ - public function setTargetPort(?int $targetPort): self + public function setTargetPort(?int $targetPort) : self { + $this->initialized['targetPort'] = true; $this->targetPort = $targetPort; - return $this; } - /** * The port on the swarm hosts. * - * @return int + * @return int|null */ - public function getPublishedPort(): ?int + public function getPublishedPort() : ?int { return $this->publishedPort; } - /** * The port on the swarm hosts. * - * @param int $publishedPort + * @param int|null $publishedPort * * @return self */ - public function setPublishedPort(?int $publishedPort): self + public function setPublishedPort(?int $publishedPort) : self { + $this->initialized['publishedPort'] = true; $this->publishedPort = $publishedPort; - return $this; } - /** - * The mode in which port is published. - + * The mode in which port is published. +


- - - "ingress" makes the target port accessible on on every node, + + - "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 - */ - public function getPublishMode(): ?string + + * + * @return string|null + */ + public function getPublishMode() : ?string { return $this->publishMode; } - /** - * The mode in which port is published. - + * The mode in which port is published. +


- - - "ingress" makes the target port accessible on on every node, + + - "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 $publishMode - * - * @return self - */ - public function setPublishMode(?string $publishMode): self + + * + * @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/src/Model/EndpointSettings.php b/src/Model/EndpointSettings.php index ec0c9ba7..9ecef60b 100644 --- a/src/Model/EndpointSettings.php +++ b/src/Model/EndpointSettings.php @@ -1,399 +1,385 @@ initialized); + } /** * EndpointIPAMConfig represents an endpoint's IPAM configuration. * - * @var EndpointIPAMConfig + * @var EndpointIPAMConfig|null */ protected $iPAMConfig; /** - * @var string[] + * + * + * @var string[]|null */ protected $links; /** - * @var string[] + * + * + * @var string[]|null */ protected $aliases; /** * Unique ID of the network. * - * @var string + * @var string|null */ protected $networkID; /** * Unique ID for the service endpoint in a Sandbox. * - * @var string + * @var string|null */ protected $endpointID; /** * Gateway address for this network. * - * @var string + * @var string|null */ protected $gateway; /** * IPv4 address. * - * @var string + * @var string|null */ protected $iPAddress; /** * Mask length of the IPv4 address. * - * @var int + * @var int|null */ protected $iPPrefixLen; /** * IPv6 gateway address. * - * @var string + * @var string|null */ protected $iPv6Gateway; /** * Global IPv6 address. * - * @var string + * @var string|null */ protected $globalIPv6Address; /** * Mask length of the global IPv6 address. * - * @var int + * @var int|null */ protected $globalIPv6PrefixLen; /** * MAC address for the endpoint on this network. * - * @var string + * @var string|null */ protected $macAddress; /** - * DriverOpts is a mapping of driver options and values. These options. + * DriverOpts is a mapping of driver options and values. These options are passed directly to the driver and are driver specific. - - * - * @var string[] - */ + + * + * @var array|null + */ protected $driverOpts; - /** * EndpointIPAMConfig represents an endpoint's IPAM configuration. * - * @return EndpointIPAMConfig + * @return EndpointIPAMConfig|null */ - public function getIPAMConfig(): ?EndpointIPAMConfig + public function getIPAMConfig() : ?EndpointIPAMConfig { return $this->iPAMConfig; } - /** * EndpointIPAMConfig represents an endpoint's IPAM configuration. * - * @param EndpointIPAMConfig $iPAMConfig + * @param EndpointIPAMConfig|null $iPAMConfig * * @return self */ - public function setIPAMConfig(?EndpointIPAMConfig $iPAMConfig): self + public function setIPAMConfig(?EndpointIPAMConfig $iPAMConfig) : self { + $this->initialized['iPAMConfig'] = true; $this->iPAMConfig = $iPAMConfig; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getLinks(): ?array + public function getLinks() : ?array { return $this->links; } - /** - * @param string[] $links + * + * + * @param string[]|null $links * * @return self */ - public function setLinks(?array $links): self + public function setLinks(?array $links) : self { + $this->initialized['links'] = true; $this->links = $links; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getAliases(): ?array + public function getAliases() : ?array { return $this->aliases; } - /** - * @param string[] $aliases + * + * + * @param string[]|null $aliases * * @return self */ - public function setAliases(?array $aliases): self + public function setAliases(?array $aliases) : self { + $this->initialized['aliases'] = true; $this->aliases = $aliases; - return $this; } - /** * Unique ID of the network. * - * @return string + * @return string|null */ - public function getNetworkID(): ?string + public function getNetworkID() : ?string { return $this->networkID; } - /** * Unique ID of the network. * - * @param string $networkID + * @param string|null $networkID * * @return self */ - public function setNetworkID(?string $networkID): self + public function setNetworkID(?string $networkID) : self { + $this->initialized['networkID'] = true; $this->networkID = $networkID; - return $this; } - /** * Unique ID for the service endpoint in a Sandbox. * - * @return string + * @return string|null */ - public function getEndpointID(): ?string + public function getEndpointID() : ?string { return $this->endpointID; } - /** * Unique ID for the service endpoint in a Sandbox. * - * @param string $endpointID + * @param string|null $endpointID * * @return self */ - public function setEndpointID(?string $endpointID): self + public function setEndpointID(?string $endpointID) : self { + $this->initialized['endpointID'] = true; $this->endpointID = $endpointID; - return $this; } - /** * Gateway address for this network. * - * @return string + * @return string|null */ - public function getGateway(): ?string + public function getGateway() : ?string { return $this->gateway; } - /** * Gateway address for this network. * - * @param string $gateway + * @param string|null $gateway * * @return self */ - public function setGateway(?string $gateway): self + public function setGateway(?string $gateway) : self { + $this->initialized['gateway'] = true; $this->gateway = $gateway; - return $this; } - /** * IPv4 address. * - * @return string + * @return string|null */ - public function getIPAddress(): ?string + public function getIPAddress() : ?string { return $this->iPAddress; } - /** * IPv4 address. * - * @param string $iPAddress + * @param string|null $iPAddress * * @return self */ - public function setIPAddress(?string $iPAddress): self + public function setIPAddress(?string $iPAddress) : self { + $this->initialized['iPAddress'] = true; $this->iPAddress = $iPAddress; - return $this; } - /** * Mask length of the IPv4 address. * - * @return int + * @return int|null */ - public function getIPPrefixLen(): ?int + public function getIPPrefixLen() : ?int { return $this->iPPrefixLen; } - /** * Mask length of the IPv4 address. * - * @param int $iPPrefixLen + * @param int|null $iPPrefixLen * * @return self */ - public function setIPPrefixLen(?int $iPPrefixLen): self + public function setIPPrefixLen(?int $iPPrefixLen) : self { + $this->initialized['iPPrefixLen'] = true; $this->iPPrefixLen = $iPPrefixLen; - return $this; } - /** * IPv6 gateway address. * - * @return string + * @return string|null */ - public function getIPv6Gateway(): ?string + public function getIPv6Gateway() : ?string { return $this->iPv6Gateway; } - /** * IPv6 gateway address. * - * @param string $iPv6Gateway + * @param string|null $iPv6Gateway * * @return self */ - public function setIPv6Gateway(?string $iPv6Gateway): self + public function setIPv6Gateway(?string $iPv6Gateway) : self { + $this->initialized['iPv6Gateway'] = true; $this->iPv6Gateway = $iPv6Gateway; - return $this; } - /** * Global IPv6 address. * - * @return string + * @return string|null */ - public function getGlobalIPv6Address(): ?string + public function getGlobalIPv6Address() : ?string { return $this->globalIPv6Address; } - /** * Global IPv6 address. * - * @param string $globalIPv6Address + * @param string|null $globalIPv6Address * * @return self */ - public function setGlobalIPv6Address(?string $globalIPv6Address): self + public function setGlobalIPv6Address(?string $globalIPv6Address) : self { + $this->initialized['globalIPv6Address'] = true; $this->globalIPv6Address = $globalIPv6Address; - return $this; } - /** * Mask length of the global IPv6 address. * - * @return int + * @return int|null */ - public function getGlobalIPv6PrefixLen(): ?int + public function getGlobalIPv6PrefixLen() : ?int { return $this->globalIPv6PrefixLen; } - /** * Mask length of the global IPv6 address. * - * @param int $globalIPv6PrefixLen + * @param int|null $globalIPv6PrefixLen * * @return self */ - public function setGlobalIPv6PrefixLen(?int $globalIPv6PrefixLen): self + public function setGlobalIPv6PrefixLen(?int $globalIPv6PrefixLen) : self { + $this->initialized['globalIPv6PrefixLen'] = true; $this->globalIPv6PrefixLen = $globalIPv6PrefixLen; - return $this; } - /** * MAC address for the endpoint on this network. * - * @return string + * @return string|null */ - public function getMacAddress(): ?string + public function getMacAddress() : ?string { return $this->macAddress; } - /** * MAC address for the endpoint on this network. * - * @param string $macAddress + * @param string|null $macAddress * * @return self */ - public function setMacAddress(?string $macAddress): self + public function setMacAddress(?string $macAddress) : self { + $this->initialized['macAddress'] = true; $this->macAddress = $macAddress; - return $this; } - /** - * DriverOpts is a mapping of driver options and values. These options. + * DriverOpts is a mapping of driver options and values. These options are passed directly to the driver and are driver specific. - - * - * @return string[] - */ - public function getDriverOpts(): ?\ArrayObject + + * + * @return array|null + */ + public function getDriverOpts() : ?iterable { return $this->driverOpts; } - /** - * DriverOpts is a mapping of driver options and values. These options. + * DriverOpts is a mapping of driver options and values. These options are passed directly to the driver and are driver specific. - - * - * @param string[] $driverOpts - * - * @return self - */ - public function setDriverOpts(?\ArrayObject $driverOpts): self + + * + * @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/src/Model/EndpointSpec.php b/src/Model/EndpointSpec.php index d8ca38ad..76fa7bec 100644 --- a/src/Model/EndpointSpec.php +++ b/src/Model/EndpointSpec.php @@ -1,75 +1,77 @@ initialized); + } /** - * List of exposed ports that this service is accessible on from the outside. Ports can only be provided if `vip` resolution mode is used. + * The mode of resolution to use for internal load balancing between tasks. * - * @var EndpointPortConfig[] + * @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 EndpointPortConfig[]|null + */ protected $ports; - /** * The mode of resolution to use for internal load balancing between tasks. * - * @return string + * @return string|null */ - public function getMode(): ?string + public function getMode() : ?string { return $this->mode; } - /** * The mode of resolution to use for internal load balancing between tasks. * - * @param string $mode + * @param string|null $mode * * @return self */ - public function setMode(?string $mode): self + public function setMode(?string $mode) : self { + $this->initialized['mode'] = true; $this->mode = $mode; - return $this; } - /** - * 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 EndpointPortConfig[] - */ - public function getPorts(): ?array + * 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 EndpointPortConfig[]|null + */ + public function getPorts() : ?array { return $this->ports; } - /** - * 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 EndpointPortConfig[] $ports - * - * @return self - */ - public function setPorts(?array $ports): self + * 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 EndpointPortConfig[]|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/src/Model/EngineDescription.php b/src/Model/EngineDescription.php index 1ca665aa..88885cfd 100644 --- a/src/Model/EngineDescription.php +++ b/src/Model/EngineDescription.php @@ -1,87 +1,99 @@ initialized); + } + /** + * + * + * @var string|null */ protected $engineVersion; /** - * @var string[] + * + * + * @var array|null */ protected $labels; /** - * @var EngineDescriptionPluginsItem[] + * + * + * @var EngineDescriptionPluginsItem[]|null */ protected $plugins; - /** - * @return string + * + * + * @return string|null */ - public function getEngineVersion(): ?string + public function getEngineVersion() : ?string { return $this->engineVersion; } - /** - * @param string $engineVersion + * + * + * @param string|null $engineVersion * * @return self */ - public function setEngineVersion(?string $engineVersion): self + public function setEngineVersion(?string $engineVersion) : self { + $this->initialized['engineVersion'] = true; $this->engineVersion = $engineVersion; - return $this; } - /** - * @return string[] + * + * + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** - * @param string[] $labels + * + * + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels) : self { + $this->initialized['labels'] = true; $this->labels = $labels; - return $this; } - /** - * @return EngineDescriptionPluginsItem[] + * + * + * @return EngineDescriptionPluginsItem[]|null */ - public function getPlugins(): ?array + public function getPlugins() : ?array { return $this->plugins; } - /** - * @param EngineDescriptionPluginsItem[] $plugins + * + * + * @param EngineDescriptionPluginsItem[]|null $plugins * * @return self */ - public function setPlugins(?array $plugins): 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/src/Model/EngineDescriptionPluginsItem.php b/src/Model/EngineDescriptionPluginsItem.php index 3639f536..3d0f07d0 100644 --- a/src/Model/EngineDescriptionPluginsItem.php +++ b/src/Model/EngineDescriptionPluginsItem.php @@ -1,63 +1,71 @@ initialized); + } + /** + * + * + * @var string|null */ protected $type; /** - * @var string + * + * + * @var string|null */ protected $name; - /** - * @return string + * + * + * @return string|null */ - public function getType(): ?string + public function getType() : ?string { return $this->type; } - /** - * @param string $type + * + * + * @param string|null $type * * @return self */ - public function setType(?string $type): self + public function setType(?string $type) : self { + $this->initialized['type'] = true; $this->type = $type; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** - * @param string $name + * + * + * @param string|null $name * * @return self */ - public function setName(?string $name): 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/src/Model/ErrorDetail.php b/src/Model/ErrorDetail.php index 1a7dad50..d7711263 100644 --- a/src/Model/ErrorDetail.php +++ b/src/Model/ErrorDetail.php @@ -1,63 +1,71 @@ initialized); + } + /** + * + * + * @var int|null */ protected $code; /** - * @var string + * + * + * @var string|null */ protected $message; - /** - * @return int + * + * + * @return int|null */ - public function getCode(): ?int + public function getCode() : ?int { return $this->code; } - /** - * @param int $code + * + * + * @param int|null $code * * @return self */ - public function setCode(?int $code): self + public function setCode(?int $code) : self { + $this->initialized['code'] = true; $this->code = $code; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getMessage(): ?string + public function getMessage() : ?string { return $this->message; } - /** - * @param string $message + * + * + * @param string|null $message * * @return self */ - public function setMessage(?string $message): 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/src/Model/ErrorResponse.php b/src/Model/ErrorResponse.php index 6e10b3b1..d6d6c850 100644 --- a/src/Model/ErrorResponse.php +++ b/src/Model/ErrorResponse.php @@ -1,45 +1,43 @@ initialized); + } /** * The error message. * - * @var string + * @var string|null */ protected $message; - /** * The error message. * - * @return string + * @return string|null */ - public function getMessage(): ?string + public function getMessage() : ?string { return $this->message; } - /** * The error message. * - * @param string $message + * @param string|null $message * * @return self */ - public function setMessage(?string $message): 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/src/Model/EventActor.php b/src/Model/EventActor.php new file mode 100644 index 00000000..e98f6ee6 --- /dev/null +++ b/src/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/src/Model/EventMessage.php b/src/Model/EventMessage.php new file mode 100644 index 00000000..53d2189e --- /dev/null +++ b/src/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/src/Model/EventsGetResponse200.php b/src/Model/EventsGetResponse200.php deleted file mode 100644 index 4f342cf7..00000000 --- a/src/Model/EventsGetResponse200.php +++ /dev/null @@ -1,159 +0,0 @@ -type; - } - - /** - * The type of object emitting the event. - * - * @param string $type - * - * @return self - */ - public function setType(?string $type): self - { - $this->type = $type; - - return $this; - } - - /** - * The type of event. - * - * @return string - */ - public function getAction(): ?string - { - return $this->action; - } - - /** - * The type of event. - * - * @param string $action - * - * @return self - */ - public function setAction(?string $action): self - { - $this->action = $action; - - return $this; - } - - /** - * @return EventsGetResponse200Actor - */ - public function getActor(): ?EventsGetResponse200Actor - { - return $this->actor; - } - - /** - * @param EventsGetResponse200Actor $actor - * - * @return self - */ - public function setActor(?EventsGetResponse200Actor $actor): self - { - $this->actor = $actor; - - return $this; - } - - /** - * Timestamp of event. - * - * @return int - */ - public function getTime(): ?int - { - return $this->time; - } - - /** - * Timestamp of event. - * - * @param int $time - * - * @return self - */ - public function setTime(?int $time): self - { - $this->time = $time; - - return $this; - } - - /** - * Timestamp of event, with nanosecond accuracy. - * - * @return int - */ - public function getTimeNano(): ?int - { - return $this->timeNano; - } - - /** - * Timestamp of event, with nanosecond accuracy. - * - * @param int $timeNano - * - * @return self - */ - public function setTimeNano(?int $timeNano): self - { - $this->timeNano = $timeNano; - - return $this; - } -} diff --git a/src/Model/EventsGetResponse200Actor.php b/src/Model/EventsGetResponse200Actor.php deleted file mode 100644 index 84824aa7..00000000 --- a/src/Model/EventsGetResponse200Actor.php +++ /dev/null @@ -1,75 +0,0 @@ -iD; - } - - /** - * The ID of the object emitting the event. - * - * @param string $iD - * - * @return self - */ - public function setID(?string $iD): self - { - $this->iD = $iD; - - return $this; - } - - /** - * Various key/value attributes of the object, depending on its type. - * - * @return string[] - */ - public function getAttributes(): ?\ArrayObject - { - return $this->attributes; - } - - /** - * Various key/value attributes of the object, depending on its type. - * - * @param string[] $attributes - * - * @return self - */ - public function setAttributes(?\ArrayObject $attributes): self - { - $this->attributes = $attributes; - - return $this; - } -} diff --git a/src/Model/ExecIdJsonGetResponse200.php b/src/Model/ExecIdJsonGetResponse200.php index 81267a39..33272ccb 100644 --- a/src/Model/ExecIdJsonGetResponse200.php +++ b/src/Model/ExecIdJsonGetResponse200.php @@ -1,285 +1,323 @@ initialized); + } + /** + * + * + * @var bool|null */ protected $canRemove; /** - * @var string + * + * + * @var string|null */ protected $detachKeys; /** - * @var string + * + * + * @var string|null */ protected $iD; /** - * @var bool + * + * + * @var bool|null */ protected $running; /** - * @var int + * + * + * @var int|null */ protected $exitCode; /** - * @var ProcessConfig + * + * + * @var ProcessConfig|null */ protected $processConfig; /** - * @var bool + * + * + * @var bool|null */ protected $openStdin; /** - * @var bool + * + * + * @var bool|null */ protected $openStderr; /** - * @var bool + * + * + * @var bool|null */ protected $openStdout; /** - * @var string + * + * + * @var string|null */ protected $containerID; /** * The system process ID for the exec process. * - * @var int + * @var int|null */ protected $pid; - /** - * @return bool + * + * + * @return bool|null */ - public function getCanRemove(): ?bool + public function getCanRemove() : ?bool { return $this->canRemove; } - /** - * @param bool $canRemove + * + * + * @param bool|null $canRemove * * @return self */ - public function setCanRemove(?bool $canRemove): self + public function setCanRemove(?bool $canRemove) : self { + $this->initialized['canRemove'] = true; $this->canRemove = $canRemove; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getDetachKeys(): ?string + public function getDetachKeys() : ?string { return $this->detachKeys; } - /** - * @param string $detachKeys + * + * + * @param string|null $detachKeys * * @return self */ - public function setDetachKeys(?string $detachKeys): self + public function setDetachKeys(?string $detachKeys) : self { + $this->initialized['detachKeys'] = true; $this->detachKeys = $detachKeys; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getID(): ?string + public function getID() : ?string { return $this->iD; } - /** - * @param string $iD + * + * + * @param string|null $iD * * @return self */ - public function setID(?string $iD): self + public function setID(?string $iD) : self { + $this->initialized['iD'] = true; $this->iD = $iD; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getRunning(): ?bool + public function getRunning() : ?bool { return $this->running; } - /** - * @param bool $running + * + * + * @param bool|null $running * * @return self */ - public function setRunning(?bool $running): self + public function setRunning(?bool $running) : self { + $this->initialized['running'] = true; $this->running = $running; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getExitCode(): ?int + public function getExitCode() : ?int { return $this->exitCode; } - /** - * @param int $exitCode + * + * + * @param int|null $exitCode * * @return self */ - public function setExitCode(?int $exitCode): self + public function setExitCode(?int $exitCode) : self { + $this->initialized['exitCode'] = true; $this->exitCode = $exitCode; - return $this; } - /** - * @return ProcessConfig + * + * + * @return ProcessConfig|null */ - public function getProcessConfig(): ?ProcessConfig + public function getProcessConfig() : ?ProcessConfig { return $this->processConfig; } - /** - * @param ProcessConfig $processConfig + * + * + * @param ProcessConfig|null $processConfig * * @return self */ - public function setProcessConfig(?ProcessConfig $processConfig): self + public function setProcessConfig(?ProcessConfig $processConfig) : self { + $this->initialized['processConfig'] = true; $this->processConfig = $processConfig; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getOpenStdin(): ?bool + public function getOpenStdin() : ?bool { return $this->openStdin; } - /** - * @param bool $openStdin + * + * + * @param bool|null $openStdin * * @return self */ - public function setOpenStdin(?bool $openStdin): self + public function setOpenStdin(?bool $openStdin) : self { + $this->initialized['openStdin'] = true; $this->openStdin = $openStdin; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getOpenStderr(): ?bool + public function getOpenStderr() : ?bool { return $this->openStderr; } - /** - * @param bool $openStderr + * + * + * @param bool|null $openStderr * * @return self */ - public function setOpenStderr(?bool $openStderr): self + public function setOpenStderr(?bool $openStderr) : self { + $this->initialized['openStderr'] = true; $this->openStderr = $openStderr; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getOpenStdout(): ?bool + public function getOpenStdout() : ?bool { return $this->openStdout; } - /** - * @param bool $openStdout + * + * + * @param bool|null $openStdout * * @return self */ - public function setOpenStdout(?bool $openStdout): self + public function setOpenStdout(?bool $openStdout) : self { + $this->initialized['openStdout'] = true; $this->openStdout = $openStdout; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getContainerID(): ?string + public function getContainerID() : ?string { return $this->containerID; } - /** - * @param string $containerID + * + * + * @param string|null $containerID * * @return self */ - public function setContainerID(?string $containerID): 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 + * @return int|null */ - public function getPid(): ?int + public function getPid() : ?int { return $this->pid; } - /** * The system process ID for the exec process. * - * @param int $pid + * @param int|null $pid * * @return self */ - public function setPid(?int $pid): 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/src/Model/ExecIdStartPostBody.php b/src/Model/ExecIdStartPostBody.php index 044a7ab9..3365f7f1 100644 --- a/src/Model/ExecIdStartPostBody.php +++ b/src/Model/ExecIdStartPostBody.php @@ -1,75 +1,99 @@ initialized); + } /** * Detach from the command. * - * @var bool + * @var bool|null */ protected $detach; /** * Allocate a pseudo-TTY. * - * @var bool + * @var bool|null */ protected $tty; - + /** + * Initial console size, as an `[height, width]` array. + * + * @var int[]|null + */ + protected $consoleSize; /** * Detach from the command. * - * @return bool + * @return bool|null */ - public function getDetach(): ?bool + public function getDetach() : ?bool { return $this->detach; } - /** * Detach from the command. * - * @param bool $detach + * @param bool|null $detach * * @return self */ - public function setDetach(?bool $detach): self + public function setDetach(?bool $detach) : self { + $this->initialized['detach'] = true; $this->detach = $detach; - return $this; } - /** * Allocate a pseudo-TTY. * - * @return bool + * @return bool|null */ - public function getTty(): ?bool + public function getTty() : ?bool { return $this->tty; } - /** * Allocate a pseudo-TTY. * - * @param bool $tty + * @param bool|null $tty * * @return self */ - public function setTty(?bool $tty): 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 int[]|null + */ + public function getConsoleSize() : ?array + { + return $this->consoleSize; + } + /** + * Initial console size, as an `[height, width]` array. + * + * @param int[]|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/src/Model/FilesystemChange.php b/src/Model/FilesystemChange.php new file mode 100644 index 00000000..b57f2983 --- /dev/null +++ b/src/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/src/Model/GenericResourcesItem.php b/src/Model/GenericResourcesItem.php index 605ab71f..c8111e9f 100644 --- a/src/Model/GenericResourcesItem.php +++ b/src/Model/GenericResourcesItem.php @@ -1,63 +1,71 @@ initialized); + } + /** + * + * + * @var GenericResourcesItemNamedResourceSpec|null */ protected $namedResourceSpec; /** - * @var GenericResourcesItemDiscreteResourceSpec + * + * + * @var GenericResourcesItemDiscreteResourceSpec|null */ protected $discreteResourceSpec; - /** - * @return GenericResourcesItemNamedResourceSpec + * + * + * @return GenericResourcesItemNamedResourceSpec|null */ - public function getNamedResourceSpec(): ?GenericResourcesItemNamedResourceSpec + public function getNamedResourceSpec() : ?GenericResourcesItemNamedResourceSpec { return $this->namedResourceSpec; } - /** - * @param GenericResourcesItemNamedResourceSpec $namedResourceSpec + * + * + * @param GenericResourcesItemNamedResourceSpec|null $namedResourceSpec * * @return self */ - public function setNamedResourceSpec(?GenericResourcesItemNamedResourceSpec $namedResourceSpec): self + public function setNamedResourceSpec(?GenericResourcesItemNamedResourceSpec $namedResourceSpec) : self { + $this->initialized['namedResourceSpec'] = true; $this->namedResourceSpec = $namedResourceSpec; - return $this; } - /** - * @return GenericResourcesItemDiscreteResourceSpec + * + * + * @return GenericResourcesItemDiscreteResourceSpec|null */ - public function getDiscreteResourceSpec(): ?GenericResourcesItemDiscreteResourceSpec + public function getDiscreteResourceSpec() : ?GenericResourcesItemDiscreteResourceSpec { return $this->discreteResourceSpec; } - /** - * @param GenericResourcesItemDiscreteResourceSpec $discreteResourceSpec + * + * + * @param GenericResourcesItemDiscreteResourceSpec|null $discreteResourceSpec * * @return self */ - public function setDiscreteResourceSpec(?GenericResourcesItemDiscreteResourceSpec $discreteResourceSpec): 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/src/Model/GenericResourcesItemDiscreteResourceSpec.php b/src/Model/GenericResourcesItemDiscreteResourceSpec.php index db108de8..635a3ca9 100644 --- a/src/Model/GenericResourcesItemDiscreteResourceSpec.php +++ b/src/Model/GenericResourcesItemDiscreteResourceSpec.php @@ -1,63 +1,71 @@ initialized); + } + /** + * + * + * @var string|null */ protected $kind; /** - * @var int + * + * + * @var int|null */ protected $value; - /** - * @return string + * + * + * @return string|null */ - public function getKind(): ?string + public function getKind() : ?string { return $this->kind; } - /** - * @param string $kind + * + * + * @param string|null $kind * * @return self */ - public function setKind(?string $kind): self + public function setKind(?string $kind) : self { + $this->initialized['kind'] = true; $this->kind = $kind; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getValue(): ?int + public function getValue() : ?int { return $this->value; } - /** - * @param int $value + * + * + * @param int|null $value * * @return self */ - public function setValue(?int $value): 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/src/Model/GenericResourcesItemNamedResourceSpec.php b/src/Model/GenericResourcesItemNamedResourceSpec.php index 10a4c7bf..b18eb988 100644 --- a/src/Model/GenericResourcesItemNamedResourceSpec.php +++ b/src/Model/GenericResourcesItemNamedResourceSpec.php @@ -1,63 +1,71 @@ initialized); + } + /** + * + * + * @var string|null */ protected $kind; /** - * @var string + * + * + * @var string|null */ protected $value; - /** - * @return string + * + * + * @return string|null */ - public function getKind(): ?string + public function getKind() : ?string { return $this->kind; } - /** - * @param string $kind + * + * + * @param string|null $kind * * @return self */ - public function setKind(?string $kind): self + public function setKind(?string $kind) : self { + $this->initialized['kind'] = true; $this->kind = $kind; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getValue(): ?string + public function getValue() : ?string { return $this->value; } - /** - * @param string $value + * + * + * @param string|null $value * * @return self */ - public function setValue(?string $value): 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/src/Model/GraphDriverData.php b/src/Model/GraphDriverData.php index d4169c73..c39ab211 100644 --- a/src/Model/GraphDriverData.php +++ b/src/Model/GraphDriverData.php @@ -1,63 +1,83 @@ initialized); + } /** - * @var string[] + * 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; - /** - * @return string + * Name of the storage driver. + * + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** - * @param string $name + * Name of the storage driver. + * + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string[] - */ - public function getData(): ?\ArrayObject + * 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; } - /** - * @param string[] $data - * - * @return self - */ - public function setData(?\ArrayObject $data): self + * 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/src/Model/Health.php b/src/Model/Health.php new file mode 100644 index 00000000..753007f2 --- /dev/null +++ b/src/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 HealthcheckResult[]|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 HealthcheckResult[]|null + */ + public function getLog() : ?array + { + return $this->log; + } + /** + * Log contains the last few results (oldest first) + * + * @param HealthcheckResult[]|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/src/Model/HealthConfig.php b/src/Model/HealthConfig.php index 50b88589..4dd867f1 100644 --- a/src/Model/HealthConfig.php +++ b/src/Model/HealthConfig.php @@ -1,183 +1,200 @@ 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 string[] - */ + + * + * @var string[]|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 - */ + * 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 - */ + * 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 - */ + * 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 - */ + * 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 test to perform. Possible values are:. - + * 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 string[] - */ - public function getTest(): ?array + + * + * @return string[]|null + */ + public function getTest() : ?array { return $this->test; } - /** - * The test to perform. Possible values are:. - + * 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 string[] $test - * - * @return self - */ - public function setTest(?array $test): self + + * + * @param string[]|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 - */ - public function getInterval(): ?int + * 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 $interval - * - * @return self - */ - public function setInterval(?int $interval): self + * 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 - */ - public function getTimeout(): ?int + * 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 $timeout - * - * @return self - */ - public function setTimeout(?int $timeout): self + * 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 - */ - public function getRetries(): ?int + * 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 $retries - * - * @return self - */ - public function setRetries(?int $retries): self + * 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 - */ - public function getStartPeriod(): ?int + * 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 $startPeriod - * - * @return self - */ - public function setStartPeriod(?int $startPeriod): self + * 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; } -} +} \ No newline at end of file diff --git a/src/Model/HealthcheckResult.php b/src/Model/HealthcheckResult.php new file mode 100644 index 00000000..7b5dfbfd --- /dev/null +++ b/src/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/src/Model/HostConfig.php b/src/Model/HostConfig.php index 32414fca..d4f4e00b 100644 --- a/src/Model/HostConfig.php +++ b/src/Model/HostConfig.php @@ -1,2094 +1,2536 @@ 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 + * @var int|null */ - protected $memory; + 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 - */ + * 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 + * @var int|null */ protected $blkioWeight; /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. - * - * @var ResourcesBlkioWeightDeviceItem[] - */ + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @var ResourcesBlkioWeightDeviceItem[]|null + */ protected $blkioWeightDevice; /** - * Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - * - * @var ThrottleDevice[] - */ + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var ThrottleDevice[]|null + */ protected $blkioDeviceReadBps; /** - * Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - * - * @var ThrottleDevice[] - */ + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var ThrottleDevice[]|null + */ protected $blkioDeviceWriteBps; /** - * Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - * - * @var ThrottleDevice[] - */ + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var ThrottleDevice[]|null + */ protected $blkioDeviceReadIOps; /** - * Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - * - * @var ThrottleDevice[] - */ + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var ThrottleDevice[]|null + */ protected $blkioDeviceWriteIOps; /** * The length of a CPU period in microseconds. * - * @var int + * @var int|null */ protected $cpuPeriod; /** * Microseconds of CPU time that the container can get in a CPU period. * - * @var int + * @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 - */ + * 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 - */ + * 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 + * @var string|null */ protected $cpusetCpus; /** - * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. - * - * @var string - */ + * 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 DeviceMapping[] + * @var DeviceMapping[]|null */ protected $devices; /** - * a list of cgroup rules to apply to the container. + * a list of cgroup rules to apply to the container * - * @var string[] + * @var string[]|null */ protected $deviceCgroupRules; /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @var int + * @var DeviceRequest[]|null */ - protected $diskQuota; + protected $deviceRequests; /** - * Kernel memory limit in bytes. - * - * @var int - */ - protected $kernelMemory; + * 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 + * @var int|null */ protected $memoryReservation; /** - * Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. - * - * @var int - */ + * 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 - */ + * 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 + * @var int|null */ - protected $nanoCPUs; + protected $nanoCpus; /** * Disable OOM Killer for the container. * - * @var bool + * @var bool|null */ protected $oomKillDisable; /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @var int - */ + * 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 ResourcesUlimitsItem[] - */ + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @var ResourcesUlimitsItem[]|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 - */ + * 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 - */ + * 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). + * Maximum IOps for the container system drive (Windows only) * - * @var int + * @var int|null */ protected $iOMaximumIOps; /** - * Maximum IO in bytes per second for the container system drive (Windows only). - * - * @var int - */ + * 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` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `host-src:container-dest:ro` to make the bind mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. - - `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path. - - * - * @var string[] - */ + * 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 string[]|null + */ protected $binds; /** - * Path to a file where the container ID is written. + * Path to a file where the container ID is written * - * @var string + * @var string|null */ protected $containerIDFile; /** - * The logging configuration for this container. + * The logging configuration for this container * - * @var HostConfigLogConfig + * @var HostConfigLogConfig|null */ protected $logConfig; /** - * 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 - */ + * 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. + * 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 both `tcp` and `udp`, two separate - entries are added to the mapping table. - - * - * @var PortBinding[][] - */ + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + + * + * @var array|null + */ protected $portBindings; /** - * 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 - */ + * 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; /** - * Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set. - * - * @var bool - */ + * Automatically remove the container when the container's process + exits. This has no effect if `RestartPolicy` is set. + + * + * @var bool|null + */ protected $autoRemove; /** * Driver that this container uses to mount volumes. * - * @var string + * @var string|null */ protected $volumeDriver; /** - * A list of volumes to inherit from another container, specified in the form `[:]`. - * - * @var string[] - */ + * A list of volumes to inherit from another container, specified in + the form `[:]`. + + * + * @var string[]|null + */ protected $volumesFrom; /** * Specification for mounts to be added to the container. * - * @var Mount[] + * @var Mount[]|null */ protected $mounts; /** - * A list of kernel capabilities to add to the container. + * Initial console size, as an `[height, width]` array. * - * @var string[] + * @var int[]|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 string[]|null + */ protected $capAdd; /** - * A list of kernel capabilities to drop from the container. - * - * @var string[] - */ + * A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + + * + * @var string[]|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 string[] + * @var string[]|null */ protected $dns; /** * A list of DNS options. * - * @var string[] + * @var string[]|null */ protected $dnsOptions; /** * A list of DNS search domains. * - * @var string[] + * @var string[]|null */ protected $dnsSearch; /** - * A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. - * - * @var string[] - */ + * A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + + * + * @var string[]|null + */ protected $extraHosts; /** * A list of additional groups that the container process will run as. * - * @var string[] + * @var string[]|null */ protected $groupAdd; /** - * IPC sharing mode for the container. Possible values are:. - + * 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 - */ + + * + * @var string|null + */ protected $ipcMode; /** * Cgroup to use for the container. * - * @var string + * @var string|null */ protected $cgroup; /** * A list of links for the container in the form `container_name:alias`. * - * @var string[] + * @var string[]|null */ protected $links; /** - * An integer value containing the score given to the container in order to tune OOM killer preferences. - * - * @var int - */ + * An integer value containing the score given to the container in + order to tune OOM killer preferences. + + * + * @var int|null + */ protected $oomScoreAdj; /** - * Set the PID (Process) Namespace mode for the container. It can be either:. - + * 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 - */ + + * + * @var string|null + */ protected $pidMode; /** * Gives the container full access to the host. * - * @var bool + * @var bool|null */ protected $privileged; /** - * Allocates an ephemeral host port for all of a container's. + * 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 - */ + + 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; /** * Mount the container's root filesystem as read only. * - * @var bool + * @var bool|null */ protected $readonlyRootfs; /** - * A list of string values to customize labels for MLS systems, such as SELinux. - * - * @var string[] - */ + * A list of string values to customize labels for MLS systems, such + as SELinux. + + * + * @var string[]|null + */ protected $securityOpt; /** * Storage driver options for this container, in the form `{"size": "120G"}`. * - * @var string[] + * @var array|null */ protected $storageOpt; /** - * 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 string[] - */ + * 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; /** * UTS namespace to use for the container. * - * @var string + * @var string|null */ protected $uTSMode; /** - * Sets the usernamespace mode for the container when usernamespace remapping option is enabled. - * - * @var string - */ + * Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + + * + * @var string|null + */ protected $usernsMode; /** * Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. * - * @var int + * @var int|null */ protected $shmSize; /** - * A list of kernel parameters (sysctls) to set in the container. For example: `{"net.ipv4.ip_forward": "1"}`. - * - * @var string[] - */ + * 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 + * @var string|null */ protected $runtime; /** - * Initial console size, as an `[height, width]` array. (Windows only). - * - * @var int[] - */ - protected $consoleSize; - /** - * Isolation technology of the container. (Windows only). + * Isolation technology of the container. (Windows only) * - * @var string + * @var string|null */ protected $isolation; - /** - * An integer value representing this container's relative CPU weight versus other containers. - * - * @return int - */ - public function getCpuShares(): ?int + * The list of paths to be masked inside the container (this overrides + the default set of paths). + + * + * @var string[]|null + */ + protected $maskedPaths; + /** + * The list of paths to be set as read-only inside the container + (this overrides the default set of paths). + + * + * @var string[]|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->cpuShares; } - /** - * An integer value representing this container's relative CPU weight versus other containers. - * - * @param int $cpuShares - * - * @return self - */ - public function setCpuShares(?int $cpuShares): self + * 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 + * @return int|null */ - public function getMemory(): ?int + public function getMemory() : ?int { return $this->memory; } - /** * Memory limit in bytes. * - * @param int $memory + * @param int|null $memory * * @return self */ - public function setMemory(?int $memory): 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 - */ - public function getCgroupParent(): ?string + * 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 $cgroupParent - * - * @return self - */ - public function setCgroupParent(?string $cgroupParent): self + * 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 + * @return int|null */ - public function getBlkioWeight(): ?int + public function getBlkioWeight() : ?int { return $this->blkioWeight; } - /** * Block IO weight (relative weight). * - * @param int $blkioWeight + * @param int|null $blkioWeight * * @return self */ - public function setBlkioWeight(?int $blkioWeight): 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 ResourcesBlkioWeightDeviceItem[] - */ - public function getBlkioWeightDevice(): ?array + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @return ResourcesBlkioWeightDeviceItem[]|null + */ + public function getBlkioWeightDevice() : ?array { return $this->blkioWeightDevice; } - /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. - * - * @param ResourcesBlkioWeightDeviceItem[] $blkioWeightDevice - * - * @return self - */ - public function setBlkioWeightDevice(?array $blkioWeightDevice): self - { + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @param ResourcesBlkioWeightDeviceItem[]|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 ThrottleDevice[] - */ - public function getBlkioDeviceReadBps(): ?array + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return ThrottleDevice[]|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 ThrottleDevice[] $blkioDeviceReadBps - * - * @return self - */ - public function setBlkioDeviceReadBps(?array $blkioDeviceReadBps): self - { + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param ThrottleDevice[]|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 ThrottleDevice[] - */ - public function getBlkioDeviceWriteBps(): ?array + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return ThrottleDevice[]|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 ThrottleDevice[] $blkioDeviceWriteBps - * - * @return self - */ - public function setBlkioDeviceWriteBps(?array $blkioDeviceWriteBps): self - { + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param ThrottleDevice[]|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 ThrottleDevice[] - */ - public function getBlkioDeviceReadIOps(): ?array + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return ThrottleDevice[]|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 ThrottleDevice[] $blkioDeviceReadIOps - * - * @return self - */ - public function setBlkioDeviceReadIOps(?array $blkioDeviceReadIOps): self - { + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param ThrottleDevice[]|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 ThrottleDevice[] - */ - public function getBlkioDeviceWriteIOps(): ?array + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return ThrottleDevice[]|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 ThrottleDevice[] $blkioDeviceWriteIOps - * - * @return self - */ - public function setBlkioDeviceWriteIOps(?array $blkioDeviceWriteIOps): self - { + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param ThrottleDevice[]|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 + * @return int|null */ - public function getCpuPeriod(): ?int + public function getCpuPeriod() : ?int { return $this->cpuPeriod; } - /** * The length of a CPU period in microseconds. * - * @param int $cpuPeriod + * @param int|null $cpuPeriod * * @return self */ - public function setCpuPeriod(?int $cpuPeriod): 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 + * @return int|null */ - public function getCpuQuota(): ?int + public function getCpuQuota() : ?int { return $this->cpuQuota; } - /** * Microseconds of CPU time that the container can get in a CPU period. * - * @param int $cpuQuota + * @param int|null $cpuQuota * * @return self */ - public function setCpuQuota(?int $cpuQuota): 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 - */ - public function getCpuRealtimePeriod(): ?int + * 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 $cpuRealtimePeriod - * - * @return self - */ - public function setCpuRealtimePeriod(?int $cpuRealtimePeriod): self + * 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 - */ - public function getCpuRealtimeRuntime(): ?int + * 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 $cpuRealtimeRuntime - * - * @return self - */ - public function setCpuRealtimeRuntime(?int $cpuRealtimeRuntime): self + * 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 + * @return string|null */ - public function getCpusetCpus(): ?string + public function getCpusetCpus() : ?string { return $this->cpusetCpus; } - /** * CPUs in which to allow execution (e.g., `0-3`, `0,1`). * - * @param string $cpusetCpus + * @param string|null $cpusetCpus * * @return self */ - public function setCpusetCpus(?string $cpusetCpus): 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 - */ - public function getCpusetMems(): ?string + * 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 $cpusetMems - * - * @return self - */ - public function setCpusetMems(?string $cpusetMems): self + * 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 DeviceMapping[] + * @return DeviceMapping[]|null */ - public function getDevices(): ?array + public function getDevices() : ?array { return $this->devices; } - /** * A list of devices to add to the container. * - * @param DeviceMapping[] $devices + * @param DeviceMapping[]|null $devices * * @return self */ - public function setDevices(?array $devices): 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. + * a list of cgroup rules to apply to the container * - * @return string[] + * @return string[]|null */ - public function getDeviceCgroupRules(): ?array + public function getDeviceCgroupRules() : ?array { return $this->deviceCgroupRules; } - /** - * a list of cgroup rules to apply to the container. + * a list of cgroup rules to apply to the container * - * @param string[] $deviceCgroupRules + * @param string[]|null $deviceCgroupRules * * @return self */ - public function setDeviceCgroupRules(?array $deviceCgroupRules): self + public function setDeviceCgroupRules(?array $deviceCgroupRules) : self { + $this->initialized['deviceCgroupRules'] = true; $this->deviceCgroupRules = $deviceCgroupRules; - return $this; } - /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @return int + * @return DeviceRequest[]|null */ - public function getDiskQuota(): ?int + public function getDeviceRequests() : ?array { - return $this->diskQuota; + return $this->deviceRequests; } - /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @param int $diskQuota + * @param DeviceRequest[]|null $deviceRequests * * @return self */ - public function setDiskQuota(?int $diskQuota): self + public function setDeviceRequests(?array $deviceRequests) : self { - $this->diskQuota = $diskQuota; - + $this->initialized['deviceRequests'] = true; + $this->deviceRequests = $deviceRequests; return $this; } - /** - * Kernel memory limit in bytes. - * - * @return int - */ - public function getKernelMemory(): ?int + * 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->kernelMemory; + return $this->kernelMemoryTCP; } - /** - * Kernel memory limit in bytes. - * - * @param int $kernelMemory - * - * @return self - */ - public function setKernelMemory(?int $kernelMemory): self + * 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->kernelMemory = $kernelMemory; - + $this->initialized['kernelMemoryTCP'] = true; + $this->kernelMemoryTCP = $kernelMemoryTCP; return $this; } - /** * Memory soft limit in bytes. * - * @return int + * @return int|null */ - public function getMemoryReservation(): ?int + public function getMemoryReservation() : ?int { return $this->memoryReservation; } - /** * Memory soft limit in bytes. * - * @param int $memoryReservation + * @param int|null $memoryReservation * * @return self */ - public function setMemoryReservation(?int $memoryReservation): 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 - */ - public function getMemorySwap(): ?int + * 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 $memorySwap - * - * @return self - */ - public function setMemorySwap(?int $memorySwap): self + * 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 - */ - public function getMemorySwappiness(): ?int + * 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 $memorySwappiness - * - * @return self - */ - public function setMemorySwappiness(?int $memorySwappiness): self + * 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 + * @return int|null */ - public function getNanoCPUs(): ?int + public function getNanoCpus() : ?int { - return $this->nanoCPUs; + return $this->nanoCpus; } - /** * CPU quota in units of 10-9 CPUs. * - * @param int $nanoCPUs + * @param int|null $nanoCpus * * @return self */ - public function setNanoCPUs(?int $nanoCPUs): self + public function setNanoCpus(?int $nanoCpus) : self { - $this->nanoCPUs = $nanoCPUs; - + $this->initialized['nanoCpus'] = true; + $this->nanoCpus = $nanoCpus; return $this; } - /** * Disable OOM Killer for the container. * - * @return bool + * @return bool|null */ - public function getOomKillDisable(): ?bool + public function getOomKillDisable() : ?bool { return $this->oomKillDisable; } - /** * Disable OOM Killer for the container. * - * @param bool $oomKillDisable + * @param bool|null $oomKillDisable * * @return self */ - public function setOomKillDisable(?bool $oomKillDisable): self + public function setOomKillDisable(?bool $oomKillDisable) : self { + $this->initialized['oomKillDisable'] = true; $this->oomKillDisable = $oomKillDisable; - return $this; } - /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @return int - */ - public function getPidsLimit(): ?int + * 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->pidsLimit; + return $this->init; } - /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @param int $pidsLimit - * - * @return self - */ - public function setPidsLimit(?int $pidsLimit): self + * 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 ResourcesUlimitsItem[] - */ - public function getUlimits(): ?array + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @return ResourcesUlimitsItem[]|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 ResourcesUlimitsItem[] $ulimits - * - * @return self - */ - public function setUlimits(?array $ulimits): self - { + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @param ResourcesUlimitsItem[]|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 - */ - public function getCpuCount(): ?int + * 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 $cpuCount - * - * @return self - */ - public function setCpuCount(?int $cpuCount): self - { + * 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 - */ - public function getCpuPercent(): ?int + * 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 $cpuPercent - * - * @return self - */ - public function setCpuPercent(?int $cpuPercent): self - { + * 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). + * Maximum IOps for the container system drive (Windows only) * - * @return int + * @return int|null */ - public function getIOMaximumIOps(): ?int + public function getIOMaximumIOps() : ?int { return $this->iOMaximumIOps; } - /** - * Maximum IOps for the container system drive (Windows only). + * Maximum IOps for the container system drive (Windows only) * - * @param int $iOMaximumIOps + * @param int|null $iOMaximumIOps * * @return self */ - public function setIOMaximumIOps(?int $iOMaximumIOps): 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 - */ - public function getIOMaximumBandwidth(): ?int + * 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 $iOMaximumBandwidth - * - * @return self - */ - public function setIOMaximumBandwidth(?int $iOMaximumBandwidth): self + * 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` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `host-src:container-dest:ro` to make the bind mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. - - `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path. - - * - * @return string[] - */ - public function getBinds(): ?array + * 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 string[]|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` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `host-src:container-dest:ro` to make the bind mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. - - `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path. - - * - * @param string[] $binds - * - * @return self - */ - public function setBinds(?array $binds): self - { + * 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 string[]|null $binds + * + * @return self + */ + public function setBinds(?array $binds) : self + { + $this->initialized['binds'] = true; $this->binds = $binds; - return $this; } - /** - * Path to a file where the container ID is written. + * Path to a file where the container ID is written * - * @return string + * @return string|null */ - public function getContainerIDFile(): ?string + public function getContainerIDFile() : ?string { return $this->containerIDFile; } - /** - * Path to a file where the container ID is written. + * Path to a file where the container ID is written * - * @param string $containerIDFile + * @param string|null $containerIDFile * * @return self */ - public function setContainerIDFile(?string $containerIDFile): self + public function setContainerIDFile(?string $containerIDFile) : self { + $this->initialized['containerIDFile'] = true; $this->containerIDFile = $containerIDFile; - return $this; } - /** - * The logging configuration for this container. + * The logging configuration for this container * - * @return HostConfigLogConfig + * @return HostConfigLogConfig|null */ - public function getLogConfig(): ?HostConfigLogConfig + public function getLogConfig() : ?HostConfigLogConfig { return $this->logConfig; } - /** - * The logging configuration for this container. + * The logging configuration for this container * - * @param HostConfigLogConfig $logConfig + * @param HostConfigLogConfig|null $logConfig * * @return self */ - public function setLogConfig(?HostConfigLogConfig $logConfig): self + public function setLogConfig(?HostConfigLogConfig $logConfig) : self { + $this->initialized['logConfig'] = true; $this->logConfig = $logConfig; - return $this; } - /** - * 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 - */ - public function getNetworkMode(): ?string + * 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->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 $networkMode - * - * @return self - */ - public function setNetworkMode(?string $networkMode): self + * 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. + * 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 both `tcp` and `udp`, two separate - entries are added to the mapping table. - - * - * @return PortBinding[][] - */ - public function getPortBindings(): ?\ArrayObject + + 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. + * 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 both `tcp` and `udp`, two separate - entries are added to the mapping table. - - * - * @param PortBinding[][] $portBindings - * - * @return self - */ - public function setPortBindings(?\ArrayObject $portBindings): self - { + + 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 - */ - public function getRestartPolicy(): ?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. + + * + * @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 $restartPolicy - * - * @return self - */ - public function setRestartPolicy(?RestartPolicy $restartPolicy): self - { + * 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 - */ - public function getAutoRemove(): ?bool + * 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; } - /** - * Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set. - * - * @param bool $autoRemove - * - * @return self - */ - public function setAutoRemove(?bool $autoRemove): self + * 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->initialized['autoRemove'] = true; $this->autoRemove = $autoRemove; - return $this; } - /** * Driver that this container uses to mount volumes. * - * @return string + * @return string|null */ - public function getVolumeDriver(): ?string + public function getVolumeDriver() : ?string { return $this->volumeDriver; } - /** * Driver that this container uses to mount volumes. * - * @param string $volumeDriver + * @param string|null $volumeDriver * * @return self */ - public function setVolumeDriver(?string $volumeDriver): self + public function setVolumeDriver(?string $volumeDriver) : self { + $this->initialized['volumeDriver'] = true; $this->volumeDriver = $volumeDriver; - return $this; } - /** - * A list of volumes to inherit from another container, specified in the form `[:]`. - * - * @return string[] - */ - public function getVolumesFrom(): ?array + * A list of volumes to inherit from another container, specified in + the form `[:]`. + + * + * @return string[]|null + */ + public function getVolumesFrom() : ?array { return $this->volumesFrom; } - /** - * A list of volumes to inherit from another container, specified in the form `[:]`. - * - * @param string[] $volumesFrom - * - * @return self - */ - public function setVolumesFrom(?array $volumesFrom): self + * A list of volumes to inherit from another container, specified in + the form `[:]`. + + * + * @param string[]|null $volumesFrom + * + * @return self + */ + public function setVolumesFrom(?array $volumesFrom) : self { + $this->initialized['volumesFrom'] = true; $this->volumesFrom = $volumesFrom; - return $this; } - /** * Specification for mounts to be added to the container. * - * @return Mount[] + * @return Mount[]|null */ - public function getMounts(): ?array + public function getMounts() : ?array { return $this->mounts; } - /** * Specification for mounts to be added to the container. * - * @param Mount[] $mounts + * @param Mount[]|null $mounts * * @return self */ - public function setMounts(?array $mounts): self + public function setMounts(?array $mounts) : self { + $this->initialized['mounts'] = true; $this->mounts = $mounts; - return $this; } - /** - * A list of kernel capabilities to add to the container. + * Initial console size, as an `[height, width]` array. * - * @return string[] + * @return int[]|null */ - public function getCapAdd(): ?array + public function getConsoleSize() : ?array { - return $this->capAdd; + return $this->consoleSize; } - /** - * A list of kernel capabilities to add to the container. + * Initial console size, as an `[height, width]` array. * - * @param string[] $capAdd + * @param int[]|null $consoleSize * * @return self */ - public function setCapAdd(?array $capAdd): self + public function setConsoleSize(?array $consoleSize) : self { + $this->initialized['consoleSize'] = true; + $this->consoleSize = $consoleSize; + return $this; + } + /** + * 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->annotations; + } + /** + * 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->initialized['annotations'] = true; + $this->annotations = $annotations; + return $this; + } + /** + * A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + + * + * @return string[]|null + */ + public function getCapAdd() : ?array + { + return $this->capAdd; + } + /** + * A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + + * + * @param string[]|null $capAdd + * + * @return self + */ + public function setCapAdd(?array $capAdd) : self + { + $this->initialized['capAdd'] = true; $this->capAdd = $capAdd; - return $this; } - /** - * A list of kernel capabilities to drop from the container. - * - * @return string[] - */ - public function getCapDrop(): ?array + * A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + + * + * @return string[]|null + */ + public function getCapDrop() : ?array { return $this->capDrop; } - /** - * A list of kernel capabilities to drop from the container. - * - * @param string[] $capDrop - * - * @return self - */ - public function setCapDrop(?array $capDrop): self + * A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + + * + * @param string[]|null $capDrop + * + * @return self + */ + public function setCapDrop(?array $capDrop) : self { + $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; + } /** * A list of DNS servers for the container to use. * - * @return string[] + * @return string[]|null */ - public function getDns(): ?array + public function getDns() : ?array { return $this->dns; } - /** * A list of DNS servers for the container to use. * - * @param string[] $dns + * @param string[]|null $dns * * @return self */ - public function setDns(?array $dns): self + public function setDns(?array $dns) : self { + $this->initialized['dns'] = true; $this->dns = $dns; - return $this; } - /** * A list of DNS options. * - * @return string[] + * @return string[]|null */ - public function getDnsOptions(): ?array + public function getDnsOptions() : ?array { return $this->dnsOptions; } - /** * A list of DNS options. * - * @param string[] $dnsOptions + * @param string[]|null $dnsOptions * * @return self */ - public function setDnsOptions(?array $dnsOptions): self + public function setDnsOptions(?array $dnsOptions) : self { + $this->initialized['dnsOptions'] = true; $this->dnsOptions = $dnsOptions; - return $this; } - /** * A list of DNS search domains. * - * @return string[] + * @return string[]|null */ - public function getDnsSearch(): ?array + public function getDnsSearch() : ?array { return $this->dnsSearch; } - /** * A list of DNS search domains. * - * @param string[] $dnsSearch + * @param string[]|null $dnsSearch * * @return self */ - public function setDnsSearch(?array $dnsSearch): self + public function setDnsSearch(?array $dnsSearch) : self { + $this->initialized['dnsSearch'] = true; $this->dnsSearch = $dnsSearch; - return $this; } - /** - * A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. - * - * @return string[] - */ - public function getExtraHosts(): ?array + * A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + + * + * @return string[]|null + */ + public function getExtraHosts() : ?array { return $this->extraHosts; } - /** - * A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. - * - * @param string[] $extraHosts - * - * @return self - */ - public function setExtraHosts(?array $extraHosts): self + * A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + + * + * @param string[]|null $extraHosts + * + * @return self + */ + public function setExtraHosts(?array $extraHosts) : self { + $this->initialized['extraHosts'] = true; $this->extraHosts = $extraHosts; - return $this; } - /** * A list of additional groups that the container process will run as. * - * @return string[] + * @return string[]|null */ - public function getGroupAdd(): ?array + public function getGroupAdd() : ?array { return $this->groupAdd; } - /** * A list of additional groups that the container process will run as. * - * @param string[] $groupAdd + * @param string[]|null $groupAdd * * @return self */ - public function setGroupAdd(?array $groupAdd): self + public function setGroupAdd(?array $groupAdd) : self { + $this->initialized['groupAdd'] = true; $this->groupAdd = $groupAdd; - return $this; } - /** - * IPC sharing mode for the container. Possible values are:. - + * 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 - */ - public function getIpcMode(): ?string + + * + * @return string|null + */ + public function getIpcMode() : ?string { return $this->ipcMode; } - /** - * IPC sharing mode for the container. Possible values are:. - + * 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 $ipcMode - * - * @return self - */ - public function setIpcMode(?string $ipcMode): self - { + + * + * @param string|null $ipcMode + * + * @return self + */ + public function setIpcMode(?string $ipcMode) : self + { + $this->initialized['ipcMode'] = true; $this->ipcMode = $ipcMode; - return $this; } - /** * Cgroup to use for the container. * - * @return string + * @return string|null */ - public function getCgroup(): ?string + public function getCgroup() : ?string { return $this->cgroup; } - /** * Cgroup to use for the container. * - * @param string $cgroup + * @param string|null $cgroup * * @return self */ - public function setCgroup(?string $cgroup): self + public function setCgroup(?string $cgroup) : self { + $this->initialized['cgroup'] = true; $this->cgroup = $cgroup; - return $this; } - /** * A list of links for the container in the form `container_name:alias`. * - * @return string[] + * @return string[]|null */ - public function getLinks(): ?array + public function getLinks() : ?array { return $this->links; } - /** * A list of links for the container in the form `container_name:alias`. * - * @param string[] $links + * @param string[]|null $links * * @return self */ - public function setLinks(?array $links): self + public function setLinks(?array $links) : self { + $this->initialized['links'] = true; $this->links = $links; - return $this; } - /** - * An integer value containing the score given to the container in order to tune OOM killer preferences. - * - * @return int - */ - public function getOomScoreAdj(): ?int + * 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 $oomScoreAdj - * - * @return self - */ - public function setOomScoreAdj(?int $oomScoreAdj): self + * 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; } - /** - * Set the PID (Process) Namespace mode for the container. It can be either:. - + * 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 - */ - public function getPidMode(): ?string + + * + * @return string|null + */ + public function getPidMode() : ?string { return $this->pidMode; } - /** - * Set the PID (Process) Namespace mode for the container. It can be either:. - + * 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 $pidMode - * - * @return self - */ - public function setPidMode(?string $pidMode): self - { + + * + * @param string|null $pidMode + * + * @return self + */ + public function setPidMode(?string $pidMode) : self + { + $this->initialized['pidMode'] = true; $this->pidMode = $pidMode; - return $this; } - /** * Gives the container full access to the host. * - * @return bool + * @return bool|null */ - public function getPrivileged(): ?bool + public function getPrivileged() : ?bool { return $this->privileged; } - /** * Gives the container full access to the host. * - * @param bool $privileged + * @param bool|null $privileged * * @return self */ - public function setPrivileged(?bool $privileged): self + public function setPrivileged(?bool $privileged) : self { + $this->initialized['privileged'] = true; $this->privileged = $privileged; - return $this; } - /** - * Allocates an ephemeral host port for all of a container's. + * 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 - */ - public function getPublishAllPorts(): ?bool + + 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. + * 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 $publishAllPorts - * - * @return self - */ - public function setPublishAllPorts(?bool $publishAllPorts): self - { + + 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; } - /** * Mount the container's root filesystem as read only. * - * @return bool + * @return bool|null */ - public function getReadonlyRootfs(): ?bool + public function getReadonlyRootfs() : ?bool { return $this->readonlyRootfs; } - /** * Mount the container's root filesystem as read only. * - * @param bool $readonlyRootfs + * @param bool|null $readonlyRootfs * * @return self */ - public function setReadonlyRootfs(?bool $readonlyRootfs): self + public function setReadonlyRootfs(?bool $readonlyRootfs) : self { + $this->initialized['readonlyRootfs'] = true; $this->readonlyRootfs = $readonlyRootfs; - return $this; } - /** - * A list of string values to customize labels for MLS systems, such as SELinux. - * - * @return string[] - */ - public function getSecurityOpt(): ?array + * A list of string values to customize labels for MLS systems, such + as SELinux. + + * + * @return string[]|null + */ + public function getSecurityOpt() : ?array { return $this->securityOpt; } - /** - * A list of string values to customize labels for MLS systems, such as SELinux. - * - * @param string[] $securityOpt - * - * @return self - */ - public function setSecurityOpt(?array $securityOpt): self + * A list of string values to customize labels for MLS systems, such + as SELinux. + + * + * @param string[]|null $securityOpt + * + * @return self + */ + public function setSecurityOpt(?array $securityOpt) : self { + $this->initialized['securityOpt'] = true; $this->securityOpt = $securityOpt; - return $this; } - /** * Storage driver options for this container, in the form `{"size": "120G"}`. * - * @return string[] + * @return array|null */ - public function getStorageOpt(): ?\ArrayObject + public function getStorageOpt() : ?iterable { return $this->storageOpt; } - /** * Storage driver options for this container, in the form `{"size": "120G"}`. * - * @param string[] $storageOpt + * @param array|null $storageOpt * * @return self */ - public function setStorageOpt(?\ArrayObject $storageOpt): self + public function setStorageOpt(?iterable $storageOpt) : self { + $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 string[] - */ - public function getTmpfs(): ?\ArrayObject + * 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 string[] $tmpfs - * - * @return self - */ - public function setTmpfs(?\ArrayObject $tmpfs): self - { + * 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; } - /** * UTS namespace to use for the container. * - * @return string + * @return string|null */ - public function getUTSMode(): ?string + public function getUTSMode() : ?string { return $this->uTSMode; } - /** * UTS namespace to use for the container. * - * @param string $uTSMode + * @param string|null $uTSMode * * @return self */ - public function setUTSMode(?string $uTSMode): self + public function setUTSMode(?string $uTSMode) : self { + $this->initialized['uTSMode'] = true; $this->uTSMode = $uTSMode; - return $this; } - /** - * Sets the usernamespace mode for the container when usernamespace remapping option is enabled. - * - * @return string - */ - public function getUsernsMode(): ?string + * Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + + * + * @return string|null + */ + public function getUsernsMode() : ?string { return $this->usernsMode; } - /** - * Sets the usernamespace mode for the container when usernamespace remapping option is enabled. - * - * @param string $usernsMode - * - * @return self - */ - public function setUsernsMode(?string $usernsMode): self + * 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->initialized['usernsMode'] = true; $this->usernsMode = $usernsMode; - return $this; } - /** * Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. * - * @return int + * @return int|null */ - public function getShmSize(): ?int + public function getShmSize() : ?int { return $this->shmSize; } - /** * Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. * - * @param int $shmSize + * @param int|null $shmSize * * @return self */ - public function setShmSize(?int $shmSize): self + public function setShmSize(?int $shmSize) : self { + $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 string[] - */ - public function getSysctls(): ?\ArrayObject + * 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 string[] $sysctls - * - * @return self - */ - public function setSysctls(?\ArrayObject $sysctls): self - { + * 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; } - /** * Runtime to use with this container. * - * @return string + * @return string|null */ - public function getRuntime(): ?string + public function getRuntime() : ?string { return $this->runtime; } - /** * Runtime to use with this container. * - * @param string $runtime + * @param string|null $runtime * * @return self */ - public function setRuntime(?string $runtime): self + public function setRuntime(?string $runtime) : self { + $this->initialized['runtime'] = true; $this->runtime = $runtime; - return $this; } - /** - * Initial console size, as an `[height, width]` array. (Windows only). + * Isolation technology of the container. (Windows only) * - * @return int[] + * @return string|null */ - public function getConsoleSize(): ?array + public function getIsolation() : ?string { - return $this->consoleSize; + return $this->isolation; } - /** - * Initial console size, as an `[height, width]` array. (Windows only). + * Isolation technology of the container. (Windows only) * - * @param int[] $consoleSize + * @param string|null $isolation * * @return self */ - public function setConsoleSize(?array $consoleSize): self + public function setIsolation(?string $isolation) : self { - $this->consoleSize = $consoleSize; - + $this->initialized['isolation'] = true; + $this->isolation = $isolation; return $this; } - /** - * Isolation technology of the container. (Windows only). - * - * @return string - */ - public function getIsolation(): ?string + * The list of paths to be masked inside the container (this overrides + the default set of paths). + + * + * @return string[]|null + */ + public function getMaskedPaths() : ?array { - return $this->isolation; + return $this->maskedPaths; } - /** - * Isolation technology of the container. (Windows only). - * - * @param string $isolation - * - * @return self - */ - public function setIsolation(?string $isolation): self + * The list of paths to be masked inside the container (this overrides + the default set of paths). + + * + * @param string[]|null $maskedPaths + * + * @return self + */ + public function setMaskedPaths(?array $maskedPaths) : self { - $this->isolation = $isolation; - + $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 string[]|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 string[]|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/src/Model/HostConfigLogConfig.php b/src/Model/HostConfigLogConfig.php index bf5a5951..5737e24d 100644 --- a/src/Model/HostConfigLogConfig.php +++ b/src/Model/HostConfigLogConfig.php @@ -1,63 +1,71 @@ initialized); + } + /** + * + * + * @var string|null */ protected $type; /** - * @var string[] + * + * + * @var array|null */ protected $config; - /** - * @return string + * + * + * @return string|null */ - public function getType(): ?string + public function getType() : ?string { return $this->type; } - /** - * @param string $type + * + * + * @param string|null $type * * @return self */ - public function setType(?string $type): self + public function setType(?string $type) : self { + $this->initialized['type'] = true; $this->type = $type; - return $this; } - /** - * @return string[] + * + * + * @return array|null */ - public function getConfig(): ?\ArrayObject + public function getConfig() : ?iterable { return $this->config; } - /** - * @param string[] $config + * + * + * @param array|null $config * * @return self */ - public function setConfig(?\ArrayObject $config): 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/src/Model/IPAM.php b/src/Model/IPAM.php index 16748ff1..2114599c 100644 --- a/src/Model/IPAM.php +++ b/src/Model/IPAM.php @@ -1,105 +1,114 @@ initialized); + } /** - * List of IPAM configuration options, specified as a map: `{"Subnet": , "IPRange": , "Gateway": , "AuxAddress": }`. + * Name of the IPAM driver to use. * - * @var string[][] + * @var string|null */ + protected $driver = 'default'; + /** + * List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": , "IPRange": , "Gateway": , "AuxAddress": } + ``` + + * + * @var IPAMConfig[]|null + */ protected $config; /** * Driver-specific options, specified as a map. * - * @var string[][] + * @var array|null */ protected $options; - /** * Name of the IPAM driver to use. * - * @return string + * @return string|null */ - public function getDriver(): ?string + public function getDriver() : ?string { return $this->driver; } - /** * Name of the IPAM driver to use. * - * @param string $driver + * @param string|null $driver * * @return self */ - public function setDriver(?string $driver): self + public function setDriver(?string $driver) : self { + $this->initialized['driver'] = true; $this->driver = $driver; - return $this; } - /** - * List of IPAM configuration options, specified as a map: `{"Subnet": , "IPRange": , "Gateway": , "AuxAddress": }`. - * - * @return string[][] - */ - public function getConfig(): ?array + * List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": , "IPRange": , "Gateway": , "AuxAddress": } + ``` + + * + * @return IPAMConfig[]|null + */ + public function getConfig() : ?array { return $this->config; } - /** - * List of IPAM configuration options, specified as a map: `{"Subnet": , "IPRange": , "Gateway": , "AuxAddress": }`. - * - * @param string[][] $config - * - * @return self - */ - public function setConfig(?array $config): self + * List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": , "IPRange": , "Gateway": , "AuxAddress": } + ``` + + * + * @param IPAMConfig[]|null $config + * + * @return self + */ + public function setConfig(?array $config) : self { + $this->initialized['config'] = true; $this->config = $config; - return $this; } - /** * Driver-specific options, specified as a map. * - * @return string[][] + * @return array|null */ - public function getOptions(): ?array + public function getOptions() : ?iterable { return $this->options; } - /** * Driver-specific options, specified as a map. * - * @param string[][] $options + * @param array|null $options * * @return self */ - public function setOptions(?array $options): 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/src/Model/IPAMConfig.php b/src/Model/IPAMConfig.php new file mode 100644 index 00000000..38152514 --- /dev/null +++ b/src/Model/IPAMConfig.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $subnet; + /** + * + * + * @var string|null + */ + protected $iPRange; + /** + * + * + * @var string|null + */ + protected $gateway; + /** + * + * + * @var array|null + */ + protected $auxiliaryAddresses; + /** + * + * + * @return string|null + */ + public function getSubnet() : ?string + { + return $this->subnet; + } + /** + * + * + * @param string|null $subnet + * + * @return self + */ + public function setSubnet(?string $subnet) : self + { + $this->initialized['subnet'] = true; + $this->subnet = $subnet; + return $this; + } + /** + * + * + * @return string|null + */ + public function getIPRange() : ?string + { + return $this->iPRange; + } + /** + * + * + * @param string|null $iPRange + * + * @return self + */ + public function setIPRange(?string $iPRange) : self + { + $this->initialized['iPRange'] = true; + $this->iPRange = $iPRange; + return $this; + } + /** + * + * + * @return string|null + */ + public function getGateway() : ?string + { + return $this->gateway; + } + /** + * + * + * @param string|null $gateway + * + * @return self + */ + 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/src/Model/IdResponse.php b/src/Model/IdResponse.php index 776c0fd5..c5de292d 100644 --- a/src/Model/IdResponse.php +++ b/src/Model/IdResponse.php @@ -1,45 +1,43 @@ initialized); + } /** * The id of the newly created object. * - * @var string + * @var string|null */ protected $id; - /** * The id of the newly created object. * - * @return string + * @return string|null */ - public function getId(): ?string + public function getId() : ?string { return $this->id; } - /** * The id of the newly created object. * - * @param string $id + * @param string|null $id * * @return self */ - public function setId(?string $id): 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/src/Model/Image.php b/src/Model/Image.php deleted file mode 100644 index 56385858..00000000 --- a/src/Model/Image.php +++ /dev/null @@ -1,489 +0,0 @@ -id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId(?string $id): self - { - $this->id = $id; - - return $this; - } - - /** - * @return string[] - */ - public function getRepoTags(): ?array - { - return $this->repoTags; - } - - /** - * @param string[] $repoTags - * - * @return self - */ - public function setRepoTags(?array $repoTags): self - { - $this->repoTags = $repoTags; - - return $this; - } - - /** - * @return string[] - */ - public function getRepoDigests(): ?array - { - return $this->repoDigests; - } - - /** - * @param string[] $repoDigests - * - * @return self - */ - public function setRepoDigests(?array $repoDigests): self - { - $this->repoDigests = $repoDigests; - - return $this; - } - - /** - * @return string - */ - public function getParent(): ?string - { - return $this->parent; - } - - /** - * @param string $parent - * - * @return self - */ - public function setParent(?string $parent): self - { - $this->parent = $parent; - - return $this; - } - - /** - * @return string - */ - public function getComment(): ?string - { - return $this->comment; - } - - /** - * @param string $comment - * - * @return self - */ - public function setComment(?string $comment): self - { - $this->comment = $comment; - - return $this; - } - - /** - * @return string - */ - public function getCreated(): ?string - { - return $this->created; - } - - /** - * @param string $created - * - * @return self - */ - public function setCreated(?string $created): self - { - $this->created = $created; - - return $this; - } - - /** - * @return string - */ - public function getContainer(): ?string - { - return $this->container; - } - - /** - * @param string $container - * - * @return self - */ - public function setContainer(?string $container): self - { - $this->container = $container; - - return $this; - } - - /** - * Configuration for a container that is portable between hosts. - * - * @return ContainerConfig - */ - public function getContainerConfig(): ?ContainerConfig - { - return $this->containerConfig; - } - - /** - * Configuration for a container that is portable between hosts. - * - * @param ContainerConfig $containerConfig - * - * @return self - */ - public function setContainerConfig(?ContainerConfig $containerConfig): self - { - $this->containerConfig = $containerConfig; - - return $this; - } - - /** - * @return string - */ - public function getDockerVersion(): ?string - { - return $this->dockerVersion; - } - - /** - * @param string $dockerVersion - * - * @return self - */ - public function setDockerVersion(?string $dockerVersion): self - { - $this->dockerVersion = $dockerVersion; - - return $this; - } - - /** - * @return string - */ - public function getAuthor(): ?string - { - return $this->author; - } - - /** - * @param string $author - * - * @return self - */ - public function setAuthor(?string $author): self - { - $this->author = $author; - - return $this; - } - - /** - * Configuration for a container that is portable between hosts. - * - * @return ContainerConfig - */ - public function getConfig(): ?ContainerConfig - { - return $this->config; - } - - /** - * Configuration for a container that is portable between hosts. - * - * @param ContainerConfig $config - * - * @return self - */ - public function setConfig(?ContainerConfig $config): self - { - $this->config = $config; - - return $this; - } - - /** - * @return string - */ - public function getArchitecture(): ?string - { - return $this->architecture; - } - - /** - * @param string $architecture - * - * @return self - */ - public function setArchitecture(?string $architecture): self - { - $this->architecture = $architecture; - - return $this; - } - - /** - * @return string - */ - public function getOs(): ?string - { - return $this->os; - } - - /** - * @param string $os - * - * @return self - */ - public function setOs(?string $os): self - { - $this->os = $os; - - return $this; - } - - /** - * @return string - */ - public function getOsVersion(): ?string - { - return $this->osVersion; - } - - /** - * @param string $osVersion - * - * @return self - */ - public function setOsVersion(?string $osVersion): self - { - $this->osVersion = $osVersion; - - return $this; - } - - /** - * @return int - */ - public function getSize(): ?int - { - return $this->size; - } - - /** - * @param int $size - * - * @return self - */ - public function setSize(?int $size): self - { - $this->size = $size; - - return $this; - } - - /** - * @return int - */ - public function getVirtualSize(): ?int - { - return $this->virtualSize; - } - - /** - * @param int $virtualSize - * - * @return self - */ - public function setVirtualSize(?int $virtualSize): self - { - $this->virtualSize = $virtualSize; - - return $this; - } - - /** - * Information about a container's graph driver. - * - * @return GraphDriverData - */ - public function getGraphDriver(): ?GraphDriverData - { - return $this->graphDriver; - } - - /** - * Information about a container's graph driver. - * - * @param GraphDriverData $graphDriver - * - * @return self - */ - public function setGraphDriver(?GraphDriverData $graphDriver): self - { - $this->graphDriver = $graphDriver; - - return $this; - } - - /** - * @return ImageRootFS - */ - public function getRootFS(): ?ImageRootFS - { - return $this->rootFS; - } - - /** - * @param ImageRootFS $rootFS - * - * @return self - */ - public function setRootFS(?ImageRootFS $rootFS): self - { - $this->rootFS = $rootFS; - - return $this; - } - - /** - * @return ImageMetadata - */ - public function getMetadata(): ?ImageMetadata - { - return $this->metadata; - } - - /** - * @param ImageMetadata $metadata - * - * @return self - */ - public function setMetadata(?ImageMetadata $metadata): self - { - $this->metadata = $metadata; - - return $this; - } -} diff --git a/src/Model/ImageDeleteResponseItem.php b/src/Model/ImageDeleteResponseItem.php index 2ef278d1..8193958a 100644 --- a/src/Model/ImageDeleteResponseItem.php +++ b/src/Model/ImageDeleteResponseItem.php @@ -1,75 +1,71 @@ initialized); + } + /** + * The image ID of an image that was untagged * - * @var string + * @var string|null */ protected $untagged; /** - * The image ID of an image that was deleted. + * The image ID of an image that was deleted * - * @var string + * @var string|null */ protected $deleted; - /** - * The image ID of an image that was untagged. + * The image ID of an image that was untagged * - * @return string + * @return string|null */ - public function getUntagged(): ?string + public function getUntagged() : ?string { return $this->untagged; } - /** - * The image ID of an image that was untagged. + * The image ID of an image that was untagged * - * @param string $untagged + * @param string|null $untagged * * @return self */ - public function setUntagged(?string $untagged): 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. + * The image ID of an image that was deleted * - * @return string + * @return string|null */ - public function getDeleted(): ?string + public function getDeleted() : ?string { return $this->deleted; } - /** - * The image ID of an image that was deleted. + * The image ID of an image that was deleted * - * @param string $deleted + * @param string|null $deleted * * @return self */ - public function setDeleted(?string $deleted): 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/src/Model/ImageID.php b/src/Model/ImageID.php index c398e6d5..8379e836 100644 --- a/src/Model/ImageID.php +++ b/src/Model/ImageID.php @@ -1,39 +1,43 @@ initialized); + } + /** + * + * + * @var string|null */ protected $iD; - /** - * @return string + * + * + * @return string|null */ - public function getID(): ?string + public function getID() : ?string { return $this->iD; } - /** - * @param string $iD + * + * + * @param string|null $iD * * @return self */ - public function setID(?string $iD): 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/src/Model/ImageInspect.php b/src/Model/ImageInspect.php new file mode 100644 index 00000000..ba70a2ea --- /dev/null +++ b/src/Model/ImageInspect.php @@ -0,0 +1,776 @@ +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 string[]|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 string[]|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. + + * + * @var string|null + */ + protected $created; + /** + * The ID of the container that was used to create the image. + + Depending on how the image was created, this field may be empty. + + * + * @var string|null + */ + protected $container; + /** + * Configuration for a container that is portable between hosts. + + When used as `ContainerConfig` field in an image, `ContainerConfig` is an + optional field containing the configuration of the container that was last + committed when creating the image. + + Previous versions of Docker builder used this field to store build cache, + and it is not in active use anymore. + + * + * @var ContainerConfig|null + */ + protected $containerConfig; + /** + * 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 for a container that is portable between hosts. + + When used as `ContainerConfig` field in an image, `ContainerConfig` is an + optional field containing the configuration of the container that was last + committed when creating the image. + + Previous versions of Docker builder used this field to store build cache, + and it is not in active use anymore. + + * + * @var ContainerConfig|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. + + In versions of Docker before v1.10, this field was calculated from + the image itself and all of its parent images. Images are now stored + self-contained, and no longer use a parent-chain, making this field + an equivalent of the Size field. + + > **Deprecated**: this field is kept for backward compatibility, but + > will be removed in API v1.44. + + * + * @var int|null + */ + protected $virtualSize; + /** + * Information about the storage driver used to store the container's and + image's filesystem. + + * + * @var GraphDriverData|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 string[]|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 string[]|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 string[]|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 string[]|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. + + * + * @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. + + * + * @param string|null $created + * + * @return self + */ + public function setCreated(?string $created) : self + { + $this->initialized['created'] = true; + $this->created = $created; + return $this; + } + /** + * The ID of the container that was used to create the image. + + Depending on how the image was created, this field may be empty. + + * + * @return string|null + */ + public function getContainer() : ?string + { + return $this->container; + } + /** + * The ID of the container that was used to create the image. + + Depending on how the image was created, this field may be empty. + + * + * @param string|null $container + * + * @return self + */ + public function setContainer(?string $container) : self + { + $this->initialized['container'] = true; + $this->container = $container; + return $this; + } + /** + * Configuration for a container that is portable between hosts. + + When used as `ContainerConfig` field in an image, `ContainerConfig` is an + optional field containing the configuration of the container that was last + committed when creating the image. + + Previous versions of Docker builder used this field to store build cache, + and it is not in active use anymore. + + * + * @return ContainerConfig|null + */ + public function getContainerConfig() : ?ContainerConfig + { + return $this->containerConfig; + } + /** + * Configuration for a container that is portable between hosts. + + When used as `ContainerConfig` field in an image, `ContainerConfig` is an + optional field containing the configuration of the container that was last + committed when creating the image. + + Previous versions of Docker builder used this field to store build cache, + and it is not in active use anymore. + + * + * @param ContainerConfig|null $containerConfig + * + * @return self + */ + public function setContainerConfig(?ContainerConfig $containerConfig) : self + { + $this->initialized['containerConfig'] = true; + $this->containerConfig = $containerConfig; + 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 for a container that is portable between hosts. + + When used as `ContainerConfig` field in an image, `ContainerConfig` is an + optional field containing the configuration of the container that was last + committed when creating the image. + + Previous versions of Docker builder used this field to store build cache, + and it is not in active use anymore. + + * + * @return ContainerConfig|null + */ + public function getConfig() : ?ContainerConfig + { + return $this->config; + } + /** + * Configuration for a container that is portable between hosts. + + When used as `ContainerConfig` field in an image, `ContainerConfig` is an + optional field containing the configuration of the container that was last + committed when creating the image. + + Previous versions of Docker builder used this field to store build cache, + and it is not in active use anymore. + + * + * @param ContainerConfig|null $config + * + * @return self + */ + public function setConfig(?ContainerConfig $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. + + In versions of Docker before v1.10, this field was calculated from + the image itself and all of its parent images. Images are now stored + self-contained, and no longer use a parent-chain, making this field + an equivalent of the Size field. + + > **Deprecated**: this field is kept for backward compatibility, but + > will be removed in API v1.44. + + * + * @return int|null + */ + public function getVirtualSize() : ?int + { + return $this->virtualSize; + } + /** + * Total size of the image including all layers it is composed of. + + In versions of Docker before v1.10, this field was calculated from + the image itself and all of its parent images. Images are now stored + self-contained, and no longer use a parent-chain, making this field + an equivalent of the Size field. + + > **Deprecated**: this field is kept for backward compatibility, but + > will be removed in API v1.44. + + * + * @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 GraphDriverData|null + */ + public function getGraphDriver() : ?GraphDriverData + { + return $this->graphDriver; + } + /** + * Information about the storage driver used to store the container's and + image's filesystem. + + * + * @param GraphDriverData|null $graphDriver + * + * @return self + */ + public function setGraphDriver(?GraphDriverData $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/src/Model/ImageInspectMetadata.php b/src/Model/ImageInspectMetadata.php new file mode 100644 index 00000000..7b1bc292 --- /dev/null +++ b/src/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/src/Model/ImageInspectRootFS.php b/src/Model/ImageInspectRootFS.php new file mode 100644 index 00000000..6a475616 --- /dev/null +++ b/src/Model/ImageInspectRootFS.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $type; + /** + * + * + * @var string[]|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 string[]|null + */ + public function getLayers() : ?array + { + return $this->layers; + } + /** + * + * + * @param string[]|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/src/Model/ImageMetadata.php b/src/Model/ImageMetadata.php deleted file mode 100644 index 755df0a0..00000000 --- a/src/Model/ImageMetadata.php +++ /dev/null @@ -1,39 +0,0 @@ -lastTagTime; - } - - /** - * @param string $lastTagTime - * - * @return self - */ - public function setLastTagTime(?string $lastTagTime): self - { - $this->lastTagTime = $lastTagTime; - - return $this; - } -} diff --git a/src/Model/ImageRootFS.php b/src/Model/ImageRootFS.php deleted file mode 100644 index 99e1d618..00000000 --- a/src/Model/ImageRootFS.php +++ /dev/null @@ -1,87 +0,0 @@ -type; - } - - /** - * @param string $type - * - * @return self - */ - public function setType(?string $type): self - { - $this->type = $type; - - return $this; - } - - /** - * @return string[] - */ - public function getLayers(): ?array - { - return $this->layers; - } - - /** - * @param string[] $layers - * - * @return self - */ - public function setLayers(?array $layers): self - { - $this->layers = $layers; - - return $this; - } - - /** - * @return string - */ - public function getBaseLayer(): ?string - { - return $this->baseLayer; - } - - /** - * @param string $baseLayer - * - * @return self - */ - public function setBaseLayer(?string $baseLayer): self - { - $this->baseLayer = $baseLayer; - - return $this; - } -} diff --git a/src/Model/ImageSummary.php b/src/Model/ImageSummary.php index 12cba8db..ebedaf69 100644 --- a/src/Model/ImageSummary.php +++ b/src/Model/ImageSummary.php @@ -1,255 +1,430 @@ 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; /** - * @var string - */ + * 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; /** - * @var string[] - */ + * 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 string[]|null + */ protected $repoTags; /** - * @var string[] - */ + * 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 string[]|null + */ protected $repoDigests; /** - * @var int - */ + * Date and time at which the image was created as a Unix timestamp + (number of seconds sinds EPOCH). + + * + * @var int|null + */ protected $created; /** - * @var int + * Total size of the image including all layers it is composed of. + * + * @var int|null */ protected $size; /** - * @var int - */ + * 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; /** - * @var int - */ + * Total size of the image including all layers it is composed of. + + In versions of Docker before v1.10, this field was calculated from + the image itself and all of its parent images. Images are now stored + self-contained, and no longer use a parent-chain, making this field + an equivalent of the Size field. + + Deprecated: this field is kept for backward compatibility, and will be removed in API v1.44. + * + * @var int|null + */ protected $virtualSize; /** - * @var string[] + * User-defined key/value metadata. + * + * @var array|null */ protected $labels; /** - * @var int - */ + * 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; - /** - * @return string - */ - public function getId(): ?string + * 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; } - /** - * @param string $id - * - * @return self - */ - public function setId(?string $id): self + * 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; } - /** - * @return string - */ - public function getParentId(): ?string + * 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; } - /** - * @param string $parentId - * - * @return self - */ - public function setParentId(?string $parentId): self + * 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; } - /** - * @return string[] - */ - public function getRepoTags(): ?array + * 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 string[]|null + */ + public function getRepoTags() : ?array { return $this->repoTags; } - /** - * @param string[] $repoTags - * - * @return self - */ - public function setRepoTags(?array $repoTags): self + * 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 string[]|null $repoTags + * + * @return self + */ + public function setRepoTags(?array $repoTags) : self { + $this->initialized['repoTags'] = true; $this->repoTags = $repoTags; - return $this; } - /** - * @return string[] - */ - public function getRepoDigests(): ?array + * 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 string[]|null + */ + public function getRepoDigests() : ?array { return $this->repoDigests; } - /** - * @param string[] $repoDigests - * - * @return self - */ - public function setRepoDigests(?array $repoDigests): self + * 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 string[]|null $repoDigests + * + * @return self + */ + public function setRepoDigests(?array $repoDigests) : self { + $this->initialized['repoDigests'] = true; $this->repoDigests = $repoDigests; - return $this; } - /** - * @return int - */ - public function getCreated(): ?int + * Date and time at which the image was created as a Unix timestamp + (number of seconds sinds EPOCH). + + * + * @return int|null + */ + public function getCreated() : ?int { return $this->created; } - /** - * @param int $created - * - * @return self - */ - public function setCreated(?int $created): self + * Date and time at which the image was created as a Unix timestamp + (number of seconds sinds EPOCH). + + * + * @param int|null $created + * + * @return self + */ + public function setCreated(?int $created) : self { + $this->initialized['created'] = true; $this->created = $created; - return $this; } - /** - * @return int + * Total size of the image including all layers it is composed of. + * + * @return int|null */ - public function getSize(): ?int + public function getSize() : ?int { return $this->size; } - /** - * @param int $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 + public function setSize(?int $size) : self { + $this->initialized['size'] = true; $this->size = $size; - return $this; } - /** - * @return int - */ - public function getSharedSize(): ?int + * 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; } - /** - * @param int $sharedSize - * - * @return self - */ - public function setSharedSize(?int $sharedSize): self + * 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; } - /** - * @return int - */ - public function getVirtualSize(): ?int + * Total size of the image including all layers it is composed of. + + In versions of Docker before v1.10, this field was calculated from + the image itself and all of its parent images. Images are now stored + self-contained, and no longer use a parent-chain, making this field + an equivalent of the Size field. + + Deprecated: this field is kept for backward compatibility, and will be removed in API v1.44. + * + * @return int|null + */ + public function getVirtualSize() : ?int { return $this->virtualSize; } - /** - * @param int $virtualSize - * - * @return self - */ - public function setVirtualSize(?int $virtualSize): self + * Total size of the image including all layers it is composed of. + + In versions of Docker before v1.10, this field was calculated from + the image itself and all of its parent images. Images are now stored + self-contained, and no longer use a parent-chain, making this field + an equivalent of the Size field. + + Deprecated: this field is kept for backward compatibility, and will be removed in API v1.44. + * + * @param int|null $virtualSize + * + * @return self + */ + public function setVirtualSize(?int $virtualSize) : self { + $this->initialized['virtualSize'] = true; $this->virtualSize = $virtualSize; - return $this; } - /** - * @return string[] + * User-defined key/value metadata. + * + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** - * @param string[] $labels + * User-defined key/value metadata. + * + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels) : self { + $this->initialized['labels'] = true; $this->labels = $labels; - return $this; } - /** - * @return int - */ - public function getContainers(): ?int + * 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; } - /** - * @param int $containers - * - * @return self - */ - public function setContainers(?int $containers): self + * 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; } -} +} \ No newline at end of file diff --git a/src/Model/ImagesNameHistoryGetResponse200Item.php b/src/Model/ImagesNameHistoryGetResponse200Item.php index 8da36732..a8a5a822 100644 --- a/src/Model/ImagesNameHistoryGetResponse200Item.php +++ b/src/Model/ImagesNameHistoryGetResponse200Item.php @@ -1,159 +1,183 @@ initialized); + } + /** + * + * + * @var string|null */ protected $id; /** - * @var int + * + * + * @var int|null */ protected $created; /** - * @var string + * + * + * @var string|null */ protected $createdBy; /** - * @var string[] + * + * + * @var string[]|null */ protected $tags; /** - * @var int + * + * + * @var int|null */ protected $size; /** - * @var string + * + * + * @var string|null */ protected $comment; - /** - * @return string + * + * + * @return string|null */ - public function getId(): ?string + public function getId() : ?string { return $this->id; } - /** - * @param string $id + * + * + * @param string|null $id * * @return self */ - public function setId(?string $id): self + public function setId(?string $id) : self { + $this->initialized['id'] = true; $this->id = $id; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getCreated(): ?int + public function getCreated() : ?int { return $this->created; } - /** - * @param int $created + * + * + * @param int|null $created * * @return self */ - public function setCreated(?int $created): self + public function setCreated(?int $created) : self { + $this->initialized['created'] = true; $this->created = $created; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getCreatedBy(): ?string + public function getCreatedBy() : ?string { return $this->createdBy; } - /** - * @param string $createdBy + * + * + * @param string|null $createdBy * * @return self */ - public function setCreatedBy(?string $createdBy): self + public function setCreatedBy(?string $createdBy) : self { + $this->initialized['createdBy'] = true; $this->createdBy = $createdBy; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getTags(): ?array + public function getTags() : ?array { return $this->tags; } - /** - * @param string[] $tags + * + * + * @param string[]|null $tags * * @return self */ - public function setTags(?array $tags): self + public function setTags(?array $tags) : self { + $this->initialized['tags'] = true; $this->tags = $tags; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getSize(): ?int + public function getSize() : ?int { return $this->size; } - /** - * @param int $size + * + * + * @param int|null $size * * @return self */ - public function setSize(?int $size): self + public function setSize(?int $size) : self { + $this->initialized['size'] = true; $this->size = $size; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getComment(): ?string + public function getComment() : ?string { return $this->comment; } - /** - * @param string $comment + * + * + * @param string|null $comment * * @return self */ - public function setComment(?string $comment): 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/src/Model/ImagesPrunePostResponse200.php b/src/Model/ImagesPrunePostResponse200.php index 2562781e..fed717d2 100644 --- a/src/Model/ImagesPrunePostResponse200.php +++ b/src/Model/ImagesPrunePostResponse200.php @@ -1,75 +1,71 @@ initialized); + } + /** + * Images that were deleted * - * @var ImageDeleteResponseItem[] + * @var ImageDeleteResponseItem[]|null */ protected $imagesDeleted; /** - * Disk space reclaimed in bytes. + * Disk space reclaimed in bytes * - * @var int + * @var int|null */ protected $spaceReclaimed; - /** - * Images that were deleted. + * Images that were deleted * - * @return ImageDeleteResponseItem[] + * @return ImageDeleteResponseItem[]|null */ - public function getImagesDeleted(): ?array + public function getImagesDeleted() : ?array { return $this->imagesDeleted; } - /** - * Images that were deleted. + * Images that were deleted * - * @param ImageDeleteResponseItem[] $imagesDeleted + * @param ImageDeleteResponseItem[]|null $imagesDeleted * * @return self */ - public function setImagesDeleted(?array $imagesDeleted): self + public function setImagesDeleted(?array $imagesDeleted) : self { + $this->initialized['imagesDeleted'] = true; $this->imagesDeleted = $imagesDeleted; - return $this; } - /** - * Disk space reclaimed in bytes. + * Disk space reclaimed in bytes * - * @return int + * @return int|null */ - public function getSpaceReclaimed(): ?int + public function getSpaceReclaimed() : ?int { return $this->spaceReclaimed; } - /** - * Disk space reclaimed in bytes. + * Disk space reclaimed in bytes * - * @param int $spaceReclaimed + * @param int|null $spaceReclaimed * * @return self */ - public function setSpaceReclaimed(?int $spaceReclaimed): 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/src/Model/ImagesSearchGetResponse200Item.php b/src/Model/ImagesSearchGetResponse200Item.php index 186076bc..3a5d3b46 100644 --- a/src/Model/ImagesSearchGetResponse200Item.php +++ b/src/Model/ImagesSearchGetResponse200Item.php @@ -1,135 +1,155 @@ initialized); + } + /** + * + * + * @var string|null */ protected $description; /** - * @var bool + * + * + * @var bool|null */ protected $isOfficial; /** - * @var bool + * + * + * @var bool|null */ protected $isAutomated; /** - * @var string + * + * + * @var string|null */ protected $name; /** - * @var int + * + * + * @var int|null */ protected $starCount; - /** - * @return string + * + * + * @return string|null */ - public function getDescription(): ?string + public function getDescription() : ?string { return $this->description; } - /** - * @param string $description + * + * + * @param string|null $description * * @return self */ - public function setDescription(?string $description): self + public function setDescription(?string $description) : self { + $this->initialized['description'] = true; $this->description = $description; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getIsOfficial(): ?bool + public function getIsOfficial() : ?bool { return $this->isOfficial; } - /** - * @param bool $isOfficial + * + * + * @param bool|null $isOfficial * * @return self */ - public function setIsOfficial(?bool $isOfficial): self + public function setIsOfficial(?bool $isOfficial) : self { + $this->initialized['isOfficial'] = true; $this->isOfficial = $isOfficial; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getIsAutomated(): ?bool + public function getIsAutomated() : ?bool { return $this->isAutomated; } - /** - * @param bool $isAutomated + * + * + * @param bool|null $isAutomated * * @return self */ - public function setIsAutomated(?bool $isAutomated): self + public function setIsAutomated(?bool $isAutomated) : self { + $this->initialized['isAutomated'] = true; $this->isAutomated = $isAutomated; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** - * @param string $name + * + * + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getStarCount(): ?int + public function getStarCount() : ?int { return $this->starCount; } - /** - * @param int $starCount + * + * + * @param int|null $starCount * * @return self */ - public function setStarCount(?int $starCount): 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/src/Model/IndexInfo.php b/src/Model/IndexInfo.php index 0744d216..70a74168 100644 --- a/src/Model/IndexInfo.php +++ b/src/Model/IndexInfo.php @@ -1,171 +1,163 @@ initialized); + } /** * Name of the registry, such as "docker.io". * - * @var string + * @var string|null */ protected $name; /** * List of mirrors, expressed as URIs. * - * @var string[] + * @var string[]|null */ protected $mirrors; /** - * Indicates if the the registry is part of the list of insecure. + * 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 - */ + + * + * @var bool|null + */ protected $secure; /** - * Indicates whether this is an official registry (i.e., Docker Hub / docker.io). + * Indicates whether this is an official registry (i.e., Docker Hub / docker.io) * - * @var bool + * @var bool|null */ protected $official; - /** * Name of the registry, such as "docker.io". * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Name of the registry, such as "docker.io". * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * List of mirrors, expressed as URIs. * - * @return string[] + * @return string[]|null */ - public function getMirrors(): ?array + public function getMirrors() : ?array { return $this->mirrors; } - /** * List of mirrors, expressed as URIs. * - * @param string[] $mirrors + * @param string[]|null $mirrors * * @return self */ - public function setMirrors(?array $mirrors): self + public function setMirrors(?array $mirrors) : self { + $this->initialized['mirrors'] = true; $this->mirrors = $mirrors; - return $this; } - /** - * Indicates if the the registry is part of the list of insecure. + * 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 - */ - public function getSecure(): ?bool + + * + * @return bool|null + */ + public function getSecure() : ?bool { return $this->secure; } - /** - * Indicates if the the registry is part of the list of insecure. + * 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 $secure - * - * @return self - */ - public function setSecure(?bool $secure): self + + * + * @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). + * Indicates whether this is an official registry (i.e., Docker Hub / docker.io) * - * @return bool + * @return bool|null */ - public function getOfficial(): ?bool + public function getOfficial() : ?bool { return $this->official; } - /** - * Indicates whether this is an official registry (i.e., Docker Hub / docker.io). + * Indicates whether this is an official registry (i.e., Docker Hub / docker.io) * - * @param bool $official + * @param bool|null $official * * @return self */ - public function setOfficial(?bool $official): 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/src/Model/JoinTokens.php b/src/Model/JoinTokens.php index e17c2513..5fb61c35 100644 --- a/src/Model/JoinTokens.php +++ b/src/Model/JoinTokens.php @@ -1,75 +1,71 @@ initialized); + } /** * The token workers can use to join the swarm. * - * @var string + * @var string|null */ protected $worker; /** * The token managers can use to join the swarm. * - * @var string + * @var string|null */ protected $manager; - /** * The token workers can use to join the swarm. * - * @return string + * @return string|null */ - public function getWorker(): ?string + public function getWorker() : ?string { return $this->worker; } - /** * The token workers can use to join the swarm. * - * @param string $worker + * @param string|null $worker * * @return self */ - public function setWorker(?string $worker): 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 + * @return string|null */ - public function getManager(): ?string + public function getManager() : ?string { return $this->manager; } - /** * The token managers can use to join the swarm. * - * @param string $manager + * @param string|null $manager * * @return self */ - public function setManager(?string $manager): 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/src/Model/Limit.php b/src/Model/Limit.php new file mode 100644 index 00000000..2c373ba4 --- /dev/null +++ b/src/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/src/Model/ManagerStatus.php b/src/Model/ManagerStatus.php index cc829635..1ecbc11b 100644 --- a/src/Model/ManagerStatus.php +++ b/src/Model/ManagerStatus.php @@ -1,99 +1,99 @@ initialized); + } + /** + * + * + * @var bool|null + */ + protected $leader = false; /** * Reachability represents the reachability of a node. * - * @var string + * @var string|null */ protected $reachability; /** * The IP address and port at which the manager is reachable. * - * @var string + * @var string|null */ protected $addr; - /** - * @return bool + * + * + * @return bool|null */ - public function getLeader(): ?bool + public function getLeader() : ?bool { return $this->leader; } - /** - * @param bool $leader + * + * + * @param bool|null $leader * * @return self */ - public function setLeader(?bool $leader): 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 + * @return string|null */ - public function getReachability(): ?string + public function getReachability() : ?string { return $this->reachability; } - /** * Reachability represents the reachability of a node. * - * @param string $reachability + * @param string|null $reachability * * @return self */ - public function setReachability(?string $reachability): 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 + * @return string|null */ - public function getAddr(): ?string + public function getAddr() : ?string { return $this->addr; } - /** * The IP address and port at which the manager is reachable. * - * @param string $addr + * @param string|null $addr * * @return self */ - public function setAddr(?string $addr): 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/src/Model/Mount.php b/src/Model/Mount.php index c710aba8..eaf3c6bf 100644 --- a/src/Model/Mount.php +++ b/src/Model/Mount.php @@ -1,270 +1,260 @@ initialized); + } /** * Container path. * - * @var string + * @var string|null */ protected $target; /** * Mount source (e.g. a volume name, a host path). * - * @var string + * @var string|null */ protected $source; /** - * The mount type. Available types:. - + * 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. - - * - * @var string - */ + - `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 + * @var bool|null */ protected $readOnly; /** * The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`. * - * @var string + * @var string|null */ protected $consistency; /** * Optional configuration for the `bind` type. * - * @var MountBindOptions + * @var MountBindOptions|null */ protected $bindOptions; /** * Optional configuration for the `volume` type. * - * @var MountVolumeOptions + * @var MountVolumeOptions|null */ protected $volumeOptions; /** * Optional configuration for the `tmpfs` type. * - * @var MountTmpfsOptions + * @var MountTmpfsOptions|null */ protected $tmpfsOptions; - /** * Container path. * - * @return string + * @return string|null */ - public function getTarget(): ?string + public function getTarget() : ?string { return $this->target; } - /** * Container path. * - * @param string $target + * @param string|null $target * * @return self */ - public function setTarget(?string $target): self + public function setTarget(?string $target) : self { + $this->initialized['target'] = true; $this->target = $target; - return $this; } - /** * Mount source (e.g. a volume name, a host path). * - * @return string + * @return string|null */ - public function getSource(): ?string + public function getSource() : ?string { return $this->source; } - /** * Mount source (e.g. a volume name, a host path). * - * @param string $source + * @param string|null $source * * @return self */ - public function setSource(?string $source): self + public function setSource(?string $source) : self { + $this->initialized['source'] = true; $this->source = $source; - return $this; } - /** - * The mount type. Available types:. - + * 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. - - * - * @return string - */ - public function getType(): ?string + - `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:. - + * 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. - - * - * @param string $type - * - * @return self - */ - public function setType(?string $type): self + - `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 + * @return bool|null */ - public function getReadOnly(): ?bool + public function getReadOnly() : ?bool { return $this->readOnly; } - /** * Whether the mount should be read-only. * - * @param bool $readOnly + * @param bool|null $readOnly * * @return self */ - public function setReadOnly(?bool $readOnly): self + public function setReadOnly(?bool $readOnly) : self { + $this->initialized['readOnly'] = true; $this->readOnly = $readOnly; - return $this; } - /** * The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`. * - * @return string + * @return string|null */ - public function getConsistency(): ?string + public function getConsistency() : ?string { return $this->consistency; } - /** * The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`. * - * @param string $consistency + * @param string|null $consistency * * @return self */ - public function setConsistency(?string $consistency): self + public function setConsistency(?string $consistency) : self { + $this->initialized['consistency'] = true; $this->consistency = $consistency; - return $this; } - /** * Optional configuration for the `bind` type. * - * @return MountBindOptions + * @return MountBindOptions|null */ - public function getBindOptions(): ?MountBindOptions + public function getBindOptions() : ?MountBindOptions { return $this->bindOptions; } - /** * Optional configuration for the `bind` type. * - * @param MountBindOptions $bindOptions + * @param MountBindOptions|null $bindOptions * * @return self */ - public function setBindOptions(?MountBindOptions $bindOptions): self + public function setBindOptions(?MountBindOptions $bindOptions) : self { + $this->initialized['bindOptions'] = true; $this->bindOptions = $bindOptions; - return $this; } - /** * Optional configuration for the `volume` type. * - * @return MountVolumeOptions + * @return MountVolumeOptions|null */ - public function getVolumeOptions(): ?MountVolumeOptions + public function getVolumeOptions() : ?MountVolumeOptions { return $this->volumeOptions; } - /** * Optional configuration for the `volume` type. * - * @param MountVolumeOptions $volumeOptions + * @param MountVolumeOptions|null $volumeOptions * * @return self */ - public function setVolumeOptions(?MountVolumeOptions $volumeOptions): self + public function setVolumeOptions(?MountVolumeOptions $volumeOptions) : self { + $this->initialized['volumeOptions'] = true; $this->volumeOptions = $volumeOptions; - return $this; } - /** * Optional configuration for the `tmpfs` type. * - * @return MountTmpfsOptions + * @return MountTmpfsOptions|null */ - public function getTmpfsOptions(): ?MountTmpfsOptions + public function getTmpfsOptions() : ?MountTmpfsOptions { return $this->tmpfsOptions; } - /** * Optional configuration for the `tmpfs` type. * - * @param MountTmpfsOptions $tmpfsOptions + * @param MountTmpfsOptions|null $tmpfsOptions * * @return self */ - public function setTmpfsOptions(?MountTmpfsOptions $tmpfsOptions): self + public function setTmpfsOptions(?MountTmpfsOptions $tmpfsOptions) : self { + $this->initialized['tmpfsOptions'] = true; $this->tmpfsOptions = $tmpfsOptions; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/MountBindOptions.php b/src/Model/MountBindOptions.php index a4f5bef1..8b5bc4d4 100644 --- a/src/Model/MountBindOptions.php +++ b/src/Model/MountBindOptions.php @@ -1,45 +1,99 @@ initialized); + } /** * A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`. * - * @var string + * @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; /** * A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`. * - * @return string + * @return string|null */ - public function getPropagation(): ?string + public function getPropagation() : ?string { return $this->propagation; } - /** * A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`. * - * @param string $propagation + * @param string|null $propagation * * @return self */ - public function setPropagation(?string $propagation): 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; + } +} \ No newline at end of file diff --git a/src/Model/MountPoint.php b/src/Model/MountPoint.php index e0dcdac7..e904d46f 100644 --- a/src/Model/MountPoint.php +++ b/src/Model/MountPoint.php @@ -1,207 +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; /** - * @var string - */ + * Name is the name reference to the underlying data defined by `Source` + e.g., the volume name. + + * + * @var string|null + */ protected $name; /** - * @var string - */ + * 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; /** - * @var string - */ + * Destination is the path relative to the container root (`/`) where + the `Source` is mounted inside the container. + + * + * @var string|null + */ protected $destination; /** - * @var string + * Driver is the volume driver used to create the volume (if it is a volume). + * + * @var string|null */ protected $driver; /** - * @var string - */ + * 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; /** - * @var bool + * Whether the mount is mounted writable (read-write). + * + * @var bool|null */ protected $rW; /** - * @var string - */ + * 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; - /** - * @return string - */ - public function getType(): ?string + * 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; } - /** - * @param string $type - * - * @return self - */ - public function setType(?string $type): self + * 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; } - /** - * @return string - */ - public function getName(): ?string + * 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; } - /** - * @param string $name - * - * @return self - */ - public function setName(?string $name): self + * 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; } - /** - * @return string - */ - public function getSource(): ?string + * 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; } - /** - * @param string $source - * - * @return self - */ - public function setSource(?string $source): self + * 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; } - /** - * @return string - */ - public function getDestination(): ?string + * 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; } - /** - * @param string $destination - * - * @return self - */ - public function setDestination(?string $destination): self + * 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; } - /** - * @return string + * Driver is the volume driver used to create the volume (if it is a volume). + * + * @return string|null */ - public function getDriver(): ?string + public function getDriver() : ?string { return $this->driver; } - /** - * @param string $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 + public function setDriver(?string $driver) : self { + $this->initialized['driver'] = true; $this->driver = $driver; - return $this; } - /** - * @return string - */ - public function getMode(): ?string + * 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; } - /** - * @param string $mode - * - * @return self - */ - public function setMode(?string $mode): self + * 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; } - /** - * @return bool + * Whether the mount is mounted writable (read-write). + * + * @return bool|null */ - public function getRW(): ?bool + public function getRW() : ?bool { return $this->rW; } - /** - * @param bool $rW + * Whether the mount is mounted writable (read-write). + * + * @param bool|null $rW * * @return self */ - public function setRW(?bool $rW): self + public function setRW(?bool $rW) : self { + $this->initialized['rW'] = true; $this->rW = $rW; - return $this; } - /** - * @return string - */ - public function getPropagation(): ?string + * 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; } - /** - * @param string $propagation - * - * @return self - */ - public function setPropagation(?string $propagation): self + * 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/src/Model/MountTmpfsOptions.php b/src/Model/MountTmpfsOptions.php index c33ef140..88570c69 100644 --- a/src/Model/MountTmpfsOptions.php +++ b/src/Model/MountTmpfsOptions.php @@ -1,75 +1,71 @@ initialized); + } /** * The size for the tmpfs mount in bytes. * - * @var int + * @var int|null */ protected $sizeBytes; /** * The permission mode for the tmpfs mount in an integer. * - * @var int + * @var int|null */ protected $mode; - /** * The size for the tmpfs mount in bytes. * - * @return int + * @return int|null */ - public function getSizeBytes(): ?int + public function getSizeBytes() : ?int { return $this->sizeBytes; } - /** * The size for the tmpfs mount in bytes. * - * @param int $sizeBytes + * @param int|null $sizeBytes * * @return self */ - public function setSizeBytes(?int $sizeBytes): 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 + * @return int|null */ - public function getMode(): ?int + public function getMode() : ?int { return $this->mode; } - /** * The permission mode for the tmpfs mount in an integer. * - * @param int $mode + * @param int|null $mode * * @return self */ - public function setMode(?int $mode): 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/src/Model/MountVolumeOptions.php b/src/Model/MountVolumeOptions.php index 678f133b..e3a3be04 100644 --- a/src/Model/MountVolumeOptions.php +++ b/src/Model/MountVolumeOptions.php @@ -1,105 +1,99 @@ initialized); + } /** * Populate volume with data from the target. * - * @var bool + * @var bool|null */ - protected $noCopy; + protected $noCopy = false; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** - * Map of driver specific options. + * Map of driver specific options * - * @var MountVolumeOptionsDriverConfig + * @var MountVolumeOptionsDriverConfig|null */ protected $driverConfig; - /** * Populate volume with data from the target. * - * @return bool + * @return bool|null */ - public function getNoCopy(): ?bool + public function getNoCopy() : ?bool { return $this->noCopy; } - /** * Populate volume with data from the target. * - * @param bool $noCopy + * @param bool|null $noCopy * * @return self */ - public function setNoCopy(?bool $noCopy): self + public function setNoCopy(?bool $noCopy) : self { + $this->initialized['noCopy'] = true; $this->noCopy = $noCopy; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels) : self { + $this->initialized['labels'] = true; $this->labels = $labels; - return $this; } - /** - * Map of driver specific options. + * Map of driver specific options * - * @return MountVolumeOptionsDriverConfig + * @return MountVolumeOptionsDriverConfig|null */ - public function getDriverConfig(): ?MountVolumeOptionsDriverConfig + public function getDriverConfig() : ?MountVolumeOptionsDriverConfig { return $this->driverConfig; } - /** - * Map of driver specific options. + * Map of driver specific options * - * @param MountVolumeOptionsDriverConfig $driverConfig + * @param MountVolumeOptionsDriverConfig|null $driverConfig * * @return self */ - public function setDriverConfig(?MountVolumeOptionsDriverConfig $driverConfig): self + public function setDriverConfig(?MountVolumeOptionsDriverConfig $driverConfig) : self { + $this->initialized['driverConfig'] = true; $this->driverConfig = $driverConfig; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/MountVolumeOptionsDriverConfig.php b/src/Model/MountVolumeOptionsDriverConfig.php index 624c1370..8c98d962 100644 --- a/src/Model/MountVolumeOptionsDriverConfig.php +++ b/src/Model/MountVolumeOptionsDriverConfig.php @@ -1,75 +1,71 @@ initialized); + } /** * Name of the driver to use to create the volume. * - * @var string + * @var string|null */ protected $name; /** * key/value map of driver specific options. * - * @var string[] + * @var array|null */ protected $options; - /** * Name of the driver to use to create the volume. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Name of the driver to use to create the volume. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * key/value map of driver specific options. * - * @return string[] + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions() : ?iterable { return $this->options; } - /** * key/value map of driver specific options. * - * @param string[] $options + * @param array|null $options * * @return self */ - public function setOptions(?\ArrayObject $options): 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/src/Model/Network.php b/src/Model/Network.php index c0e2700f..76557867 100644 --- a/src/Model/Network.php +++ b/src/Model/Network.php @@ -1,327 +1,379 @@ initialized); + } + /** + * + * + * @var string|null */ protected $name; /** - * @var string + * + * + * @var string|null */ protected $id; /** - * @var string + * + * + * @var string|null */ protected $created; /** - * @var string + * + * + * @var string|null */ protected $scope; /** - * @var string + * + * + * @var string|null */ protected $driver; /** - * @var bool + * + * + * @var bool|null */ protected $enableIPv6; /** - * @var IPAM + * + * + * @var IPAM|null */ protected $iPAM; /** - * @var bool + * + * + * @var bool|null */ protected $internal; /** - * @var bool + * + * + * @var bool|null */ protected $attachable; /** - * @var bool + * + * + * @var bool|null */ protected $ingress; /** - * @var NetworkContainer[] + * + * + * @var array|null */ protected $containers; /** - * @var string[] + * + * + * @var array|null */ protected $options; /** - * @var string[] + * + * + * @var array|null */ protected $labels; - /** - * @return string + * + * + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** - * @param string $name + * + * + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getId(): ?string + public function getId() : ?string { return $this->id; } - /** - * @param string $id + * + * + * @param string|null $id * * @return self */ - public function setId(?string $id): self + public function setId(?string $id) : self { + $this->initialized['id'] = true; $this->id = $id; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getCreated(): ?string + public function getCreated() : ?string { return $this->created; } - /** - * @param string $created + * + * + * @param string|null $created * * @return self */ - public function setCreated(?string $created): self + public function setCreated(?string $created) : self { + $this->initialized['created'] = true; $this->created = $created; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getScope(): ?string + public function getScope() : ?string { return $this->scope; } - /** - * @param string $scope + * + * + * @param string|null $scope * * @return self */ - public function setScope(?string $scope): self + public function setScope(?string $scope) : self { + $this->initialized['scope'] = true; $this->scope = $scope; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getDriver(): ?string + public function getDriver() : ?string { return $this->driver; } - /** - * @param string $driver + * + * + * @param string|null $driver * * @return self */ - public function setDriver(?string $driver): self + public function setDriver(?string $driver) : self { + $this->initialized['driver'] = true; $this->driver = $driver; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getEnableIPv6(): ?bool + public function getEnableIPv6() : ?bool { return $this->enableIPv6; } - /** - * @param bool $enableIPv6 + * + * + * @param bool|null $enableIPv6 * * @return self */ - public function setEnableIPv6(?bool $enableIPv6): self + public function setEnableIPv6(?bool $enableIPv6) : self { + $this->initialized['enableIPv6'] = true; $this->enableIPv6 = $enableIPv6; - return $this; } - /** - * @return IPAM + * + * + * @return IPAM|null */ - public function getIPAM(): ?IPAM + public function getIPAM() : ?IPAM { return $this->iPAM; } - /** - * @param IPAM $iPAM + * + * + * @param IPAM|null $iPAM * * @return self */ - public function setIPAM(?IPAM $iPAM): self + public function setIPAM(?IPAM $iPAM) : self { + $this->initialized['iPAM'] = true; $this->iPAM = $iPAM; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getInternal(): ?bool + public function getInternal() : ?bool { return $this->internal; } - /** - * @param bool $internal + * + * + * @param bool|null $internal * * @return self */ - public function setInternal(?bool $internal): self + public function setInternal(?bool $internal) : self { + $this->initialized['internal'] = true; $this->internal = $internal; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getAttachable(): ?bool + public function getAttachable() : ?bool { return $this->attachable; } - /** - * @param bool $attachable + * + * + * @param bool|null $attachable * * @return self */ - public function setAttachable(?bool $attachable): self + public function setAttachable(?bool $attachable) : self { + $this->initialized['attachable'] = true; $this->attachable = $attachable; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getIngress(): ?bool + public function getIngress() : ?bool { return $this->ingress; } - /** - * @param bool $ingress + * + * + * @param bool|null $ingress * * @return self */ - public function setIngress(?bool $ingress): self + public function setIngress(?bool $ingress) : self { + $this->initialized['ingress'] = true; $this->ingress = $ingress; - return $this; } - /** - * @return NetworkContainer[] + * + * + * @return array|null */ - public function getContainers(): ?\ArrayObject + public function getContainers() : ?iterable { return $this->containers; } - /** - * @param NetworkContainer[] $containers + * + * + * @param array|null $containers * * @return self */ - public function setContainers(?\ArrayObject $containers): self + public function setContainers(?iterable $containers) : self { + $this->initialized['containers'] = true; $this->containers = $containers; - return $this; } - /** - * @return string[] + * + * + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions() : ?iterable { return $this->options; } - /** - * @param string[] $options + * + * + * @param array|null $options * * @return self */ - public function setOptions(?\ArrayObject $options): self + public function setOptions(?iterable $options) : self { + $this->initialized['options'] = true; $this->options = $options; - return $this; } - /** - * @return string[] + * + * + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** - * @param string[] $labels + * + * + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): 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/src/Model/NetworkAttachmentConfig.php b/src/Model/NetworkAttachmentConfig.php new file mode 100644 index 00000000..870539b4 --- /dev/null +++ b/src/Model/NetworkAttachmentConfig.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * The target network for attachment. Must be a network name or ID. + * + * @var string|null + */ + protected $target; + /** + * Discoverable alternate names for the service on this network. + * + * @var string[]|null + */ + protected $aliases; + /** + * 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() : ?string + { + return $this->target; + } + /** + * The target network for attachment. Must be a network name or ID. + * + * @param string|null $target + * + * @return self + */ + public function setTarget(?string $target) : self + { + $this->initialized['target'] = true; + $this->target = $target; + return $this; + } + /** + * Discoverable alternate names for the service on this network. + * + * @return string[]|null + */ + public function getAliases() : ?array + { + return $this->aliases; + } + /** + * Discoverable alternate names for the service on this network. + * + * @param string[]|null $aliases + * + * @return self + */ + 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/src/Model/NetworkContainer.php b/src/Model/NetworkContainer.php index 0af36861..71db06d1 100644 --- a/src/Model/NetworkContainer.php +++ b/src/Model/NetworkContainer.php @@ -1,135 +1,155 @@ 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(): ?string + public function getName() : ?string { return $this->name; } - /** - * @param string $name + * + * + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getEndpointID(): ?string + public function getEndpointID() : ?string { return $this->endpointID; } - /** - * @param string $endpointID + * + * + * @param string|null $endpointID * * @return self */ - public function setEndpointID(?string $endpointID): self + public function setEndpointID(?string $endpointID) : self { + $this->initialized['endpointID'] = true; $this->endpointID = $endpointID; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getMacAddress(): ?string + public function getMacAddress() : ?string { return $this->macAddress; } - /** - * @param string $macAddress + * + * + * @param string|null $macAddress * * @return self */ - public function setMacAddress(?string $macAddress): self + public function setMacAddress(?string $macAddress) : self { + $this->initialized['macAddress'] = true; $this->macAddress = $macAddress; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getIPv4Address(): ?string + public function getIPv4Address() : ?string { return $this->iPv4Address; } - /** - * @param string $iPv4Address + * + * + * @param string|null $iPv4Address * * @return self */ - public function setIPv4Address(?string $iPv4Address): self + public function setIPv4Address(?string $iPv4Address) : self { + $this->initialized['iPv4Address'] = true; $this->iPv4Address = $iPv4Address; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getIPv6Address(): ?string + public function getIPv6Address() : ?string { return $this->iPv6Address; } - /** - * @param string $iPv6Address + * + * + * @param string|null $iPv6Address * * @return self */ - public function setIPv6Address(?string $iPv6Address): self + public function setIPv6Address(?string $iPv6Address) : self { + $this->initialized['iPv6Address'] = true; $this->iPv6Address = $iPv6Address; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/NetworkSettings.php b/src/Model/NetworkSettings.php index 37b71730..ce04c762 100644 --- a/src/Model/NetworkSettings.php +++ b/src/Model/NetworkSettings.php @@ -1,777 +1,753 @@ initialized); + } + /** + * Name of the network's bridge (for example, `docker0`). * - * @var string + * @var string|null */ protected $bridge; /** * SandboxID uniquely represents a container's network stack. * - * @var string + * @var string|null */ protected $sandboxID; /** * Indicates if hairpin NAT should be enabled on the virtual interface. * - * @var bool + * @var bool|null */ protected $hairpinMode; /** * IPv6 unicast address using the link-local prefix. * - * @var string + * @var string|null */ protected $linkLocalIPv6Address; /** * Prefix length of the IPv6 unicast address. * - * @var int + * @var int|null */ protected $linkLocalIPv6PrefixLen; /** - * PortMap describes the mapping of container ports to host ports, using the. + * 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 both `tcp` and `udp`, two separate - entries are added to the mapping table. - - * - * @var PortBinding[][] - */ + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + + * + * @var array|null + */ protected $ports; /** - * SandboxKey identifies the sandbox. + * SandboxKey identifies the sandbox * - * @var string + * @var string|null */ protected $sandboxKey; /** - * @var Address[] + * + * + * @var Address[]|null */ protected $secondaryIPAddresses; /** - * @var Address[] + * + * + * @var Address[]|null */ protected $secondaryIPv6Addresses; /** - * EndpointID uniquely represents a service endpoint in a Sandbox. - + * 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 - */ + + * + * @var string|null + */ protected $endpointID; /** - * Gateway address for the default "bridge" network. - + * 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 - */ + + * + * @var string|null + */ protected $gateway; /** - * Global IPv6 address for the default "bridge" network. - + * 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 - */ + + * + * @var string|null + */ protected $globalIPv6Address; /** - * Mask length of the global IPv6 address. - + * 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 - */ + + * + * @var int|null + */ protected $globalIPv6PrefixLen; /** - * IPv4 address for the default "bridge" network. - + * 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 - */ + + * + * @var string|null + */ protected $iPAddress; /** - * Mask length of the IPv4 address. - + * 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 - */ + + * + * @var int|null + */ protected $iPPrefixLen; /** - * IPv6 gateway address for this network. - + * 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 - */ + + * + * @var string|null + */ protected $iPv6Gateway; /** - * MAC address for the container on the default "bridge" network. - + * 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 - */ + + * + * @var string|null + */ protected $macAddress; /** * Information about all networks that the container is connected to. * - * @var EndpointSettings[] + * @var array|null */ protected $networks; - /** - * Name of the network'a bridge (for example, `docker0`). + * Name of the network's bridge (for example, `docker0`). * - * @return string + * @return string|null */ - public function getBridge(): ?string + public function getBridge() : ?string { return $this->bridge; } - /** - * Name of the network'a bridge (for example, `docker0`). + * Name of the network's bridge (for example, `docker0`). * - * @param string $bridge + * @param string|null $bridge * * @return self */ - public function setBridge(?string $bridge): 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 + * @return string|null */ - public function getSandboxID(): ?string + public function getSandboxID() : ?string { return $this->sandboxID; } - /** * SandboxID uniquely represents a container's network stack. * - * @param string $sandboxID + * @param string|null $sandboxID * * @return self */ - public function setSandboxID(?string $sandboxID): 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. * - * @return bool + * @return bool|null */ - public function getHairpinMode(): ?bool + public function getHairpinMode() : ?bool { return $this->hairpinMode; } - /** * Indicates if hairpin NAT should be enabled on the virtual interface. * - * @param bool $hairpinMode + * @param bool|null $hairpinMode * * @return self */ - public function setHairpinMode(?bool $hairpinMode): self + public function setHairpinMode(?bool $hairpinMode) : self { + $this->initialized['hairpinMode'] = true; $this->hairpinMode = $hairpinMode; - return $this; } - /** * IPv6 unicast address using the link-local prefix. * - * @return string + * @return string|null */ - public function getLinkLocalIPv6Address(): ?string + public function getLinkLocalIPv6Address() : ?string { return $this->linkLocalIPv6Address; } - /** * IPv6 unicast address using the link-local prefix. * - * @param string $linkLocalIPv6Address + * @param string|null $linkLocalIPv6Address * * @return self */ - public function setLinkLocalIPv6Address(?string $linkLocalIPv6Address): self + public function setLinkLocalIPv6Address(?string $linkLocalIPv6Address) : self { + $this->initialized['linkLocalIPv6Address'] = true; $this->linkLocalIPv6Address = $linkLocalIPv6Address; - return $this; } - /** * Prefix length of the IPv6 unicast address. * - * @return int + * @return int|null */ - public function getLinkLocalIPv6PrefixLen(): ?int + public function getLinkLocalIPv6PrefixLen() : ?int { return $this->linkLocalIPv6PrefixLen; } - /** * Prefix length of the IPv6 unicast address. * - * @param int $linkLocalIPv6PrefixLen + * @param int|null $linkLocalIPv6PrefixLen * * @return self */ - public function setLinkLocalIPv6PrefixLen(?int $linkLocalIPv6PrefixLen): 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. + * 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 both `tcp` and `udp`, two separate - entries are added to the mapping table. - - * - * @return PortBinding[][] - */ - public function getPorts(): ?\ArrayObject + + 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. + * 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 both `tcp` and `udp`, two separate - entries are added to the mapping table. - - * - * @param PortBinding[][] $ports - * - * @return self - */ - public function setPorts(?\ArrayObject $ports): self - { + + 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 identifies the sandbox. + * SandboxKey identifies the sandbox * - * @return string + * @return string|null */ - public function getSandboxKey(): ?string + public function getSandboxKey() : ?string { return $this->sandboxKey; } - /** - * SandboxKey identifies the sandbox. + * SandboxKey identifies the sandbox * - * @param string $sandboxKey + * @param string|null $sandboxKey * * @return self */ - public function setSandboxKey(?string $sandboxKey): self + public function setSandboxKey(?string $sandboxKey) : self { + $this->initialized['sandboxKey'] = true; $this->sandboxKey = $sandboxKey; - return $this; } - /** - * @return Address[] + * + * + * @return Address[]|null */ - public function getSecondaryIPAddresses(): ?array + public function getSecondaryIPAddresses() : ?array { return $this->secondaryIPAddresses; } - /** - * @param Address[] $secondaryIPAddresses + * + * + * @param Address[]|null $secondaryIPAddresses * * @return self */ - public function setSecondaryIPAddresses(?array $secondaryIPAddresses): self + public function setSecondaryIPAddresses(?array $secondaryIPAddresses) : self { + $this->initialized['secondaryIPAddresses'] = true; $this->secondaryIPAddresses = $secondaryIPAddresses; - return $this; } - /** - * @return Address[] + * + * + * @return Address[]|null */ - public function getSecondaryIPv6Addresses(): ?array + public function getSecondaryIPv6Addresses() : ?array { return $this->secondaryIPv6Addresses; } - /** - * @param Address[] $secondaryIPv6Addresses + * + * + * @param Address[]|null $secondaryIPv6Addresses * * @return self */ - public function setSecondaryIPv6Addresses(?array $secondaryIPv6Addresses): 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. - + * 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 - */ - public function getEndpointID(): ?string + + * + * @return string|null + */ + public function getEndpointID() : ?string { return $this->endpointID; } - /** - * EndpointID uniquely represents a service endpoint in a Sandbox. - + * 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 $endpointID - * - * @return self - */ - public function setEndpointID(?string $endpointID): self - { + + * + * @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. - + * 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 - */ - public function getGateway(): ?string + + * + * @return string|null + */ + public function getGateway() : ?string { return $this->gateway; } - /** - * Gateway address for the default "bridge" network. - + * 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 $gateway - * - * @return self - */ - public function setGateway(?string $gateway): self - { + + * + * @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. - + * 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 - */ - public function getGlobalIPv6Address(): ?string + + * + * @return string|null + */ + public function getGlobalIPv6Address() : ?string { return $this->globalIPv6Address; } - /** - * Global IPv6 address for the default "bridge" network. - + * 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 $globalIPv6Address - * - * @return self - */ - public function setGlobalIPv6Address(?string $globalIPv6Address): self - { + + * + * @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. - + * 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 - */ - public function getGlobalIPv6PrefixLen(): ?int + + * + * @return int|null + */ + public function getGlobalIPv6PrefixLen() : ?int { return $this->globalIPv6PrefixLen; } - /** - * Mask length of the global IPv6 address. - + * 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 $globalIPv6PrefixLen - * - * @return self - */ - public function setGlobalIPv6PrefixLen(?int $globalIPv6PrefixLen): self - { + + * + * @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. - + * 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 - */ - public function getIPAddress(): ?string + + * + * @return string|null + */ + public function getIPAddress() : ?string { return $this->iPAddress; } - /** - * IPv4 address for the default "bridge" network. - + * 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 $iPAddress - * - * @return self - */ - public function setIPAddress(?string $iPAddress): self - { + + * + * @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. - + * 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 - */ - public function getIPPrefixLen(): ?int + + * + * @return int|null + */ + public function getIPPrefixLen() : ?int { return $this->iPPrefixLen; } - /** - * Mask length of the IPv4 address. - + * 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 $iPPrefixLen - * - * @return self - */ - public function setIPPrefixLen(?int $iPPrefixLen): self - { + + * + * @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. - + * 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 - */ - public function getIPv6Gateway(): ?string + + * + * @return string|null + */ + public function getIPv6Gateway() : ?string { return $this->iPv6Gateway; } - /** - * IPv6 gateway address for this network. - + * 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 $iPv6Gateway - * - * @return self - */ - public function setIPv6Gateway(?string $iPv6Gateway): self - { + + * + * @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. - + * 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 - */ - public function getMacAddress(): ?string + + * + * @return string|null + */ + public function getMacAddress() : ?string { return $this->macAddress; } - /** - * MAC address for the container on the default "bridge" network. - + * 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 $macAddress - * - * @return self - */ - public function setMacAddress(?string $macAddress): self - { + + * + * @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 EndpointSettings[] + * @return array|null */ - public function getNetworks(): ?\ArrayObject + public function getNetworks() : ?iterable { return $this->networks; } - /** * Information about all networks that the container is connected to. * - * @param EndpointSettings[] $networks + * @param array|null $networks * * @return self */ - public function setNetworks(?\ArrayObject $networks): 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/src/Model/NetworkingConfig.php b/src/Model/NetworkingConfig.php new file mode 100644 index 00000000..3185335a --- /dev/null +++ b/src/Model/NetworkingConfig.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * A mapping of network name to endpoint configuration for that network. + * + * @var array|null + */ + protected $endpointsConfig; + /** + * A mapping of network name to endpoint configuration for that network. + * + * @return array|null + */ + public function getEndpointsConfig() : ?iterable + { + return $this->endpointsConfig; + } + /** + * A mapping of network name to endpoint configuration for that network. + * + * @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/src/Model/NetworksCreatePostBody.php b/src/Model/NetworksCreatePostBody.php index c45486c8..6e1082c0 100644 --- a/src/Model/NetworksCreatePostBody.php +++ b/src/Model/NetworksCreatePostBody.php @@ -1,309 +1,328 @@ initialized); + } /** * The network's name. * - * @var string + * @var string|null */ protected $name; /** - * Check for networks with duplicate names. Since Network is primarily keyed based on a random ID and not on the name, and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, there is no guaranteed way to check for duplicates. CheckDuplicate is there to provide a best effort checking of any networks which has the same name but it is not guaranteed to catch all name collisions. - * - * @var bool - */ + * Check for networks with duplicate names. Since Network is + primarily keyed based on a random ID and not on the name, and + network name is strictly a user-friendly alias to the network + which is uniquely identified using ID, there is no guaranteed + way to check for duplicates. CheckDuplicate is there to provide + a best effort checking of any networks which has the same name + but it is not guaranteed to catch all name collisions. + + * + * @var bool|null + */ protected $checkDuplicate; /** * Name of the network driver plugin to use. * - * @var string + * @var string|null */ - protected $driver; + protected $driver = 'bridge'; /** * Restrict external access to the network. * - * @var bool + * @var bool|null */ protected $internal; /** - * Globally scoped network is manually attachable by regular containers from workers in swarm mode. - * - * @var bool - */ + * 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 - */ + * Ingress network is the network which provides the routing-mesh + in swarm mode. + + * + * @var bool|null + */ protected $ingress; /** - * @var IPAM + * + * + * @var IPAM|null */ protected $iPAM; /** * Enable IPv6 on the network. * - * @var bool + * @var bool|null */ protected $enableIPv6; /** * Network specific options to be used by the drivers. * - * @var string[] + * @var array|null */ protected $options; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; - /** * The network's name. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * The network's name. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * Check for networks with duplicate names. Since Network is primarily keyed based on a random ID and not on the name, and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, there is no guaranteed way to check for duplicates. CheckDuplicate is there to provide a best effort checking of any networks which has the same name but it is not guaranteed to catch all name collisions. - * - * @return bool - */ - public function getCheckDuplicate(): ?bool + * Check for networks with duplicate names. Since Network is + primarily keyed based on a random ID and not on the name, and + network name is strictly a user-friendly alias to the network + which is uniquely identified using ID, there is no guaranteed + way to check for duplicates. CheckDuplicate is there to provide + a best effort checking of any networks which has the same name + but it is not guaranteed to catch all name collisions. + + * + * @return bool|null + */ + public function getCheckDuplicate() : ?bool { return $this->checkDuplicate; } - /** - * Check for networks with duplicate names. Since Network is primarily keyed based on a random ID and not on the name, and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, there is no guaranteed way to check for duplicates. CheckDuplicate is there to provide a best effort checking of any networks which has the same name but it is not guaranteed to catch all name collisions. - * - * @param bool $checkDuplicate - * - * @return self - */ - public function setCheckDuplicate(?bool $checkDuplicate): self + * Check for networks with duplicate names. Since Network is + primarily keyed based on a random ID and not on the name, and + network name is strictly a user-friendly alias to the network + which is uniquely identified using ID, there is no guaranteed + way to check for duplicates. CheckDuplicate is there to provide + a best effort checking of any networks which has the same name + but it is not guaranteed to catch all name collisions. + + * + * @param bool|null $checkDuplicate + * + * @return self + */ + public function setCheckDuplicate(?bool $checkDuplicate) : self { + $this->initialized['checkDuplicate'] = true; $this->checkDuplicate = $checkDuplicate; - return $this; } - /** * Name of the network driver plugin to use. * - * @return string + * @return string|null */ - public function getDriver(): ?string + public function getDriver() : ?string { return $this->driver; } - /** * Name of the network driver plugin to use. * - * @param string $driver + * @param string|null $driver * * @return self */ - public function setDriver(?string $driver): self + public function setDriver(?string $driver) : self { + $this->initialized['driver'] = true; $this->driver = $driver; - return $this; } - /** * Restrict external access to the network. * - * @return bool + * @return bool|null */ - public function getInternal(): ?bool + public function getInternal() : ?bool { return $this->internal; } - /** * Restrict external access to the network. * - * @param bool $internal + * @param bool|null $internal * * @return self */ - public function setInternal(?bool $internal): 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 - */ - public function getAttachable(): ?bool + * 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 $attachable - * - * @return self - */ - public function setAttachable(?bool $attachable): self + * 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 - */ - public function getIngress(): ?bool + * 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 $ingress - * - * @return self - */ - public function setIngress(?bool $ingress): self + * 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; } - /** - * @return IPAM + * + * + * @return IPAM|null */ - public function getIPAM(): ?IPAM + public function getIPAM() : ?IPAM { return $this->iPAM; } - /** - * @param IPAM $iPAM + * + * + * @param IPAM|null $iPAM * * @return self */ - public function setIPAM(?IPAM $iPAM): self + public function setIPAM(?IPAM $iPAM) : self { + $this->initialized['iPAM'] = true; $this->iPAM = $iPAM; - return $this; } - /** * Enable IPv6 on the network. * - * @return bool + * @return bool|null */ - public function getEnableIPv6(): ?bool + public function getEnableIPv6() : ?bool { return $this->enableIPv6; } - /** * Enable IPv6 on the network. * - * @param bool $enableIPv6 + * @param bool|null $enableIPv6 * * @return self */ - public function setEnableIPv6(?bool $enableIPv6): 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 string[] + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions() : ?iterable { return $this->options; } - /** * Network specific options to be used by the drivers. * - * @param string[] $options + * @param array|null $options * * @return self */ - public function setOptions(?\ArrayObject $options): self + public function setOptions(?iterable $options) : self { + $this->initialized['options'] = true; $this->options = $options; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): 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/src/Model/NetworksCreatePostResponse201.php b/src/Model/NetworksCreatePostResponse201.php index 31ecdee1..cf089ed9 100644 --- a/src/Model/NetworksCreatePostResponse201.php +++ b/src/Model/NetworksCreatePostResponse201.php @@ -1,69 +1,71 @@ initialized); + } /** * The ID of the created network. * - * @var string + * @var string|null */ protected $id; /** - * @var string + * + * + * @var string|null */ protected $warning; - /** * The ID of the created network. * - * @return string + * @return string|null */ - public function getId(): ?string + public function getId() : ?string { return $this->id; } - /** * The ID of the created network. * - * @param string $id + * @param string|null $id * * @return self */ - public function setId(?string $id): self + public function setId(?string $id) : self { + $this->initialized['id'] = true; $this->id = $id; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getWarning(): ?string + public function getWarning() : ?string { return $this->warning; } - /** - * @param string $warning + * + * + * @param string|null $warning * * @return self */ - public function setWarning(?string $warning): 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/src/Model/NetworksIdConnectPostBody.php b/src/Model/NetworksIdConnectPostBody.php index 0f7d7ac3..c9a863c2 100644 --- a/src/Model/NetworksIdConnectPostBody.php +++ b/src/Model/NetworksIdConnectPostBody.php @@ -1,75 +1,71 @@ initialized); + } /** * The ID or name of the container to connect to the network. * - * @var string + * @var string|null */ protected $container; /** * Configuration for a network endpoint. * - * @var EndpointSettings + * @var EndpointSettings|null */ protected $endpointConfig; - /** * The ID or name of the container to connect to the network. * - * @return string + * @return string|null */ - public function getContainer(): ?string + public function getContainer() : ?string { return $this->container; } - /** * The ID or name of the container to connect to the network. * - * @param string $container + * @param string|null $container * * @return self */ - public function setContainer(?string $container): self + public function setContainer(?string $container) : self { + $this->initialized['container'] = true; $this->container = $container; - return $this; } - /** * Configuration for a network endpoint. * - * @return EndpointSettings + * @return EndpointSettings|null */ - public function getEndpointConfig(): ?EndpointSettings + public function getEndpointConfig() : ?EndpointSettings { return $this->endpointConfig; } - /** * Configuration for a network endpoint. * - * @param EndpointSettings $endpointConfig + * @param EndpointSettings|null $endpointConfig * * @return self */ - public function setEndpointConfig(?EndpointSettings $endpointConfig): 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/src/Model/NetworksIdDisconnectPostBody.php b/src/Model/NetworksIdDisconnectPostBody.php index a2486356..7bf39373 100644 --- a/src/Model/NetworksIdDisconnectPostBody.php +++ b/src/Model/NetworksIdDisconnectPostBody.php @@ -1,75 +1,71 @@ initialized); + } /** * The ID or name of the container to disconnect from the network. * - * @var string + * @var string|null */ protected $container; /** * Force the container to disconnect from the network. * - * @var bool + * @var bool|null */ protected $force; - /** * The ID or name of the container to disconnect from the network. * - * @return string + * @return string|null */ - public function getContainer(): ?string + public function getContainer() : ?string { return $this->container; } - /** * The ID or name of the container to disconnect from the network. * - * @param string $container + * @param string|null $container * * @return self */ - public function setContainer(?string $container): 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 + * @return bool|null */ - public function getForce(): ?bool + public function getForce() : ?bool { return $this->force; } - /** * Force the container to disconnect from the network. * - * @param bool $force + * @param bool|null $force * * @return self */ - public function setForce(?bool $force): 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/src/Model/NetworksPrunePostResponse200.php b/src/Model/NetworksPrunePostResponse200.php index 44db2e05..1f4588ba 100644 --- a/src/Model/NetworksPrunePostResponse200.php +++ b/src/Model/NetworksPrunePostResponse200.php @@ -1,45 +1,43 @@ initialized); + } + /** + * Networks that were deleted * - * @var string[] + * @var string[]|null */ protected $networksDeleted; - /** - * Networks that were deleted. + * Networks that were deleted * - * @return string[] + * @return string[]|null */ - public function getNetworksDeleted(): ?array + public function getNetworksDeleted() : ?array { return $this->networksDeleted; } - /** - * Networks that were deleted. + * Networks that were deleted * - * @param string[] $networksDeleted + * @param string[]|null $networksDeleted * * @return self */ - public function setNetworksDeleted(?array $networksDeleted): 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/src/Model/Node.php b/src/Model/Node.php index 46fcf97d..86fc98bc 100644 --- a/src/Model/Node.php +++ b/src/Model/Node.php @@ -1,303 +1,308 @@ 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 + * @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 node was added to the swarm in. + * 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 - */ + + * + * @var string|null + */ protected $createdAt; /** - * Date and time at which the node was last updated in. + * 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 - */ + + * + * @var string|null + */ protected $updatedAt; /** - * @var NodeSpec + * + * + * @var NodeSpec|null */ protected $spec; /** - * NodeDescription encapsulates the properties of the Node as reported by the. + * NodeDescription encapsulates the properties of the Node as reported by the agent. - - * - * @var NodeDescription - */ + + * + * @var NodeDescription|null + */ protected $description; /** - * NodeStatus represents the status of a node. - + * NodeStatus represents the status of a node. + It provides the current status of the node, as seen by the manager. - - * - * @var NodeStatus - */ + + * + * @var NodeStatus|null + */ protected $status; /** - * ManagerStatus represents the status of a manager. - + * 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 - */ + + * + * @var ManagerStatus|null + */ protected $managerStatus; - /** - * @return string + * + * + * @return string|null */ - public function getID(): ?string + public function getID() : ?string { return $this->iD; } - /** - * @param string $iD + * + * + * @param string|null $iD * * @return self */ - public function setID(?string $iD): 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 - */ - public function getVersion(): ?ObjectVersion + * 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 $version - * - * @return self - */ - public function setVersion(?ObjectVersion $version): self + * 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 node was added to the swarm in. + * 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 - */ - public function getCreatedAt(): ?string + + * + * @return string|null + */ + public function getCreatedAt() : ?string { return $this->createdAt; } - /** - * Date and time at which the node was added to the swarm in. + * 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 $createdAt - * - * @return self - */ - public function setCreatedAt(?string $createdAt): self + + * + * @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 node was last updated in. + * 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 - */ - public function getUpdatedAt(): ?string + + * + * @return string|null + */ + public function getUpdatedAt() : ?string { return $this->updatedAt; } - /** - * Date and time at which the node was last updated in. + * 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 $updatedAt - * - * @return self - */ - public function setUpdatedAt(?string $updatedAt): self + + * + * @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(): ?NodeSpec + public function getSpec() : ?NodeSpec { return $this->spec; } - /** - * @param NodeSpec $spec + * + * + * @param NodeSpec|null $spec * * @return self */ - public function setSpec(?NodeSpec $spec): self + public function setSpec(?NodeSpec $spec) : self { + $this->initialized['spec'] = true; $this->spec = $spec; - return $this; } - /** - * NodeDescription encapsulates the properties of the Node as reported by the. + * NodeDescription encapsulates the properties of the Node as reported by the agent. - - * - * @return NodeDescription - */ - public function getDescription(): ?NodeDescription + + * + * @return NodeDescription|null + */ + public function getDescription() : ?NodeDescription { return $this->description; } - /** - * NodeDescription encapsulates the properties of the Node as reported by the. + * NodeDescription encapsulates the properties of the Node as reported by the agent. - - * - * @param NodeDescription $description - * - * @return self - */ - public function setDescription(?NodeDescription $description): self + + * + * @param NodeDescription|null $description + * + * @return self + */ + public function setDescription(?NodeDescription $description) : self { + $this->initialized['description'] = true; $this->description = $description; - return $this; } - /** - * NodeStatus represents the status of a node. - + * NodeStatus represents the status of a node. + It provides the current status of the node, as seen by the manager. - - * - * @return NodeStatus - */ - public function getStatus(): ?NodeStatus + + * + * @return NodeStatus|null + */ + public function getStatus() : ?NodeStatus { return $this->status; } - /** - * NodeStatus represents the status of a node. - + * NodeStatus represents the status of a node. + It provides the current status of the node, as seen by the manager. - - * - * @param NodeStatus $status - * - * @return self - */ - public function setStatus(?NodeStatus $status): self + + * + * @param NodeStatus|null $status + * + * @return self + */ + public function setStatus(?NodeStatus $status) : self { + $this->initialized['status'] = true; $this->status = $status; - return $this; } - /** - * ManagerStatus represents the status of a manager. - + * 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 - */ - public function getManagerStatus(): ?ManagerStatus + + * + * @return ManagerStatus|null + */ + public function getManagerStatus() : ?ManagerStatus { return $this->managerStatus; } - /** - * ManagerStatus represents the status of a manager. - + * 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 $managerStatus - * - * @return self - */ - public function setManagerStatus(?ManagerStatus $managerStatus): self + + * + * @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/src/Model/NodeDescription.php b/src/Model/NodeDescription.php index 37657aaf..aafe56cb 100644 --- a/src/Model/NodeDescription.php +++ b/src/Model/NodeDescription.php @@ -1,159 +1,167 @@ initialized); + } + /** + * + * + * @var string|null */ protected $hostname; /** * Platform represents the platform (Arch/OS). * - * @var Platform + * @var Platform|null */ protected $platform; /** - * An object describing the resources which can be advertised by a node and requested by a task. - * - * @var ResourceObject - */ + * An object describing the resources which can be advertised by a node and + requested by a task. + + * + * @var ResourceObject|null + */ protected $resources; /** * EngineDescription provides information about an engine. * - * @var EngineDescription + * @var EngineDescription|null */ protected $engine; /** - * Information about the issuer of leaf TLS certificates and the trusted root CA certificate. - * - * @var TLSInfo - */ + * Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + + * + * @var TLSInfo|null + */ protected $tLSInfo; - /** - * @return string + * + * + * @return string|null */ - public function getHostname(): ?string + public function getHostname() : ?string { return $this->hostname; } - /** - * @param string $hostname + * + * + * @param string|null $hostname * * @return self */ - public function setHostname(?string $hostname): self + public function setHostname(?string $hostname) : self { + $this->initialized['hostname'] = true; $this->hostname = $hostname; - return $this; } - /** * Platform represents the platform (Arch/OS). * - * @return Platform + * @return Platform|null */ - public function getPlatform(): ?Platform + public function getPlatform() : ?Platform { return $this->platform; } - /** * Platform represents the platform (Arch/OS). * - * @param Platform $platform + * @param Platform|null $platform * * @return self */ - public function setPlatform(?Platform $platform): self + public function setPlatform(?Platform $platform) : self { + $this->initialized['platform'] = true; $this->platform = $platform; - return $this; } - /** - * An object describing the resources which can be advertised by a node and requested by a task. - * - * @return ResourceObject - */ - public function getResources(): ?ResourceObject + * 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; } - /** - * An object describing the resources which can be advertised by a node and requested by a task. - * - * @param ResourceObject $resources - * - * @return self - */ - public function setResources(?ResourceObject $resources): self + * 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; } - /** * EngineDescription provides information about an engine. * - * @return EngineDescription + * @return EngineDescription|null */ - public function getEngine(): ?EngineDescription + public function getEngine() : ?EngineDescription { return $this->engine; } - /** * EngineDescription provides information about an engine. * - * @param EngineDescription $engine + * @param EngineDescription|null $engine * * @return self */ - public function setEngine(?EngineDescription $engine): self + 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 - */ - public function getTLSInfo(): ?TLSInfo + * 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 $tLSInfo - * - * @return self - */ - public function setTLSInfo(?TLSInfo $tLSInfo): self + * 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/src/Model/NodeSpec.php b/src/Model/NodeSpec.php index 1c7d9f17..15f25a0b 100644 --- a/src/Model/NodeSpec.php +++ b/src/Model/NodeSpec.php @@ -1,135 +1,127 @@ initialized); + } /** * Name for the node. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * Role of the node. * - * @var string + * @var string|null */ protected $role; /** * Availability of the node. * - * @var string + * @var string|null */ protected $availability; - /** * Name for the node. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Name for the node. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels) : self { + $this->initialized['labels'] = true; $this->labels = $labels; - return $this; } - /** * Role of the node. * - * @return string + * @return string|null */ - public function getRole(): ?string + public function getRole() : ?string { return $this->role; } - /** * Role of the node. * - * @param string $role + * @param string|null $role * * @return self */ - public function setRole(?string $role): self + public function setRole(?string $role) : self { + $this->initialized['role'] = true; $this->role = $role; - return $this; } - /** * Availability of the node. * - * @return string + * @return string|null */ - public function getAvailability(): ?string + public function getAvailability() : ?string { return $this->availability; } - /** * Availability of the node. * - * @param string $availability + * @param string|null $availability * * @return self */ - public function setAvailability(?string $availability): 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/src/Model/NodeStatus.php b/src/Model/NodeStatus.php index ea23e91f..84c40362 100644 --- a/src/Model/NodeStatus.php +++ b/src/Model/NodeStatus.php @@ -1,99 +1,99 @@ initialized); + } /** * NodeState represents the state of a node. * - * @var string + * @var string|null */ protected $state; /** - * @var string + * + * + * @var string|null */ protected $message; /** * IP address of the node. * - * @var string + * @var string|null */ protected $addr; - /** * NodeState represents the state of a node. * - * @return string + * @return string|null */ - public function getState(): ?string + public function getState() : ?string { return $this->state; } - /** * NodeState represents the state of a node. * - * @param string $state + * @param string|null $state * * @return self */ - public function setState(?string $state): self + public function setState(?string $state) : self { + $this->initialized['state'] = true; $this->state = $state; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getMessage(): ?string + public function getMessage() : ?string { return $this->message; } - /** - * @param string $message + * + * + * @param string|null $message * * @return self */ - public function setMessage(?string $message): self + public function setMessage(?string $message) : self { + $this->initialized['message'] = true; $this->message = $message; - return $this; } - /** * IP address of the node. * - * @return string + * @return string|null */ - public function getAddr(): ?string + public function getAddr() : ?string { return $this->addr; } - /** * IP address of the node. * - * @param string $addr + * @param string|null $addr * * @return self */ - public function setAddr(?string $addr): 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/src/Model/OCIDescriptor.php b/src/Model/OCIDescriptor.php new file mode 100644 index 00000000..4dcef1d0 --- /dev/null +++ b/src/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/src/Model/OCIPlatform.php b/src/Model/OCIPlatform.php new file mode 100644 index 00000000..14746255 --- /dev/null +++ b/src/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 string[]|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 string[]|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 string[]|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/src/Model/ObjectVersion.php b/src/Model/ObjectVersion.php index 3516edb3..9878049a 100644 --- a/src/Model/ObjectVersion.php +++ b/src/Model/ObjectVersion.php @@ -1,39 +1,43 @@ initialized); + } + /** + * + * + * @var int|null */ protected $index; - /** - * @return int + * + * + * @return int|null */ - public function getIndex(): ?int + public function getIndex() : ?int { return $this->index; } - /** - * @param int $index + * + * + * @param int|null $index * * @return self */ - public function setIndex(?int $index): 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/src/Model/PeerNode.php b/src/Model/PeerNode.php index 719da214..a91f1a87 100644 --- a/src/Model/PeerNode.php +++ b/src/Model/PeerNode.php @@ -1,75 +1,71 @@ initialized); + } /** * Unique identifier of for this node in the swarm. * - * @var string + * @var string|null */ protected $nodeID; /** * IP address and ports at which this node can be reached. * - * @var string + * @var string|null */ protected $addr; - /** * Unique identifier of for this node in the swarm. * - * @return string + * @return string|null */ - public function getNodeID(): ?string + public function getNodeID() : ?string { return $this->nodeID; } - /** * Unique identifier of for this node in the swarm. * - * @param string $nodeID + * @param string|null $nodeID * * @return self */ - public function setNodeID(?string $nodeID): 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 + * @return string|null */ - public function getAddr(): ?string + public function getAddr() : ?string { return $this->addr; } - /** * IP address and ports at which this node can be reached. * - * @param string $addr + * @param string|null $addr * * @return self */ - public function setAddr(?string $addr): 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/src/Model/Platform.php b/src/Model/Platform.php index cf508a6d..0231ff78 100644 --- a/src/Model/Platform.php +++ b/src/Model/Platform.php @@ -1,81 +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 + * @var string|null */ protected $oS; - /** - * Architecture represents the hardware architecture (for example,. + * Architecture represents the hardware architecture (for example, `x86_64`). - - * - * @return string - */ - public function getArchitecture(): ?string + + * + * @return string|null + */ + public function getArchitecture() : ?string { return $this->architecture; } - /** - * Architecture represents the hardware architecture (for example,. + * Architecture represents the hardware architecture (for example, `x86_64`). - - * - * @param string $architecture - * - * @return self - */ - public function setArchitecture(?string $architecture): self + + * + * @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 + * @return string|null */ - public function getOS(): ?string + public function getOS() : ?string { return $this->oS; } - /** * OS represents the Operating System (for example, `linux` or `windows`). * - * @param string $oS + * @param string|null $oS * * @return self */ - public function setOS(?string $oS): 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/src/Model/Plugin.php b/src/Model/Plugin.php index 89c70d5c..1307d75f 100644 --- a/src/Model/Plugin.php +++ b/src/Model/Plugin.php @@ -1,183 +1,183 @@ initialized); + } + /** + * + * + * @var string|null */ protected $id; /** - * @var string + * + * + * @var string|null */ protected $name; /** * True if the plugin is running. False if the plugin is not running, only installed. * - * @var bool + * @var bool|null */ protected $enabled; /** * Settings that can be modified by users. * - * @var PluginSettings + * @var PluginSettings|null */ protected $settings; /** - * plugin remote reference used to push/pull the plugin. + * plugin remote reference used to push/pull the plugin * - * @var string + * @var string|null */ protected $pluginReference; /** * The config of a plugin. * - * @var PluginConfig + * @var PluginConfig|null */ protected $config; - /** - * @return string + * + * + * @return string|null */ - public function getId(): ?string + public function getId() : ?string { return $this->id; } - /** - * @param string $id + * + * + * @param string|null $id * * @return self */ - public function setId(?string $id): self + public function setId(?string $id) : self { + $this->initialized['id'] = true; $this->id = $id; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** - * @param string $name + * + * + * @param string|null $name * * @return self */ - public function setName(?string $name): 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 + * @return bool|null */ - public function getEnabled(): ?bool + public function getEnabled() : ?bool { return $this->enabled; } - /** * True if the plugin is running. False if the plugin is not running, only installed. * - * @param bool $enabled + * @param bool|null $enabled * * @return self */ - public function setEnabled(?bool $enabled): 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 + * @return PluginSettings|null */ - public function getSettings(): ?PluginSettings + public function getSettings() : ?PluginSettings { return $this->settings; } - /** * Settings that can be modified by users. * - * @param PluginSettings $settings + * @param PluginSettings|null $settings * * @return self */ - public function setSettings(?PluginSettings $settings): 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. + * plugin remote reference used to push/pull the plugin * - * @return string + * @return string|null */ - public function getPluginReference(): ?string + public function getPluginReference() : ?string { return $this->pluginReference; } - /** - * plugin remote reference used to push/pull the plugin. + * plugin remote reference used to push/pull the plugin * - * @param string $pluginReference + * @param string|null $pluginReference * * @return self */ - public function setPluginReference(?string $pluginReference): self + public function setPluginReference(?string $pluginReference) : self { + $this->initialized['pluginReference'] = true; $this->pluginReference = $pluginReference; - return $this; } - /** * The config of a plugin. * - * @return PluginConfig + * @return PluginConfig|null */ - public function getConfig(): ?PluginConfig + public function getConfig() : ?PluginConfig { return $this->config; } - /** * The config of a plugin. * - * @param PluginConfig $config + * @param PluginConfig|null $config * * @return self */ - public function setConfig(?PluginConfig $config): 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/src/Model/PluginConfig.php b/src/Model/PluginConfig.php index 6f3d0c04..3a325fed 100644 --- a/src/Model/PluginConfig.php +++ b/src/Model/PluginConfig.php @@ -1,411 +1,463 @@ initialized); + } + /** + * Docker Version used to create the plugin * - * @var string + * @var string|null */ protected $dockerVersion; /** - * @var string + * + * + * @var string|null */ protected $description; /** - * @var string + * + * + * @var string|null */ protected $documentation; /** - * The interface between Docker and the plugin. + * The interface between Docker and the plugin * - * @var PluginConfigInterface + * @var PluginConfigInterface|null */ protected $interface; /** - * @var string[] + * + * + * @var string[]|null */ protected $entrypoint; /** - * @var string + * + * + * @var string|null */ protected $workDir; /** - * @var PluginConfigUser + * + * + * @var PluginConfigUser|null */ protected $user; /** - * @var PluginConfigNetwork + * + * + * @var PluginConfigNetwork|null */ protected $network; /** - * @var PluginConfigLinux + * + * + * @var PluginConfigLinux|null */ protected $linux; /** - * @var string + * + * + * @var string|null */ protected $propagatedMount; /** - * @var bool + * + * + * @var bool|null */ protected $ipcHost; /** - * @var bool + * + * + * @var bool|null */ protected $pidHost; /** - * @var PluginMount[] + * + * + * @var PluginMount[]|null */ protected $mounts; /** - * @var PluginEnv[] + * + * + * @var PluginEnv[]|null */ protected $env; /** - * @var PluginConfigArgs + * + * + * @var PluginConfigArgs|null */ protected $args; /** - * @var PluginConfigRootfs + * + * + * @var PluginConfigRootfs|null */ protected $rootfs; - /** - * Docker Version used to create the plugin. + * Docker Version used to create the plugin * - * @return string + * @return string|null */ - public function getDockerVersion(): ?string + public function getDockerVersion() : ?string { return $this->dockerVersion; } - /** - * Docker Version used to create the plugin. + * Docker Version used to create the plugin * - * @param string $dockerVersion + * @param string|null $dockerVersion * * @return self */ - public function setDockerVersion(?string $dockerVersion): self + public function setDockerVersion(?string $dockerVersion) : self { + $this->initialized['dockerVersion'] = true; $this->dockerVersion = $dockerVersion; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getDescription(): ?string + public function getDescription() : ?string { return $this->description; } - /** - * @param string $description + * + * + * @param string|null $description * * @return self */ - public function setDescription(?string $description): self + public function setDescription(?string $description) : self { + $this->initialized['description'] = true; $this->description = $description; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getDocumentation(): ?string + public function getDocumentation() : ?string { return $this->documentation; } - /** - * @param string $documentation + * + * + * @param string|null $documentation * * @return self */ - public function setDocumentation(?string $documentation): self + public function setDocumentation(?string $documentation) : self { + $this->initialized['documentation'] = true; $this->documentation = $documentation; - return $this; } - /** - * The interface between Docker and the plugin. + * The interface between Docker and the plugin * - * @return PluginConfigInterface + * @return PluginConfigInterface|null */ - public function getInterface(): ?PluginConfigInterface + public function getInterface() : ?PluginConfigInterface { return $this->interface; } - /** - * The interface between Docker and the plugin. + * The interface between Docker and the plugin * - * @param PluginConfigInterface $interface + * @param PluginConfigInterface|null $interface * * @return self */ - public function setInterface(?PluginConfigInterface $interface): self + public function setInterface(?PluginConfigInterface $interface) : self { + $this->initialized['interface'] = true; $this->interface = $interface; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getEntrypoint(): ?array + public function getEntrypoint() : ?array { return $this->entrypoint; } - /** - * @param string[] $entrypoint + * + * + * @param string[]|null $entrypoint * * @return self */ - public function setEntrypoint(?array $entrypoint): self + public function setEntrypoint(?array $entrypoint) : self { + $this->initialized['entrypoint'] = true; $this->entrypoint = $entrypoint; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getWorkDir(): ?string + public function getWorkDir() : ?string { return $this->workDir; } - /** - * @param string $workDir + * + * + * @param string|null $workDir * * @return self */ - public function setWorkDir(?string $workDir): self + public function setWorkDir(?string $workDir) : self { + $this->initialized['workDir'] = true; $this->workDir = $workDir; - return $this; } - /** - * @return PluginConfigUser + * + * + * @return PluginConfigUser|null */ - public function getUser(): ?PluginConfigUser + public function getUser() : ?PluginConfigUser { return $this->user; } - /** - * @param PluginConfigUser $user + * + * + * @param PluginConfigUser|null $user * * @return self */ - public function setUser(?PluginConfigUser $user): self + public function setUser(?PluginConfigUser $user) : self { + $this->initialized['user'] = true; $this->user = $user; - return $this; } - /** - * @return PluginConfigNetwork + * + * + * @return PluginConfigNetwork|null */ - public function getNetwork(): ?PluginConfigNetwork + public function getNetwork() : ?PluginConfigNetwork { return $this->network; } - /** - * @param PluginConfigNetwork $network + * + * + * @param PluginConfigNetwork|null $network * * @return self */ - public function setNetwork(?PluginConfigNetwork $network): self + public function setNetwork(?PluginConfigNetwork $network) : self { + $this->initialized['network'] = true; $this->network = $network; - return $this; } - /** - * @return PluginConfigLinux + * + * + * @return PluginConfigLinux|null */ - public function getLinux(): ?PluginConfigLinux + public function getLinux() : ?PluginConfigLinux { return $this->linux; } - /** - * @param PluginConfigLinux $linux + * + * + * @param PluginConfigLinux|null $linux * * @return self */ - public function setLinux(?PluginConfigLinux $linux): self + public function setLinux(?PluginConfigLinux $linux) : self { + $this->initialized['linux'] = true; $this->linux = $linux; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getPropagatedMount(): ?string + public function getPropagatedMount() : ?string { return $this->propagatedMount; } - /** - * @param string $propagatedMount + * + * + * @param string|null $propagatedMount * * @return self */ - public function setPropagatedMount(?string $propagatedMount): self + public function setPropagatedMount(?string $propagatedMount) : self { + $this->initialized['propagatedMount'] = true; $this->propagatedMount = $propagatedMount; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getIpcHost(): ?bool + public function getIpcHost() : ?bool { return $this->ipcHost; } - /** - * @param bool $ipcHost + * + * + * @param bool|null $ipcHost * * @return self */ - public function setIpcHost(?bool $ipcHost): self + public function setIpcHost(?bool $ipcHost) : self { + $this->initialized['ipcHost'] = true; $this->ipcHost = $ipcHost; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getPidHost(): ?bool + public function getPidHost() : ?bool { return $this->pidHost; } - /** - * @param bool $pidHost + * + * + * @param bool|null $pidHost * * @return self */ - public function setPidHost(?bool $pidHost): self + public function setPidHost(?bool $pidHost) : self { + $this->initialized['pidHost'] = true; $this->pidHost = $pidHost; - return $this; } - /** - * @return PluginMount[] + * + * + * @return PluginMount[]|null */ - public function getMounts(): ?array + public function getMounts() : ?array { return $this->mounts; } - /** - * @param PluginMount[] $mounts + * + * + * @param PluginMount[]|null $mounts * * @return self */ - public function setMounts(?array $mounts): self + public function setMounts(?array $mounts) : self { + $this->initialized['mounts'] = true; $this->mounts = $mounts; - return $this; } - /** - * @return PluginEnv[] + * + * + * @return PluginEnv[]|null */ - public function getEnv(): ?array + public function getEnv() : ?array { return $this->env; } - /** - * @param PluginEnv[] $env + * + * + * @param PluginEnv[]|null $env * * @return self */ - public function setEnv(?array $env): self + public function setEnv(?array $env) : self { + $this->initialized['env'] = true; $this->env = $env; - return $this; } - /** - * @return PluginConfigArgs + * + * + * @return PluginConfigArgs|null */ - public function getArgs(): ?PluginConfigArgs + public function getArgs() : ?PluginConfigArgs { return $this->args; } - /** - * @param PluginConfigArgs $args + * + * + * @param PluginConfigArgs|null $args * * @return self */ - public function setArgs(?PluginConfigArgs $args): self + public function setArgs(?PluginConfigArgs $args) : self { + $this->initialized['args'] = true; $this->args = $args; - return $this; } - /** - * @return PluginConfigRootfs + * + * + * @return PluginConfigRootfs|null */ - public function getRootfs(): ?PluginConfigRootfs + public function getRootfs() : ?PluginConfigRootfs { return $this->rootfs; } - /** - * @param PluginConfigRootfs $rootfs + * + * + * @param PluginConfigRootfs|null $rootfs * * @return self */ - public function setRootfs(?PluginConfigRootfs $rootfs): 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/src/Model/PluginConfigArgs.php b/src/Model/PluginConfigArgs.php index f28f4a2a..2264a675 100644 --- a/src/Model/PluginConfigArgs.php +++ b/src/Model/PluginConfigArgs.php @@ -1,111 +1,127 @@ initialized); + } + /** + * + * + * @var string|null */ protected $name; /** - * @var string + * + * + * @var string|null */ protected $description; /** - * @var string[] + * + * + * @var string[]|null */ protected $settable; /** - * @var string[] + * + * + * @var string[]|null */ protected $value; - /** - * @return string + * + * + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** - * @param string $name + * + * + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getDescription(): ?string + public function getDescription() : ?string { return $this->description; } - /** - * @param string $description + * + * + * @param string|null $description * * @return self */ - public function setDescription(?string $description): self + public function setDescription(?string $description) : self { + $this->initialized['description'] = true; $this->description = $description; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getSettable(): ?array + public function getSettable() : ?array { return $this->settable; } - /** - * @param string[] $settable + * + * + * @param string[]|null $settable * * @return self */ - public function setSettable(?array $settable): self + public function setSettable(?array $settable) : self { + $this->initialized['settable'] = true; $this->settable = $settable; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getValue(): ?array + public function getValue() : ?array { return $this->value; } - /** - * @param string[] $value + * + * + * @param string[]|null $value * * @return self */ - public function setValue(?array $value): 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/src/Model/PluginConfigInterface.php b/src/Model/PluginConfigInterface.php index e5021ea1..a4ef8fff 100644 --- a/src/Model/PluginConfigInterface.php +++ b/src/Model/PluginConfigInterface.php @@ -1,63 +1,99 @@ initialized); + } + /** + * + * + * @var PluginInterfaceType[]|null */ protected $types; /** - * @var string + * + * + * @var string|null */ protected $socket; - /** - * @return PluginInterfaceType[] + * Protocol to use for clients connecting to the plugin. + * + * @var string|null + */ + protected $protocolScheme; + /** + * + * + * @return PluginInterfaceType[]|null */ - public function getTypes(): ?array + public function getTypes() : ?array { return $this->types; } - /** - * @param PluginInterfaceType[] $types + * + * + * @param PluginInterfaceType[]|null $types * * @return self */ - public function setTypes(?array $types): self + public function setTypes(?array $types) : self { + $this->initialized['types'] = true; $this->types = $types; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getSocket(): ?string + public function getSocket() : ?string { return $this->socket; } - /** - * @param string $socket + * + * + * @param string|null $socket * * @return self */ - public function setSocket(?string $socket): 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/src/Model/PluginConfigLinux.php b/src/Model/PluginConfigLinux.php index c32b8806..e682afe1 100644 --- a/src/Model/PluginConfigLinux.php +++ b/src/Model/PluginConfigLinux.php @@ -1,87 +1,99 @@ initialized); + } + /** + * + * + * @var string[]|null */ protected $capabilities; /** - * @var bool + * + * + * @var bool|null */ protected $allowAllDevices; /** - * @var PluginDevice[] + * + * + * @var PluginDevice[]|null */ protected $devices; - /** - * @return string[] + * + * + * @return string[]|null */ - public function getCapabilities(): ?array + public function getCapabilities() : ?array { return $this->capabilities; } - /** - * @param string[] $capabilities + * + * + * @param string[]|null $capabilities * * @return self */ - public function setCapabilities(?array $capabilities): self + public function setCapabilities(?array $capabilities) : self { + $this->initialized['capabilities'] = true; $this->capabilities = $capabilities; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getAllowAllDevices(): ?bool + public function getAllowAllDevices() : ?bool { return $this->allowAllDevices; } - /** - * @param bool $allowAllDevices + * + * + * @param bool|null $allowAllDevices * * @return self */ - public function setAllowAllDevices(?bool $allowAllDevices): self + public function setAllowAllDevices(?bool $allowAllDevices) : self { + $this->initialized['allowAllDevices'] = true; $this->allowAllDevices = $allowAllDevices; - return $this; } - /** - * @return PluginDevice[] + * + * + * @return PluginDevice[]|null */ - public function getDevices(): ?array + public function getDevices() : ?array { return $this->devices; } - /** - * @param PluginDevice[] $devices + * + * + * @param PluginDevice[]|null $devices * * @return self */ - public function setDevices(?array $devices): 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/src/Model/PluginConfigNetwork.php b/src/Model/PluginConfigNetwork.php index a1b8630f..7054a491 100644 --- a/src/Model/PluginConfigNetwork.php +++ b/src/Model/PluginConfigNetwork.php @@ -1,39 +1,43 @@ initialized); + } + /** + * + * + * @var string|null */ protected $type; - /** - * @return string + * + * + * @return string|null */ - public function getType(): ?string + public function getType() : ?string { return $this->type; } - /** - * @param string $type + * + * + * @param string|null $type * * @return self */ - public function setType(?string $type): 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/src/Model/PluginConfigRootfs.php b/src/Model/PluginConfigRootfs.php index af60a93e..664627bf 100644 --- a/src/Model/PluginConfigRootfs.php +++ b/src/Model/PluginConfigRootfs.php @@ -1,63 +1,71 @@ initialized); + } + /** + * + * + * @var string|null */ protected $type; /** - * @var string[] + * + * + * @var string[]|null */ protected $diffIds; - /** - * @return string + * + * + * @return string|null */ - public function getType(): ?string + public function getType() : ?string { return $this->type; } - /** - * @param string $type + * + * + * @param string|null $type * * @return self */ - public function setType(?string $type): self + public function setType(?string $type) : self { + $this->initialized['type'] = true; $this->type = $type; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getDiffIds(): ?array + public function getDiffIds() : ?array { return $this->diffIds; } - /** - * @param string[] $diffIds + * + * + * @param string[]|null $diffIds * * @return self */ - public function setDiffIds(?array $diffIds): 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/src/Model/PluginConfigUser.php b/src/Model/PluginConfigUser.php index 7195b4f3..14c530d6 100644 --- a/src/Model/PluginConfigUser.php +++ b/src/Model/PluginConfigUser.php @@ -1,63 +1,71 @@ initialized); + } + /** + * + * + * @var int|null */ protected $uID; /** - * @var int + * + * + * @var int|null */ protected $gID; - /** - * @return int + * + * + * @return int|null */ - public function getUID(): ?int + public function getUID() : ?int { return $this->uID; } - /** - * @param int $uID + * + * + * @param int|null $uID * * @return self */ - public function setUID(?int $uID): self + public function setUID(?int $uID) : self { + $this->initialized['uID'] = true; $this->uID = $uID; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getGID(): ?int + public function getGID() : ?int { return $this->gID; } - /** - * @param int $gID + * + * + * @param int|null $gID * * @return self */ - public function setGID(?int $gID): 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/src/Model/PluginDevice.php b/src/Model/PluginDevice.php index 60cea592..04cfdffa 100644 --- a/src/Model/PluginDevice.php +++ b/src/Model/PluginDevice.php @@ -1,111 +1,127 @@ initialized); + } + /** + * + * + * @var string|null */ protected $name; /** - * @var string + * + * + * @var string|null */ protected $description; /** - * @var string[] + * + * + * @var string[]|null */ protected $settable; /** - * @var string + * + * + * @var string|null */ protected $path; - /** - * @return string + * + * + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** - * @param string $name + * + * + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getDescription(): ?string + public function getDescription() : ?string { return $this->description; } - /** - * @param string $description + * + * + * @param string|null $description * * @return self */ - public function setDescription(?string $description): self + public function setDescription(?string $description) : self { + $this->initialized['description'] = true; $this->description = $description; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getSettable(): ?array + public function getSettable() : ?array { return $this->settable; } - /** - * @param string[] $settable + * + * + * @param string[]|null $settable * * @return self */ - public function setSettable(?array $settable): self + public function setSettable(?array $settable) : self { + $this->initialized['settable'] = true; $this->settable = $settable; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getPath(): ?string + public function getPath() : ?string { return $this->path; } - /** - * @param string $path + * + * + * @param string|null $path * * @return self */ - public function setPath(?string $path): 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/src/Model/PluginEnv.php b/src/Model/PluginEnv.php index b76ba9ba..9dd6b92b 100644 --- a/src/Model/PluginEnv.php +++ b/src/Model/PluginEnv.php @@ -1,111 +1,127 @@ initialized); + } + /** + * + * + * @var string|null */ protected $name; /** - * @var string + * + * + * @var string|null */ protected $description; /** - * @var string[] + * + * + * @var string[]|null */ protected $settable; /** - * @var string + * + * + * @var string|null */ protected $value; - /** - * @return string + * + * + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** - * @param string $name + * + * + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getDescription(): ?string + public function getDescription() : ?string { return $this->description; } - /** - * @param string $description + * + * + * @param string|null $description * * @return self */ - public function setDescription(?string $description): self + public function setDescription(?string $description) : self { + $this->initialized['description'] = true; $this->description = $description; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getSettable(): ?array + public function getSettable() : ?array { return $this->settable; } - /** - * @param string[] $settable + * + * + * @param string[]|null $settable * * @return self */ - public function setSettable(?array $settable): self + public function setSettable(?array $settable) : self { + $this->initialized['settable'] = true; $this->settable = $settable; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getValue(): ?string + public function getValue() : ?string { return $this->value; } - /** - * @param string $value + * + * + * @param string|null $value * * @return self */ - public function setValue(?string $value): 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/src/Model/PluginInterfaceType.php b/src/Model/PluginInterfaceType.php index e110e099..98a072f3 100644 --- a/src/Model/PluginInterfaceType.php +++ b/src/Model/PluginInterfaceType.php @@ -1,87 +1,99 @@ initialized); + } + /** + * + * + * @var string|null */ protected $prefix; /** - * @var string + * + * + * @var string|null */ protected $capability; /** - * @var string + * + * + * @var string|null */ protected $version; - /** - * @return string + * + * + * @return string|null */ - public function getPrefix(): ?string + public function getPrefix() : ?string { return $this->prefix; } - /** - * @param string $prefix + * + * + * @param string|null $prefix * * @return self */ - public function setPrefix(?string $prefix): self + public function setPrefix(?string $prefix) : self { + $this->initialized['prefix'] = true; $this->prefix = $prefix; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getCapability(): ?string + public function getCapability() : ?string { return $this->capability; } - /** - * @param string $capability + * + * + * @param string|null $capability * * @return self */ - public function setCapability(?string $capability): self + public function setCapability(?string $capability) : self { + $this->initialized['capability'] = true; $this->capability = $capability; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getVersion(): ?string + public function getVersion() : ?string { return $this->version; } - /** - * @param string $version + * + * + * @param string|null $version * * @return self */ - public function setVersion(?string $version): 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/src/Model/PluginMount.php b/src/Model/PluginMount.php index 9717af42..4bab4906 100644 --- a/src/Model/PluginMount.php +++ b/src/Model/PluginMount.php @@ -1,183 +1,211 @@ initialized); + } + /** + * + * + * @var string|null */ protected $name; /** - * @var string + * + * + * @var string|null */ protected $description; /** - * @var string[] + * + * + * @var string[]|null */ protected $settable; /** - * @var string + * + * + * @var string|null */ protected $source; /** - * @var string + * + * + * @var string|null */ protected $destination; /** - * @var string + * + * + * @var string|null */ protected $type; /** - * @var string[] + * + * + * @var string[]|null */ protected $options; - /** - * @return string + * + * + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** - * @param string $name + * + * + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getDescription(): ?string + public function getDescription() : ?string { return $this->description; } - /** - * @param string $description + * + * + * @param string|null $description * * @return self */ - public function setDescription(?string $description): self + public function setDescription(?string $description) : self { + $this->initialized['description'] = true; $this->description = $description; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getSettable(): ?array + public function getSettable() : ?array { return $this->settable; } - /** - * @param string[] $settable + * + * + * @param string[]|null $settable * * @return self */ - public function setSettable(?array $settable): self + public function setSettable(?array $settable) : self { + $this->initialized['settable'] = true; $this->settable = $settable; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getSource(): ?string + public function getSource() : ?string { return $this->source; } - /** - * @param string $source + * + * + * @param string|null $source * * @return self */ - public function setSource(?string $source): self + public function setSource(?string $source) : self { + $this->initialized['source'] = true; $this->source = $source; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getDestination(): ?string + public function getDestination() : ?string { return $this->destination; } - /** - * @param string $destination + * + * + * @param string|null $destination * * @return self */ - public function setDestination(?string $destination): self + public function setDestination(?string $destination) : self { + $this->initialized['destination'] = true; $this->destination = $destination; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getType(): ?string + public function getType() : ?string { return $this->type; } - /** - * @param string $type + * + * + * @param string|null $type * * @return self */ - public function setType(?string $type): self + public function setType(?string $type) : self { + $this->initialized['type'] = true; $this->type = $type; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getOptions(): ?array + public function getOptions() : ?array { return $this->options; } - /** - * @param string[] $options + * + * + * @param string[]|null $options * * @return self */ - public function setOptions(?array $options): 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/src/Model/PluginPrivilege.php b/src/Model/PluginPrivilege.php new file mode 100644 index 00000000..0c20da20 --- /dev/null +++ b/src/Model/PluginPrivilege.php @@ -0,0 +1,99 @@ +initialized); + } + /** + * + * + * @var string|null + */ + protected $name; + /** + * + * + * @var string|null + */ + protected $description; + /** + * + * + * @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 string[]|null + */ + public function getValue() : ?array + { + return $this->value; + } + /** + * + * + * @param string[]|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/src/Model/PluginSettings.php b/src/Model/PluginSettings.php index 51e33474..1e0a4c48 100644 --- a/src/Model/PluginSettings.php +++ b/src/Model/PluginSettings.php @@ -1,111 +1,127 @@ initialized); + } + /** + * + * + * @var PluginMount[]|null */ protected $mounts; /** - * @var string[] + * + * + * @var string[]|null */ protected $env; /** - * @var string[] + * + * + * @var string[]|null */ protected $args; /** - * @var PluginDevice[] + * + * + * @var PluginDevice[]|null */ protected $devices; - /** - * @return PluginMount[] + * + * + * @return PluginMount[]|null */ - public function getMounts(): ?array + public function getMounts() : ?array { return $this->mounts; } - /** - * @param PluginMount[] $mounts + * + * + * @param PluginMount[]|null $mounts * * @return self */ - public function setMounts(?array $mounts): self + public function setMounts(?array $mounts) : self { + $this->initialized['mounts'] = true; $this->mounts = $mounts; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getEnv(): ?array + public function getEnv() : ?array { return $this->env; } - /** - * @param string[] $env + * + * + * @param string[]|null $env * * @return self */ - public function setEnv(?array $env): self + public function setEnv(?array $env) : self { + $this->initialized['env'] = true; $this->env = $env; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getArgs(): ?array + public function getArgs() : ?array { return $this->args; } - /** - * @param string[] $args + * + * + * @param string[]|null $args * * @return self */ - public function setArgs(?array $args): self + public function setArgs(?array $args) : self { + $this->initialized['args'] = true; $this->args = $args; - return $this; } - /** - * @return PluginDevice[] + * + * + * @return PluginDevice[]|null */ - public function getDevices(): ?array + public function getDevices() : ?array { return $this->devices; } - /** - * @param PluginDevice[] $devices + * + * + * @param PluginDevice[]|null $devices * * @return self */ - public function setDevices(?array $devices): 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/src/Model/PluginsInfo.php b/src/Model/PluginsInfo.php index 7dc58983..053072db 100644 --- a/src/Model/PluginsInfo.php +++ b/src/Model/PluginsInfo.php @@ -1,135 +1,127 @@ initialized); + } /** * Names of available volume-drivers, and network-driver plugins. * - * @var string[] + * @var string[]|null */ protected $volume; /** * Names of available network-drivers, and network-driver plugins. * - * @var string[] + * @var string[]|null */ protected $network; /** * Names of available authorization plugins. * - * @var string[] + * @var string[]|null */ protected $authorization; /** * Names of available logging-drivers, and logging-driver plugins. * - * @var string[] + * @var string[]|null */ protected $log; - /** * Names of available volume-drivers, and network-driver plugins. * - * @return string[] + * @return string[]|null */ - public function getVolume(): ?array + public function getVolume() : ?array { return $this->volume; } - /** * Names of available volume-drivers, and network-driver plugins. * - * @param string[] $volume + * @param string[]|null $volume * * @return self */ - public function setVolume(?array $volume): 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 string[] + * @return string[]|null */ - public function getNetwork(): ?array + public function getNetwork() : ?array { return $this->network; } - /** * Names of available network-drivers, and network-driver plugins. * - * @param string[] $network + * @param string[]|null $network * * @return self */ - public function setNetwork(?array $network): self + public function setNetwork(?array $network) : self { + $this->initialized['network'] = true; $this->network = $network; - return $this; } - /** * Names of available authorization plugins. * - * @return string[] + * @return string[]|null */ - public function getAuthorization(): ?array + public function getAuthorization() : ?array { return $this->authorization; } - /** * Names of available authorization plugins. * - * @param string[] $authorization + * @param string[]|null $authorization * * @return self */ - public function setAuthorization(?array $authorization): 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 string[] + * @return string[]|null */ - public function getLog(): ?array + public function getLog() : ?array { return $this->log; } - /** * Names of available logging-drivers, and logging-driver plugins. * - * @param string[] $log + * @param string[]|null $log * * @return self */ - public function setLog(?array $log): 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/src/Model/PluginsNameUpgradePostBodyItem.php b/src/Model/PluginsNameUpgradePostBodyItem.php deleted file mode 100644 index 5a9073b4..00000000 --- a/src/Model/PluginsNameUpgradePostBodyItem.php +++ /dev/null @@ -1,87 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName(?string $name): self - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getDescription(): ?string - { - return $this->description; - } - - /** - * @param string $description - * - * @return self - */ - public function setDescription(?string $description): self - { - $this->description = $description; - - return $this; - } - - /** - * @return string[] - */ - public function getValue(): ?array - { - return $this->value; - } - - /** - * @param string[] $value - * - * @return self - */ - public function setValue(?array $value): self - { - $this->value = $value; - - return $this; - } -} diff --git a/src/Model/PluginsPrivilegesGetResponse200Item.php b/src/Model/PluginsPrivilegesGetResponse200Item.php deleted file mode 100644 index 49a10a0c..00000000 --- a/src/Model/PluginsPrivilegesGetResponse200Item.php +++ /dev/null @@ -1,87 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName(?string $name): self - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getDescription(): ?string - { - return $this->description; - } - - /** - * @param string $description - * - * @return self - */ - public function setDescription(?string $description): self - { - $this->description = $description; - - return $this; - } - - /** - * @return string[] - */ - public function getValue(): ?array - { - return $this->value; - } - - /** - * @param string[] $value - * - * @return self - */ - public function setValue(?array $value): self - { - $this->value = $value; - - return $this; - } -} diff --git a/src/Model/PluginsPullPostBodyItem.php b/src/Model/PluginsPullPostBodyItem.php deleted file mode 100644 index ea478a53..00000000 --- a/src/Model/PluginsPullPostBodyItem.php +++ /dev/null @@ -1,87 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName(?string $name): self - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getDescription(): ?string - { - return $this->description; - } - - /** - * @param string $description - * - * @return self - */ - public function setDescription(?string $description): self - { - $this->description = $description; - - return $this; - } - - /** - * @return string[] - */ - public function getValue(): ?array - { - return $this->value; - } - - /** - * @param string[] $value - * - * @return self - */ - public function setValue(?array $value): self - { - $this->value = $value; - - return $this; - } -} diff --git a/src/Model/Port.php b/src/Model/Port.php index 4a53824f..9eb4a5d2 100644 --- a/src/Model/Port.php +++ b/src/Model/Port.php @@ -1,123 +1,127 @@ initialized); + } + /** + * Host IP address that the container's port is mapped to + * + * @var string|null */ protected $iP; /** - * Port on the container. + * Port on the container * - * @var int + * @var int|null */ protected $privatePort; /** - * Port exposed on the host. + * Port exposed on the host * - * @var int + * @var int|null */ protected $publicPort; /** - * @var string + * + * + * @var string|null */ protected $type; - /** - * @return string + * Host IP address that the container's port is mapped to + * + * @return string|null */ - public function getIP(): ?string + public function getIP() : ?string { return $this->iP; } - /** - * @param string $iP + * Host IP address that the container's port is mapped to + * + * @param string|null $iP * * @return self */ - public function setIP(?string $iP): self + public function setIP(?string $iP) : self { + $this->initialized['iP'] = true; $this->iP = $iP; - return $this; } - /** - * Port on the container. + * Port on the container * - * @return int + * @return int|null */ - public function getPrivatePort(): ?int + public function getPrivatePort() : ?int { return $this->privatePort; } - /** - * Port on the container. + * Port on the container * - * @param int $privatePort + * @param int|null $privatePort * * @return self */ - public function setPrivatePort(?int $privatePort): self + public function setPrivatePort(?int $privatePort) : self { + $this->initialized['privatePort'] = true; $this->privatePort = $privatePort; - return $this; } - /** - * Port exposed on the host. + * Port exposed on the host * - * @return int + * @return int|null */ - public function getPublicPort(): ?int + public function getPublicPort() : ?int { return $this->publicPort; } - /** - * Port exposed on the host. + * Port exposed on the host * - * @param int $publicPort + * @param int|null $publicPort * * @return self */ - public function setPublicPort(?int $publicPort): self + public function setPublicPort(?int $publicPort) : self { + $this->initialized['publicPort'] = true; $this->publicPort = $publicPort; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getType(): ?string + public function getType() : ?string { return $this->type; } - /** - * @param string $type + * + * + * @param string|null $type * * @return self */ - public function setType(?string $type): 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/src/Model/PortBinding.php b/src/Model/PortBinding.php index 108d6796..f4e71b61 100644 --- a/src/Model/PortBinding.php +++ b/src/Model/PortBinding.php @@ -1,75 +1,71 @@ initialized); + } /** * Host IP address that the container's port is mapped to. * - * @var string + * @var string|null */ protected $hostIp; /** * Host port number that the container's port is mapped to. * - * @var string + * @var string|null */ protected $hostPort; - /** * Host IP address that the container's port is mapped to. * - * @return string + * @return string|null */ - public function getHostIp(): ?string + public function getHostIp() : ?string { return $this->hostIp; } - /** * Host IP address that the container's port is mapped to. * - * @param string $hostIp + * @param string|null $hostIp * * @return self */ - public function setHostIp(?string $hostIp): self + public function setHostIp(?string $hostIp) : self { + $this->initialized['hostIp'] = true; $this->hostIp = $hostIp; - return $this; } - /** * Host port number that the container's port is mapped to. * - * @return string + * @return string|null */ - public function getHostPort(): ?string + public function getHostPort() : ?string { return $this->hostPort; } - /** * Host port number that the container's port is mapped to. * - * @param string $hostPort + * @param string|null $hostPort * * @return self */ - public function setHostPort(?string $hostPort): self + public function setHostPort(?string $hostPort) : self { + $this->initialized['hostPort'] = true; $this->hostPort = $hostPort; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/ProcessConfig.php b/src/Model/ProcessConfig.php index b59c92d3..4fe3a138 100644 --- a/src/Model/ProcessConfig.php +++ b/src/Model/ProcessConfig.php @@ -1,135 +1,155 @@ 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[] + * + * + * @var string[]|null */ protected $arguments; - /** - * @return bool + * + * + * @return bool|null */ - public function getPrivileged(): ?bool + public function getPrivileged() : ?bool { return $this->privileged; } - /** - * @param bool $privileged + * + * + * @param bool|null $privileged * * @return self */ - public function setPrivileged(?bool $privileged): self + public function setPrivileged(?bool $privileged) : self { + $this->initialized['privileged'] = true; $this->privileged = $privileged; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getUser(): ?string + public function getUser() : ?string { return $this->user; } - /** - * @param string $user + * + * + * @param string|null $user * * @return self */ - public function setUser(?string $user): self + public function setUser(?string $user) : self { + $this->initialized['user'] = true; $this->user = $user; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getTty(): ?bool + public function getTty() : ?bool { return $this->tty; } - /** - * @param bool $tty + * + * + * @param bool|null $tty * * @return self */ - public function setTty(?bool $tty): self + public function setTty(?bool $tty) : self { + $this->initialized['tty'] = true; $this->tty = $tty; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getEntrypoint(): ?string + public function getEntrypoint() : ?string { return $this->entrypoint; } - /** - * @param string $entrypoint + * + * + * @param string|null $entrypoint * * @return self */ - public function setEntrypoint(?string $entrypoint): self + public function setEntrypoint(?string $entrypoint) : self { + $this->initialized['entrypoint'] = true; $this->entrypoint = $entrypoint; - return $this; } - /** - * @return string[] + * + * + * @return string[]|null */ - public function getArguments(): ?array + public function getArguments() : ?array { return $this->arguments; } - /** - * @param string[] $arguments + * + * + * @param string[]|null $arguments * * @return self */ - public function setArguments(?array $arguments): self + public function setArguments(?array $arguments) : self { + $this->initialized['arguments'] = true; $this->arguments = $arguments; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/ProgressDetail.php b/src/Model/ProgressDetail.php index b3078ba7..2da150df 100644 --- a/src/Model/ProgressDetail.php +++ b/src/Model/ProgressDetail.php @@ -1,63 +1,71 @@ initialized); + } + /** + * + * + * @var int|null */ protected $current; /** - * @var int + * + * + * @var int|null */ protected $total; - /** - * @return int + * + * + * @return int|null */ - public function getCurrent(): ?int + public function getCurrent() : ?int { return $this->current; } - /** - * @param int $current + * + * + * @param int|null $current * * @return self */ - public function setCurrent(?int $current): self + public function setCurrent(?int $current) : self { + $this->initialized['current'] = true; $this->current = $current; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getTotal(): ?int + public function getTotal() : ?int { return $this->total; } - /** - * @param int $total + * + * + * @param int|null $total * * @return self */ - public function setTotal(?int $total): self + public function setTotal(?int $total) : self { + $this->initialized['total'] = true; $this->total = $total; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/PushImageInfo.php b/src/Model/PushImageInfo.php index 898307dd..b23245a2 100644 --- a/src/Model/PushImageInfo.php +++ b/src/Model/PushImageInfo.php @@ -1,111 +1,127 @@ 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(): ?string + public function getError() : ?string { return $this->error; } - /** - * @param string $error + * + * + * @param string|null $error * * @return self */ - public function setError(?string $error): self + public function setError(?string $error) : self { + $this->initialized['error'] = true; $this->error = $error; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getStatus(): ?string + public function getStatus() : ?string { return $this->status; } - /** - * @param string $status + * + * + * @param string|null $status * * @return self */ - public function setStatus(?string $status): self + public function setStatus(?string $status) : self { + $this->initialized['status'] = true; $this->status = $status; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getProgress(): ?string + public function getProgress() : ?string { return $this->progress; } - /** - * @param string $progress + * + * + * @param string|null $progress * * @return self */ - public function setProgress(?string $progress): self + public function setProgress(?string $progress) : self { + $this->initialized['progress'] = true; $this->progress = $progress; - return $this; } - /** - * @return ProgressDetail + * + * + * @return ProgressDetail|null */ - public function getProgressDetail(): ?ProgressDetail + public function getProgressDetail() : ?ProgressDetail { return $this->progressDetail; } - /** - * @param ProgressDetail $progressDetail + * + * + * @param ProgressDetail|null $progressDetail * * @return self */ - public function setProgressDetail(?ProgressDetail $progressDetail): self + public function setProgressDetail(?ProgressDetail $progressDetail) : self { + $this->initialized['progressDetail'] = true; $this->progressDetail = $progressDetail; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/RegistryServiceConfig.php b/src/Model/RegistryServiceConfig.php index e8ed0c79..0b6ff07e 100644 --- a/src/Model/RegistryServiceConfig.php +++ b/src/Model/RegistryServiceConfig.php @@ -1,357 +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 string[] - */ + + * + * @var string[]|null + */ protected $allowNondistributableArtifactsCIDRs; /** - * List of registry hostnames to which nondistributable artifacts can be. + * 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 string[] - */ + + * + * @var string[]|null + */ protected $allowNondistributableArtifactsHostnames; /** - * List of IP ranges of insecure registries, using the CIDR syntax. + * 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 string[] - */ + + * + * @var string[]|null + */ protected $insecureRegistryCIDRs; /** - * @var IndexInfo[] + * + * + * @var array|null */ protected $indexConfigs; /** - * List of registry URLs that act as a mirror for the official. + * List of registry URLs that act as a mirror for the official (`docker.io`) registry. - - * - * @var string[] - */ + + * + * @var string[]|null + */ protected $mirrors; - /** - * List of IP ranges to which nondistributable artifacts can be pushed,. + * 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 string[] - */ - public function getAllowNondistributableArtifactsCIDRs(): ?array + + * + * @return string[]|null + */ + public function getAllowNondistributableArtifactsCIDRs() : ?array { return $this->allowNondistributableArtifactsCIDRs; } - /** - * List of IP ranges to which nondistributable artifacts can be pushed,. + * 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 string[] $allowNondistributableArtifactsCIDRs - * - * @return self - */ - public function setAllowNondistributableArtifactsCIDRs(?array $allowNondistributableArtifactsCIDRs): self + + * + * @param string[]|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. + * 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 string[] - */ - public function getAllowNondistributableArtifactsHostnames(): ?array + + * + * @return string[]|null + */ + public function getAllowNondistributableArtifactsHostnames() : ?array { return $this->allowNondistributableArtifactsHostnames; } - /** - * List of registry hostnames to which nondistributable artifacts can be. + * 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 string[] $allowNondistributableArtifactsHostnames - * - * @return self - */ - public function setAllowNondistributableArtifactsHostnames(?array $allowNondistributableArtifactsHostnames): self + + * + * @param string[]|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. + * 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 string[] - */ - public function getInsecureRegistryCIDRs(): ?array + + * + * @return string[]|null + */ + public function getInsecureRegistryCIDRs() : ?array { return $this->insecureRegistryCIDRs; } - /** - * List of IP ranges of insecure registries, using the CIDR syntax. + * 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 string[] $insecureRegistryCIDRs - * - * @return self - */ - public function setInsecureRegistryCIDRs(?array $insecureRegistryCIDRs): self + + * + * @param string[]|null $insecureRegistryCIDRs + * + * @return self + */ + public function setInsecureRegistryCIDRs(?array $insecureRegistryCIDRs) : self { + $this->initialized['insecureRegistryCIDRs'] = true; $this->insecureRegistryCIDRs = $insecureRegistryCIDRs; - return $this; } - /** - * @return IndexInfo[] + * + * + * @return array|null */ - public function getIndexConfigs(): ?\ArrayObject + public function getIndexConfigs() : ?iterable { return $this->indexConfigs; } - /** - * @param IndexInfo[] $indexConfigs + * + * + * @param array|null $indexConfigs * * @return self */ - public function setIndexConfigs(?\ArrayObject $indexConfigs): 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. + * List of registry URLs that act as a mirror for the official (`docker.io`) registry. - - * - * @return string[] - */ - public function getMirrors(): ?array + + * + * @return string[]|null + */ + public function getMirrors() : ?array { return $this->mirrors; } - /** - * List of registry URLs that act as a mirror for the official. + * List of registry URLs that act as a mirror for the official (`docker.io`) registry. - - * - * @param string[] $mirrors - * - * @return self - */ - public function setMirrors(?array $mirrors): self + + * + * @param string[]|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/src/Model/ResourceObject.php b/src/Model/ResourceObject.php index 4b839c74..aa1e8f4c 100644 --- a/src/Model/ResourceObject.php +++ b/src/Model/ResourceObject.php @@ -1,93 +1,105 @@ initialized); + } /** - * @var int + * + * + * @var int|null */ - protected $memoryBytes; + protected $nanoCPUs; /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). + * * - * @var GenericResourcesItem[] + * @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 GenericResourcesItem[]|null + */ protected $genericResources; - /** - * @return int + * + * + * @return int|null */ - public function getNanoCPUs(): ?int + public function getNanoCPUs() : ?int { return $this->nanoCPUs; } - /** - * @param int $nanoCPUs + * + * + * @param int|null $nanoCPUs * * @return self */ - public function setNanoCPUs(?int $nanoCPUs): self + public function setNanoCPUs(?int $nanoCPUs) : self { + $this->initialized['nanoCPUs'] = true; $this->nanoCPUs = $nanoCPUs; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getMemoryBytes(): ?int + public function getMemoryBytes() : ?int { return $this->memoryBytes; } - /** - * @param int $memoryBytes + * + * + * @param int|null $memoryBytes * * @return self */ - public function setMemoryBytes(?int $memoryBytes): 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 GenericResourcesItem[] - */ - public function getGenericResources(): ?array + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @return GenericResourcesItem[]|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 GenericResourcesItem[] $genericResources - * - * @return self - */ - public function setGenericResources(?array $genericResources): self + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @param GenericResourcesItem[]|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/src/Model/Resources.php b/src/Model/Resources.php index 2568c5c2..91f8b756 100644 --- a/src/Model/Resources.php +++ b/src/Model/Resources.php @@ -1,933 +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 + * @var int|null */ - protected $memory; + 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 - */ + * 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 + * @var int|null */ protected $blkioWeight; /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. - * - * @var ResourcesBlkioWeightDeviceItem[] - */ + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @var ResourcesBlkioWeightDeviceItem[]|null + */ protected $blkioWeightDevice; /** - * Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - * - * @var ThrottleDevice[] - */ + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var ThrottleDevice[]|null + */ protected $blkioDeviceReadBps; /** - * Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - * - * @var ThrottleDevice[] - */ + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var ThrottleDevice[]|null + */ protected $blkioDeviceWriteBps; /** - * Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - * - * @var ThrottleDevice[] - */ + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var ThrottleDevice[]|null + */ protected $blkioDeviceReadIOps; /** - * Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - * - * @var ThrottleDevice[] - */ + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @var ThrottleDevice[]|null + */ protected $blkioDeviceWriteIOps; /** * The length of a CPU period in microseconds. * - * @var int + * @var int|null */ protected $cpuPeriod; /** * Microseconds of CPU time that the container can get in a CPU period. * - * @var int + * @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 - */ + * 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 - */ + * 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 + * @var string|null */ protected $cpusetCpus; /** - * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. - * - * @var string - */ + * 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 DeviceMapping[] + * @var DeviceMapping[]|null */ protected $devices; /** - * a list of cgroup rules to apply to the container. + * a list of cgroup rules to apply to the container * - * @var string[] + * @var string[]|null */ protected $deviceCgroupRules; /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @var int + * @var DeviceRequest[]|null */ - protected $diskQuota; + protected $deviceRequests; /** - * Kernel memory limit in bytes. - * - * @var int - */ - protected $kernelMemory; + * 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 + * @var int|null */ protected $memoryReservation; /** - * Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. - * - * @var int - */ + * 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 - */ + * 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 + * @var int|null */ - protected $nanoCPUs; + protected $nanoCpus; /** * Disable OOM Killer for the container. * - * @var bool + * @var bool|null */ protected $oomKillDisable; /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @var int - */ + * 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 ResourcesUlimitsItem[] - */ + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @var ResourcesUlimitsItem[]|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 - */ + * 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 - */ + * 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). + * Maximum IOps for the container system drive (Windows only) * - * @var int + * @var int|null */ protected $iOMaximumIOps; /** - * Maximum IO in bytes per second for the container system drive (Windows only). - * - * @var int - */ + * 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 - */ - public function getCpuShares(): ?int + * 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 $cpuShares - * - * @return self - */ - public function setCpuShares(?int $cpuShares): self + * 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 + * @return int|null */ - public function getMemory(): ?int + public function getMemory() : ?int { return $this->memory; } - /** * Memory limit in bytes. * - * @param int $memory + * @param int|null $memory * * @return self */ - public function setMemory(?int $memory): 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 - */ - public function getCgroupParent(): ?string + * 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 $cgroupParent - * - * @return self - */ - public function setCgroupParent(?string $cgroupParent): self + * 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 + * @return int|null */ - public function getBlkioWeight(): ?int + public function getBlkioWeight() : ?int { return $this->blkioWeight; } - /** * Block IO weight (relative weight). * - * @param int $blkioWeight + * @param int|null $blkioWeight * * @return self */ - public function setBlkioWeight(?int $blkioWeight): 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 ResourcesBlkioWeightDeviceItem[] - */ - public function getBlkioWeightDevice(): ?array + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @return ResourcesBlkioWeightDeviceItem[]|null + */ + public function getBlkioWeightDevice() : ?array { return $this->blkioWeightDevice; } - /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. - * - * @param ResourcesBlkioWeightDeviceItem[] $blkioWeightDevice - * - * @return self - */ - public function setBlkioWeightDevice(?array $blkioWeightDevice): self + * Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + + * + * @param ResourcesBlkioWeightDeviceItem[]|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 ThrottleDevice[] - */ - public function getBlkioDeviceReadBps(): ?array + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return ThrottleDevice[]|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 ThrottleDevice[] $blkioDeviceReadBps - * - * @return self - */ - public function setBlkioDeviceReadBps(?array $blkioDeviceReadBps): self + * Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param ThrottleDevice[]|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 ThrottleDevice[] - */ - public function getBlkioDeviceWriteBps(): ?array + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return ThrottleDevice[]|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 ThrottleDevice[] $blkioDeviceWriteBps - * - * @return self - */ - public function setBlkioDeviceWriteBps(?array $blkioDeviceWriteBps): self + * Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param ThrottleDevice[]|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 ThrottleDevice[] - */ - public function getBlkioDeviceReadIOps(): ?array + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return ThrottleDevice[]|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 ThrottleDevice[] $blkioDeviceReadIOps - * - * @return self - */ - public function setBlkioDeviceReadIOps(?array $blkioDeviceReadIOps): self + * Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param ThrottleDevice[]|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 ThrottleDevice[] - */ - public function getBlkioDeviceWriteIOps(): ?array + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @return ThrottleDevice[]|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 ThrottleDevice[] $blkioDeviceWriteIOps - * - * @return self - */ - public function setBlkioDeviceWriteIOps(?array $blkioDeviceWriteIOps): self + * Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + + * + * @param ThrottleDevice[]|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 + * @return int|null */ - public function getCpuPeriod(): ?int + public function getCpuPeriod() : ?int { return $this->cpuPeriod; } - /** * The length of a CPU period in microseconds. * - * @param int $cpuPeriod + * @param int|null $cpuPeriod * * @return self */ - public function setCpuPeriod(?int $cpuPeriod): 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 + * @return int|null */ - public function getCpuQuota(): ?int + public function getCpuQuota() : ?int { return $this->cpuQuota; } - /** * Microseconds of CPU time that the container can get in a CPU period. * - * @param int $cpuQuota + * @param int|null $cpuQuota * * @return self */ - public function setCpuQuota(?int $cpuQuota): 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 - */ - public function getCpuRealtimePeriod(): ?int + * 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 $cpuRealtimePeriod - * - * @return self - */ - public function setCpuRealtimePeriod(?int $cpuRealtimePeriod): self + * 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 - */ - public function getCpuRealtimeRuntime(): ?int + * 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 $cpuRealtimeRuntime - * - * @return self - */ - public function setCpuRealtimeRuntime(?int $cpuRealtimeRuntime): self + * 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 + * @return string|null */ - public function getCpusetCpus(): ?string + public function getCpusetCpus() : ?string { return $this->cpusetCpus; } - /** * CPUs in which to allow execution (e.g., `0-3`, `0,1`). * - * @param string $cpusetCpus + * @param string|null $cpusetCpus * * @return self */ - public function setCpusetCpus(?string $cpusetCpus): 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 - */ - public function getCpusetMems(): ?string + * 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 $cpusetMems - * - * @return self - */ - public function setCpusetMems(?string $cpusetMems): self + * 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 DeviceMapping[] + * @return DeviceMapping[]|null */ - public function getDevices(): ?array + public function getDevices() : ?array { return $this->devices; } - /** * A list of devices to add to the container. * - * @param DeviceMapping[] $devices + * @param DeviceMapping[]|null $devices * * @return self */ - public function setDevices(?array $devices): 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. + * a list of cgroup rules to apply to the container * - * @return string[] + * @return string[]|null */ - public function getDeviceCgroupRules(): ?array + public function getDeviceCgroupRules() : ?array { return $this->deviceCgroupRules; } - /** - * a list of cgroup rules to apply to the container. + * a list of cgroup rules to apply to the container * - * @param string[] $deviceCgroupRules + * @param string[]|null $deviceCgroupRules * * @return self */ - public function setDeviceCgroupRules(?array $deviceCgroupRules): self + public function setDeviceCgroupRules(?array $deviceCgroupRules) : self { + $this->initialized['deviceCgroupRules'] = true; $this->deviceCgroupRules = $deviceCgroupRules; - return $this; } - /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @return int + * @return DeviceRequest[]|null */ - public function getDiskQuota(): ?int + public function getDeviceRequests() : ?array { - return $this->diskQuota; + return $this->deviceRequests; } - /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @param int $diskQuota + * @param DeviceRequest[]|null $deviceRequests * * @return self */ - public function setDiskQuota(?int $diskQuota): self + public function setDeviceRequests(?array $deviceRequests) : self { - $this->diskQuota = $diskQuota; - + $this->initialized['deviceRequests'] = true; + $this->deviceRequests = $deviceRequests; return $this; } - /** - * Kernel memory limit in bytes. - * - * @return int - */ - public function getKernelMemory(): ?int + * 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->kernelMemory; + return $this->kernelMemoryTCP; } - /** - * Kernel memory limit in bytes. - * - * @param int $kernelMemory - * - * @return self - */ - public function setKernelMemory(?int $kernelMemory): self + * 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->kernelMemory = $kernelMemory; - + $this->initialized['kernelMemoryTCP'] = true; + $this->kernelMemoryTCP = $kernelMemoryTCP; return $this; } - /** * Memory soft limit in bytes. * - * @return int + * @return int|null */ - public function getMemoryReservation(): ?int + public function getMemoryReservation() : ?int { return $this->memoryReservation; } - /** * Memory soft limit in bytes. * - * @param int $memoryReservation + * @param int|null $memoryReservation * * @return self */ - public function setMemoryReservation(?int $memoryReservation): 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 - */ - public function getMemorySwap(): ?int + * 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 $memorySwap - * - * @return self - */ - public function setMemorySwap(?int $memorySwap): self + * 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 - */ - public function getMemorySwappiness(): ?int + * 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 $memorySwappiness - * - * @return self - */ - public function setMemorySwappiness(?int $memorySwappiness): self + * 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 + * @return int|null */ - public function getNanoCPUs(): ?int + public function getNanoCpus() : ?int { - return $this->nanoCPUs; + return $this->nanoCpus; } - /** * CPU quota in units of 10-9 CPUs. * - * @param int $nanoCPUs + * @param int|null $nanoCpus * * @return self */ - public function setNanoCPUs(?int $nanoCPUs): self + public function setNanoCpus(?int $nanoCpus) : self { - $this->nanoCPUs = $nanoCPUs; - + $this->initialized['nanoCpus'] = true; + $this->nanoCpus = $nanoCpus; return $this; } - /** * Disable OOM Killer for the container. * - * @return bool + * @return bool|null */ - public function getOomKillDisable(): ?bool + public function getOomKillDisable() : ?bool { return $this->oomKillDisable; } - /** * Disable OOM Killer for the container. * - * @param bool $oomKillDisable + * @param bool|null $oomKillDisable * * @return self */ - public function setOomKillDisable(?bool $oomKillDisable): self + public function setOomKillDisable(?bool $oomKillDisable) : self { + $this->initialized['oomKillDisable'] = true; $this->oomKillDisable = $oomKillDisable; - return $this; } - /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @return int - */ - public function getPidsLimit(): ?int + * 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 -1 for unlimited. - * - * @param int $pidsLimit - * - * @return self - */ - public function setPidsLimit(?int $pidsLimit): self + * 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 ResourcesUlimitsItem[] - */ - public function getUlimits(): ?array + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @return ResourcesUlimitsItem[]|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 ResourcesUlimitsItem[] $ulimits - * - * @return self - */ - public function setUlimits(?array $ulimits): self + * A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + + * + * @param ResourcesUlimitsItem[]|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 - */ - public function getCpuCount(): ?int + * 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 $cpuCount - * - * @return self - */ - public function setCpuCount(?int $cpuCount): self + * 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 - */ - public function getCpuPercent(): ?int + * 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 $cpuPercent - * - * @return self - */ - public function setCpuPercent(?int $cpuPercent): self + * 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). + * Maximum IOps for the container system drive (Windows only) * - * @return int + * @return int|null */ - public function getIOMaximumIOps(): ?int + public function getIOMaximumIOps() : ?int { return $this->iOMaximumIOps; } - /** - * Maximum IOps for the container system drive (Windows only). + * Maximum IOps for the container system drive (Windows only) * - * @param int $iOMaximumIOps + * @param int|null $iOMaximumIOps * * @return self */ - public function setIOMaximumIOps(?int $iOMaximumIOps): 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 - */ - public function getIOMaximumBandwidth(): ?int + * 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 $iOMaximumBandwidth - * - * @return self - */ - public function setIOMaximumBandwidth(?int $iOMaximumBandwidth): self + * 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/src/Model/ResourcesBlkioWeightDeviceItem.php b/src/Model/ResourcesBlkioWeightDeviceItem.php index 9ec9aba4..a6a13163 100644 --- a/src/Model/ResourcesBlkioWeightDeviceItem.php +++ b/src/Model/ResourcesBlkioWeightDeviceItem.php @@ -1,63 +1,71 @@ initialized); + } + /** + * + * + * @var string|null */ protected $path; /** - * @var int + * + * + * @var int|null */ protected $weight; - /** - * @return string + * + * + * @return string|null */ - public function getPath(): ?string + public function getPath() : ?string { return $this->path; } - /** - * @param string $path + * + * + * @param string|null $path * * @return self */ - public function setPath(?string $path): self + public function setPath(?string $path) : self { + $this->initialized['path'] = true; $this->path = $path; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getWeight(): ?int + public function getWeight() : ?int { return $this->weight; } - /** - * @param int $weight + * + * + * @param int|null $weight * * @return self */ - public function setWeight(?int $weight): 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/src/Model/ResourcesUlimitsItem.php b/src/Model/ResourcesUlimitsItem.php index fdf51001..313be664 100644 --- a/src/Model/ResourcesUlimitsItem.php +++ b/src/Model/ResourcesUlimitsItem.php @@ -1,105 +1,99 @@ initialized); + } + /** + * Name of ulimit * - * @var string + * @var string|null */ protected $name; /** - * Soft limit. + * Soft limit * - * @var int + * @var int|null */ protected $soft; /** - * Hard limit. + * Hard limit * - * @var int + * @var int|null */ protected $hard; - /** - * Name of ulimit. + * Name of ulimit * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** - * Name of ulimit. + * Name of ulimit * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * Soft limit. + * Soft limit * - * @return int + * @return int|null */ - public function getSoft(): ?int + public function getSoft() : ?int { return $this->soft; } - /** - * Soft limit. + * Soft limit * - * @param int $soft + * @param int|null $soft * * @return self */ - public function setSoft(?int $soft): self + public function setSoft(?int $soft) : self { + $this->initialized['soft'] = true; $this->soft = $soft; - return $this; } - /** - * Hard limit. + * Hard limit * - * @return int + * @return int|null */ - public function getHard(): ?int + public function getHard() : ?int { return $this->hard; } - /** - * Hard limit. + * Hard limit * - * @param int $hard + * @param int|null $hard * * @return self */ - public function setHard(?int $hard): 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/src/Model/RestartPolicy.php b/src/Model/RestartPolicy.php index 88d3b5e1..55649674 100644 --- a/src/Model/RestartPolicy.php +++ b/src/Model/RestartPolicy.php @@ -1,87 +1,86 @@ 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 - */ + + * + * @var string|null + */ protected $name; /** * If `on-failure` is used, the number of times to retry before giving up. * - * @var int + * @var int|null */ protected $maximumRetryCount; - /** - * - Empty string means not to restart. + * - 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 - */ - public function getName(): ?string + + * + * @return string|null + */ + public function getName() : ?string { return $this->name; } - /** - * - Empty string means not to restart. + * - 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 $name - * - * @return self - */ - public function setName(?string $name): self + + * + * @param string|null $name + * + * @return self + */ + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * If `on-failure` is used, the number of times to retry before giving up. * - * @return int + * @return int|null */ - public function getMaximumRetryCount(): ?int + public function getMaximumRetryCount() : ?int { return $this->maximumRetryCount; } - /** * If `on-failure` is used, the number of times to retry before giving up. * - * @param int $maximumRetryCount + * @param int|null $maximumRetryCount * * @return self */ - public function setMaximumRetryCount(?int $maximumRetryCount): self + public function setMaximumRetryCount(?int $maximumRetryCount) : self { + $this->initialized['maximumRetryCount'] = true; $this->maximumRetryCount = $maximumRetryCount; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/Runtime.php b/src/Model/Runtime.php index 5ce83d96..bfa608da 100644 --- a/src/Model/Runtime.php +++ b/src/Model/Runtime.php @@ -1,87 +1,83 @@ 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 - */ + + * + * @var string|null + */ protected $path; /** * List of command-line arguments to pass to the runtime when invoked. * - * @var string[] + * @var string[]|null */ protected $runtimeArgs; - /** - * Name and, optional, path, of the OCI executable binary. - + * 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 - */ - public function getPath(): ?string + + * + * @return string|null + */ + public function getPath() : ?string { return $this->path; } - /** - * Name and, optional, path, of the OCI executable binary. - + * 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 $path - * - * @return self - */ - public function setPath(?string $path): self + + * + * @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 string[] + * @return string[]|null */ - public function getRuntimeArgs(): ?array + public function getRuntimeArgs() : ?array { return $this->runtimeArgs; } - /** * List of command-line arguments to pass to the runtime when invoked. * - * @param string[] $runtimeArgs + * @param string[]|null $runtimeArgs * * @return self */ - public function setRuntimeArgs(?array $runtimeArgs): self + public function setRuntimeArgs(?array $runtimeArgs) : self { + $this->initialized['runtimeArgs'] = true; $this->runtimeArgs = $runtimeArgs; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/Secret.php b/src/Model/Secret.php index 009b55e6..5ccb02f7 100644 --- a/src/Model/Secret.php +++ b/src/Model/Secret.php @@ -1,162 +1,185 @@ 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 + * @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 + * + * + * @var string|null */ protected $createdAt; /** - * @var string + * + * + * @var string|null */ protected $updatedAt; /** - * @var SecretSpec + * + * + * @var SecretSpec|null */ protected $spec; - /** - * @return string + * + * + * @return string|null */ - public function getID(): ?string + public function getID() : ?string { return $this->iD; } - /** - * @param string $iD + * + * + * @param string|null $iD * * @return self */ - public function setID(?string $iD): 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 - */ - public function getVersion(): ?ObjectVersion + * 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 $version - * - * @return self - */ - public function setVersion(?ObjectVersion $version): self + * 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 + * + * + * @return string|null */ - public function getCreatedAt(): ?string + public function getCreatedAt() : ?string { return $this->createdAt; } - /** - * @param string $createdAt + * + * + * @param string|null $createdAt * * @return self */ - public function setCreatedAt(?string $createdAt): self + public function setCreatedAt(?string $createdAt) : self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getUpdatedAt(): ?string + public function getUpdatedAt() : ?string { return $this->updatedAt; } - /** - * @param string $updatedAt + * + * + * @param string|null $updatedAt * * @return self */ - public function setUpdatedAt(?string $updatedAt): self + public function setUpdatedAt(?string $updatedAt) : self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; - return $this; } - /** - * @return SecretSpec + * + * + * @return SecretSpec|null */ - public function getSpec(): ?SecretSpec + public function getSpec() : ?SecretSpec { return $this->spec; } - /** - * @param SecretSpec $spec + * + * + * @param SecretSpec|null $spec * * @return self */ - public function setSpec(?SecretSpec $spec): 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/src/Model/SecretSpec.php b/src/Model/SecretSpec.php index 8fb8941f..331d5bb9 100644 --- a/src/Model/SecretSpec.php +++ b/src/Model/SecretSpec.php @@ -1,150 +1,170 @@ initialized); + } /** * User-defined name of the secret. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). + * 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 - */ + + * + * @var string|null + */ protected $data; /** * Driver represents a driver (network, logging, secrets). * - * @var Driver + * @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 + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * User-defined name of the secret. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): 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-3.2)). + * 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 - */ - public function getData(): ?string + + * + * @return string|null + */ + public function getData() : ?string { return $this->data; } - /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). + * 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 string $data + * @param Driver|null $driver * * @return self */ - public function setData(?string $data): self + public function setDriver(?Driver $driver) : self { - $this->data = $data; - + $this->initialized['driver'] = true; + $this->driver = $driver; return $this; } - /** * Driver represents a driver (network, logging, secrets). * - * @return Driver + * @return Driver|null */ - public function getDriver(): ?Driver + public function getTemplating() : ?Driver { - return $this->driver; + return $this->templating; } - /** * Driver represents a driver (network, logging, secrets). * - * @param Driver $driver + * @param Driver|null $templating * * @return self */ - public function setDriver(?Driver $driver): self + public function setTemplating(?Driver $templating) : self { - $this->driver = $driver; - + $this->initialized['templating'] = true; + $this->templating = $templating; return $this; } -} +} \ No newline at end of file diff --git a/src/Model/SecretsCreatePostBody.php b/src/Model/SecretsCreatePostBody.php index 0f85b194..3993b401 100644 --- a/src/Model/SecretsCreatePostBody.php +++ b/src/Model/SecretsCreatePostBody.php @@ -1,150 +1,170 @@ initialized); + } /** * User-defined name of the secret. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). + * 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 - */ + + * + * @var string|null + */ protected $data; /** * Driver represents a driver (network, logging, secrets). * - * @var Driver + * @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 + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * User-defined name of the secret. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): 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-3.2)). + * 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 - */ - public function getData(): ?string + + * + * @return string|null + */ + public function getData() : ?string { return $this->data; } - /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). + * 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 string $data + * @param Driver|null $driver * * @return self */ - public function setData(?string $data): self + public function setDriver(?Driver $driver) : self { - $this->data = $data; - + $this->initialized['driver'] = true; + $this->driver = $driver; return $this; } - /** * Driver represents a driver (network, logging, secrets). * - * @return Driver + * @return Driver|null */ - public function getDriver(): ?Driver + public function getTemplating() : ?Driver { - return $this->driver; + return $this->templating; } - /** * Driver represents a driver (network, logging, secrets). * - * @param Driver $driver + * @param Driver|null $templating * * @return self */ - public function setDriver(?Driver $driver): self + public function setTemplating(?Driver $templating) : self { - $this->driver = $driver; - + $this->initialized['templating'] = true; + $this->templating = $templating; return $this; } -} +} \ No newline at end of file diff --git a/src/Model/Service.php b/src/Model/Service.php index c0a5bfe5..98af5aac 100644 --- a/src/Model/Service.php +++ b/src/Model/Service.php @@ -1,222 +1,315 @@ 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 + * @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 + * + * + * @var string|null */ protected $createdAt; /** - * @var string + * + * + * @var string|null */ protected $updatedAt; /** * User modifiable configuration for a service. * - * @var ServiceSpec + * @var ServiceSpec|null */ protected $spec; /** - * @var ServiceEndpoint + * + * + * @var ServiceEndpoint|null */ protected $endpoint; /** * The status of a service update. * - * @var ServiceUpdateStatus + * @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(): ?string + public function getID() : ?string { return $this->iD; } - /** - * @param string $iD + * + * + * @param string|null $iD * * @return self */ - public function setID(?string $iD): 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 - */ - public function getVersion(): ?ObjectVersion + * 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 $version - * - * @return self - */ - public function setVersion(?ObjectVersion $version): self + * 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 + * + * + * @return string|null */ - public function getCreatedAt(): ?string + public function getCreatedAt() : ?string { return $this->createdAt; } - /** - * @param string $createdAt + * + * + * @param string|null $createdAt * * @return self */ - public function setCreatedAt(?string $createdAt): self + public function setCreatedAt(?string $createdAt) : self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getUpdatedAt(): ?string + public function getUpdatedAt() : ?string { return $this->updatedAt; } - /** - * @param string $updatedAt + * + * + * @param string|null $updatedAt * * @return self */ - public function setUpdatedAt(?string $updatedAt): self + public function setUpdatedAt(?string $updatedAt) : self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; - return $this; } - /** * User modifiable configuration for a service. * - * @return ServiceSpec + * @return ServiceSpec|null */ - public function getSpec(): ?ServiceSpec + public function getSpec() : ?ServiceSpec { return $this->spec; } - /** * User modifiable configuration for a service. * - * @param ServiceSpec $spec + * @param ServiceSpec|null $spec * * @return self */ - public function setSpec(?ServiceSpec $spec): self + public function setSpec(?ServiceSpec $spec) : self { + $this->initialized['spec'] = true; $this->spec = $spec; - return $this; } - /** - * @return ServiceEndpoint + * + * + * @return ServiceEndpoint|null */ - public function getEndpoint(): ?ServiceEndpoint + public function getEndpoint() : ?ServiceEndpoint { return $this->endpoint; } - /** - * @param ServiceEndpoint $endpoint + * + * + * @param ServiceEndpoint|null $endpoint * * @return self */ - public function setEndpoint(?ServiceEndpoint $endpoint): self + public function setEndpoint(?ServiceEndpoint $endpoint) : self { + $this->initialized['endpoint'] = true; $this->endpoint = $endpoint; - return $this; } - /** * The status of a service update. * - * @return ServiceUpdateStatus + * @return ServiceUpdateStatus|null */ - public function getUpdateStatus(): ?ServiceUpdateStatus + public function getUpdateStatus() : ?ServiceUpdateStatus { return $this->updateStatus; } - /** * The status of a service update. * - * @param ServiceUpdateStatus $updateStatus + * @param ServiceUpdateStatus|null $updateStatus * * @return self */ - public function setUpdateStatus(?ServiceUpdateStatus $updateStatus): self + 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/src/Model/ServiceEndpoint.php b/src/Model/ServiceEndpoint.php index ae67f3cc..e7b04d7c 100644 --- a/src/Model/ServiceEndpoint.php +++ b/src/Model/ServiceEndpoint.php @@ -1,93 +1,99 @@ initialized); + } /** * Properties that can be configured to access and load balance a service. * - * @var EndpointSpec + * @var EndpointSpec|null */ protected $spec; /** - * @var EndpointPortConfig[] + * + * + * @var EndpointPortConfig[]|null */ protected $ports; /** - * @var ServiceEndpointVirtualIPsItem[] + * + * + * @var ServiceEndpointVirtualIPsItem[]|null */ protected $virtualIPs; - /** * Properties that can be configured to access and load balance a service. * - * @return EndpointSpec + * @return EndpointSpec|null */ - public function getSpec(): ?EndpointSpec + public function getSpec() : ?EndpointSpec { return $this->spec; } - /** * Properties that can be configured to access and load balance a service. * - * @param EndpointSpec $spec + * @param EndpointSpec|null $spec * * @return self */ - public function setSpec(?EndpointSpec $spec): self + public function setSpec(?EndpointSpec $spec) : self { + $this->initialized['spec'] = true; $this->spec = $spec; - return $this; } - /** - * @return EndpointPortConfig[] + * + * + * @return EndpointPortConfig[]|null */ - public function getPorts(): ?array + public function getPorts() : ?array { return $this->ports; } - /** - * @param EndpointPortConfig[] $ports + * + * + * @param EndpointPortConfig[]|null $ports * * @return self */ - public function setPorts(?array $ports): self + public function setPorts(?array $ports) : self { + $this->initialized['ports'] = true; $this->ports = $ports; - return $this; } - /** - * @return ServiceEndpointVirtualIPsItem[] + * + * + * @return ServiceEndpointVirtualIPsItem[]|null */ - public function getVirtualIPs(): ?array + public function getVirtualIPs() : ?array { return $this->virtualIPs; } - /** - * @param ServiceEndpointVirtualIPsItem[] $virtualIPs + * + * + * @param ServiceEndpointVirtualIPsItem[]|null $virtualIPs * * @return self */ - public function setVirtualIPs(?array $virtualIPs): 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/src/Model/ServiceEndpointVirtualIPsItem.php b/src/Model/ServiceEndpointVirtualIPsItem.php index 2221ceaf..2c6661f4 100644 --- a/src/Model/ServiceEndpointVirtualIPsItem.php +++ b/src/Model/ServiceEndpointVirtualIPsItem.php @@ -1,63 +1,71 @@ initialized); + } + /** + * + * + * @var string|null */ protected $networkID; /** - * @var string + * + * + * @var string|null */ protected $addr; - /** - * @return string + * + * + * @return string|null */ - public function getNetworkID(): ?string + public function getNetworkID() : ?string { return $this->networkID; } - /** - * @param string $networkID + * + * + * @param string|null $networkID * * @return self */ - public function setNetworkID(?string $networkID): self + public function setNetworkID(?string $networkID) : self { + $this->initialized['networkID'] = true; $this->networkID = $networkID; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getAddr(): ?string + public function getAddr() : ?string { return $this->addr; } - /** - * @param string $addr + * + * + * @param string|null $addr * * @return self */ - public function setAddr(?string $addr): 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/src/Model/ServiceJobStatus.php b/src/Model/ServiceJobStatus.php new file mode 100644 index 00000000..483d6407 --- /dev/null +++ b/src/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/src/Model/ServiceServiceStatus.php b/src/Model/ServiceServiceStatus.php new file mode 100644 index 00000000..193527f5 --- /dev/null +++ b/src/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/src/Model/ServiceSpec.php b/src/Model/ServiceSpec.php index 4416800e..966153f3 100644 --- a/src/Model/ServiceSpec.php +++ b/src/Model/ServiceSpec.php @@ -1,255 +1,239 @@ initialized); + } /** * Name of the service. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * User modifiable task configuration. * - * @var TaskSpec + * @var TaskSpec|null */ protected $taskTemplate; /** * Scheduling mode for the service. * - * @var ServiceSpecMode + * @var ServiceSpecMode|null */ protected $mode; /** * Specification for the update strategy of the service. * - * @var ServiceSpecUpdateConfig + * @var ServiceSpecUpdateConfig|null */ protected $updateConfig; /** * Specification for the rollback strategy of the service. * - * @var ServiceSpecRollbackConfig + * @var ServiceSpecRollbackConfig|null */ protected $rollbackConfig; /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. * - * @var ServiceSpecNetworksItem[] + * @var NetworkAttachmentConfig[]|null */ protected $networks; /** * Properties that can be configured to access and load balance a service. * - * @var EndpointSpec + * @var EndpointSpec|null */ protected $endpointSpec; - /** * Name of the service. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Name of the service. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels) : self { + $this->initialized['labels'] = true; $this->labels = $labels; - return $this; } - /** * User modifiable task configuration. * - * @return TaskSpec + * @return TaskSpec|null */ - public function getTaskTemplate(): ?TaskSpec + public function getTaskTemplate() : ?TaskSpec { return $this->taskTemplate; } - /** * User modifiable task configuration. * - * @param TaskSpec $taskTemplate + * @param TaskSpec|null $taskTemplate * * @return self */ - public function setTaskTemplate(?TaskSpec $taskTemplate): self + public function setTaskTemplate(?TaskSpec $taskTemplate) : self { + $this->initialized['taskTemplate'] = true; $this->taskTemplate = $taskTemplate; - return $this; } - /** * Scheduling mode for the service. * - * @return ServiceSpecMode + * @return ServiceSpecMode|null */ - public function getMode(): ?ServiceSpecMode + public function getMode() : ?ServiceSpecMode { return $this->mode; } - /** * Scheduling mode for the service. * - * @param ServiceSpecMode $mode + * @param ServiceSpecMode|null $mode * * @return self */ - public function setMode(?ServiceSpecMode $mode): 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 + * @return ServiceSpecUpdateConfig|null */ - public function getUpdateConfig(): ?ServiceSpecUpdateConfig + public function getUpdateConfig() : ?ServiceSpecUpdateConfig { return $this->updateConfig; } - /** * Specification for the update strategy of the service. * - * @param ServiceSpecUpdateConfig $updateConfig + * @param ServiceSpecUpdateConfig|null $updateConfig * * @return self */ - public function setUpdateConfig(?ServiceSpecUpdateConfig $updateConfig): 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 + * @return ServiceSpecRollbackConfig|null */ - public function getRollbackConfig(): ?ServiceSpecRollbackConfig + public function getRollbackConfig() : ?ServiceSpecRollbackConfig { return $this->rollbackConfig; } - /** * Specification for the rollback strategy of the service. * - * @param ServiceSpecRollbackConfig $rollbackConfig + * @param ServiceSpecRollbackConfig|null $rollbackConfig * * @return self */ - public function setRollbackConfig(?ServiceSpecRollbackConfig $rollbackConfig): self + public function setRollbackConfig(?ServiceSpecRollbackConfig $rollbackConfig) : self { + $this->initialized['rollbackConfig'] = true; $this->rollbackConfig = $rollbackConfig; - return $this; } - /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. * - * @return ServiceSpecNetworksItem[] + * @return NetworkAttachmentConfig[]|null */ - public function getNetworks(): ?array + public function getNetworks() : ?array { return $this->networks; } - /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. * - * @param ServiceSpecNetworksItem[] $networks + * @param NetworkAttachmentConfig[]|null $networks * * @return self */ - public function setNetworks(?array $networks): 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 + * @return EndpointSpec|null */ - public function getEndpointSpec(): ?EndpointSpec + public function getEndpointSpec() : ?EndpointSpec { return $this->endpointSpec; } - /** * Properties that can be configured to access and load balance a service. * - * @param EndpointSpec $endpointSpec + * @param EndpointSpec|null $endpointSpec * * @return self */ - public function setEndpointSpec(?EndpointSpec $endpointSpec): 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/src/Model/ServiceSpecMode.php b/src/Model/ServiceSpecMode.php index a04731fb..11769049 100644 --- a/src/Model/ServiceSpecMode.php +++ b/src/Model/ServiceSpecMode.php @@ -1,63 +1,139 @@ initialized); + } + /** + * + * + * @var ServiceSpecModeReplicated|null */ protected $replicated; /** - * @var mixed + * + * + * @var mixed|null */ protected $global; - /** - * @return ServiceSpecModeReplicated + * 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(): ?ServiceSpecModeReplicated + public function getReplicated() : ?ServiceSpecModeReplicated { return $this->replicated; } - /** - * @param ServiceSpecModeReplicated $replicated + * + * + * @param ServiceSpecModeReplicated|null $replicated * * @return self */ - public function setReplicated(?ServiceSpecModeReplicated $replicated): self + public function setReplicated(?ServiceSpecModeReplicated $replicated) : self { + $this->initialized['replicated'] = true; $this->replicated = $replicated; - return $this; } - /** + * + * * @return mixed */ public function getGlobal() { return $this->global; } - /** + * + * * @param mixed $global * * @return self */ - public function setGlobal($global): self + 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/src/Model/ServiceSpecModeReplicated.php b/src/Model/ServiceSpecModeReplicated.php index 9c8bf3ef..346f4ebb 100644 --- a/src/Model/ServiceSpecModeReplicated.php +++ b/src/Model/ServiceSpecModeReplicated.php @@ -1,39 +1,43 @@ initialized); + } + /** + * + * + * @var int|null */ protected $replicas; - /** - * @return int + * + * + * @return int|null */ - public function getReplicas(): ?int + public function getReplicas() : ?int { return $this->replicas; } - /** - * @param int $replicas + * + * + * @param int|null $replicas * * @return self */ - public function setReplicas(?int $replicas): 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/src/Model/ServiceSpecModeReplicatedJob.php b/src/Model/ServiceSpecModeReplicatedJob.php new file mode 100644 index 00000000..271ae169 --- /dev/null +++ b/src/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/src/Model/ServiceSpecNetworksItem.php b/src/Model/ServiceSpecNetworksItem.php deleted file mode 100644 index 32ebb9ac..00000000 --- a/src/Model/ServiceSpecNetworksItem.php +++ /dev/null @@ -1,63 +0,0 @@ -target; - } - - /** - * @param string $target - * - * @return self - */ - public function setTarget(?string $target): self - { - $this->target = $target; - - return $this; - } - - /** - * @return string[] - */ - public function getAliases(): ?array - { - return $this->aliases; - } - - /** - * @param string[] $aliases - * - * @return self - */ - public function setAliases(?array $aliases): self - { - $this->aliases = $aliases; - - return $this; - } -} diff --git a/src/Model/ServiceSpecRollbackConfig.php b/src/Model/ServiceSpecRollbackConfig.php index ec8a260a..aa668d6d 100644 --- a/src/Model/ServiceSpecRollbackConfig.php +++ b/src/Model/ServiceSpecRollbackConfig.php @@ -1,195 +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 + * @var int|null */ protected $delay; /** - * Action to take if an rolled back task fails to run, or stops running during the rollback. - * - * @var string - */ + * 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 - */ + * 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 - */ - protected $maxFailureRatio; - /** - * 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 - */ + * 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 - */ - public function getParallelism(): ?int + * 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 $parallelism - * - * @return self - */ - public function setParallelism(?int $parallelism): self + * 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 + * @return int|null */ - public function getDelay(): ?int + public function getDelay() : ?int { return $this->delay; } - /** * Amount of time between rollback iterations, in nanoseconds. * - * @param int $delay + * @param int|null $delay * * @return self */ - public function setDelay(?int $delay): 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 - */ - public function getFailureAction(): ?string + * 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 $failureAction - * - * @return self - */ - public function setFailureAction(?string $failureAction): self + * 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 - */ - public function getMonitor(): ?int + * 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 $monitor - * - * @return self - */ - public function setMonitor(?int $monitor): self + * 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 - */ - public function getMaxFailureRatio(): ?float + * 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 $maxFailureRatio - * - * @return self - */ - public function setMaxFailureRatio(?float $maxFailureRatio): self + * 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 - */ - public function getOrder(): ?string + * 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 $order - * - * @return self - */ - public function setOrder(?string $order): self + * 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/src/Model/ServiceSpecUpdateConfig.php b/src/Model/ServiceSpecUpdateConfig.php index ccb913e7..08817ad4 100644 --- a/src/Model/ServiceSpecUpdateConfig.php +++ b/src/Model/ServiceSpecUpdateConfig.php @@ -1,195 +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 + * @var int|null */ protected $delay; /** - * Action to take if an updated task fails to run, or stops running during the update. - * - * @var string - */ + * 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 - */ + * 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 - */ - protected $maxFailureRatio; - /** - * 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 - */ + * 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 - */ - public function getParallelism(): ?int + * 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 $parallelism - * - * @return self - */ - public function setParallelism(?int $parallelism): self + * 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 + * @return int|null */ - public function getDelay(): ?int + public function getDelay() : ?int { return $this->delay; } - /** * Amount of time between updates, in nanoseconds. * - * @param int $delay + * @param int|null $delay * * @return self */ - public function setDelay(?int $delay): 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 - */ - public function getFailureAction(): ?string + * 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 $failureAction - * - * @return self - */ - public function setFailureAction(?string $failureAction): self + * 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 - */ - public function getMonitor(): ?int + * 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 $monitor - * - * @return self - */ - public function setMonitor(?int $monitor): self + * 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 - */ - public function getMaxFailureRatio(): ?float + * 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 $maxFailureRatio - * - * @return self - */ - public function setMaxFailureRatio(?float $maxFailureRatio): self + * 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 - */ - public function getOrder(): ?string + * 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 $order - * - * @return self - */ - public function setOrder(?string $order): self + * 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/src/Model/ServiceUpdateResponse.php b/src/Model/ServiceUpdateResponse.php index cb77082d..3355df58 100644 --- a/src/Model/ServiceUpdateResponse.php +++ b/src/Model/ServiceUpdateResponse.php @@ -1,45 +1,43 @@ initialized); + } + /** + * Optional warning messages * - * @var string[] + * @var string[]|null */ protected $warnings; - /** - * Optional warning messages. + * Optional warning messages * - * @return string[] + * @return string[]|null */ - public function getWarnings(): ?array + public function getWarnings() : ?array { return $this->warnings; } - /** - * Optional warning messages. + * Optional warning messages * - * @param string[] $warnings + * @param string[]|null $warnings * * @return self */ - public function setWarnings(?array $warnings): 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/src/Model/ServiceUpdateStatus.php b/src/Model/ServiceUpdateStatus.php index 3626d277..414ed2d4 100644 --- a/src/Model/ServiceUpdateStatus.php +++ b/src/Model/ServiceUpdateStatus.php @@ -1,111 +1,127 @@ initialized); + } + /** + * + * + * @var string|null */ protected $state; /** - * @var string + * + * + * @var string|null */ protected $startedAt; /** - * @var string + * + * + * @var string|null */ protected $completedAt; /** - * @var string + * + * + * @var string|null */ protected $message; - /** - * @return string + * + * + * @return string|null */ - public function getState(): ?string + public function getState() : ?string { return $this->state; } - /** - * @param string $state + * + * + * @param string|null $state * * @return self */ - public function setState(?string $state): self + public function setState(?string $state) : self { + $this->initialized['state'] = true; $this->state = $state; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getStartedAt(): ?string + public function getStartedAt() : ?string { return $this->startedAt; } - /** - * @param string $startedAt + * + * + * @param string|null $startedAt * * @return self */ - public function setStartedAt(?string $startedAt): self + public function setStartedAt(?string $startedAt) : self { + $this->initialized['startedAt'] = true; $this->startedAt = $startedAt; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getCompletedAt(): ?string + public function getCompletedAt() : ?string { return $this->completedAt; } - /** - * @param string $completedAt + * + * + * @param string|null $completedAt * * @return self */ - public function setCompletedAt(?string $completedAt): self + public function setCompletedAt(?string $completedAt) : self { + $this->initialized['completedAt'] = true; $this->completedAt = $completedAt; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getMessage(): ?string + public function getMessage() : ?string { return $this->message; } - /** - * @param string $message + * + * + * @param string|null $message * * @return self */ - public function setMessage(?string $message): 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/src/Model/ServicesCreatePostBody.php b/src/Model/ServicesCreatePostBody.php index 4b65df1d..e347d2c5 100644 --- a/src/Model/ServicesCreatePostBody.php +++ b/src/Model/ServicesCreatePostBody.php @@ -1,255 +1,239 @@ initialized); + } /** * Name of the service. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * User modifiable task configuration. * - * @var TaskSpec + * @var TaskSpec|null */ protected $taskTemplate; /** * Scheduling mode for the service. * - * @var ServiceSpecMode + * @var ServiceSpecMode|null */ protected $mode; /** * Specification for the update strategy of the service. * - * @var ServiceSpecUpdateConfig + * @var ServiceSpecUpdateConfig|null */ protected $updateConfig; /** * Specification for the rollback strategy of the service. * - * @var ServiceSpecRollbackConfig + * @var ServiceSpecRollbackConfig|null */ protected $rollbackConfig; /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. * - * @var ServiceSpecNetworksItem[] + * @var NetworkAttachmentConfig[]|null */ protected $networks; /** * Properties that can be configured to access and load balance a service. * - * @var EndpointSpec + * @var EndpointSpec|null */ protected $endpointSpec; - /** * Name of the service. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Name of the service. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels) : self { + $this->initialized['labels'] = true; $this->labels = $labels; - return $this; } - /** * User modifiable task configuration. * - * @return TaskSpec + * @return TaskSpec|null */ - public function getTaskTemplate(): ?TaskSpec + public function getTaskTemplate() : ?TaskSpec { return $this->taskTemplate; } - /** * User modifiable task configuration. * - * @param TaskSpec $taskTemplate + * @param TaskSpec|null $taskTemplate * * @return self */ - public function setTaskTemplate(?TaskSpec $taskTemplate): self + public function setTaskTemplate(?TaskSpec $taskTemplate) : self { + $this->initialized['taskTemplate'] = true; $this->taskTemplate = $taskTemplate; - return $this; } - /** * Scheduling mode for the service. * - * @return ServiceSpecMode + * @return ServiceSpecMode|null */ - public function getMode(): ?ServiceSpecMode + public function getMode() : ?ServiceSpecMode { return $this->mode; } - /** * Scheduling mode for the service. * - * @param ServiceSpecMode $mode + * @param ServiceSpecMode|null $mode * * @return self */ - public function setMode(?ServiceSpecMode $mode): 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 + * @return ServiceSpecUpdateConfig|null */ - public function getUpdateConfig(): ?ServiceSpecUpdateConfig + public function getUpdateConfig() : ?ServiceSpecUpdateConfig { return $this->updateConfig; } - /** * Specification for the update strategy of the service. * - * @param ServiceSpecUpdateConfig $updateConfig + * @param ServiceSpecUpdateConfig|null $updateConfig * * @return self */ - public function setUpdateConfig(?ServiceSpecUpdateConfig $updateConfig): 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 + * @return ServiceSpecRollbackConfig|null */ - public function getRollbackConfig(): ?ServiceSpecRollbackConfig + public function getRollbackConfig() : ?ServiceSpecRollbackConfig { return $this->rollbackConfig; } - /** * Specification for the rollback strategy of the service. * - * @param ServiceSpecRollbackConfig $rollbackConfig + * @param ServiceSpecRollbackConfig|null $rollbackConfig * * @return self */ - public function setRollbackConfig(?ServiceSpecRollbackConfig $rollbackConfig): self + public function setRollbackConfig(?ServiceSpecRollbackConfig $rollbackConfig) : self { + $this->initialized['rollbackConfig'] = true; $this->rollbackConfig = $rollbackConfig; - return $this; } - /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. * - * @return ServiceSpecNetworksItem[] + * @return NetworkAttachmentConfig[]|null */ - public function getNetworks(): ?array + public function getNetworks() : ?array { return $this->networks; } - /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. * - * @param ServiceSpecNetworksItem[] $networks + * @param NetworkAttachmentConfig[]|null $networks * * @return self */ - public function setNetworks(?array $networks): 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 + * @return EndpointSpec|null */ - public function getEndpointSpec(): ?EndpointSpec + public function getEndpointSpec() : ?EndpointSpec { return $this->endpointSpec; } - /** * Properties that can be configured to access and load balance a service. * - * @param EndpointSpec $endpointSpec + * @param EndpointSpec|null $endpointSpec * * @return self */ - public function setEndpointSpec(?EndpointSpec $endpointSpec): 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/src/Model/ServicesCreatePostResponse201.php b/src/Model/ServicesCreatePostResponse201.php index d1d83385..1e3f70f5 100644 --- a/src/Model/ServicesCreatePostResponse201.php +++ b/src/Model/ServicesCreatePostResponse201.php @@ -1,75 +1,71 @@ initialized); + } /** * The ID of the created service. * - * @var string + * @var string|null */ protected $iD; /** - * Optional warning message. + * Optional warning message * - * @var string + * @var string|null */ protected $warning; - /** * The ID of the created service. * - * @return string + * @return string|null */ - public function getID(): ?string + public function getID() : ?string { return $this->iD; } - /** * The ID of the created service. * - * @param string $iD + * @param string|null $iD * * @return self */ - public function setID(?string $iD): self + public function setID(?string $iD) : self { + $this->initialized['iD'] = true; $this->iD = $iD; - return $this; } - /** - * Optional warning message. + * Optional warning message * - * @return string + * @return string|null */ - public function getWarning(): ?string + public function getWarning() : ?string { return $this->warning; } - /** - * Optional warning message. + * Optional warning message * - * @param string $warning + * @param string|null $warning * * @return self */ - public function setWarning(?string $warning): 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/src/Model/ServicesIdUpdatePostBody.php b/src/Model/ServicesIdUpdatePostBody.php index 1fc66e96..d612a49b 100644 --- a/src/Model/ServicesIdUpdatePostBody.php +++ b/src/Model/ServicesIdUpdatePostBody.php @@ -1,255 +1,239 @@ initialized); + } /** * Name of the service. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * User modifiable task configuration. * - * @var TaskSpec + * @var TaskSpec|null */ protected $taskTemplate; /** * Scheduling mode for the service. * - * @var ServiceSpecMode + * @var ServiceSpecMode|null */ protected $mode; /** * Specification for the update strategy of the service. * - * @var ServiceSpecUpdateConfig + * @var ServiceSpecUpdateConfig|null */ protected $updateConfig; /** * Specification for the rollback strategy of the service. * - * @var ServiceSpecRollbackConfig + * @var ServiceSpecRollbackConfig|null */ protected $rollbackConfig; /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. * - * @var ServiceSpecNetworksItem[] + * @var NetworkAttachmentConfig[]|null */ protected $networks; /** * Properties that can be configured to access and load balance a service. * - * @var EndpointSpec + * @var EndpointSpec|null */ protected $endpointSpec; - /** * Name of the service. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Name of the service. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels) : self { + $this->initialized['labels'] = true; $this->labels = $labels; - return $this; } - /** * User modifiable task configuration. * - * @return TaskSpec + * @return TaskSpec|null */ - public function getTaskTemplate(): ?TaskSpec + public function getTaskTemplate() : ?TaskSpec { return $this->taskTemplate; } - /** * User modifiable task configuration. * - * @param TaskSpec $taskTemplate + * @param TaskSpec|null $taskTemplate * * @return self */ - public function setTaskTemplate(?TaskSpec $taskTemplate): self + public function setTaskTemplate(?TaskSpec $taskTemplate) : self { + $this->initialized['taskTemplate'] = true; $this->taskTemplate = $taskTemplate; - return $this; } - /** * Scheduling mode for the service. * - * @return ServiceSpecMode + * @return ServiceSpecMode|null */ - public function getMode(): ?ServiceSpecMode + public function getMode() : ?ServiceSpecMode { return $this->mode; } - /** * Scheduling mode for the service. * - * @param ServiceSpecMode $mode + * @param ServiceSpecMode|null $mode * * @return self */ - public function setMode(?ServiceSpecMode $mode): 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 + * @return ServiceSpecUpdateConfig|null */ - public function getUpdateConfig(): ?ServiceSpecUpdateConfig + public function getUpdateConfig() : ?ServiceSpecUpdateConfig { return $this->updateConfig; } - /** * Specification for the update strategy of the service. * - * @param ServiceSpecUpdateConfig $updateConfig + * @param ServiceSpecUpdateConfig|null $updateConfig * * @return self */ - public function setUpdateConfig(?ServiceSpecUpdateConfig $updateConfig): 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 + * @return ServiceSpecRollbackConfig|null */ - public function getRollbackConfig(): ?ServiceSpecRollbackConfig + public function getRollbackConfig() : ?ServiceSpecRollbackConfig { return $this->rollbackConfig; } - /** * Specification for the rollback strategy of the service. * - * @param ServiceSpecRollbackConfig $rollbackConfig + * @param ServiceSpecRollbackConfig|null $rollbackConfig * * @return self */ - public function setRollbackConfig(?ServiceSpecRollbackConfig $rollbackConfig): self + public function setRollbackConfig(?ServiceSpecRollbackConfig $rollbackConfig) : self { + $this->initialized['rollbackConfig'] = true; $this->rollbackConfig = $rollbackConfig; - return $this; } - /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. * - * @return ServiceSpecNetworksItem[] + * @return NetworkAttachmentConfig[]|null */ - public function getNetworks(): ?array + public function getNetworks() : ?array { return $this->networks; } - /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. * - * @param ServiceSpecNetworksItem[] $networks + * @param NetworkAttachmentConfig[]|null $networks * * @return self */ - public function setNetworks(?array $networks): 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 + * @return EndpointSpec|null */ - public function getEndpointSpec(): ?EndpointSpec + public function getEndpointSpec() : ?EndpointSpec { return $this->endpointSpec; } - /** * Properties that can be configured to access and load balance a service. * - * @param EndpointSpec $endpointSpec + * @param EndpointSpec|null $endpointSpec * * @return self */ - public function setEndpointSpec(?EndpointSpec $endpointSpec): 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/src/Model/Swarm.php b/src/Model/Swarm.php index b2fa2dec..f81397b8 100644 --- a/src/Model/Swarm.php +++ b/src/Model/Swarm.php @@ -1,288 +1,392 @@ initialized); + } /** * The ID of the swarm. * - * @var string + * @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 - */ + * 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. + * 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 - */ + + * + * @var string|null + */ protected $createdAt; /** - * Date and time at which the swarm was last updated in. + * 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 - */ + + * + * @var string|null + */ protected $updatedAt; /** * User modifiable swarm configuration. * - * @var SwarmSpec + * @var SwarmSpec|null */ protected $spec; /** - * Information about the issuer of leaf TLS certificates and the trusted root CA certificate. - * - * @var TLSInfo - */ + * 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. + * Whether there is currently a root CA rotation in progress for the swarm * - * @var bool + * @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 string[]|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 + * @var JoinTokens|null */ protected $joinTokens; - /** * The ID of the swarm. * - * @return string + * @return string|null */ - public function getID(): ?string + public function getID() : ?string { return $this->iD; } - /** * The ID of the swarm. * - * @param string $iD + * @param string|null $iD * * @return self */ - public function setID(?string $iD): 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 - */ - public function getVersion(): ?ObjectVersion + * 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 $version - * - * @return self - */ - public function setVersion(?ObjectVersion $version): self + * 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. + * 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 - */ - public function getCreatedAt(): ?string + + * + * @return string|null + */ + public function getCreatedAt() : ?string { return $this->createdAt; } - /** - * Date and time at which the swarm was initialised in. + * 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 $createdAt - * - * @return self - */ - public function setCreatedAt(?string $createdAt): self + + * + * @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. + * 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 - */ - public function getUpdatedAt(): ?string + + * + * @return string|null + */ + public function getUpdatedAt() : ?string { return $this->updatedAt; } - /** - * Date and time at which the swarm was last updated in. + * 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 $updatedAt - * - * @return self - */ - public function setUpdatedAt(?string $updatedAt): self + + * + * @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 + * @return SwarmSpec|null */ - public function getSpec(): ?SwarmSpec + public function getSpec() : ?SwarmSpec { return $this->spec; } - /** * User modifiable swarm configuration. * - * @param SwarmSpec $spec + * @param SwarmSpec|null $spec * * @return self */ - public function setSpec(?SwarmSpec $spec): 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 - */ - public function getTLSInfo(): ?TLSInfo + * 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 $tLSInfo - * - * @return self - */ - public function setTLSInfo(?TLSInfo $tLSInfo): self + * 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. + * Whether there is currently a root CA rotation in progress for the swarm * - * @return bool + * @return bool|null */ - public function getRootRotationInProgress(): ?bool + public function getRootRotationInProgress() : ?bool { return $this->rootRotationInProgress; } - /** - * Whether there is currently a root CA rotation in progress for the swarm. + * Whether there is currently a root CA rotation in progress for the swarm * - * @param bool $rootRotationInProgress + * @param bool|null $rootRotationInProgress * * @return self */ - public function setRootRotationInProgress(?bool $rootRotationInProgress): 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 string[]|null + */ + public function getDefaultAddrPool() : ?array + { + return $this->defaultAddrPool; + } + /** + * Default Address Pool specifies default subnet pools for global scope + networks. + + * + * @param string[]|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 + * @return JoinTokens|null */ - public function getJoinTokens(): ?JoinTokens + public function getJoinTokens() : ?JoinTokens { return $this->joinTokens; } - /** * JoinTokens contains the tokens workers and managers need to join the swarm. * - * @param JoinTokens $joinTokens + * @param JoinTokens|null $joinTokens * * @return self */ - public function setJoinTokens(?JoinTokens $joinTokens): 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/src/Model/SwarmInfo.php b/src/Model/SwarmInfo.php index 42c6993c..d2571e92 100644 --- a/src/Model/SwarmInfo.php +++ b/src/Model/SwarmInfo.php @@ -1,285 +1,279 @@ initialized); + } /** * Unique identifier of for this node in the swarm. * - * @var string + * @var string|null */ - protected $nodeID; + protected $nodeID = ''; /** - * IP address at which this node can be reached by other nodes in the. + * IP address at which this node can be reached by other nodes in the swarm. - - * - * @var string - */ - protected $nodeAddr; + + * + * @var string|null + */ + protected $nodeAddr = ''; /** * Current local status of this node. * - * @var string + * @var string|null */ - protected $localNodeState; + protected $localNodeState = ''; /** - * @var bool + * + * + * @var bool|null */ - protected $controlAvailable; + protected $controlAvailable = false; /** - * @var string + * + * + * @var string|null */ - protected $error; + protected $error = ''; /** * List of ID's and addresses of other managers in the swarm. * - * @var PeerNode[] + * @var PeerNode[]|null */ protected $remoteManagers; /** * Total number of nodes in the swarm. * - * @var int + * @var int|null */ protected $nodes; /** * Total number of managers in the swarm. * - * @var int + * @var int|null */ protected $managers; /** - * ClusterInfo represents information about the swarm as is returned by the. + * ClusterInfo represents information about the swarm as is returned by the "/info" endpoint. Join-tokens are not included. - - * - * @var ClusterInfo - */ + + * + * @var ClusterInfo|null + */ protected $cluster; - /** * Unique identifier of for this node in the swarm. * - * @return string + * @return string|null */ - public function getNodeID(): ?string + public function getNodeID() : ?string { return $this->nodeID; } - /** * Unique identifier of for this node in the swarm. * - * @param string $nodeID + * @param string|null $nodeID * * @return self */ - public function setNodeID(?string $nodeID): 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. + * IP address at which this node can be reached by other nodes in the swarm. - - * - * @return string - */ - public function getNodeAddr(): ?string + + * + * @return string|null + */ + public function getNodeAddr() : ?string { return $this->nodeAddr; } - /** - * IP address at which this node can be reached by other nodes in the. + * IP address at which this node can be reached by other nodes in the swarm. - - * - * @param string $nodeAddr - * - * @return self - */ - public function setNodeAddr(?string $nodeAddr): self + + * + * @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 + * @return string|null */ - public function getLocalNodeState(): ?string + public function getLocalNodeState() : ?string { return $this->localNodeState; } - /** * Current local status of this node. * - * @param string $localNodeState + * @param string|null $localNodeState * * @return self */ - public function setLocalNodeState(?string $localNodeState): self + public function setLocalNodeState(?string $localNodeState) : self { + $this->initialized['localNodeState'] = true; $this->localNodeState = $localNodeState; - return $this; } - /** - * @return bool + * + * + * @return bool|null */ - public function getControlAvailable(): ?bool + public function getControlAvailable() : ?bool { return $this->controlAvailable; } - /** - * @param bool $controlAvailable + * + * + * @param bool|null $controlAvailable * * @return self */ - public function setControlAvailable(?bool $controlAvailable): self + public function setControlAvailable(?bool $controlAvailable) : self { + $this->initialized['controlAvailable'] = true; $this->controlAvailable = $controlAvailable; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getError(): ?string + public function getError() : ?string { return $this->error; } - /** - * @param string $error + * + * + * @param string|null $error * * @return self */ - public function setError(?string $error): 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 PeerNode[] + * @return PeerNode[]|null */ - public function getRemoteManagers(): ?array + public function getRemoteManagers() : ?array { return $this->remoteManagers; } - /** * List of ID's and addresses of other managers in the swarm. * - * @param PeerNode[] $remoteManagers + * @param PeerNode[]|null $remoteManagers * * @return self */ - public function setRemoteManagers(?array $remoteManagers): 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 + * @return int|null */ - public function getNodes(): ?int + public function getNodes() : ?int { return $this->nodes; } - /** * Total number of nodes in the swarm. * - * @param int $nodes + * @param int|null $nodes * * @return self */ - public function setNodes(?int $nodes): 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 + * @return int|null */ - public function getManagers(): ?int + public function getManagers() : ?int { return $this->managers; } - /** * Total number of managers in the swarm. * - * @param int $managers + * @param int|null $managers * * @return self */ - public function setManagers(?int $managers): 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. + * ClusterInfo represents information about the swarm as is returned by the "/info" endpoint. Join-tokens are not included. - - * - * @return ClusterInfo - */ - public function getCluster(): ?ClusterInfo + + * + * @return ClusterInfo|null + */ + public function getCluster() : ?ClusterInfo { return $this->cluster; } - /** - * ClusterInfo represents information about the swarm as is returned by the. + * ClusterInfo represents information about the swarm as is returned by the "/info" endpoint. Join-tokens are not included. - - * - * @param ClusterInfo $cluster - * - * @return self - */ - public function setCluster(?ClusterInfo $cluster): self + + * + * @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/src/Model/SwarmInitPostBody.php b/src/Model/SwarmInitPostBody.php index c383e49b..89d0151f 100644 --- a/src/Model/SwarmInitPostBody.php +++ b/src/Model/SwarmInitPostBody.php @@ -1,186 +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 - */ + * 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 - */ + * 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 string[]|null + */ + protected $defaultAddrPool; /** * Force creation of a new swarm. * - * @var bool + * @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 + * @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 - */ - public function getListenAddr(): ?string + * 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 $listenAddr - * - * @return self - */ - public function setListenAddr(?string $listenAddr): self + * 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 - */ - public function getAdvertiseAddr(): ?string + * 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 $advertiseAddr - * - * @return self - */ - public function setAdvertiseAddr(?string $advertiseAddr): self + * 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 - */ - public function getDataPathAddr(): ?string + * 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 $dataPathAddr - * - * @return self - */ - public function setDataPathAddr(?string $dataPathAddr): self + * 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 string[]|null + */ + public function getDefaultAddrPool() : ?array + { + return $this->defaultAddrPool; + } + /** + * Default Address Pool specifies default subnet pools for global + scope networks. + + * + * @param string[]|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 + * @return bool|null */ - public function getForceNewCluster(): ?bool + public function getForceNewCluster() : ?bool { return $this->forceNewCluster; } - /** * Force creation of a new swarm. * - * @param bool $forceNewCluster + * @param bool|null $forceNewCluster * * @return self */ - public function setForceNewCluster(?bool $forceNewCluster): 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 + * @return SwarmSpec|null */ - public function getSpec(): ?SwarmSpec + public function getSpec() : ?SwarmSpec { return $this->spec; } - /** * User modifiable swarm configuration. * - * @param SwarmSpec $spec + * @param SwarmSpec|null $spec * * @return self */ - public function setSpec(?SwarmSpec $spec): 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/src/Model/SwarmJoinPostBody.php b/src/Model/SwarmJoinPostBody.php index fdf759f2..cfabfdbe 100644 --- a/src/Model/SwarmJoinPostBody.php +++ b/src/Model/SwarmJoinPostBody.php @@ -1,186 +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 - */ + * 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 - */ + * 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 string + * @var string[]|null */ protected $remoteAddrs; /** * Secret token for joining this swarm. * - * @var string + * @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 - */ - public function getListenAddr(): ?string + * 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 $listenAddr - * - * @return self - */ - public function setListenAddr(?string $listenAddr): self + * 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 - */ - public function getAdvertiseAddr(): ?string + * 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 $advertiseAddr - * - * @return self - */ - public function setAdvertiseAddr(?string $advertiseAddr): self + * 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 - */ - public function getDataPathAddr(): ?string + * 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 $dataPathAddr - * - * @return self - */ - public function setDataPathAddr(?string $dataPathAddr): self + * 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 string + * @return string[]|null */ - public function getRemoteAddrs(): ?string + public function getRemoteAddrs() : ?array { return $this->remoteAddrs; } - /** * Addresses of manager nodes already participating in the swarm. * - * @param string $remoteAddrs + * @param string[]|null $remoteAddrs * * @return self */ - public function setRemoteAddrs(?string $remoteAddrs): self + public function setRemoteAddrs(?array $remoteAddrs) : self { + $this->initialized['remoteAddrs'] = true; $this->remoteAddrs = $remoteAddrs; - return $this; } - /** * Secret token for joining this swarm. * - * @return string + * @return string|null */ - public function getJoinToken(): ?string + public function getJoinToken() : ?string { return $this->joinToken; } - /** * Secret token for joining this swarm. * - * @param string $joinToken + * @param string|null $joinToken * * @return self */ - public function setJoinToken(?string $joinToken): 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/src/Model/SwarmSpec.php b/src/Model/SwarmSpec.php index 5f5b6d07..7c25b9ef 100644 --- a/src/Model/SwarmSpec.php +++ b/src/Model/SwarmSpec.php @@ -1,255 +1,239 @@ initialized); + } /** * Name of the swarm. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * Orchestration configuration. * - * @var SwarmSpecOrchestration + * @var SwarmSpecOrchestration|null */ protected $orchestration; /** * Raft configuration. * - * @var SwarmSpecRaft + * @var SwarmSpecRaft|null */ protected $raft; /** * Dispatcher configuration. * - * @var SwarmSpecDispatcher + * @var SwarmSpecDispatcher|null */ protected $dispatcher; /** * CA configuration. * - * @var SwarmSpecCAConfig + * @var SwarmSpecCAConfig|null */ protected $cAConfig; /** * Parameters related to encryption-at-rest. * - * @var SwarmSpecEncryptionConfig + * @var SwarmSpecEncryptionConfig|null */ protected $encryptionConfig; /** * Defaults for creating tasks in this cluster. * - * @var SwarmSpecTaskDefaults + * @var SwarmSpecTaskDefaults|null */ protected $taskDefaults; - /** * Name of the swarm. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Name of the swarm. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels) : self { + $this->initialized['labels'] = true; $this->labels = $labels; - return $this; } - /** * Orchestration configuration. * - * @return SwarmSpecOrchestration + * @return SwarmSpecOrchestration|null */ - public function getOrchestration(): ?SwarmSpecOrchestration + public function getOrchestration() : ?SwarmSpecOrchestration { return $this->orchestration; } - /** * Orchestration configuration. * - * @param SwarmSpecOrchestration $orchestration + * @param SwarmSpecOrchestration|null $orchestration * * @return self */ - public function setOrchestration(?SwarmSpecOrchestration $orchestration): self + public function setOrchestration(?SwarmSpecOrchestration $orchestration) : self { + $this->initialized['orchestration'] = true; $this->orchestration = $orchestration; - return $this; } - /** * Raft configuration. * - * @return SwarmSpecRaft + * @return SwarmSpecRaft|null */ - public function getRaft(): ?SwarmSpecRaft + public function getRaft() : ?SwarmSpecRaft { return $this->raft; } - /** * Raft configuration. * - * @param SwarmSpecRaft $raft + * @param SwarmSpecRaft|null $raft * * @return self */ - public function setRaft(?SwarmSpecRaft $raft): self + public function setRaft(?SwarmSpecRaft $raft) : self { + $this->initialized['raft'] = true; $this->raft = $raft; - return $this; } - /** * Dispatcher configuration. * - * @return SwarmSpecDispatcher + * @return SwarmSpecDispatcher|null */ - public function getDispatcher(): ?SwarmSpecDispatcher + public function getDispatcher() : ?SwarmSpecDispatcher { return $this->dispatcher; } - /** * Dispatcher configuration. * - * @param SwarmSpecDispatcher $dispatcher + * @param SwarmSpecDispatcher|null $dispatcher * * @return self */ - public function setDispatcher(?SwarmSpecDispatcher $dispatcher): self + public function setDispatcher(?SwarmSpecDispatcher $dispatcher) : self { + $this->initialized['dispatcher'] = true; $this->dispatcher = $dispatcher; - return $this; } - /** * CA configuration. * - * @return SwarmSpecCAConfig + * @return SwarmSpecCAConfig|null */ - public function getCAConfig(): ?SwarmSpecCAConfig + public function getCAConfig() : ?SwarmSpecCAConfig { return $this->cAConfig; } - /** * CA configuration. * - * @param SwarmSpecCAConfig $cAConfig + * @param SwarmSpecCAConfig|null $cAConfig * * @return self */ - public function setCAConfig(?SwarmSpecCAConfig $cAConfig): self + public function setCAConfig(?SwarmSpecCAConfig $cAConfig) : self { + $this->initialized['cAConfig'] = true; $this->cAConfig = $cAConfig; - return $this; } - /** * Parameters related to encryption-at-rest. * - * @return SwarmSpecEncryptionConfig + * @return SwarmSpecEncryptionConfig|null */ - public function getEncryptionConfig(): ?SwarmSpecEncryptionConfig + public function getEncryptionConfig() : ?SwarmSpecEncryptionConfig { return $this->encryptionConfig; } - /** * Parameters related to encryption-at-rest. * - * @param SwarmSpecEncryptionConfig $encryptionConfig + * @param SwarmSpecEncryptionConfig|null $encryptionConfig * * @return self */ - public function setEncryptionConfig(?SwarmSpecEncryptionConfig $encryptionConfig): 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 + * @return SwarmSpecTaskDefaults|null */ - public function getTaskDefaults(): ?SwarmSpecTaskDefaults + public function getTaskDefaults() : ?SwarmSpecTaskDefaults { return $this->taskDefaults; } - /** * Defaults for creating tasks in this cluster. * - * @param SwarmSpecTaskDefaults $taskDefaults + * @param SwarmSpecTaskDefaults|null $taskDefaults * * @return self */ - public function setTaskDefaults(?SwarmSpecTaskDefaults $taskDefaults): 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/src/Model/SwarmSpecCAConfig.php b/src/Model/SwarmSpecCAConfig.php index 3efe3070..fbe04304 100644 --- a/src/Model/SwarmSpecCAConfig.php +++ b/src/Model/SwarmSpecCAConfig.php @@ -1,165 +1,182 @@ initialized); + } /** * The duration node certificates are issued for. * - * @var int + * @var int|null */ protected $nodeCertExpiry; /** - * Configuration for forwarding signing requests to an external certificate authority. - * - * @var SwarmSpecCAConfigExternalCAsItem[] - */ + * Configuration for forwarding signing requests to an external + certificate authority. + + * + * @var SwarmSpecCAConfigExternalCAsItem[]|null + */ protected $externalCAs; /** - * The desired signing CA certificate for all swarm node TLS leaf certificates, in PEM format. - * - * @var string - */ + * 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 - */ + * 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 - */ + * 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 + * @return int|null */ - public function getNodeCertExpiry(): ?int + public function getNodeCertExpiry() : ?int { return $this->nodeCertExpiry; } - /** * The duration node certificates are issued for. * - * @param int $nodeCertExpiry + * @param int|null $nodeCertExpiry * * @return self */ - public function setNodeCertExpiry(?int $nodeCertExpiry): 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 SwarmSpecCAConfigExternalCAsItem[] - */ - public function getExternalCAs(): ?array + * Configuration for forwarding signing requests to an external + certificate authority. + + * + * @return SwarmSpecCAConfigExternalCAsItem[]|null + */ + public function getExternalCAs() : ?array { return $this->externalCAs; } - /** - * Configuration for forwarding signing requests to an external certificate authority. - * - * @param SwarmSpecCAConfigExternalCAsItem[] $externalCAs - * - * @return self - */ - public function setExternalCAs(?array $externalCAs): self + * Configuration for forwarding signing requests to an external + certificate authority. + + * + * @param SwarmSpecCAConfigExternalCAsItem[]|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 - */ - public function getSigningCACert(): ?string + * 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 $signingCACert - * - * @return self - */ - public function setSigningCACert(?string $signingCACert): self + * 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 - */ - public function getSigningCAKey(): ?string + * 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 $signingCAKey - * - * @return self - */ - public function setSigningCAKey(?string $signingCAKey): self + * 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 - */ - public function getForceRotate(): ?int + * 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 $forceRotate - * - * @return self - */ - public function setForceRotate(?int $forceRotate): self + * 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/src/Model/SwarmSpecCAConfigExternalCAsItem.php b/src/Model/SwarmSpecCAConfigExternalCAsItem.php index a3e087f1..3aa52d4c 100644 --- a/src/Model/SwarmSpecCAConfigExternalCAsItem.php +++ b/src/Model/SwarmSpecCAConfigExternalCAsItem.php @@ -1,135 +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 + * @var string|null */ protected $uRL; /** - * An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver. - * - * @var string[] - */ + * 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 - */ + * 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 - */ - public function getProtocol(): ?string + * 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 $protocol - * - * @return self - */ - public function setProtocol(?string $protocol): self + * 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 + * @return string|null */ - public function getURL(): ?string + public function getURL() : ?string { return $this->uRL; } - /** * URL where certificate signing requests should be sent. * - * @param string $uRL + * @param string|null $uRL * * @return self */ - public function setURL(?string $uRL): 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 string[] - */ - public function getOptions(): ?\ArrayObject + * 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 string[] $options - * - * @return self - */ - public function setOptions(?\ArrayObject $options): self + * 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 - */ - public function getCACert(): ?string + * 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 $cACert - * - * @return self - */ - public function setCACert(?string $cACert): self + * 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/src/Model/SwarmSpecDispatcher.php b/src/Model/SwarmSpecDispatcher.php index 7d0dee96..c5730c0b 100644 --- a/src/Model/SwarmSpecDispatcher.php +++ b/src/Model/SwarmSpecDispatcher.php @@ -1,45 +1,43 @@ initialized); + } /** * The delay for an agent to send a heartbeat to the dispatcher. * - * @var int + * @var int|null */ protected $heartbeatPeriod; - /** * The delay for an agent to send a heartbeat to the dispatcher. * - * @return int + * @return int|null */ - public function getHeartbeatPeriod(): ?int + public function getHeartbeatPeriod() : ?int { return $this->heartbeatPeriod; } - /** * The delay for an agent to send a heartbeat to the dispatcher. * - * @param int $heartbeatPeriod + * @param int|null $heartbeatPeriod * * @return self */ - public function setHeartbeatPeriod(?int $heartbeatPeriod): 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/src/Model/SwarmSpecEncryptionConfig.php b/src/Model/SwarmSpecEncryptionConfig.php index c848fc16..2d2a3763 100644 --- a/src/Model/SwarmSpecEncryptionConfig.php +++ b/src/Model/SwarmSpecEncryptionConfig.php @@ -1,45 +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 - */ - public function getAutoLockManagers(): ?bool + * 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 $autoLockManagers - * - * @return self - */ - public function setAutoLockManagers(?bool $autoLockManagers): self + * 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/src/Model/SwarmSpecOrchestration.php b/src/Model/SwarmSpecOrchestration.php index a953751b..0de460ed 100644 --- a/src/Model/SwarmSpecOrchestration.php +++ b/src/Model/SwarmSpecOrchestration.php @@ -1,45 +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 - */ - public function getTaskHistoryRetentionLimit(): ?int + * 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 $taskHistoryRetentionLimit - * - * @return self - */ - public function setTaskHistoryRetentionLimit(?int $taskHistoryRetentionLimit): self + * 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/src/Model/SwarmSpecRaft.php b/src/Model/SwarmSpecRaft.php index c413a55a..f3870242 100644 --- a/src/Model/SwarmSpecRaft.php +++ b/src/Model/SwarmSpecRaft.php @@ -1,183 +1,194 @@ initialized); + } /** * The number of log entries between snapshots. * - * @var int + * @var int|null */ protected $snapshotInterval; /** * The number of snapshots to keep beyond the current snapshot. * - * @var int + * @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 - */ + * 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 - */ + * 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 - */ + * 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 + * @return int|null */ - public function getSnapshotInterval(): ?int + public function getSnapshotInterval() : ?int { return $this->snapshotInterval; } - /** * The number of log entries between snapshots. * - * @param int $snapshotInterval + * @param int|null $snapshotInterval * * @return self */ - public function setSnapshotInterval(?int $snapshotInterval): 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 + * @return int|null */ - public function getKeepOldSnapshots(): ?int + public function getKeepOldSnapshots() : ?int { return $this->keepOldSnapshots; } - /** * The number of snapshots to keep beyond the current snapshot. * - * @param int $keepOldSnapshots + * @param int|null $keepOldSnapshots * * @return self */ - public function setKeepOldSnapshots(?int $keepOldSnapshots): 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 - */ - public function getLogEntriesForSlowFollowers(): ?int + * 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 $logEntriesForSlowFollowers - * - * @return self - */ - public function setLogEntriesForSlowFollowers(?int $logEntriesForSlowFollowers): self + * 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 - */ - public function getElectionTick(): ?int + * 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 $electionTick - * - * @return self - */ - public function setElectionTick(?int $electionTick): self + * 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 - */ - public function getHeartbeatTick(): ?int + * 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 $heartbeatTick - * - * @return self - */ - public function setHeartbeatTick(?int $heartbeatTick): self + * 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/src/Model/SwarmSpecTaskDefaults.php b/src/Model/SwarmSpecTaskDefaults.php index a5f85611..e227be65 100644 --- a/src/Model/SwarmSpecTaskDefaults.php +++ b/src/Model/SwarmSpecTaskDefaults.php @@ -1,60 +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 - */ + + * + * @var SwarmSpecTaskDefaultsLogDriver|null + */ protected $logDriver; - /** - * The log driver to use for tasks created in the orchestrator if. + * 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 - */ - public function getLogDriver(): ?SwarmSpecTaskDefaultsLogDriver + + * + * @return SwarmSpecTaskDefaultsLogDriver|null + */ + public function getLogDriver() : ?SwarmSpecTaskDefaultsLogDriver { return $this->logDriver; } - /** - * The log driver to use for tasks created in the orchestrator if. + * 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 $logDriver - * - * @return self - */ - public function setLogDriver(?SwarmSpecTaskDefaultsLogDriver $logDriver): self + + * + * @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/src/Model/SwarmSpecTaskDefaultsLogDriver.php b/src/Model/SwarmSpecTaskDefaultsLogDriver.php index 4fd39d9e..a03f77cf 100644 --- a/src/Model/SwarmSpecTaskDefaultsLogDriver.php +++ b/src/Model/SwarmSpecTaskDefaultsLogDriver.php @@ -1,81 +1,77 @@ initialized); + } /** * The log driver to use as a default for new tasks. * - * @var string + * @var string|null */ protected $name; /** - * Driver-specific options for the selectd log driver, specified. + * Driver-specific options for the selectd log driver, specified as key/value pairs. - - * - * @var string[] - */ + + * + * @var array|null + */ protected $options; - /** * The log driver to use as a default for new tasks. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * The log driver to use as a default for new tasks. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * Driver-specific options for the selectd log driver, specified. + * Driver-specific options for the selectd log driver, specified as key/value pairs. - - * - * @return string[] - */ - public function getOptions(): ?\ArrayObject + + * + * @return array|null + */ + public function getOptions() : ?iterable { return $this->options; } - /** - * Driver-specific options for the selectd log driver, specified. + * Driver-specific options for the selectd log driver, specified as key/value pairs. - - * - * @param string[] $options - * - * @return self - */ - public function setOptions(?\ArrayObject $options): self + + * + * @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/src/Model/SwarmUnlockPostBody.php b/src/Model/SwarmUnlockPostBody.php index 2d1c4e71..e59271f2 100644 --- a/src/Model/SwarmUnlockPostBody.php +++ b/src/Model/SwarmUnlockPostBody.php @@ -1,45 +1,43 @@ initialized); + } /** * The swarm's unlock key. * - * @var string + * @var string|null */ protected $unlockKey; - /** * The swarm's unlock key. * - * @return string + * @return string|null */ - public function getUnlockKey(): ?string + public function getUnlockKey() : ?string { return $this->unlockKey; } - /** * The swarm's unlock key. * - * @param string $unlockKey + * @param string|null $unlockKey * * @return self */ - public function setUnlockKey(?string $unlockKey): 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/src/Model/SwarmUnlockkeyGetResponse200.php b/src/Model/SwarmUnlockkeyGetResponse200.php index cc28747a..4d4d257c 100644 --- a/src/Model/SwarmUnlockkeyGetResponse200.php +++ b/src/Model/SwarmUnlockkeyGetResponse200.php @@ -1,45 +1,43 @@ initialized); + } /** * The swarm's unlock key. * - * @var string + * @var string|null */ protected $unlockKey; - /** * The swarm's unlock key. * - * @return string + * @return string|null */ - public function getUnlockKey(): ?string + public function getUnlockKey() : ?string { return $this->unlockKey; } - /** * The swarm's unlock key. * - * @param string $unlockKey + * @param string|null $unlockKey * * @return self */ - public function setUnlockKey(?string $unlockKey): 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/src/Model/SystemDfGetResponse200.php b/src/Model/SystemDfGetResponse200.php index 4a0ef614..f63c09d3 100644 --- a/src/Model/SystemDfGetResponse200.php +++ b/src/Model/SystemDfGetResponse200.php @@ -1,111 +1,155 @@ initialized); + } + /** + * + * + * @var int|null */ protected $layersSize; /** - * @var ImageSummary[] + * + * + * @var ImageSummary[]|null */ protected $images; /** - * @var ContainerSummaryItem[][] + * + * + * @var ContainerSummary[]|null */ protected $containers; /** - * @var Volume[] + * + * + * @var Volume[]|null */ protected $volumes; - /** - * @return int + * + * + * @var BuildCache[]|null */ - public function getLayersSize(): ?int + protected $buildCache; + /** + * + * + * @return int|null + */ + public function getLayersSize() : ?int { return $this->layersSize; } - /** - * @param int $layersSize + * + * + * @param int|null $layersSize * * @return self */ - public function setLayersSize(?int $layersSize): self + public function setLayersSize(?int $layersSize) : self { + $this->initialized['layersSize'] = true; $this->layersSize = $layersSize; - return $this; } - /** - * @return ImageSummary[] + * + * + * @return ImageSummary[]|null */ - public function getImages(): ?array + public function getImages() : ?array { return $this->images; } - /** - * @param ImageSummary[] $images + * + * + * @param ImageSummary[]|null $images * * @return self */ - public function setImages(?array $images): self + public function setImages(?array $images) : self { + $this->initialized['images'] = true; $this->images = $images; - return $this; } - /** - * @return ContainerSummaryItem[][] + * + * + * @return ContainerSummary[]|null */ - public function getContainers(): ?array + public function getContainers() : ?array { return $this->containers; } - /** - * @param ContainerSummaryItem[][] $containers + * + * + * @param ContainerSummary[]|null $containers * * @return self */ - public function setContainers(?array $containers): self + public function setContainers(?array $containers) : self { + $this->initialized['containers'] = true; $this->containers = $containers; - return $this; } - /** - * @return Volume[] + * + * + * @return Volume[]|null */ - public function getVolumes(): ?array + public function getVolumes() : ?array { return $this->volumes; } - /** - * @param Volume[] $volumes + * + * + * @param Volume[]|null $volumes * * @return self */ - public function setVolumes(?array $volumes): self + public function setVolumes(?array $volumes) : self { + $this->initialized['volumes'] = true; $this->volumes = $volumes; - return $this; } -} + /** + * + * + * @return BuildCache[]|null + */ + public function getBuildCache() : ?array + { + return $this->buildCache; + } + /** + * + * + * @param BuildCache[]|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/src/Model/SystemInfo.php b/src/Model/SystemInfo.php index 0afee2e6..13340a99 100644 --- a/src/Model/SystemInfo.php +++ b/src/Model/SystemInfo.php @@ -1,2220 +1,2202 @@ 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 - */ + + * + * @var string|null + */ protected $iD; /** * Total number of containers on the host. * - * @var int + * @var int|null */ protected $containers; /** * Number of containers with status `"running"`. * - * @var int + * @var int|null */ protected $containersRunning; /** * Number of containers with status `"paused"`. * - * @var int + * @var int|null */ protected $containersPaused; /** * Number of containers with status `"stopped"`. * - * @var int + * @var int|null */ protected $containersStopped; /** - * Total number of images on the host. - + * Total number of images on the host. + Both _tagged_ and _untagged_ (dangling) images are counted. - - * - * @var int - */ + + * + * @var int|null + */ protected $images; /** * Name of the storage driver in use. * - * @var string + * @var string|null */ protected $driver; /** - * Information specific to the storage driver, provided as. + * 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 string[][] - */ + + * + * @var string[][]|null + */ protected $driverStatus; /** - * Root directory of persistent Docker state. - + * Root directory of persistent Docker state. + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` on Windows. - - * - * @var string - */ + + * + * @var string|null + */ protected $dockerRootDir; /** - * Status information about this node (standalone Swarm API). - -


- - > **Note**: The information returned in this field is only propagated - > by the Swarm standalone API, and is empty (`null`) when using - > built-in swarm mode. - - * - * @var string[][] - */ - protected $systemStatus; - /** - * Available plugins per type. - + * 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 - */ + + * + * @var PluginsInfo|null + */ protected $plugins; /** * Indicates if the host has memory limit support enabled. * - * @var bool + * @var bool|null */ protected $memoryLimit; /** * Indicates if the host has memory swap limit support enabled. * - * @var bool + * @var bool|null */ protected $swapLimit; /** - * Indicates if the host has kernel memory limit support enabled. - * - * @var bool - */ - protected $kernelMemory; - /** - * Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host. - * - * @var bool - */ + * 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 - */ + * 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 + * @var bool|null */ protected $cPUShares; /** - * Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. - + * 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 + * @var bool|null */ - protected $cPUSet; + protected $pidsLimit; /** * Indicates if OOM killer disable is supported on the host. * - * @var bool + * @var bool|null */ protected $oomKillDisable; /** * Indicates IPv4 forwarding is enabled. * - * @var bool + * @var bool|null */ protected $iPv4Forwarding; /** * Indicates if `bridge-nf-call-iptables` is available on the host. * - * @var bool + * @var bool|null */ protected $bridgeNfIptables; /** * Indicates if `bridge-nf-call-ip6tables` is available on the host. * - * @var bool + * @var bool|null */ protected $bridgeNfIp6tables; /** - * Indicates if the daemon is running in debug-mode / with debug-level logging enabled. - * - * @var bool - */ + * 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. - + * The total number of file Descriptors in use by the daemon process. + This information is only returned if debug-mode is enabled. - - * - * @var int - */ + + * + * @var int|null + */ protected $nFd; /** - * The number of goroutines that currently exist. - + * The number of goroutines that currently exist. + This information is only returned if debug-mode is enabled. - - * - * @var int - */ + + * + * @var int|null + */ protected $nGoroutines; /** - * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt). + * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @var string - */ + + * + * @var string|null + */ protected $systemTime; /** * The logging driver to use as a default for new containers. * - * @var string + * @var string|null */ protected $loggingDriver; /** * The driver to use for managing cgroups. * - * @var string + * @var string|null + */ + protected $cgroupDriver = 'cgroupfs'; + /** + * The version of the cgroup. + * + * @var string|null */ - protected $cgroupDriver; + protected $cgroupVersion = '1'; /** * Number of event listeners subscribed. * - * @var int + * @var int|null */ protected $nEventsListener; /** - * Kernel version of the host. - + * 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 - */ + + * + * @var string|null + */ protected $kernelVersion; /** - * Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS". + * Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS" or "Windows Server 2016 Datacenter" - - * - * @var string - */ + + * + * @var string|null + */ protected $operatingSystem; /** - * Generic type of the operating system of the host, as returned by the. + * 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://golang.org/doc/install/source#environment). - - * - * @var string - */ + + * + * @var string|null + */ protected $oSType; /** - * Hardware architecture of the host, as returned by the Go runtime. + * 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://golang.org/doc/install/source#environment). - - * - * @var string - */ + + * + * @var string|null + */ protected $architecture; /** - * The number of logical CPUs usable by the daemon. - + * 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 - */ + + * + * @var int|null + */ protected $nCPU; /** - * Total amount of physical memory available on the host, in kilobytes (kB). + * Total amount of physical memory available on the host, in bytes. * - * @var int + * @var int|null */ protected $memTotal; /** - * Address / URL of the index server that is used for image search,. + * 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 - */ - protected $indexServerAddress; + + * + * @var string|null + */ + protected $indexServerAddress = 'https://index.docker.io/v1/'; /** * RegistryServiceConfig stores daemon registry services configuration. * - * @var RegistryServiceConfig + * @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 GenericResourcesItem[] - */ + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @var GenericResourcesItem[]|null + */ protected $genericResources; /** - * HTTP-proxy configured for the daemon. This value is obtained from the. + * 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 - */ + + * + * @var string|null + */ protected $httpProxy; /** - * HTTPS-proxy configured for the daemon. This value is obtained from the. + * 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 - */ + + * + * @var string|null + */ protected $httpsProxy; /** - * Comma-separated list of domain extensions for which no proxy should be. + * 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 - */ + + * + * @var string|null + */ protected $noProxy; /** * Hostname of the host. * - * @var string + * @var string|null */ protected $name; /** - * User-defined labels (key/value metadata) as set on the daemon. - + * 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 string[] - */ + + * + * @var string[]|null + */ protected $labels; /** * Indicates if experimental features are enabled on the daemon. * - * @var bool + * @var bool|null */ protected $experimentalBuild; /** * Version string of the daemon. - - > **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/) - > returns the Swarm version instead of the daemon version, for example - > `swarm/1.2.8`. - * - * @var string + * @var string|null */ protected $serverVersion; /** - * URL of the distributed storage backend. - - - The storage backend is used for multihost networking (to store - network and endpoint information) and by the node discovery mechanism. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - - * - * @var string - */ - protected $clusterStore; - /** - * The network endpoint that the Engine advertises for the purpose of. - node discovery. ClusterAdvertise is a `host:port` combination on which - the daemon is reachable by other hosts. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - - * - * @var string - */ - protected $clusterAdvertise; - /** - * List of [OCI compliant](https://github.com/opencontainers/runtime-spec). + * 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 Runtime[] - */ + + * + * @var array|null + */ protected $runtimes; /** - * Name of the default OCI runtime that is used when starting containers. - + * Name of the default OCI runtime that is used when starting containers. + The default can be overridden per-container at create time. - - * - * @var string - */ - protected $defaultRuntime; + + * + * @var string|null + */ + protected $defaultRuntime = 'runc'; /** * Represents generic information about swarm. * - * @var SwarmInfo + * @var SwarmInfo|null */ protected $swarm; /** - * Indicates if live restore is enabled. - + * 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 - */ - protected $liveRestoreEnabled; + + * + * @var bool|null + */ + protected $liveRestoreEnabled = false; /** - * Represents the isolation technology to use as a default for containers. + * 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 - */ - protected $isolation; - /** - * Name and, optional, path of the the `docker-init` binary. - + + * + * @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 - */ + + * + * @var string|null + */ protected $initBinary; /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. + * 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 - */ + + * + * @var Commit|null + */ protected $containerdCommit; /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. + * 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 - */ + + * + * @var Commit|null + */ protected $runcCommit; /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. + * 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 - */ + + * + * @var Commit|null + */ protected $initCommit; /** - * List of security features that are enabled on the daemon, such as. - apparmor, seccomp, SELinux, and user-namespaces (userns). - + * 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 string[] - */ + + * + * @var string[]|null + */ protected $securityOptions; - /** - * Unique identifier of the daemon. - + * 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 SystemInfoDefaultAddressPoolsItem[]|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 string[]|null + */ + protected $warnings; + /** + * 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 - */ - public function getID(): ?string + + * + * @return string|null + */ + public function getID() : ?string { return $this->iD; } - /** - * Unique identifier of the daemon. - + * 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 $iD - * - * @return self - */ - public function setID(?string $iD): self - { + + * + * @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 + * @return int|null */ - public function getContainers(): ?int + public function getContainers() : ?int { return $this->containers; } - /** * Total number of containers on the host. * - * @param int $containers + * @param int|null $containers * * @return self */ - public function setContainers(?int $containers): self + public function setContainers(?int $containers) : self { + $this->initialized['containers'] = true; $this->containers = $containers; - return $this; } - /** * Number of containers with status `"running"`. * - * @return int + * @return int|null */ - public function getContainersRunning(): ?int + public function getContainersRunning() : ?int { return $this->containersRunning; } - /** * Number of containers with status `"running"`. * - * @param int $containersRunning + * @param int|null $containersRunning * * @return self */ - public function setContainersRunning(?int $containersRunning): self + public function setContainersRunning(?int $containersRunning) : self { + $this->initialized['containersRunning'] = true; $this->containersRunning = $containersRunning; - return $this; } - /** * Number of containers with status `"paused"`. * - * @return int + * @return int|null */ - public function getContainersPaused(): ?int + public function getContainersPaused() : ?int { return $this->containersPaused; } - /** * Number of containers with status `"paused"`. * - * @param int $containersPaused + * @param int|null $containersPaused * * @return self */ - public function setContainersPaused(?int $containersPaused): self + public function setContainersPaused(?int $containersPaused) : self { + $this->initialized['containersPaused'] = true; $this->containersPaused = $containersPaused; - return $this; } - /** * Number of containers with status `"stopped"`. * - * @return int + * @return int|null */ - public function getContainersStopped(): ?int + public function getContainersStopped() : ?int { return $this->containersStopped; } - /** * Number of containers with status `"stopped"`. * - * @param int $containersStopped + * @param int|null $containersStopped * * @return self */ - public function setContainersStopped(?int $containersStopped): self + public function setContainersStopped(?int $containersStopped) : self { + $this->initialized['containersStopped'] = true; $this->containersStopped = $containersStopped; - return $this; } - /** - * Total number of images on the host. - + * Total number of images on the host. + Both _tagged_ and _untagged_ (dangling) images are counted. - - * - * @return int - */ - public function getImages(): ?int + + * + * @return int|null + */ + public function getImages() : ?int { return $this->images; } - /** - * Total number of images on the host. - + * Total number of images on the host. + Both _tagged_ and _untagged_ (dangling) images are counted. - - * - * @param int $images - * - * @return self - */ - public function setImages(?int $images): self - { + + * + * @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 + * @return string|null */ - public function getDriver(): ?string + public function getDriver() : ?string { return $this->driver; } - /** * Name of the storage driver in use. * - * @param string $driver + * @param string|null $driver * * @return self */ - public function setDriver(?string $driver): self + public function setDriver(?string $driver) : self { + $this->initialized['driver'] = true; $this->driver = $driver; - return $this; } - /** - * Information specific to the storage driver, provided as. + * 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 string[][] - */ - public function getDriverStatus(): ?array + + * + * @return string[][]|null + */ + public function getDriverStatus() : ?array { return $this->driverStatus; } - /** - * Information specific to the storage driver, provided as. + * 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 string[][] $driverStatus - * - * @return self - */ - public function setDriverStatus(?array $driverStatus): self - { + + * + * @param string[][]|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. - + * Root directory of persistent Docker state. + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` on Windows. - - * - * @return string - */ - public function getDockerRootDir(): ?string + + * + * @return string|null + */ + public function getDockerRootDir() : ?string { return $this->dockerRootDir; } - /** - * Root directory of persistent Docker state. - + * Root directory of persistent Docker state. + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` on Windows. - - * - * @param string $dockerRootDir - * - * @return self - */ - public function setDockerRootDir(?string $dockerRootDir): self - { + + * + * @param string|null $dockerRootDir + * + * @return self + */ + public function setDockerRootDir(?string $dockerRootDir) : self + { + $this->initialized['dockerRootDir'] = true; $this->dockerRootDir = $dockerRootDir; - return $this; } - /** - * Status information about this node (standalone Swarm API). - + * Available plugins per type. +


- - > **Note**: The information returned in this field is only propagated - > by the Swarm standalone API, and is empty (`null`) when using - > built-in swarm mode. - - * - * @return string[][] - */ - public function getSystemStatus(): ?array + + > **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->systemStatus; + return $this->plugins; } - /** - * Status information about this node (standalone Swarm API). - + * Available plugins per type. +


- - > **Note**: The information returned in this field is only propagated - > by the Swarm standalone API, and is empty (`null`) when using - > built-in swarm mode. - - * - * @param string[][] $systemStatus - * - * @return self - */ - public function setSystemStatus(?array $systemStatus): self - { - $this->systemStatus = $systemStatus; - - 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 - */ - 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 $plugins - * - * @return self - */ - public function setPlugins(?PluginsInfo $plugins): self - { + + * + * @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 + * @return bool|null */ - public function getMemoryLimit(): ?bool + public function getMemoryLimit() : ?bool { return $this->memoryLimit; } - /** * Indicates if the host has memory limit support enabled. * - * @param bool $memoryLimit + * @param bool|null $memoryLimit * * @return self */ - public function setMemoryLimit(?bool $memoryLimit): 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 + * @return bool|null */ - public function getSwapLimit(): ?bool + public function getSwapLimit() : ?bool { return $this->swapLimit; } - /** * Indicates if the host has memory swap limit support enabled. * - * @param bool $swapLimit + * @param bool|null $swapLimit * * @return self */ - public function setSwapLimit(?bool $swapLimit): self + public function setSwapLimit(?bool $swapLimit) : self { + $this->initialized['swapLimit'] = true; $this->swapLimit = $swapLimit; - return $this; } - - /** - * Indicates if the host has kernel memory limit support enabled. - * - * @return bool - */ - public function getKernelMemory(): ?bool - { - return $this->kernelMemory; - } - /** - * Indicates if the host has kernel memory limit support enabled. - * - * @param bool $kernelMemory - * - * @return self - */ - public function setKernelMemory(?bool $kernelMemory): self - { - $this->kernelMemory = $kernelMemory; - + * 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 - */ - public function getCpuCfsPeriod(): ?bool + * 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 $cpuCfsPeriod - * - * @return self - */ - public function setCpuCfsPeriod(?bool $cpuCfsPeriod): self + * 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 - */ - public function getCpuCfsQuota(): ?bool + * 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 $cpuCfsQuota - * - * @return self - */ - public function setCpuCfsQuota(?bool $cpuCfsQuota): self + * 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 + * @return bool|null */ - public function getCPUShares(): ?bool + public function getCPUShares() : ?bool { return $this->cPUShares; } - /** * Indicates if CPU Shares limiting is supported by the host. * - * @param bool $cPUShares + * @param bool|null $cPUShares * * @return self */ - public function setCPUShares(?bool $cPUShares): 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. - + * 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 - */ - public function getCPUSet(): ?bool + + * + * @return bool|null + */ + public function getCPUSet() : ?bool { return $this->cPUSet; } - /** - * Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. - + * 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 $cPUSet + * @param bool|null $pidsLimit * * @return self */ - public function setCPUSet(?bool $cPUSet): self + public function setPidsLimit(?bool $pidsLimit) : self { - $this->cPUSet = $cPUSet; - + $this->initialized['pidsLimit'] = true; + $this->pidsLimit = $pidsLimit; return $this; } - /** * Indicates if OOM killer disable is supported on the host. * - * @return bool + * @return bool|null */ - public function getOomKillDisable(): ?bool + public function getOomKillDisable() : ?bool { return $this->oomKillDisable; } - /** * Indicates if OOM killer disable is supported on the host. * - * @param bool $oomKillDisable + * @param bool|null $oomKillDisable * * @return self */ - public function setOomKillDisable(?bool $oomKillDisable): self + public function setOomKillDisable(?bool $oomKillDisable) : self { + $this->initialized['oomKillDisable'] = true; $this->oomKillDisable = $oomKillDisable; - return $this; } - /** * Indicates IPv4 forwarding is enabled. * - * @return bool + * @return bool|null */ - public function getIPv4Forwarding(): ?bool + public function getIPv4Forwarding() : ?bool { return $this->iPv4Forwarding; } - /** * Indicates IPv4 forwarding is enabled. * - * @param bool $iPv4Forwarding + * @param bool|null $iPv4Forwarding * * @return self */ - public function setIPv4Forwarding(?bool $iPv4Forwarding): 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 + * @return bool|null */ - public function getBridgeNfIptables(): ?bool + public function getBridgeNfIptables() : ?bool { return $this->bridgeNfIptables; } - /** * Indicates if `bridge-nf-call-iptables` is available on the host. * - * @param bool $bridgeNfIptables + * @param bool|null $bridgeNfIptables * * @return self */ - public function setBridgeNfIptables(?bool $bridgeNfIptables): 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 + * @return bool|null */ - public function getBridgeNfIp6tables(): ?bool + public function getBridgeNfIp6tables() : ?bool { return $this->bridgeNfIp6tables; } - /** * Indicates if `bridge-nf-call-ip6tables` is available on the host. * - * @param bool $bridgeNfIp6tables + * @param bool|null $bridgeNfIp6tables * * @return self */ - public function setBridgeNfIp6tables(?bool $bridgeNfIp6tables): 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 - */ - public function getDebug(): ?bool + * 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 $debug - * - * @return self - */ - public function setDebug(?bool $debug): self + * 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. - + * The total number of file Descriptors in use by the daemon process. + This information is only returned if debug-mode is enabled. - - * - * @return int - */ - public function getNFd(): ?int + + * + * @return int|null + */ + public function getNFd() : ?int { return $this->nFd; } - /** - * The total number of file Descriptors in use by the daemon process. - + * The total number of file Descriptors in use by the daemon process. + This information is only returned if debug-mode is enabled. - - * - * @param int $nFd - * - * @return self - */ - public function setNFd(?int $nFd): self - { + + * + * @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. - + * The number of goroutines that currently exist. + This information is only returned if debug-mode is enabled. - - * - * @return int - */ - public function getNGoroutines(): ?int + + * + * @return int|null + */ + public function getNGoroutines() : ?int { return $this->nGoroutines; } - /** - * The number of goroutines that currently exist. - + * The number of goroutines that currently exist. + This information is only returned if debug-mode is enabled. - - * - * @param int $nGoroutines - * - * @return self - */ - public function setNGoroutines(?int $nGoroutines): self - { + + * + * @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). + * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @return string - */ - public function getSystemTime(): ?string + + * + * @return string|null + */ + public function getSystemTime() : ?string { return $this->systemTime; } - /** - * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt). + * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @param string $systemTime - * - * @return self - */ - public function setSystemTime(?string $systemTime): self - { + + * + * @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 + * @return string|null */ - public function getLoggingDriver(): ?string + public function getLoggingDriver() : ?string { return $this->loggingDriver; } - /** * The logging driver to use as a default for new containers. * - * @param string $loggingDriver + * @param string|null $loggingDriver * * @return self */ - public function setLoggingDriver(?string $loggingDriver): 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 + * @return string|null */ - public function getCgroupDriver(): ?string + public function getCgroupDriver() : ?string { return $this->cgroupDriver; } - /** * The driver to use for managing cgroups. * - * @param string $cgroupDriver + * @param string|null $cgroupDriver * * @return self */ - public function setCgroupDriver(?string $cgroupDriver): 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 + * @return int|null */ - public function getNEventsListener(): ?int + public function getNEventsListener() : ?int { return $this->nEventsListener; } - /** * Number of event listeners subscribed. * - * @param int $nEventsListener + * @param int|null $nEventsListener * * @return self */ - public function setNEventsListener(?int $nEventsListener): self + public function setNEventsListener(?int $nEventsListener) : self { + $this->initialized['nEventsListener'] = true; $this->nEventsListener = $nEventsListener; - return $this; } - /** - * Kernel version of the host. - + * 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 - */ - public function getKernelVersion(): ?string + + * + * @return string|null + */ + public function getKernelVersion() : ?string { return $this->kernelVersion; } - /** - * Kernel version of the host. - + * 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 $kernelVersion - * - * @return self - */ - public function setKernelVersion(?string $kernelVersion): self - { + + * + * @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 16.04.2 LTS". + * Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS" or "Windows Server 2016 Datacenter" - - * - * @return string - */ - public function getOperatingSystem(): ?string + + * + * @return string|null + */ + public function getOperatingSystem() : ?string { return $this->operatingSystem; } - /** - * Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS". + * Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS" or "Windows Server 2016 Datacenter" - - * - * @param string $operatingSystem - * - * @return self - */ - public function setOperatingSystem(?string $operatingSystem): self - { + + * + * @param string|null $operatingSystem + * + * @return self + */ + public function setOperatingSystem(?string $operatingSystem) : self + { + $this->initialized['operatingSystem'] = true; $this->operatingSystem = $operatingSystem; - return $this; } - /** - * Generic type of the operating system of the host, as returned by the. + * 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://golang.org/doc/install/source#environment). - - * - * @return string - */ - public function getOSType(): ?string + + * + * @return string|null + */ + public function getOSType() : ?string { return $this->oSType; } - /** - * Generic type of the operating system of the host, as returned by the. + * 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://golang.org/doc/install/source#environment). - - * - * @param string $oSType - * - * @return self - */ - public function setOSType(?string $oSType): self - { + + * + * @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. + * 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://golang.org/doc/install/source#environment). - - * - * @return string - */ - public function getArchitecture(): ?string + + * + * @return string|null + */ + public function getArchitecture() : ?string { return $this->architecture; } - /** - * Hardware architecture of the host, as returned by the Go runtime. + * 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://golang.org/doc/install/source#environment). - - * - * @param string $architecture - * - * @return self - */ - public function setArchitecture(?string $architecture): self - { + + * + * @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 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 - */ - public function getNCPU(): ?int + + * + * @return int|null + */ + public function getNCPU() : ?int { return $this->nCPU; } - /** - * The number of logical CPUs usable by the daemon. - + * 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 $nCPU - * - * @return self - */ - public function setNCPU(?int $nCPU): self - { + + * + * @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 kilobytes (kB). + * Total amount of physical memory available on the host, in bytes. * - * @return int + * @return int|null */ - public function getMemTotal(): ?int + public function getMemTotal() : ?int { return $this->memTotal; } - /** - * Total amount of physical memory available on the host, in kilobytes (kB). + * Total amount of physical memory available on the host, in bytes. * - * @param int $memTotal + * @param int|null $memTotal * * @return self */ - public function setMemTotal(?int $memTotal): 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,. + * 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 - */ - public function getIndexServerAddress(): ?string + + * + * @return string|null + */ + public function getIndexServerAddress() : ?string { return $this->indexServerAddress; } - /** - * Address / URL of the index server that is used for image search,. + * 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 $indexServerAddress - * - * @return self - */ - public function setIndexServerAddress(?string $indexServerAddress): self - { + + * + * @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 + * @return RegistryServiceConfig|null */ - public function getRegistryConfig(): ?RegistryServiceConfig + public function getRegistryConfig() : ?RegistryServiceConfig { return $this->registryConfig; } - /** * RegistryServiceConfig stores daemon registry services configuration. * - * @param RegistryServiceConfig $registryConfig + * @param RegistryServiceConfig|null $registryConfig * * @return self */ - public function setRegistryConfig(?RegistryServiceConfig $registryConfig): 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 GenericResourcesItem[] - */ - public function getGenericResources(): ?array + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @return GenericResourcesItem[]|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 GenericResourcesItem[] $genericResources - * - * @return self - */ - public function setGenericResources(?array $genericResources): self + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @param GenericResourcesItem[]|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 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 - */ - public function getHttpProxy(): ?string + + * + * @return string|null + */ + public function getHttpProxy() : ?string { return $this->httpProxy; } - /** - * HTTP-proxy configured for the daemon. This value is obtained from the. + * 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 $httpProxy - * - * @return self - */ - public function setHttpProxy(?string $httpProxy): self - { + + * + * @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 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 - */ - public function getHttpsProxy(): ?string + + * + * @return string|null + */ + public function getHttpsProxy() : ?string { return $this->httpsProxy; } - /** - * HTTPS-proxy configured for the daemon. This value is obtained from the. + * 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 $httpsProxy - * - * @return self - */ - public function setHttpsProxy(?string $httpsProxy): self - { + + * + * @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. + * 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 - */ - public function getNoProxy(): ?string + + * + * @return string|null + */ + public function getNoProxy() : ?string { return $this->noProxy; } - /** - * Comma-separated list of domain extensions for which no proxy should be. + * 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 $noProxy - * - * @return self - */ - public function setNoProxy(?string $noProxy): self - { + + * + * @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 + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Hostname of the host. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): 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. - + * 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 string[] - */ - public function getLabels(): ?array + + * + * @return string[]|null + */ + public function getLabels() : ?array { return $this->labels; } - /** - * User-defined labels (key/value metadata) as set on the daemon. - + * 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 string[] $labels - * - * @return self - */ - public function setLabels(?array $labels): self - { + + * + * @param string[]|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 + * @return bool|null */ - public function getExperimentalBuild(): ?bool + public function getExperimentalBuild() : ?bool { return $this->experimentalBuild; } - /** * Indicates if experimental features are enabled on the daemon. * - * @param bool $experimentalBuild + * @param bool|null $experimentalBuild * * @return self */ - public function setExperimentalBuild(?bool $experimentalBuild): self + public function setExperimentalBuild(?bool $experimentalBuild) : self { + $this->initialized['experimentalBuild'] = true; $this->experimentalBuild = $experimentalBuild; - return $this; } - /** * Version string of the daemon. - - > **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/) - > returns the Swarm version instead of the daemon version, for example - > `swarm/1.2.8`. - * - * @return string + * @return string|null */ - public function getServerVersion(): ?string + public function getServerVersion() : ?string { return $this->serverVersion; } - /** * Version string of the daemon. - - > **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/) - > returns the Swarm version instead of the daemon version, for example - > `swarm/1.2.8`. - * - * @param string $serverVersion + * @param string|null $serverVersion * * @return self */ - public function setServerVersion(?string $serverVersion): self + public function setServerVersion(?string $serverVersion) : self { + $this->initialized['serverVersion'] = true; $this->serverVersion = $serverVersion; - - return $this; - } - - /** - * URL of the distributed storage backend. - - - The storage backend is used for multihost networking (to store - network and endpoint information) and by the node discovery mechanism. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - - * - * @return string - */ - public function getClusterStore(): ?string - { - return $this->clusterStore; - } - - /** - * URL of the distributed storage backend. - - - The storage backend is used for multihost networking (to store - network and endpoint information) and by the node discovery mechanism. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - - * - * @param string $clusterStore - * - * @return self - */ - public function setClusterStore(?string $clusterStore): self - { - $this->clusterStore = $clusterStore; - - return $this; - } - - /** - * The network endpoint that the Engine advertises for the purpose of. - node discovery. ClusterAdvertise is a `host:port` combination on which - the daemon is reachable by other hosts. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - - * - * @return string - */ - public function getClusterAdvertise(): ?string - { - return $this->clusterAdvertise; - } - - /** - * The network endpoint that the Engine advertises for the purpose of. - node discovery. ClusterAdvertise is a `host:port` combination on which - the daemon is reachable by other hosts. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - - * - * @param string $clusterAdvertise - * - * @return self - */ - public function setClusterAdvertise(?string $clusterAdvertise): self - { - $this->clusterAdvertise = $clusterAdvertise; - return $this; } - /** - * List of [OCI compliant](https://github.com/opencontainers/runtime-spec). + * 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 Runtime[] - */ - public function getRuntimes(): ?\ArrayObject + + * + * @return array|null + */ + public function getRuntimes() : ?iterable { return $this->runtimes; } - /** - * List of [OCI compliant](https://github.com/opencontainers/runtime-spec). + * 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 Runtime[] $runtimes - * - * @return self - */ - public function setRuntimes(?\ArrayObject $runtimes): self - { + + * + * @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. - + * Name of the default OCI runtime that is used when starting containers. + The default can be overridden per-container at create time. - - * - * @return string - */ - public function getDefaultRuntime(): ?string + + * + * @return string|null + */ + public function getDefaultRuntime() : ?string { return $this->defaultRuntime; } - /** - * Name of the default OCI runtime that is used when starting containers. - + * Name of the default OCI runtime that is used when starting containers. + The default can be overridden per-container at create time. - - * - * @param string $defaultRuntime - * - * @return self - */ - public function setDefaultRuntime(?string $defaultRuntime): self - { + + * + * @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 + * @return SwarmInfo|null */ - public function getSwarm(): ?SwarmInfo + public function getSwarm() : ?SwarmInfo { return $this->swarm; } - /** * Represents generic information about swarm. * - * @param SwarmInfo $swarm + * @param SwarmInfo|null $swarm * * @return self */ - public function setSwarm(?SwarmInfo $swarm): self + public function setSwarm(?SwarmInfo $swarm) : self { + $this->initialized['swarm'] = true; $this->swarm = $swarm; - return $this; } - /** - * Indicates if live restore is enabled. - + * 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 - */ - public function getLiveRestoreEnabled(): ?bool + + * + * @return bool|null + */ + public function getLiveRestoreEnabled() : ?bool { return $this->liveRestoreEnabled; } - /** - * Indicates if live restore is enabled. - + * 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 $liveRestoreEnabled - * - * @return self - */ - public function setLiveRestoreEnabled(?bool $liveRestoreEnabled): self - { + + * + * @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. + * 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 - */ - public function getIsolation(): ?string + + * + * @return string|null + */ + public function getIsolation() : ?string { return $this->isolation; } - /** - * Represents the isolation technology to use as a default for containers. + * 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 $isolation - * - * @return self - */ - public function setIsolation(?string $isolation): self - { + + * + * @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 the `docker-init` binary. - + * 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 - */ - public function getInitBinary(): ?string + + * + * @return string|null + */ + public function getInitBinary() : ?string { return $this->initBinary; } - /** - * Name and, optional, path of the the `docker-init` binary. - + * 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 $initBinary - * - * @return self - */ - public function setInitBinary(?string $initBinary): self - { + + * + * @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. + * 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 - */ - public function getContainerdCommit(): ?Commit + + * + * @return Commit|null + */ + public function getContainerdCommit() : ?Commit { return $this->containerdCommit; } - /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. + * 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 $containerdCommit - * - * @return self - */ - public function setContainerdCommit(?Commit $containerdCommit): self - { + + * + * @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. + * 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 - */ - public function getRuncCommit(): ?Commit + + * + * @return Commit|null + */ + public function getRuncCommit() : ?Commit { return $this->runcCommit; } - /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. + * 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 $runcCommit - * - * @return self - */ - public function setRuncCommit(?Commit $runcCommit): self - { + + * + * @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. + * 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 - */ - public function getInitCommit(): ?Commit + + * + * @return Commit|null + */ + public function getInitCommit() : ?Commit { return $this->initCommit; } - /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. + * 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 $initCommit - * - * @return self - */ - public function setInitCommit(?Commit $initCommit): self - { + + * + * @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, and user-namespaces (userns). - + * 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 string[] - */ - public function getSecurityOptions(): ?array + + * + * @return string[]|null + */ + public function getSecurityOptions() : ?array { return $this->securityOptions; } - /** - * List of security features that are enabled on the daemon, such as. - apparmor, seccomp, SELinux, and user-namespaces (userns). - + * 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 string[] $securityOptions - * - * @return self - */ - public function setSecurityOptions(?array $securityOptions): self - { + + * + * @param string[]|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 SystemInfoDefaultAddressPoolsItem[]|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 SystemInfoDefaultAddressPoolsItem[]|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 string[]|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 string[]|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/src/Model/SystemInfoDefaultAddressPoolsItem.php b/src/Model/SystemInfoDefaultAddressPoolsItem.php new file mode 100644 index 00000000..bee6206b --- /dev/null +++ b/src/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/src/Model/SystemVersion.php b/src/Model/SystemVersion.php new file mode 100644 index 00000000..ec6473c7 --- /dev/null +++ b/src/Model/SystemVersion.php @@ -0,0 +1,375 @@ +initialized); + } + /** + * + * + * @var SystemVersionPlatform|null + */ + protected $platform; + /** + * Information about system components + * + * @var SystemVersionComponentsItem[]|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 SystemVersionComponentsItem[]|null + */ + public function getComponents() : ?array + { + return $this->components; + } + /** + * Information about system components + * + * @param SystemVersionComponentsItem[]|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/src/Model/SystemVersionComponentsItem.php b/src/Model/SystemVersionComponentsItem.php new file mode 100644 index 00000000..87cc6035 --- /dev/null +++ b/src/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/src/Model/SystemVersionPlatform.php b/src/Model/SystemVersionPlatform.php new file mode 100644 index 00000000..f34e8618 --- /dev/null +++ b/src/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/src/Model/TLSInfo.php b/src/Model/TLSInfo.php index 759e140b..c1317dc0 100644 --- a/src/Model/TLSInfo.php +++ b/src/Model/TLSInfo.php @@ -1,105 +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 + * @var string|null */ protected $certIssuerSubject; /** * The base64-url-safe-encoded raw public key bytes of the issuer. * - * @var string + * @var string|null */ protected $certIssuerPublicKey; - /** - * The root CA certificate(s) that are used to validate leaf TLS certificates. - * - * @return string - */ - public function getTrustRoot(): ?string + * 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 $trustRoot - * - * @return self - */ - public function setTrustRoot(?string $trustRoot): self + * 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 + * @return string|null */ - public function getCertIssuerSubject(): ?string + public function getCertIssuerSubject() : ?string { return $this->certIssuerSubject; } - /** * The base64-url-safe-encoded raw subject bytes of the issuer. * - * @param string $certIssuerSubject + * @param string|null $certIssuerSubject * * @return self */ - public function setCertIssuerSubject(?string $certIssuerSubject): 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 + * @return string|null */ - public function getCertIssuerPublicKey(): ?string + public function getCertIssuerPublicKey() : ?string { return $this->certIssuerPublicKey; } - /** * The base64-url-safe-encoded raw public key bytes of the issuer. * - * @param string $certIssuerPublicKey + * @param string|null $certIssuerPublicKey * * @return self */ - public function setCertIssuerPublicKey(?string $certIssuerPublicKey): 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/src/Model/Task.php b/src/Model/Task.php index 2cc62683..7d922ca0 100644 --- a/src/Model/Task.php +++ b/src/Model/Task.php @@ -1,396 +1,473 @@ initialized); + } /** * The ID of the task. * - * @var string + * @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 - */ + * 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 + * + * + * @var string|null */ protected $createdAt; /** - * @var string + * + * + * @var string|null */ protected $updatedAt; /** * Name of the task. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * User modifiable task configuration. * - * @var TaskSpec + * @var TaskSpec|null */ protected $spec; /** * The ID of the service this task is part of. * - * @var string + * @var string|null */ protected $serviceID; /** - * @var int + * + * + * @var int|null */ protected $slot; /** * The ID of the node that this task is on. * - * @var string + * @var string|null */ protected $nodeID; /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). - * - * @var GenericResourcesItem[] - */ + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @var GenericResourcesItem[]|null + */ protected $assignedGenericResources; /** - * @var TaskStatus + * + * + * @var TaskStatus|null */ protected $status; /** - * @var string + * + * + * @var string|null */ protected $desiredState; - + /** + * 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 + * @return string|null */ - public function getID(): ?string + public function getID() : ?string { return $this->iD; } - /** * The ID of the task. * - * @param string $iD + * @param string|null $iD * * @return self */ - public function setID(?string $iD): 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 - */ - public function getVersion(): ?ObjectVersion + * 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 $version - * - * @return self - */ - public function setVersion(?ObjectVersion $version): self + * 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 + * + * + * @return string|null */ - public function getCreatedAt(): ?string + public function getCreatedAt() : ?string { return $this->createdAt; } - /** - * @param string $createdAt + * + * + * @param string|null $createdAt * * @return self */ - public function setCreatedAt(?string $createdAt): self + public function setCreatedAt(?string $createdAt) : self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getUpdatedAt(): ?string + public function getUpdatedAt() : ?string { return $this->updatedAt; } - /** - * @param string $updatedAt + * + * + * @param string|null $updatedAt * * @return self */ - public function setUpdatedAt(?string $updatedAt): self + public function setUpdatedAt(?string $updatedAt) : self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; - return $this; } - /** * Name of the task. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Name of the task. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels) : self { + $this->initialized['labels'] = true; $this->labels = $labels; - return $this; } - /** * User modifiable task configuration. * - * @return TaskSpec + * @return TaskSpec|null */ - public function getSpec(): ?TaskSpec + public function getSpec() : ?TaskSpec { return $this->spec; } - /** * User modifiable task configuration. * - * @param TaskSpec $spec + * @param TaskSpec|null $spec * * @return self */ - public function setSpec(?TaskSpec $spec): self + public function setSpec(?TaskSpec $spec) : self { + $this->initialized['spec'] = true; $this->spec = $spec; - return $this; } - /** * The ID of the service this task is part of. * - * @return string + * @return string|null */ - public function getServiceID(): ?string + public function getServiceID() : ?string { return $this->serviceID; } - /** * The ID of the service this task is part of. * - * @param string $serviceID + * @param string|null $serviceID * * @return self */ - public function setServiceID(?string $serviceID): self + public function setServiceID(?string $serviceID) : self { + $this->initialized['serviceID'] = true; $this->serviceID = $serviceID; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getSlot(): ?int + public function getSlot() : ?int { return $this->slot; } - /** - * @param int $slot + * + * + * @param int|null $slot * * @return self */ - public function setSlot(?int $slot): self + public function setSlot(?int $slot) : self { + $this->initialized['slot'] = true; $this->slot = $slot; - return $this; } - /** * The ID of the node that this task is on. * - * @return string + * @return string|null */ - public function getNodeID(): ?string + public function getNodeID() : ?string { return $this->nodeID; } - /** * The ID of the node that this task is on. * - * @param string $nodeID + * @param string|null $nodeID * * @return self */ - public function setNodeID(?string $nodeID): self + public function setNodeID(?string $nodeID) : self { + $this->initialized['nodeID'] = true; $this->nodeID = $nodeID; - return $this; } - /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). - * - * @return GenericResourcesItem[] - */ - public function getAssignedGenericResources(): ?array + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @return GenericResourcesItem[]|null + */ + public function getAssignedGenericResources() : ?array { return $this->assignedGenericResources; } - /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). - * - * @param GenericResourcesItem[] $assignedGenericResources - * - * @return self - */ - public function setAssignedGenericResources(?array $assignedGenericResources): self + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + + * + * @param GenericResourcesItem[]|null $assignedGenericResources + * + * @return self + */ + public function setAssignedGenericResources(?array $assignedGenericResources) : self { + $this->initialized['assignedGenericResources'] = true; $this->assignedGenericResources = $assignedGenericResources; - return $this; } - /** - * @return TaskStatus + * + * + * @return TaskStatus|null */ - public function getStatus(): ?TaskStatus + public function getStatus() : ?TaskStatus { return $this->status; } - /** - * @param TaskStatus $status + * + * + * @param TaskStatus|null $status * * @return self */ - public function setStatus(?TaskStatus $status): self + public function setStatus(?TaskStatus $status) : self { + $this->initialized['status'] = true; $this->status = $status; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getDesiredState(): ?string + public function getDesiredState() : ?string { return $this->desiredState; } - /** - * @param string $desiredState + * + * + * @param string|null $desiredState * * @return self */ - public function setDesiredState(?string $desiredState): self + public function setDesiredState(?string $desiredState) : self { + $this->initialized['desiredState'] = true; $this->desiredState = $desiredState; - 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 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; + } +} \ No newline at end of file diff --git a/src/Model/TaskSpec.php b/src/Model/TaskSpec.php index c04beb6a..f9cb0d3a 100644 --- a/src/Model/TaskSpec.php +++ b/src/Model/TaskSpec.php @@ -1,273 +1,397 @@ 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; /** - * Invalid when specified with `PluginSpec`. - * - * @var TaskSpecContainerSpec - */ + * 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; /** - * Resource requirements which apply to each individual container created as part of the service. - * - * @var TaskSpecResources - */ + * 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; /** - * Specification for the restart policy which applies to containers created as part of this service. - * - * @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; /** - * A counter that triggers an update even if no relevant parameters have been changed. - * - * @var int - */ + * 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 + * @var string|null */ protected $runtime; /** - * @var TaskSpecNetworksItem[] + * Specifies which networks the service should attach to. + * + * @var NetworkAttachmentConfig[]|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 - */ + * 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; - /** - * Invalid when specified with `ContainerSpec`. *(Experimental release only.)*. - * - * @return TaskSpecPluginSpec - */ - public function getPluginSpec(): ?TaskSpecPluginSpec + * 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; } - /** - * Invalid when specified with `ContainerSpec`. *(Experimental release only.)*. - * - * @param TaskSpecPluginSpec $pluginSpec - * - * @return self - */ - public function setPluginSpec(?TaskSpecPluginSpec $pluginSpec): self + * 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; } - /** - * Invalid when specified with `PluginSpec`. - * - * @return TaskSpecContainerSpec - */ - public function getContainerSpec(): ?TaskSpecContainerSpec + * 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; } - /** - * Invalid when specified with `PluginSpec`. - * - * @param TaskSpecContainerSpec $containerSpec - * - * @return self - */ - public function setContainerSpec(?TaskSpecContainerSpec $containerSpec): self + * 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; } - /** - * Resource requirements which apply to each individual container created as part of the service. - * - * @return TaskSpecResources - */ - public function getResources(): ?TaskSpecResources + * 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; } - /** - * Resource requirements which apply to each individual container created as part of the service. - * - * @param TaskSpecResources $resources - * - * @return self - */ - public function setResources(?TaskSpecResources $resources): self + * 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 - */ - public function getRestartPolicy(): ?TaskSpecRestartPolicy + * 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 $restartPolicy - * - * @return self - */ - public function setRestartPolicy(?TaskSpecRestartPolicy $restartPolicy): self + * 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 + * + * + * @return TaskSpecPlacement|null */ - public function getPlacement(): ?TaskSpecPlacement + public function getPlacement() : ?TaskSpecPlacement { return $this->placement; } - /** - * @param TaskSpecPlacement $placement + * + * + * @param TaskSpecPlacement|null $placement * * @return self */ - public function setPlacement(?TaskSpecPlacement $placement): self + public function setPlacement(?TaskSpecPlacement $placement) : self { + $this->initialized['placement'] = true; $this->placement = $placement; - return $this; } - /** - * A counter that triggers an update even if no relevant parameters have been changed. - * - * @return int - */ - public function getForceUpdate(): ?int + * 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 $forceUpdate - * - * @return self - */ - public function setForceUpdate(?int $forceUpdate): self + * 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 + * @return string|null */ - public function getRuntime(): ?string + public function getRuntime() : ?string { return $this->runtime; } - /** * Runtime is the type of runtime specified for the task executor. * - * @param string $runtime + * @param string|null $runtime * * @return self */ - public function setRuntime(?string $runtime): self + public function setRuntime(?string $runtime) : self { + $this->initialized['runtime'] = true; $this->runtime = $runtime; - return $this; } - /** - * @return TaskSpecNetworksItem[] + * Specifies which networks the service should attach to. + * + * @return NetworkAttachmentConfig[]|null */ - public function getNetworks(): ?array + public function getNetworks() : ?array { return $this->networks; } - /** - * @param TaskSpecNetworksItem[] $networks + * Specifies which networks the service should attach to. + * + * @param NetworkAttachmentConfig[]|null $networks * * @return self */ - public function setNetworks(?array $networks): self + public function setNetworks(?array $networks) : self { + $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 - */ - public function getLogDriver(): ?TaskSpecLogDriver + * 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 $logDriver - * - * @return self - */ - public function setLogDriver(?TaskSpecLogDriver $logDriver): self + * 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/src/Model/TaskSpecContainerSpec.php b/src/Model/TaskSpecContainerSpec.php index a0c29fed..31c6f21f 100644 --- a/src/Model/TaskSpecContainerSpec.php +++ b/src/Model/TaskSpecContainerSpec.php @@ -1,693 +1,873 @@ initialized); + } + /** + * The image name to use for the container * - * @var string + * @var string|null */ protected $image; /** * User-defined key/value data. * - * @var string[] + * @var array|null */ protected $labels; /** * The command to be run in the image. * - * @var string[] + * @var string[]|null */ protected $command; /** * Arguments to the command. * - * @var string[] + * @var string[]|null */ protected $args; /** - * The hostname to use for the container, as a valid RFC 1123 hostname. - * - * @var string - */ + * 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 string[] + * @var string[]|null */ protected $env; /** * The working directory for commands to run in. * - * @var string + * @var string|null */ protected $dir; /** * The user inside the container. * - * @var string + * @var string|null */ protected $user; /** * A list of additional groups that the container process will run as. * - * @var string[] + * @var string[]|null */ protected $groups; /** - * Security options for the container. + * Security options for the container * - * @var TaskSpecContainerSpecPrivileges + * @var TaskSpecContainerSpecPrivileges|null */ protected $privileges; /** * Whether a pseudo-TTY should be allocated. * - * @var bool + * @var bool|null */ protected $tTY; /** - * Open `stdin`. + * Open `stdin` * - * @var bool + * @var bool|null */ protected $openStdin; /** * Mount the container's root filesystem as read only. * - * @var bool + * @var bool|null */ protected $readOnly; /** - * Specification for mounts to be added to containers created as part of the service. - * - * @var Mount[] - */ + * Specification for mounts to be added to containers created as part + of the service. + + * + * @var Mount[]|null + */ protected $mounts; /** * Signal to stop the container. * - * @var string + * @var string|null */ protected $stopSignal; /** - * Amount of time to wait for the container to terminate before forcefully killing it. - * - * @var int - */ + * 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 + * @var HealthConfig|null */ protected $healthCheck; /** - * A list of hostname/IP mappings to add to the container's `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...] - - * - * @var string[] - */ + + * + * @var string[]|null + */ protected $hosts; /** - * Specification for DNS related configurations in resolver configuration file (`resolv.conf`). - * - * @var TaskSpecContainerSpecDNSConfig - */ + * 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 TaskSpecContainerSpecSecretsItem[] - */ + * Secrets contains references to zero or more secrets that will be + exposed to the service. + + * + * @var TaskSpecContainerSpecSecretsItem[]|null + */ protected $secrets; /** - * Configs contains references to zero or more configs that will be exposed to the service. - * - * @var TaskSpecContainerSpecConfigsItem[] - */ + * Configs contains references to zero or more configs that will be + exposed to the service. + + * + * @var TaskSpecContainerSpecConfigsItem[]|null + */ protected $configs; /** - * Isolation technology of the containers running the service. (Windows only). - * - * @var string - */ + * Isolation technology of the containers running the service. + (Windows only) + + * + * @var string|null + */ protected $isolation; - /** - * The image name to use for the container. - * - * @return string - */ - public function getImage(): ?string + * 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 string[]|null + */ + protected $capabilityAdd; + /** + * A list of kernel capabilities to drop from the default set + for the container. + + * + * @var string[]|null + */ + protected $capabilityDrop; + /** + * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + * + * @var TaskSpecContainerSpecUlimitsItem[]|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. + * The image name to use for the container * - * @param string $image + * @param string|null $image * * @return self */ - public function setImage(?string $image): self + public function setImage(?string $image) : self { + $this->initialized['image'] = true; $this->image = $image; - return $this; } - /** * User-defined key/value data. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value data. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): 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 string[] + * @return string[]|null */ - public function getCommand(): ?array + public function getCommand() : ?array { return $this->command; } - /** * The command to be run in the image. * - * @param string[] $command + * @param string[]|null $command * * @return self */ - public function setCommand(?array $command): self + public function setCommand(?array $command) : self { + $this->initialized['command'] = true; $this->command = $command; - return $this; } - /** * Arguments to the command. * - * @return string[] + * @return string[]|null */ - public function getArgs(): ?array + public function getArgs() : ?array { return $this->args; } - /** * Arguments to the command. * - * @param string[] $args + * @param string[]|null $args * * @return self */ - public function setArgs(?array $args): 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 hostname. - * - * @return string - */ - public function getHostname(): ?string + * 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 hostname. - * - * @param string $hostname - * - * @return self - */ - public function setHostname(?string $hostname): self + * 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 string[] + * @return string[]|null */ - public function getEnv(): ?array + public function getEnv() : ?array { return $this->env; } - /** * A list of environment variables in the form `VAR=value`. * - * @param string[] $env + * @param string[]|null $env * * @return self */ - public function setEnv(?array $env): 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 + * @return string|null */ - public function getDir(): ?string + public function getDir() : ?string { return $this->dir; } - /** * The working directory for commands to run in. * - * @param string $dir + * @param string|null $dir * * @return self */ - public function setDir(?string $dir): self + public function setDir(?string $dir) : self { + $this->initialized['dir'] = true; $this->dir = $dir; - return $this; } - /** * The user inside the container. * - * @return string + * @return string|null */ - public function getUser(): ?string + public function getUser() : ?string { return $this->user; } - /** * The user inside the container. * - * @param string $user + * @param string|null $user * * @return self */ - public function setUser(?string $user): 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 string[] + * @return string[]|null */ - public function getGroups(): ?array + public function getGroups() : ?array { return $this->groups; } - /** * A list of additional groups that the container process will run as. * - * @param string[] $groups + * @param string[]|null $groups * * @return self */ - public function setGroups(?array $groups): self + public function setGroups(?array $groups) : self { + $this->initialized['groups'] = true; $this->groups = $groups; - return $this; } - /** - * Security options for the container. + * Security options for the container * - * @return TaskSpecContainerSpecPrivileges + * @return TaskSpecContainerSpecPrivileges|null */ - public function getPrivileges(): ?TaskSpecContainerSpecPrivileges + public function getPrivileges() : ?TaskSpecContainerSpecPrivileges { return $this->privileges; } - /** - * Security options for the container. + * Security options for the container * - * @param TaskSpecContainerSpecPrivileges $privileges + * @param TaskSpecContainerSpecPrivileges|null $privileges * * @return self */ - public function setPrivileges(?TaskSpecContainerSpecPrivileges $privileges): 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 + * @return bool|null */ - public function getTTY(): ?bool + public function getTTY() : ?bool { return $this->tTY; } - /** * Whether a pseudo-TTY should be allocated. * - * @param bool $tTY + * @param bool|null $tTY * * @return self */ - public function setTTY(?bool $tTY): self + public function setTTY(?bool $tTY) : self { + $this->initialized['tTY'] = true; $this->tTY = $tTY; - return $this; } - /** - * Open `stdin`. + * Open `stdin` * - * @return bool + * @return bool|null */ - public function getOpenStdin(): ?bool + public function getOpenStdin() : ?bool { return $this->openStdin; } - /** - * Open `stdin`. + * Open `stdin` * - * @param bool $openStdin + * @param bool|null $openStdin * * @return self */ - public function setOpenStdin(?bool $openStdin): 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 + * @return bool|null */ - public function getReadOnly(): ?bool + public function getReadOnly() : ?bool { return $this->readOnly; } - /** * Mount the container's root filesystem as read only. * - * @param bool $readOnly + * @param bool|null $readOnly * * @return self */ - public function setReadOnly(?bool $readOnly): 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 Mount[] - */ - public function getMounts(): ?array + * Specification for mounts to be added to containers created as part + of the service. + + * + * @return Mount[]|null + */ + public function getMounts() : ?array { return $this->mounts; } - /** - * Specification for mounts to be added to containers created as part of the service. - * - * @param Mount[] $mounts - * - * @return self - */ - public function setMounts(?array $mounts): self + * Specification for mounts to be added to containers created as part + of the service. + + * + * @param Mount[]|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 + * @return string|null */ - public function getStopSignal(): ?string + public function getStopSignal() : ?string { return $this->stopSignal; } - /** * Signal to stop the container. * - * @param string $stopSignal + * @param string|null $stopSignal * * @return self */ - public function setStopSignal(?string $stopSignal): 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 - */ - public function getStopGracePeriod(): ?int + * 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 $stopGracePeriod - * - * @return self - */ - public function setStopGracePeriod(?int $stopGracePeriod): self + * 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 + * @return HealthConfig|null */ - public function getHealthCheck(): ?HealthConfig + public function getHealthCheck() : ?HealthConfig { return $this->healthCheck; } - /** * A test to perform to check that the container is healthy. * - * @param HealthConfig $healthCheck + * @param HealthConfig|null $healthCheck * * @return self */ - public function setHealthCheck(?HealthConfig $healthCheck): 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`. + * 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 string[] - */ - public function getHosts(): ?array + + * + * @return string[]|null + */ + public function getHosts() : ?array { return $this->hosts; } - /** - * A list of hostname/IP mappings to add to the container's `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 string[] $hosts - * - * @return self - */ - public function setHosts(?array $hosts): self - { + + * + * @param string[]|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 - */ - public function getDNSConfig(): ?TaskSpecContainerSpecDNSConfig + * 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 $dNSConfig - * - * @return self - */ - public function setDNSConfig(?TaskSpecContainerSpecDNSConfig $dNSConfig): self + * 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 TaskSpecContainerSpecSecretsItem[] - */ - public function getSecrets(): ?array + * Secrets contains references to zero or more secrets that will be + exposed to the service. + + * + * @return TaskSpecContainerSpecSecretsItem[]|null + */ + public function getSecrets() : ?array { return $this->secrets; } - /** - * Secrets contains references to zero or more secrets that will be exposed to the service. - * - * @param TaskSpecContainerSpecSecretsItem[] $secrets - * - * @return self - */ - public function setSecrets(?array $secrets): self + * Secrets contains references to zero or more secrets that will be + exposed to the service. + + * + * @param TaskSpecContainerSpecSecretsItem[]|null $secrets + * + * @return self + */ + public function setSecrets(?array $secrets) : self { + $this->initialized['secrets'] = true; $this->secrets = $secrets; - return $this; } - /** - * Configs contains references to zero or more configs that will be exposed to the service. - * - * @return TaskSpecContainerSpecConfigsItem[] - */ - public function getConfigs(): ?array + * Configs contains references to zero or more configs that will be + exposed to the service. + + * + * @return TaskSpecContainerSpecConfigsItem[]|null + */ + public function getConfigs() : ?array { return $this->configs; } - /** - * Configs contains references to zero or more configs that will be exposed to the service. - * - * @param TaskSpecContainerSpecConfigsItem[] $configs - * - * @return self - */ - public function setConfigs(?array $configs): self + * Configs contains references to zero or more configs that will be + exposed to the service. + + * + * @param TaskSpecContainerSpecConfigsItem[]|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). + * 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 string[]|null + */ + public function getCapabilityAdd() : ?array + { + return $this->capabilityAdd; + } + /** + * A list of kernel capabilities to add to the default set + for the container. + + * + * @param string[]|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 string[]|null + */ + public function getCapabilityDrop() : ?array + { + return $this->capabilityDrop; + } + /** + * A list of kernel capabilities to drop from the default set + for the container. + + * + * @param string[]|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 string + * @return TaskSpecContainerSpecUlimitsItem[]|null */ - public function getIsolation(): ?string + public function getUlimits() : ?array { - return $this->isolation; + return $this->ulimits; } - /** - * Isolation technology of the containers running the service. (Windows only). + * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" * - * @param string $isolation + * @param TaskSpecContainerSpecUlimitsItem[]|null $ulimits * * @return self */ - public function setIsolation(?string $isolation): self + public function setUlimits(?array $ulimits) : self { - $this->isolation = $isolation; - + $this->initialized['ulimits'] = true; + $this->ulimits = $ulimits; return $this; } -} +} \ No newline at end of file diff --git a/src/Model/TaskSpecContainerSpecConfigsItem.php b/src/Model/TaskSpecContainerSpecConfigsItem.php index fec154e7..1798e532 100644 --- a/src/Model/TaskSpecContainerSpecConfigsItem.php +++ b/src/Model/TaskSpecContainerSpecConfigsItem.php @@ -1,111 +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; /** - * ConfigID represents the ID of the specific config that we're referencing. - * - * @var string - */ + * 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 - */ + * 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. - * - * @return TaskSpecContainerSpecConfigsItemFile - */ - public function getFile(): ?TaskSpecContainerSpecConfigsItemFile + * 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. - * - * @param TaskSpecContainerSpecConfigsItemFile $file - * - * @return self - */ - public function setFile(?TaskSpecContainerSpecConfigsItemFile $file): self + * 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; } - /** - * ConfigID represents the ID of the specific config that we're referencing. - * - * @return string - */ - public function getConfigID(): ?string + * 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 $configID - * - * @return self - */ - public function setConfigID(?string $configID): self + * 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 - */ - public function getConfigName(): ?string + * 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 $configName - * - * @return self - */ - public function setConfigName(?string $configName): self + * 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/src/Model/TaskSpecContainerSpecConfigsItemFile.php b/src/Model/TaskSpecContainerSpecConfigsItemFile.php index 4bb8ef9f..7ea51b06 100644 --- a/src/Model/TaskSpecContainerSpecConfigsItemFile.php +++ b/src/Model/TaskSpecContainerSpecConfigsItemFile.php @@ -1,135 +1,127 @@ initialized); + } /** * Name represents the final filename in the filesystem. * - * @var string + * @var string|null */ protected $name; /** * UID represents the file UID. * - * @var string + * @var string|null */ protected $uID; /** * GID represents the file GID. * - * @var string + * @var string|null */ protected $gID; /** * Mode represents the FileMode of the file. * - * @var int + * @var int|null */ protected $mode; - /** * Name represents the final filename in the filesystem. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Name represents the final filename in the filesystem. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * UID represents the file UID. * - * @return string + * @return string|null */ - public function getUID(): ?string + public function getUID() : ?string { return $this->uID; } - /** * UID represents the file UID. * - * @param string $uID + * @param string|null $uID * * @return self */ - public function setUID(?string $uID): self + public function setUID(?string $uID) : self { + $this->initialized['uID'] = true; $this->uID = $uID; - return $this; } - /** * GID represents the file GID. * - * @return string + * @return string|null */ - public function getGID(): ?string + public function getGID() : ?string { return $this->gID; } - /** * GID represents the file GID. * - * @param string $gID + * @param string|null $gID * * @return self */ - public function setGID(?string $gID): 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 + * @return int|null */ - public function getMode(): ?int + public function getMode() : ?int { return $this->mode; } - /** * Mode represents the FileMode of the file. * - * @param int $mode + * @param int|null $mode * * @return self */ - public function setMode(?int $mode): 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/src/Model/TaskSpecContainerSpecDNSConfig.php b/src/Model/TaskSpecContainerSpecDNSConfig.php index fa2ac5fe..993bc78b 100644 --- a/src/Model/TaskSpecContainerSpecDNSConfig.php +++ b/src/Model/TaskSpecContainerSpecDNSConfig.php @@ -1,105 +1,105 @@ initialized); + } /** * The IP addresses of the name servers. * - * @var string[] + * @var string[]|null */ protected $nameservers; /** * A search list for host-name lookup. * - * @var string[] + * @var string[]|null */ protected $search; /** - * A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.). - * - * @var string[] - */ + * A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + + * + * @var string[]|null + */ protected $options; - /** * The IP addresses of the name servers. * - * @return string[] + * @return string[]|null */ - public function getNameservers(): ?array + public function getNameservers() : ?array { return $this->nameservers; } - /** * The IP addresses of the name servers. * - * @param string[] $nameservers + * @param string[]|null $nameservers * * @return self */ - public function setNameservers(?array $nameservers): self + public function setNameservers(?array $nameservers) : self { + $this->initialized['nameservers'] = true; $this->nameservers = $nameservers; - return $this; } - /** * A search list for host-name lookup. * - * @return string[] + * @return string[]|null */ - public function getSearch(): ?array + public function getSearch() : ?array { return $this->search; } - /** * A search list for host-name lookup. * - * @param string[] $search + * @param string[]|null $search * * @return self */ - public function setSearch(?array $search): 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 string[] - */ - public function getOptions(): ?array + * A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + + * + * @return string[]|null + */ + public function getOptions() : ?array { return $this->options; } - /** - * A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.). - * - * @param string[] $options - * - * @return self - */ - public function setOptions(?array $options): self + * A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + + * + * @param string[]|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/src/Model/TaskSpecContainerSpecPrivileges.php b/src/Model/TaskSpecContainerSpecPrivileges.php index 4ea08229..aa949aa9 100644 --- a/src/Model/TaskSpecContainerSpecPrivileges.php +++ b/src/Model/TaskSpecContainerSpecPrivileges.php @@ -1,75 +1,71 @@ initialized); + } + /** + * CredentialSpec for managed service account (Windows only) * - * @var TaskSpecContainerSpecPrivilegesCredentialSpec + * @var TaskSpecContainerSpecPrivilegesCredentialSpec|null */ protected $credentialSpec; /** - * SELinux labels of the container. + * SELinux labels of the container * - * @var TaskSpecContainerSpecPrivilegesSELinuxContext + * @var TaskSpecContainerSpecPrivilegesSELinuxContext|null */ protected $sELinuxContext; - /** - * CredentialSpec for managed service account (Windows only). + * CredentialSpec for managed service account (Windows only) * - * @return TaskSpecContainerSpecPrivilegesCredentialSpec + * @return TaskSpecContainerSpecPrivilegesCredentialSpec|null */ - public function getCredentialSpec(): ?TaskSpecContainerSpecPrivilegesCredentialSpec + public function getCredentialSpec() : ?TaskSpecContainerSpecPrivilegesCredentialSpec { return $this->credentialSpec; } - /** - * CredentialSpec for managed service account (Windows only). + * CredentialSpec for managed service account (Windows only) * - * @param TaskSpecContainerSpecPrivilegesCredentialSpec $credentialSpec + * @param TaskSpecContainerSpecPrivilegesCredentialSpec|null $credentialSpec * * @return self */ - public function setCredentialSpec(?TaskSpecContainerSpecPrivilegesCredentialSpec $credentialSpec): self + public function setCredentialSpec(?TaskSpecContainerSpecPrivilegesCredentialSpec $credentialSpec) : self { + $this->initialized['credentialSpec'] = true; $this->credentialSpec = $credentialSpec; - return $this; } - /** - * SELinux labels of the container. + * SELinux labels of the container * - * @return TaskSpecContainerSpecPrivilegesSELinuxContext + * @return TaskSpecContainerSpecPrivilegesSELinuxContext|null */ - public function getSELinuxContext(): ?TaskSpecContainerSpecPrivilegesSELinuxContext + public function getSELinuxContext() : ?TaskSpecContainerSpecPrivilegesSELinuxContext { return $this->sELinuxContext; } - /** - * SELinux labels of the container. + * SELinux labels of the container * - * @param TaskSpecContainerSpecPrivilegesSELinuxContext $sELinuxContext + * @param TaskSpecContainerSpecPrivilegesSELinuxContext|null $sELinuxContext * * @return self */ - public function setSELinuxContext(?TaskSpecContainerSpecPrivilegesSELinuxContext $sELinuxContext): self + public function setSELinuxContext(?TaskSpecContainerSpecPrivilegesSELinuxContext $sELinuxContext) : self { + $this->initialized['sELinuxContext'] = true; $this->sELinuxContext = $sELinuxContext; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/TaskSpecContainerSpecPrivilegesCredentialSpec.php b/src/Model/TaskSpecContainerSpecPrivilegesCredentialSpec.php index c807ff7a..8f1db9eb 100644 --- a/src/Model/TaskSpecContainerSpecPrivilegesCredentialSpec.php +++ b/src/Model/TaskSpecContainerSpecPrivilegesCredentialSpec.php @@ -1,129 +1,192 @@

- - > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive. - - * - * @var string + * @var array */ + protected $initialized = array(); + public function isInitialized($property) : bool + { + return array_key_exists($property, $this->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: - + * 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` and `CredentialSpec.Registry` are mutually exclusive. - - * - * @var string - */ + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + + * + * @var string|null + */ protected $registry; - /** - * 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`. - + * 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` and `CredentialSpec.Registry` are mutually exclusive. - - * - * @return string - */ - public function getFile(): ?string + + + > **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`. - + * 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` and `CredentialSpec.Registry` are mutually exclusive. - - * - * @param string $file - * - * @return self - */ - public function setFile(?string $file): self + + > **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: - + * 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` and `CredentialSpec.Registry` are mutually exclusive. - - * - * @return string - */ - public function getRegistry(): ?string + + + > **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: - + * 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` and `CredentialSpec.Registry` are mutually exclusive. - - * - * @param string $registry - * - * @return self - */ - public function setRegistry(?string $registry): self + + + > **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/src/Model/TaskSpecContainerSpecPrivilegesSELinuxContext.php b/src/Model/TaskSpecContainerSpecPrivilegesSELinuxContext.php index 883de75e..ca4f51cd 100644 --- a/src/Model/TaskSpecContainerSpecPrivilegesSELinuxContext.php +++ b/src/Model/TaskSpecContainerSpecPrivilegesSELinuxContext.php @@ -1,165 +1,155 @@ initialized); + } + /** + * Disable SELinux * - * @var bool + * @var bool|null */ protected $disable; /** - * SELinux user label. + * SELinux user label * - * @var string + * @var string|null */ protected $user; /** - * SELinux role label. + * SELinux role label * - * @var string + * @var string|null */ protected $role; /** - * SELinux type label. + * SELinux type label * - * @var string + * @var string|null */ protected $type; /** - * SELinux level label. + * SELinux level label * - * @var string + * @var string|null */ protected $level; - /** - * Disable SELinux. + * Disable SELinux * - * @return bool + * @return bool|null */ - public function getDisable(): ?bool + public function getDisable() : ?bool { return $this->disable; } - /** - * Disable SELinux. + * Disable SELinux * - * @param bool $disable + * @param bool|null $disable * * @return self */ - public function setDisable(?bool $disable): self + public function setDisable(?bool $disable) : self { + $this->initialized['disable'] = true; $this->disable = $disable; - return $this; } - /** - * SELinux user label. + * SELinux user label * - * @return string + * @return string|null */ - public function getUser(): ?string + public function getUser() : ?string { return $this->user; } - /** - * SELinux user label. + * SELinux user label * - * @param string $user + * @param string|null $user * * @return self */ - public function setUser(?string $user): self + public function setUser(?string $user) : self { + $this->initialized['user'] = true; $this->user = $user; - return $this; } - /** - * SELinux role label. + * SELinux role label * - * @return string + * @return string|null */ - public function getRole(): ?string + public function getRole() : ?string { return $this->role; } - /** - * SELinux role label. + * SELinux role label * - * @param string $role + * @param string|null $role * * @return self */ - public function setRole(?string $role): self + public function setRole(?string $role) : self { + $this->initialized['role'] = true; $this->role = $role; - return $this; } - /** - * SELinux type label. + * SELinux type label * - * @return string + * @return string|null */ - public function getType(): ?string + public function getType() : ?string { return $this->type; } - /** - * SELinux type label. + * SELinux type label * - * @param string $type + * @param string|null $type * * @return self */ - public function setType(?string $type): self + public function setType(?string $type) : self { + $this->initialized['type'] = true; $this->type = $type; - return $this; } - /** - * SELinux level label. + * SELinux level label * - * @return string + * @return string|null */ - public function getLevel(): ?string + public function getLevel() : ?string { return $this->level; } - /** - * SELinux level label. + * SELinux level label * - * @param string $level + * @param string|null $level * * @return self */ - public function setLevel(?string $level): 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/src/Model/TaskSpecContainerSpecSecretsItem.php b/src/Model/TaskSpecContainerSpecSecretsItem.php index 71e1205a..b02da730 100644 --- a/src/Model/TaskSpecContainerSpecSecretsItem.php +++ b/src/Model/TaskSpecContainerSpecSecretsItem.php @@ -1,111 +1,114 @@ initialized); + } /** * File represents a specific target that is backed by a file. * - * @var TaskSpecContainerSpecSecretsItemFile + * @var TaskSpecContainerSpecSecretsItemFile|null */ protected $file; /** - * SecretID represents the ID of the specific secret that we're referencing. - * - * @var string - */ + * 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 - */ + * 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 + * @return TaskSpecContainerSpecSecretsItemFile|null */ - public function getFile(): ?TaskSpecContainerSpecSecretsItemFile + public function getFile() : ?TaskSpecContainerSpecSecretsItemFile { return $this->file; } - /** * File represents a specific target that is backed by a file. * - * @param TaskSpecContainerSpecSecretsItemFile $file + * @param TaskSpecContainerSpecSecretsItemFile|null $file * * @return self */ - public function setFile(?TaskSpecContainerSpecSecretsItemFile $file): 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 - */ - public function getSecretID(): ?string + * 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 $secretID - * - * @return self - */ - public function setSecretID(?string $secretID): self + * 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 - */ - public function getSecretName(): ?string + * 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 $secretName - * - * @return self - */ - public function setSecretName(?string $secretName): self + * 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/src/Model/TaskSpecContainerSpecSecretsItemFile.php b/src/Model/TaskSpecContainerSpecSecretsItemFile.php index 960c2a2e..ade44d9e 100644 --- a/src/Model/TaskSpecContainerSpecSecretsItemFile.php +++ b/src/Model/TaskSpecContainerSpecSecretsItemFile.php @@ -1,135 +1,127 @@ initialized); + } /** * Name represents the final filename in the filesystem. * - * @var string + * @var string|null */ protected $name; /** * UID represents the file UID. * - * @var string + * @var string|null */ protected $uID; /** * GID represents the file GID. * - * @var string + * @var string|null */ protected $gID; /** * Mode represents the FileMode of the file. * - * @var int + * @var int|null */ protected $mode; - /** * Name represents the final filename in the filesystem. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Name represents the final filename in the filesystem. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * UID represents the file UID. * - * @return string + * @return string|null */ - public function getUID(): ?string + public function getUID() : ?string { return $this->uID; } - /** * UID represents the file UID. * - * @param string $uID + * @param string|null $uID * * @return self */ - public function setUID(?string $uID): self + public function setUID(?string $uID) : self { + $this->initialized['uID'] = true; $this->uID = $uID; - return $this; } - /** * GID represents the file GID. * - * @return string + * @return string|null */ - public function getGID(): ?string + public function getGID() : ?string { return $this->gID; } - /** * GID represents the file GID. * - * @param string $gID + * @param string|null $gID * * @return self */ - public function setGID(?string $gID): 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 + * @return int|null */ - public function getMode(): ?int + public function getMode() : ?int { return $this->mode; } - /** * Mode represents the FileMode of the file. * - * @param int $mode + * @param int|null $mode * * @return self */ - public function setMode(?int $mode): 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/src/Model/TaskSpecContainerSpecUlimitsItem.php b/src/Model/TaskSpecContainerSpecUlimitsItem.php new file mode 100644 index 00000000..1aec1982 --- /dev/null +++ b/src/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/src/Model/TaskSpecLogDriver.php b/src/Model/TaskSpecLogDriver.php index b4a0df28..7541f3a6 100644 --- a/src/Model/TaskSpecLogDriver.php +++ b/src/Model/TaskSpecLogDriver.php @@ -1,63 +1,71 @@ initialized); + } + /** + * + * + * @var string|null */ protected $name; /** - * @var string[] + * + * + * @var array|null */ protected $options; - /** - * @return string + * + * + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** - * @param string $name + * + * + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** - * @return string[] + * + * + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions() : ?iterable { return $this->options; } - /** - * @param string[] $options + * + * + * @param array|null $options * * @return self */ - public function setOptions(?\ArrayObject $options): 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/src/Model/TaskSpecNetworkAttachmentSpec.php b/src/Model/TaskSpecNetworkAttachmentSpec.php new file mode 100644 index 00000000..75929eb3 --- /dev/null +++ b/src/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/src/Model/TaskSpecNetworksItem.php b/src/Model/TaskSpecNetworksItem.php deleted file mode 100644 index d94a64b7..00000000 --- a/src/Model/TaskSpecNetworksItem.php +++ /dev/null @@ -1,63 +0,0 @@ -target; - } - - /** - * @param string $target - * - * @return self - */ - public function setTarget(?string $target): self - { - $this->target = $target; - - return $this; - } - - /** - * @return string[] - */ - public function getAliases(): ?array - { - return $this->aliases; - } - - /** - * @param string[] $aliases - * - * @return self - */ - public function setAliases(?array $aliases): self - { - $this->aliases = $aliases; - - return $this; - } -} diff --git a/src/Model/TaskSpecPlacement.php b/src/Model/TaskSpecPlacement.php index 08784dfe..1c42828c 100644 --- a/src/Model/TaskSpecPlacement.php +++ b/src/Model/TaskSpecPlacement.php @@ -1,117 +1,211 @@ 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-14.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 string[]|null + */ protected $constraints; /** - * 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 TaskSpecPlacementPreferencesItem[] - */ + * 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 TaskSpecPlacementPreferencesItem[]|null + */ protected $preferences; /** - * Platforms stores all the platforms that the service's image can. + * 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 Platform[] - */ + + * + * @var Platform[]|null + */ protected $platforms; - /** - * An array of constraints. - * - * @return string[] - */ - public function getConstraints(): ?array + * 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-14.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 string[]|null + */ + public function getConstraints() : ?array { return $this->constraints; } - /** - * An array of constraints. - * - * @param string[] $constraints - * - * @return self - */ - public function setConstraints(?array $constraints): self + * 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-14.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 string[]|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 TaskSpecPlacementPreferencesItem[] - */ - public function getPreferences(): ?array + * 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 TaskSpecPlacementPreferencesItem[]|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 TaskSpecPlacementPreferencesItem[] $preferences - * - * @return self - */ - public function setPreferences(?array $preferences): self + * 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 TaskSpecPlacementPreferencesItem[]|null $preferences + * + * @return self + */ + public function setPreferences(?array $preferences) : self { + $this->initialized['preferences'] = true; $this->preferences = $preferences; - return $this; } - /** - * Platforms stores all the platforms that the service's image can. + * 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 Platform[] - */ - public function getPlatforms(): ?array + + * + * @return Platform[]|null + */ + public function getPlatforms() : ?array { return $this->platforms; } - /** - * Platforms stores all the platforms that the service's image can. + * 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 Platform[] $platforms - * - * @return self - */ - public function setPlatforms(?array $platforms): self + + * + * @param Platform[]|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/src/Model/TaskSpecPlacementPreferencesItem.php b/src/Model/TaskSpecPlacementPreferencesItem.php index 7b1fda7c..83d8d735 100644 --- a/src/Model/TaskSpecPlacementPreferencesItem.php +++ b/src/Model/TaskSpecPlacementPreferencesItem.php @@ -1,39 +1,43 @@ initialized); + } + /** + * + * + * @var TaskSpecPlacementPreferencesItemSpread|null */ protected $spread; - /** - * @return TaskSpecPlacementPreferencesItemSpread + * + * + * @return TaskSpecPlacementPreferencesItemSpread|null */ - public function getSpread(): ?TaskSpecPlacementPreferencesItemSpread + public function getSpread() : ?TaskSpecPlacementPreferencesItemSpread { return $this->spread; } - /** - * @param TaskSpecPlacementPreferencesItemSpread $spread + * + * + * @param TaskSpecPlacementPreferencesItemSpread|null $spread * * @return self */ - public function setSpread(?TaskSpecPlacementPreferencesItemSpread $spread): 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/src/Model/TaskSpecPlacementPreferencesItemSpread.php b/src/Model/TaskSpecPlacementPreferencesItemSpread.php index 585f6278..67bef7d4 100644 --- a/src/Model/TaskSpecPlacementPreferencesItemSpread.php +++ b/src/Model/TaskSpecPlacementPreferencesItemSpread.php @@ -1,45 +1,43 @@ initialized); + } + /** + * label descriptor, such as `engine.labels.az`. * - * @var string + * @var string|null */ protected $spreadDescriptor; - /** - * label descriptor, such as engine.labels.az. + * label descriptor, such as `engine.labels.az`. * - * @return string + * @return string|null */ - public function getSpreadDescriptor(): ?string + public function getSpreadDescriptor() : ?string { return $this->spreadDescriptor; } - /** - * label descriptor, such as engine.labels.az. + * label descriptor, such as `engine.labels.az`. * - * @param string $spreadDescriptor + * @param string|null $spreadDescriptor * * @return self */ - public function setSpreadDescriptor(?string $spreadDescriptor): 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/src/Model/TaskSpecPluginSpec.php b/src/Model/TaskSpecPluginSpec.php index 816a9f12..8854c970 100644 --- a/src/Model/TaskSpecPluginSpec.php +++ b/src/Model/TaskSpecPluginSpec.php @@ -1,129 +1,127 @@ initialized); + } /** * The name or 'alias' to use for the plugin. * - * @var string + * @var string|null */ protected $name; /** * The plugin image reference to use. * - * @var string + * @var string|null */ protected $remote; /** * Disable the plugin once scheduled. * - * @var bool + * @var bool|null */ protected $disabled; /** - * @var TaskSpecPluginSpecPluginPrivilegeItem[] + * + * + * @var PluginPrivilege[]|null */ protected $pluginPrivilege; - /** * The name or 'alias' to use for the plugin. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * The name or 'alias' to use for the plugin. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * The plugin image reference to use. * - * @return string + * @return string|null */ - public function getRemote(): ?string + public function getRemote() : ?string { return $this->remote; } - /** * The plugin image reference to use. * - * @param string $remote + * @param string|null $remote * * @return self */ - public function setRemote(?string $remote): self + public function setRemote(?string $remote) : self { + $this->initialized['remote'] = true; $this->remote = $remote; - return $this; } - /** * Disable the plugin once scheduled. * - * @return bool + * @return bool|null */ - public function getDisabled(): ?bool + public function getDisabled() : ?bool { return $this->disabled; } - /** * Disable the plugin once scheduled. * - * @param bool $disabled + * @param bool|null $disabled * * @return self */ - public function setDisabled(?bool $disabled): self + public function setDisabled(?bool $disabled) : self { + $this->initialized['disabled'] = true; $this->disabled = $disabled; - return $this; } - /** - * @return TaskSpecPluginSpecPluginPrivilegeItem[] + * + * + * @return PluginPrivilege[]|null */ - public function getPluginPrivilege(): ?array + public function getPluginPrivilege() : ?array { return $this->pluginPrivilege; } - /** - * @param TaskSpecPluginSpecPluginPrivilegeItem[] $pluginPrivilege + * + * + * @param PluginPrivilege[]|null $pluginPrivilege * * @return self */ - public function setPluginPrivilege(?array $pluginPrivilege): 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/src/Model/TaskSpecPluginSpecPluginPrivilegeItem.php b/src/Model/TaskSpecPluginSpecPluginPrivilegeItem.php deleted file mode 100644 index 25e9eb98..00000000 --- a/src/Model/TaskSpecPluginSpecPluginPrivilegeItem.php +++ /dev/null @@ -1,87 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName(?string $name): self - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getDescription(): ?string - { - return $this->description; - } - - /** - * @param string $description - * - * @return self - */ - public function setDescription(?string $description): self - { - $this->description = $description; - - return $this; - } - - /** - * @return string[] - */ - public function getValue(): ?array - { - return $this->value; - } - - /** - * @param string[] $value - * - * @return self - */ - public function setValue(?array $value): self - { - $this->value = $value; - - return $this; - } -} diff --git a/src/Model/TaskSpecResources.php b/src/Model/TaskSpecResources.php index a3f83e74..1833fe0f 100644 --- a/src/Model/TaskSpecResources.php +++ b/src/Model/TaskSpecResources.php @@ -1,75 +1,77 @@ initialized); + } /** - * An object describing the resources which can be advertised by a node and requested by a task. + * An object describing a limit on resources which can be requested by a task. * - * @var ResourceObject + * @var Limit|null */ - protected $reservation; - + protected $limits; /** - * An object describing the resources which can be advertised by a node and requested by a task. + * 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 ResourceObject + * @return Limit|null */ - public function getLimits(): ?ResourceObject + public function getLimits() : ?Limit { return $this->limits; } - /** - * An object describing the resources which can be advertised by a node and requested by a task. + * An object describing a limit on resources which can be requested by a task. * - * @param ResourceObject $limits + * @param Limit|null $limits * * @return self */ - public function setLimits(?ResourceObject $limits): 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 - */ - public function getReservation(): ?ResourceObject + * 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->reservation; + return $this->reservations; } - /** - * An object describing the resources which can be advertised by a node and requested by a task. - * - * @param ResourceObject $reservation - * - * @return self - */ - public function setReservation(?ResourceObject $reservation): self + * 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->reservation = $reservation; - + $this->initialized['reservations'] = true; + $this->reservations = $reservations; return $this; } -} +} \ No newline at end of file diff --git a/src/Model/TaskSpecRestartPolicy.php b/src/Model/TaskSpecRestartPolicy.php index f32bb5d1..c95cf434 100644 --- a/src/Model/TaskSpecRestartPolicy.php +++ b/src/Model/TaskSpecRestartPolicy.php @@ -1,135 +1,139 @@ initialized); + } /** * Condition for restart. * - * @var string + * @var string|null */ protected $condition; /** * Delay between restart attempts. * - * @var int + * @var int|null */ protected $delay; /** - * Maximum attempts to restart a given container before giving up (default value is 0, which is ignored). - * - * @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; /** - * Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded). - * - * @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; /** * Condition for restart. * - * @return string + * @return string|null */ - public function getCondition(): ?string + public function getCondition() : ?string { return $this->condition; } - /** * Condition for restart. * - * @param string $condition + * @param string|null $condition * * @return self */ - public function setCondition(?string $condition): self + public function setCondition(?string $condition) : self { + $this->initialized['condition'] = true; $this->condition = $condition; - return $this; } - /** * Delay between restart attempts. * - * @return int + * @return int|null */ - public function getDelay(): ?int + public function getDelay() : ?int { return $this->delay; } - /** * Delay between restart attempts. * - * @param int $delay + * @param int|null $delay * * @return self */ - public function setDelay(?int $delay): self + public function setDelay(?int $delay) : self { + $this->initialized['delay'] = true; $this->delay = $delay; - return $this; } - /** - * Maximum attempts to restart a given container before giving up (default value is 0, which is ignored). - * - * @return int - */ - public function getMaxAttempts(): ?int + * 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; } - /** - * Maximum attempts to restart a given container before giving up (default value is 0, which is ignored). - * - * @param int $maxAttempts - * - * @return self - */ - public function setMaxAttempts(?int $maxAttempts): self + * 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; } - /** - * Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded). - * - * @return int - */ - public function getWindow(): ?int + * 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; } - /** - * Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded). - * - * @param int $window - * - * @return self - */ - public function setWindow(?int $window): self + * 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/src/Model/TaskStatus.php b/src/Model/TaskStatus.php index 56ebc4a7..ad9f111a 100644 --- a/src/Model/TaskStatus.php +++ b/src/Model/TaskStatus.php @@ -1,135 +1,155 @@ 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 TaskStatusContainerStatus + * + * + * @var TaskStatusContainerStatus|null */ protected $containerStatus; - /** - * @return string + * + * + * @return string|null */ - public function getTimestamp(): ?string + public function getTimestamp() : ?string { return $this->timestamp; } - /** - * @param string $timestamp + * + * + * @param string|null $timestamp * * @return self */ - public function setTimestamp(?string $timestamp): self + public function setTimestamp(?string $timestamp) : self { + $this->initialized['timestamp'] = true; $this->timestamp = $timestamp; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getState(): ?string + public function getState() : ?string { return $this->state; } - /** - * @param string $state + * + * + * @param string|null $state * * @return self */ - public function setState(?string $state): self + public function setState(?string $state) : self { + $this->initialized['state'] = true; $this->state = $state; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getMessage(): ?string + public function getMessage() : ?string { return $this->message; } - /** - * @param string $message + * + * + * @param string|null $message * * @return self */ - public function setMessage(?string $message): self + public function setMessage(?string $message) : self { + $this->initialized['message'] = true; $this->message = $message; - return $this; } - /** - * @return string + * + * + * @return string|null */ - public function getErr(): ?string + public function getErr() : ?string { return $this->err; } - /** - * @param string $err + * + * + * @param string|null $err * * @return self */ - public function setErr(?string $err): self + public function setErr(?string $err) : self { + $this->initialized['err'] = true; $this->err = $err; - return $this; } - /** - * @return TaskStatusContainerStatus + * + * + * @return TaskStatusContainerStatus|null */ - public function getContainerStatus(): ?TaskStatusContainerStatus + public function getContainerStatus() : ?TaskStatusContainerStatus { return $this->containerStatus; } - /** - * @param TaskStatusContainerStatus $containerStatus + * + * + * @param TaskStatusContainerStatus|null $containerStatus * * @return self */ - public function setContainerStatus(?TaskStatusContainerStatus $containerStatus): self + public function setContainerStatus(?TaskStatusContainerStatus $containerStatus) : self { + $this->initialized['containerStatus'] = true; $this->containerStatus = $containerStatus; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/TaskStatusContainerStatus.php b/src/Model/TaskStatusContainerStatus.php index a048ade4..851fd98e 100644 --- a/src/Model/TaskStatusContainerStatus.php +++ b/src/Model/TaskStatusContainerStatus.php @@ -1,87 +1,99 @@ 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(): ?string + public function getContainerID() : ?string { return $this->containerID; } - /** - * @param string $containerID + * + * + * @param string|null $containerID * * @return self */ - public function setContainerID(?string $containerID): self + public function setContainerID(?string $containerID) : self { + $this->initialized['containerID'] = true; $this->containerID = $containerID; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getPID(): ?int + public function getPID() : ?int { return $this->pID; } - /** - * @param int $pID + * + * + * @param int|null $pID * * @return self */ - public function setPID(?int $pID): self + public function setPID(?int $pID) : self { + $this->initialized['pID'] = true; $this->pID = $pID; - return $this; } - /** - * @return int + * + * + * @return int|null */ - public function getExitCode(): ?int + public function getExitCode() : ?int { return $this->exitCode; } - /** - * @param int $exitCode + * + * + * @param int|null $exitCode * * @return self */ - public function setExitCode(?int $exitCode): self + public function setExitCode(?int $exitCode) : self { + $this->initialized['exitCode'] = true; $this->exitCode = $exitCode; - return $this; } -} +} \ No newline at end of file diff --git a/src/Model/ThrottleDevice.php b/src/Model/ThrottleDevice.php index 60565d27..06808e61 100644 --- a/src/Model/ThrottleDevice.php +++ b/src/Model/ThrottleDevice.php @@ -1,75 +1,71 @@ initialized); + } + /** + * Device path * - * @var string + * @var string|null */ protected $path; /** - * Rate. + * Rate * - * @var int + * @var int|null */ protected $rate; - /** - * Device path. + * Device path * - * @return string + * @return string|null */ - public function getPath(): ?string + public function getPath() : ?string { return $this->path; } - /** - * Device path. + * Device path * - * @param string $path + * @param string|null $path * * @return self */ - public function setPath(?string $path): self + public function setPath(?string $path) : self { + $this->initialized['path'] = true; $this->path = $path; - return $this; } - /** - * Rate. + * Rate * - * @return int + * @return int|null */ - public function getRate(): ?int + public function getRate() : ?int { return $this->rate; } - /** - * Rate. + * Rate * - * @param int $rate + * @param int|null $rate * * @return self */ - public function setRate(?int $rate): 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/src/Model/VersionGetResponse200.php b/src/Model/VersionGetResponse200.php deleted file mode 100644 index 4bb04d5c..00000000 --- a/src/Model/VersionGetResponse200.php +++ /dev/null @@ -1,303 +0,0 @@ -platform; - } - - /** - * @param VersionGetResponse200Platform $platform - * - * @return self - */ - public function setPlatform(?VersionGetResponse200Platform $platform): self - { - $this->platform = $platform; - - return $this; - } - - /** - * @return VersionGetResponse200ComponentsItem[] - */ - public function getComponents(): ?array - { - return $this->components; - } - - /** - * @param VersionGetResponse200ComponentsItem[] $components - * - * @return self - */ - public function setComponents(?array $components): self - { - $this->components = $components; - - return $this; - } - - /** - * @return string - */ - public function getVersion(): ?string - { - return $this->version; - } - - /** - * @param string $version - * - * @return self - */ - public function setVersion(?string $version): self - { - $this->version = $version; - - return $this; - } - - /** - * @return string - */ - public function getApiVersion(): ?string - { - return $this->apiVersion; - } - - /** - * @param string $apiVersion - * - * @return self - */ - public function setApiVersion(?string $apiVersion): self - { - $this->apiVersion = $apiVersion; - - return $this; - } - - /** - * @return string - */ - public function getMinAPIVersion(): ?string - { - return $this->minAPIVersion; - } - - /** - * @param string $minAPIVersion - * - * @return self - */ - public function setMinAPIVersion(?string $minAPIVersion): self - { - $this->minAPIVersion = $minAPIVersion; - - return $this; - } - - /** - * @return string - */ - public function getGitCommit(): ?string - { - return $this->gitCommit; - } - - /** - * @param string $gitCommit - * - * @return self - */ - public function setGitCommit(?string $gitCommit): self - { - $this->gitCommit = $gitCommit; - - return $this; - } - - /** - * @return string - */ - public function getGoVersion(): ?string - { - return $this->goVersion; - } - - /** - * @param string $goVersion - * - * @return self - */ - public function setGoVersion(?string $goVersion): self - { - $this->goVersion = $goVersion; - - return $this; - } - - /** - * @return string - */ - public function getOs(): ?string - { - return $this->os; - } - - /** - * @param string $os - * - * @return self - */ - public function setOs(?string $os): self - { - $this->os = $os; - - return $this; - } - - /** - * @return string - */ - public function getArch(): ?string - { - return $this->arch; - } - - /** - * @param string $arch - * - * @return self - */ - public function setArch(?string $arch): self - { - $this->arch = $arch; - - return $this; - } - - /** - * @return string - */ - public function getKernelVersion(): ?string - { - return $this->kernelVersion; - } - - /** - * @param string $kernelVersion - * - * @return self - */ - public function setKernelVersion(?string $kernelVersion): self - { - $this->kernelVersion = $kernelVersion; - - return $this; - } - - /** - * @return bool - */ - public function getExperimental(): ?bool - { - return $this->experimental; - } - - /** - * @param bool $experimental - * - * @return self - */ - public function setExperimental(?bool $experimental): self - { - $this->experimental = $experimental; - - return $this; - } - - /** - * @return string - */ - public function getBuildTime(): ?string - { - return $this->buildTime; - } - - /** - * @param string $buildTime - * - * @return self - */ - public function setBuildTime(?string $buildTime): self - { - $this->buildTime = $buildTime; - - return $this; - } -} diff --git a/src/Model/VersionGetResponse200ComponentsItem.php b/src/Model/VersionGetResponse200ComponentsItem.php deleted file mode 100644 index ab3e944a..00000000 --- a/src/Model/VersionGetResponse200ComponentsItem.php +++ /dev/null @@ -1,87 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName(?string $name): self - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getVersion(): ?string - { - return $this->version; - } - - /** - * @param string $version - * - * @return self - */ - public function setVersion(?string $version): self - { - $this->version = $version; - - return $this; - } - - /** - * @return mixed - */ - public function getDetails() - { - return $this->details; - } - - /** - * @param mixed $details - * - * @return self - */ - public function setDetails($details): self - { - $this->details = $details; - - return $this; - } -} diff --git a/src/Model/VersionGetResponse200Platform.php b/src/Model/VersionGetResponse200Platform.php deleted file mode 100644 index e342d9e5..00000000 --- a/src/Model/VersionGetResponse200Platform.php +++ /dev/null @@ -1,39 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName(?string $name): self - { - $this->name = $name; - - return $this; - } -} diff --git a/src/Model/Volume.php b/src/Model/Volume.php index a293b807..9fb9e343 100644 --- a/src/Model/Volume.php +++ b/src/Model/Volume.php @@ -1,309 +1,331 @@ initialized); + } /** * Name of the volume. * - * @var string + * @var string|null */ protected $name; /** * Name of the volume driver used by the volume. * - * @var string + * @var string|null */ protected $driver; /** * Mount path of the volume on the host. * - * @var string + * @var string|null */ protected $mountpoint; /** * Date/Time the volume was created. * - * @var string + * @var string|null */ protected $createdAt; /** - * Low-level details about the volume, provided by the volume driver. + * 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 mixed[] - */ + + * + * @var array|null + */ protected $status; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** - * The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. - * - * @var string - */ - protected $scope; + * 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 string[] + * @var array|null */ protected $options; /** - * Usage details about the volume. This information is used by the. + * Usage details about the volume. This information is used by the `GET /system/df` endpoint, and omitted in other endpoints. - - * - * @var VolumeUsageData - */ + + * + * @var VolumeUsageData|null + */ protected $usageData; - /** * Name of the volume. * - * @return string + * @return string|null */ - public function getName(): ?string + public function getName() : ?string { return $this->name; } - /** * Name of the volume. * - * @param string $name + * @param string|null $name * * @return self */ - public function setName(?string $name): self + public function setName(?string $name) : self { + $this->initialized['name'] = true; $this->name = $name; - return $this; } - /** * Name of the volume driver used by the volume. * - * @return string + * @return string|null */ - public function getDriver(): ?string + public function getDriver() : ?string { return $this->driver; } - /** * Name of the volume driver used by the volume. * - * @param string $driver + * @param string|null $driver * * @return self */ - public function setDriver(?string $driver): self + public function setDriver(?string $driver) : self { + $this->initialized['driver'] = true; $this->driver = $driver; - return $this; } - /** * Mount path of the volume on the host. * - * @return string + * @return string|null */ - public function getMountpoint(): ?string + public function getMountpoint() : ?string { return $this->mountpoint; } - /** * Mount path of the volume on the host. * - * @param string $mountpoint + * @param string|null $mountpoint * * @return self */ - public function setMountpoint(?string $mountpoint): self + public function setMountpoint(?string $mountpoint) : self { + $this->initialized['mountpoint'] = true; $this->mountpoint = $mountpoint; - return $this; } - /** * Date/Time the volume was created. * - * @return string + * @return string|null */ - public function getCreatedAt(): ?string + public function getCreatedAt() : ?string { return $this->createdAt; } - /** * Date/Time the volume was created. * - * @param string $createdAt + * @param string|null $createdAt * * @return self */ - public function setCreatedAt(?string $createdAt): 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. + * 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 mixed[] - */ - public function getStatus(): ?\ArrayObject + + * + * @return array|null + */ + public function getStatus() : ?iterable { return $this->status; } - /** - * Low-level details about the volume, provided by the volume driver. + * 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 mixed[] $status - * - * @return self - */ - public function setStatus(?\ArrayObject $status): self + + * + * @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 string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels() : ?iterable { return $this->labels; } - /** * User-defined key/value metadata. * - * @param string[] $labels + * @param array|null $labels * * @return self */ - public function setLabels(?\ArrayObject $labels): 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 - */ - public function getScope(): ?string + * 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 $scope - * - * @return self - */ - public function setScope(?string $scope): self + * 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 string[] + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions() : ?iterable { return $this->options; } - /** * The driver specific options used when creating the volume. * - * @param string[] $options + * @param array|null $options * * @return self */ - public function setOptions(?\ArrayObject $options): 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. + * Usage details about the volume. This information is used by the `GET /system/df` endpoint, and omitted in other endpoints. - - * - * @return VolumeUsageData - */ - public function getUsageData(): ?VolumeUsageData + + * + * @return VolumeUsageData|null + */ + public function getUsageData() : ?VolumeUsageData { return $this->usageData; } - /** - * Usage details about the volume. This information is used by the. + * Usage details about the volume. This information is used by the `GET /system/df` endpoint, and omitted in other endpoints. - - * - * @param VolumeUsageData $usageData - * - * @return self - */ - public function setUsageData(?VolumeUsageData $usageData): self + + * + * @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/src/Model/VolumeCreateOptions.php b/src/Model/VolumeCreateOptions.php new file mode 100644 index 00000000..0e3f0431 --- /dev/null +++ b/src/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/src/Model/VolumeListResponse.php b/src/Model/VolumeListResponse.php new file mode 100644 index 00000000..3379a0f0 --- /dev/null +++ b/src/Model/VolumeListResponse.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * List of volumes + * + * @var Volume[]|null + */ + protected $volumes; + /** + * Warnings that occurred when fetching the list of volumes. + * + * @var string[]|null + */ + protected $warnings; + /** + * List of volumes + * + * @return Volume[]|null + */ + public function getVolumes() : ?array + { + return $this->volumes; + } + /** + * List of volumes + * + * @param Volume[]|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 string[]|null + */ + public function getWarnings() : ?array + { + return $this->warnings; + } + /** + * Warnings that occurred when fetching the list of volumes. + * + * @param string[]|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/src/Model/VolumeUsageData.php b/src/Model/VolumeUsageData.php index d33f8190..17cfa882 100644 --- a/src/Model/VolumeUsageData.php +++ b/src/Model/VolumeUsageData.php @@ -1,93 +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 - */ - protected $size; + + * + * @var int|null + */ + protected $size = -1; /** - * The number of containers referencing this volume. This field. + * The number of containers referencing this volume. This field is set to `-1` if the reference-count is not available. - - * - * @var int - */ - protected $refCount; - + + * + * @var int|null + */ + protected $refCount = -1; /** - * Amount of disk space used by the volume (in bytes). This information. + * 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 - */ - public function getSize(): ?int + + * + * @return int|null + */ + public function getSize() : ?int { return $this->size; } - /** - * Amount of disk space used by the volume (in bytes). This information. + * 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 $size - * - * @return self - */ - public function setSize(?int $size): self + + * + * @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. + * The number of containers referencing this volume. This field is set to `-1` if the reference-count is not available. - - * - * @return int - */ - public function getRefCount(): ?int + + * + * @return int|null + */ + public function getRefCount() : ?int { return $this->refCount; } - /** - * The number of containers referencing this volume. This field. + * The number of containers referencing this volume. This field is set to `-1` if the reference-count is not available. - - * - * @param int $refCount - * - * @return self - */ - public function setRefCount(?int $refCount): self + + * + * @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/src/Model/VolumesCreatePostBody.php b/src/Model/VolumesCreatePostBody.php deleted file mode 100644 index 3b7ad484..00000000 --- a/src/Model/VolumesCreatePostBody.php +++ /dev/null @@ -1,135 +0,0 @@ -name; - } - - /** - * The new volume's name. If not specified, Docker generates a name. - * - * @param string $name - * - * @return self - */ - public function setName(?string $name): self - { - $this->name = $name; - - return $this; - } - - /** - * Name of the volume driver to use. - * - * @return string - */ - public function getDriver(): ?string - { - return $this->driver; - } - - /** - * Name of the volume driver to use. - * - * @param string $driver - * - * @return self - */ - public function setDriver(?string $driver): self - { - $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 string[] - */ - public function getDriverOpts(): ?\ArrayObject - { - return $this->driverOpts; - } - - /** - * A mapping of driver options and values. These options are passed directly to the driver and are driver specific. - * - * @param string[] $driverOpts - * - * @return self - */ - public function setDriverOpts(?\ArrayObject $driverOpts): self - { - $this->driverOpts = $driverOpts; - - return $this; - } - - /** - * User-defined key/value metadata. - * - * @return string[] - */ - public function getLabels(): ?\ArrayObject - { - return $this->labels; - } - - /** - * User-defined key/value metadata. - * - * @param string[] $labels - * - * @return self - */ - public function setLabels(?\ArrayObject $labels): self - { - $this->labels = $labels; - - return $this; - } -} diff --git a/src/Model/VolumesGetResponse200.php b/src/Model/VolumesGetResponse200.php deleted file mode 100644 index 25f09825..00000000 --- a/src/Model/VolumesGetResponse200.php +++ /dev/null @@ -1,75 +0,0 @@ -volumes; - } - - /** - * List of volumes. - * - * @param Volume[] $volumes - * - * @return self - */ - public function setVolumes(?array $volumes): self - { - $this->volumes = $volumes; - - return $this; - } - - /** - * Warnings that occurred when fetching the list of volumes. - * - * @return string[] - */ - public function getWarnings(): ?array - { - return $this->warnings; - } - - /** - * Warnings that occurred when fetching the list of volumes. - * - * @param string[] $warnings - * - * @return self - */ - public function setWarnings(?array $warnings): self - { - $this->warnings = $warnings; - - return $this; - } -} diff --git a/src/Model/VolumesNamePutBody.php b/src/Model/VolumesNamePutBody.php new file mode 100644 index 00000000..1be161b9 --- /dev/null +++ b/src/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/src/Model/VolumesPrunePostResponse200.php b/src/Model/VolumesPrunePostResponse200.php index f0456883..6cd92b60 100644 --- a/src/Model/VolumesPrunePostResponse200.php +++ b/src/Model/VolumesPrunePostResponse200.php @@ -1,75 +1,71 @@ initialized); + } + /** + * Volumes that were deleted * - * @var string[] + * @var string[]|null */ protected $volumesDeleted; /** - * Disk space reclaimed in bytes. + * Disk space reclaimed in bytes * - * @var int + * @var int|null */ protected $spaceReclaimed; - /** - * Volumes that were deleted. + * Volumes that were deleted * - * @return string[] + * @return string[]|null */ - public function getVolumesDeleted(): ?array + public function getVolumesDeleted() : ?array { return $this->volumesDeleted; } - /** - * Volumes that were deleted. + * Volumes that were deleted * - * @param string[] $volumesDeleted + * @param string[]|null $volumesDeleted * * @return self */ - public function setVolumesDeleted(?array $volumesDeleted): self + public function setVolumesDeleted(?array $volumesDeleted) : self { + $this->initialized['volumesDeleted'] = true; $this->volumesDeleted = $volumesDeleted; - return $this; } - /** - * Disk space reclaimed in bytes. + * Disk space reclaimed in bytes * - * @return int + * @return int|null */ - public function getSpaceReclaimed(): ?int + public function getSpaceReclaimed() : ?int { return $this->spaceReclaimed; } - /** - * Disk space reclaimed in bytes. + * Disk space reclaimed in bytes * - * @param int $spaceReclaimed + * @param int|null $spaceReclaimed * * @return self */ - public function setSpaceReclaimed(?int $spaceReclaimed): 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/src/Normalizer/AddressNormalizer.php b/src/Normalizer/AddressNormalizer.php index 4d3c81ef..1edc96a7 100644 --- a/src/Normalizer/AddressNormalizer.php +++ b/src/Normalizer/AddressNormalizer.php @@ -1,63 +1,76 @@ {'Addr'} !== null) { - $object->setAddr($data->{'Addr'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'PrefixLen') && $data->{'PrefixLen'} !== null) { - $object->setPrefixLen($data->{'PrefixLen'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); + $data = array(); + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); } - if (null !== $object->getPrefixLen()) { - $data->{'PrefixLen'} = $object->getPrefixLen(); + if ($object->isInitialized('prefixLen') && null !== $object->getPrefixLen()) { + $data['PrefixLen'] = $object->getPrefixLen(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\Address' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/AuthConfigNormalizer.php b/src/Normalizer/AuthConfigNormalizer.php index 5ed0f80f..6e846951 100644 --- a/src/Normalizer/AuthConfigNormalizer.php +++ b/src/Normalizer/AuthConfigNormalizer.php @@ -1,75 +1,94 @@ {'username'} !== null) { - $object->setUsername($data->{'username'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'password') && $data->{'password'} !== null) { - $object->setPassword($data->{'password'}); + if (\array_key_exists('username', $data) && $data['username'] !== null) { + $object->setUsername($data['username']); } - if (property_exists($data, 'email') && $data->{'email'} !== null) { - $object->setEmail($data->{'email'}); + elseif (\array_key_exists('username', $data) && $data['username'] === null) { + $object->setUsername(null); } - if (property_exists($data, 'serveraddress') && $data->{'serveraddress'} !== null) { - $object->setServeraddress($data->{'serveraddress'}); + 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; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getUsername()) { - $data->{'username'} = $object->getUsername(); + $data = array(); + if ($object->isInitialized('username') && null !== $object->getUsername()) { + $data['username'] = $object->getUsername(); } - if (null !== $object->getPassword()) { - $data->{'password'} = $object->getPassword(); + if ($object->isInitialized('password') && null !== $object->getPassword()) { + $data['password'] = $object->getPassword(); } - if (null !== $object->getEmail()) { - $data->{'email'} = $object->getEmail(); + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $data['email'] = $object->getEmail(); } - if (null !== $object->getServeraddress()) { - $data->{'serveraddress'} = $object->getServeraddress(); + if ($object->isInitialized('serveraddress') && null !== $object->getServeraddress()) { + $data['serveraddress'] = $object->getServeraddress(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\AuthConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/AuthPostResponse200Normalizer.php b/src/Normalizer/AuthPostResponse200Normalizer.php index e5031ff4..060d659d 100644 --- a/src/Normalizer/AuthPostResponse200Normalizer.php +++ b/src/Normalizer/AuthPostResponse200Normalizer.php @@ -1,63 +1,74 @@ {'Status'} !== null) { - $object->setStatus($data->{'Status'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'IdentityToken') && $data->{'IdentityToken'} !== null) { - $object->setIdentityToken($data->{'IdentityToken'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getStatus()) { - $data->{'Status'} = $object->getStatus(); + $data = array(); + $data['Status'] = $object->getStatus(); + if ($object->isInitialized('identityToken') && null !== $object->getIdentityToken()) { + $data['IdentityToken'] = $object->getIdentityToken(); } - if (null !== $object->getIdentityToken()) { - $data->{'IdentityToken'} = $object->getIdentityToken(); - } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\AuthPostResponse200' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/BuildCacheNormalizer.php b/src/Normalizer/BuildCacheNormalizer.php new file mode 100644 index 00000000..2a5e8521 --- /dev/null +++ b/src/Normalizer/BuildCacheNormalizer.php @@ -0,0 +1,165 @@ +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 = array(); + 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 = array()) + { + $data = array(); + 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 = array(); + 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 array('Docker\\API\\Model\\BuildCache' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/BuildInfoNormalizer.php b/src/Normalizer/BuildInfoNormalizer.php index f6901a7b..6e8a2a87 100644 --- a/src/Normalizer/BuildInfoNormalizer.php +++ b/src/Normalizer/BuildInfoNormalizer.php @@ -1,99 +1,130 @@ {'id'} !== null) { - $object->setId($data->{'id'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'stream') && $data->{'stream'} !== null) { - $object->setStream($data->{'stream'}); + if (\array_key_exists('id', $data) && $data['id'] !== null) { + $object->setId($data['id']); } - if (property_exists($data, 'error') && $data->{'error'} !== null) { - $object->setError($data->{'error'}); + elseif (\array_key_exists('id', $data) && $data['id'] === null) { + $object->setId(null); } - if (property_exists($data, 'errorDetail') && $data->{'errorDetail'} !== null) { - $object->setErrorDetail($this->denormalizer->denormalize($data->{'errorDetail'}, 'Docker\\API\\Model\\ErrorDetail', 'json', $context)); + if (\array_key_exists('stream', $data) && $data['stream'] !== null) { + $object->setStream($data['stream']); } - if (property_exists($data, 'status') && $data->{'status'} !== null) { - $object->setStatus($data->{'status'}); + elseif (\array_key_exists('stream', $data) && $data['stream'] === null) { + $object->setStream(null); } - if (property_exists($data, 'progress') && $data->{'progress'} !== null) { - $object->setProgress($data->{'progress'}); + if (\array_key_exists('error', $data) && $data['error'] !== null) { + $object->setError($data['error']); } - if (property_exists($data, 'progressDetail') && $data->{'progressDetail'} !== null) { - $object->setProgressDetail($this->denormalizer->denormalize($data->{'progressDetail'}, 'Docker\\API\\Model\\ProgressDetail', 'json', $context)); + elseif (\array_key_exists('error', $data) && $data['error'] === null) { + $object->setError(null); } - if (property_exists($data, 'aux') && $data->{'aux'} !== null) { - $object->setAux($this->denormalizer->denormalize($data->{'aux'}, 'Docker\\API\\Model\\ImageID', 'json', $context)); + if (\array_key_exists('errorDetail', $data) && $data['errorDetail'] !== null) { + $object->setErrorDetail($this->denormalizer->denormalize($data['errorDetail'], 'Docker\\API\\Model\\ErrorDetail', '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', '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', 'json', $context)); + } + elseif (\array_key_exists('aux', $data) && $data['aux'] === null) { + $object->setAux(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'id'} = $object->getId(); + $data = array(); + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); } - if (null !== $object->getStream()) { - $data->{'stream'} = $object->getStream(); + if ($object->isInitialized('stream') && null !== $object->getStream()) { + $data['stream'] = $object->getStream(); } - if (null !== $object->getError()) { - $data->{'error'} = $object->getError(); + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['error'] = $object->getError(); } - if (null !== $object->getErrorDetail()) { - $data->{'errorDetail'} = $this->normalizer->normalize($object->getErrorDetail(), 'json', $context); + if ($object->isInitialized('errorDetail') && null !== $object->getErrorDetail()) { + $data['errorDetail'] = $this->normalizer->normalize($object->getErrorDetail(), 'json', $context); } - if (null !== $object->getStatus()) { - $data->{'status'} = $object->getStatus(); + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['status'] = $object->getStatus(); } - if (null !== $object->getProgress()) { - $data->{'progress'} = $object->getProgress(); + if ($object->isInitialized('progress') && null !== $object->getProgress()) { + $data['progress'] = $object->getProgress(); } - if (null !== $object->getProgressDetail()) { - $data->{'progressDetail'} = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); + if ($object->isInitialized('progressDetail') && null !== $object->getProgressDetail()) { + $data['progressDetail'] = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); } - if (null !== $object->getAux()) { - $data->{'aux'} = $this->normalizer->normalize($object->getAux(), '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 array('Docker\\API\\Model\\BuildInfo' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/BuildPrunePostResponse200Normalizer.php b/src/Normalizer/BuildPrunePostResponse200Normalizer.php index 66f8a476..bea2f6f0 100644 --- a/src/Normalizer/BuildPrunePostResponse200Normalizer.php +++ b/src/Normalizer/BuildPrunePostResponse200Normalizer.php @@ -1,57 +1,84 @@ {'SpaceReclaimed'} !== null) { - $object->setSpaceReclaimed($data->{'SpaceReclaimed'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CachesDeleted', $data) && $data['CachesDeleted'] !== null) { + $values = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getSpaceReclaimed()) { - $data->{'SpaceReclaimed'} = $object->getSpaceReclaimed(); + $data = array(); + if ($object->isInitialized('cachesDeleted') && null !== $object->getCachesDeleted()) { + $values = array(); + 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 array('Docker\\API\\Model\\BuildPrunePostResponse200' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ClusterInfoNormalizer.php b/src/Normalizer/ClusterInfoNormalizer.php index efd2f622..e347e222 100644 --- a/src/Normalizer/ClusterInfoNormalizer.php +++ b/src/Normalizer/ClusterInfoNormalizer.php @@ -1,93 +1,156 @@ {'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\SwarmSpec', 'json', $context)); + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); } - if (property_exists($data, 'TLSInfo') && $data->{'TLSInfo'} !== null) { - $object->setTLSInfo($this->denormalizer->denormalize($data->{'TLSInfo'}, 'Docker\\API\\Model\\TLSInfo', 'json', $context)); + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); } - if (property_exists($data, 'RootRotationInProgress') && $data->{'RootRotationInProgress'} !== null) { - $object->setRootRotationInProgress($data->{'RootRotationInProgress'}); + 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', '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', '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 = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $data = array(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); } - if (null !== $object->getTLSInfo()) { - $data->{'TLSInfo'} = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); + if ($object->isInitialized('tLSInfo') && null !== $object->getTLSInfo()) { + $data['TLSInfo'] = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); } - if (null !== $object->getRootRotationInProgress()) { - $data->{'RootRotationInProgress'} = $object->getRootRotationInProgress(); + 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 = array(); + 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 array('Docker\\API\\Model\\ClusterInfo' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ClusterVolumeInfoNormalizer.php b/src/Normalizer/ClusterVolumeInfoNormalizer.php new file mode 100644 index 00000000..751c17be --- /dev/null +++ b/src/Normalizer/ClusterVolumeInfoNormalizer.php @@ -0,0 +1,118 @@ +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(array(), \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 = array(); + foreach ($data['AccessibleTopology'] as $value_1) { + $values_2 = new \ArrayObject(array(), \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 = array()) + { + $data = array(); + if ($object->isInitialized('capacityBytes') && null !== $object->getCapacityBytes()) { + $data['CapacityBytes'] = $object->getCapacityBytes(); + } + if ($object->isInitialized('volumeContext') && null !== $object->getVolumeContext()) { + $values = array(); + 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 = array(); + foreach ($object->getAccessibleTopology() as $value_1) { + $values_2 = array(); + 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 array('Docker\\API\\Model\\ClusterVolumeInfo' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ClusterVolumeNormalizer.php b/src/Normalizer/ClusterVolumeNormalizer.php new file mode 100644 index 00000000..212e66e5 --- /dev/null +++ b/src/Normalizer/ClusterVolumeNormalizer.php @@ -0,0 +1,129 @@ +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', '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', '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', 'json', $context)); + } + elseif (\array_key_exists('Info', $data) && $data['Info'] === null) { + $object->setInfo(null); + } + if (\array_key_exists('PublishStatus', $data) && $data['PublishStatus'] !== null) { + $values = array(); + foreach ($data['PublishStatus'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\ClusterVolumePublishStatusItem', '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 = array()) + { + $data = array(); + 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 = array(); + 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 array('Docker\\API\\Model\\ClusterVolume' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ClusterVolumePublishStatusItemNormalizer.php b/src/Normalizer/ClusterVolumePublishStatusItemNormalizer.php new file mode 100644 index 00000000..d197fd36 --- /dev/null +++ b/src/Normalizer/ClusterVolumePublishStatusItemNormalizer.php @@ -0,0 +1,93 @@ +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(array(), \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 = array()) + { + $data = array(); + 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 = array(); + foreach ($object->getPublishContext() as $key => $value) { + $values[$key] = $value; + } + $data['PublishContext'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ClusterVolumePublishStatusItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer.php b/src/Normalizer/ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer.php new file mode 100644 index 00000000..008dd529 --- /dev/null +++ b/src/Normalizer/ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer.php @@ -0,0 +1,108 @@ + $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 = array(); + foreach ($data['Preferred'] as $value_2) { + $values_3 = new \ArrayObject(array(), \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 = array()) + { + $data = array(); + if ($object->isInitialized('requisite') && null !== $object->getRequisite()) { + $values = array(); + foreach ($object->getRequisite() as $value) { + $values_1 = array(); + 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 = array(); + foreach ($object->getPreferred() as $value_2) { + $values_3 = array(); + 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 array('Docker\\API\\Model\\ClusterVolumeSpecAccessModeAccessibilityRequirements' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ClusterVolumeSpecAccessModeCapacityRangeNormalizer.php b/src/Normalizer/ClusterVolumeSpecAccessModeCapacityRangeNormalizer.php new file mode 100644 index 00000000..fb0138a8 --- /dev/null +++ b/src/Normalizer/ClusterVolumeSpecAccessModeCapacityRangeNormalizer.php @@ -0,0 +1,76 @@ +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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\ClusterVolumeSpecAccessModeCapacityRange' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ClusterVolumeSpecAccessModeNormalizer.php b/src/Normalizer/ClusterVolumeSpecAccessModeNormalizer.php new file mode 100644 index 00000000..f4017271 --- /dev/null +++ b/src/Normalizer/ClusterVolumeSpecAccessModeNormalizer.php @@ -0,0 +1,129 @@ +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 = array(); + foreach ($data['Secrets'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\ClusterVolumeSpecAccessModeSecretsItem', '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', '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', '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 = array()) + { + $data = array(); + 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 = array(); + 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 array('Docker\\API\\Model\\ClusterVolumeSpecAccessMode' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ClusterVolumeSpecAccessModeSecretsItemNormalizer.php b/src/Normalizer/ClusterVolumeSpecAccessModeSecretsItemNormalizer.php new file mode 100644 index 00000000..07041b75 --- /dev/null +++ b/src/Normalizer/ClusterVolumeSpecAccessModeSecretsItemNormalizer.php @@ -0,0 +1,76 @@ +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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\ClusterVolumeSpecAccessModeSecretsItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ClusterVolumeSpecNormalizer.php b/src/Normalizer/ClusterVolumeSpecNormalizer.php new file mode 100644 index 00000000..f67bd3a3 --- /dev/null +++ b/src/Normalizer/ClusterVolumeSpecNormalizer.php @@ -0,0 +1,76 @@ +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', '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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\ClusterVolumeSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/CommitNormalizer.php b/src/Normalizer/CommitNormalizer.php index 7e7f59ee..8ce1b179 100644 --- a/src/Normalizer/CommitNormalizer.php +++ b/src/Normalizer/CommitNormalizer.php @@ -1,63 +1,76 @@ {'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Expected') && $data->{'Expected'} !== null) { - $object->setExpected($data->{'Expected'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $data = array(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); } - if (null !== $object->getExpected()) { - $data->{'Expected'} = $object->getExpected(); + if ($object->isInitialized('expected') && null !== $object->getExpected()) { + $data['Expected'] = $object->getExpected(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\Commit' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ConfigNormalizer.php b/src/Normalizer/ConfigNormalizer.php index 8c6c5e69..af92c3a6 100644 --- a/src/Normalizer/ConfigNormalizer.php +++ b/src/Normalizer/ConfigNormalizer.php @@ -1,81 +1,103 @@ {'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\ConfigSpec', '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', 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $data = array(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + 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 array('Docker\\API\\Model\\Config' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ConfigSpecNormalizer.php b/src/Normalizer/ConfigSpecNormalizer.php index f14a7010..1c39df83 100644 --- a/src/Normalizer/ConfigSpecNormalizer.php +++ b/src/Normalizer/ConfigSpecNormalizer.php @@ -1,77 +1,102 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'Data') && $data->{'Data'} !== null) { - $object->setData($data->{'Data'}); + 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', 'json', $context)); + } + elseif (\array_key_exists('Templating', $data) && $data['Templating'] === null) { + $object->setTemplating(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getData()) { - $data->{'Data'} = $object->getData(); + 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 array('Docker\\API\\Model\\ConfigSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ConfigsCreatePostBodyNormalizer.php b/src/Normalizer/ConfigsCreatePostBodyNormalizer.php index 942db8a4..4d14fbc7 100644 --- a/src/Normalizer/ConfigsCreatePostBodyNormalizer.php +++ b/src/Normalizer/ConfigsCreatePostBodyNormalizer.php @@ -1,77 +1,102 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'Data') && $data->{'Data'} !== null) { - $object->setData($data->{'Data'}); + 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', 'json', $context)); + } + elseif (\array_key_exists('Templating', $data) && $data['Templating'] === null) { + $object->setTemplating(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getData()) { - $data->{'Data'} = $object->getData(); + 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 array('Docker\\API\\Model\\ConfigsCreatePostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainerConfigNormalizer.php b/src/Normalizer/ContainerConfigNormalizer.php index f43fd69a..e26ca2d3 100644 --- a/src/Normalizer/ContainerConfigNormalizer.php +++ b/src/Normalizer/ContainerConfigNormalizer.php @@ -1,265 +1,347 @@ {'Hostname'} !== null) { - $object->setHostname($data->{'Hostname'}); + 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 (property_exists($data, 'Domainname') && $data->{'Domainname'} !== null) { - $object->setDomainname($data->{'Domainname'}); + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); } - if (property_exists($data, 'User') && $data->{'User'} !== null) { - $object->setUser($data->{'User'}); + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); } - if (property_exists($data, 'AttachStdin') && $data->{'AttachStdin'} !== null) { - $object->setAttachStdin($data->{'AttachStdin'}); + if (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] !== null) { + $object->setAttachStdin($data['AttachStdin']); } - if (property_exists($data, 'AttachStdout') && $data->{'AttachStdout'} !== null) { - $object->setAttachStdout($data->{'AttachStdout'}); + elseif (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] === null) { + $object->setAttachStdin(null); } - if (property_exists($data, 'AttachStderr') && $data->{'AttachStderr'} !== null) { - $object->setAttachStderr($data->{'AttachStderr'}); + if (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] !== null) { + $object->setAttachStdout($data['AttachStdout']); } - if (property_exists($data, 'ExposedPorts') && $data->{'ExposedPorts'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'ExposedPorts'} as $key => $value) { + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['ExposedPorts'] as $key => $value) { $values[$key] = $value; } $object->setExposedPorts($values); } - if (property_exists($data, 'Tty') && $data->{'Tty'} !== null) { - $object->setTty($data->{'Tty'}); + 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 (property_exists($data, 'OpenStdin') && $data->{'OpenStdin'} !== null) { - $object->setOpenStdin($data->{'OpenStdin'}); + if (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] !== null) { + $object->setOpenStdin($data['OpenStdin']); } - if (property_exists($data, 'StdinOnce') && $data->{'StdinOnce'} !== null) { - $object->setStdinOnce($data->{'StdinOnce'}); + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); } - if (property_exists($data, 'Env') && $data->{'Env'} !== null) { - $values_1 = []; - foreach ($data->{'Env'} as $value_1) { + 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 = array(); + foreach ($data['Env'] as $value_1) { $values_1[] = $value_1; } $object->setEnv($values_1); } - if (property_exists($data, 'Cmd') && $data->{'Cmd'} !== null) { - $values_2 = []; - foreach ($data->{'Cmd'} as $value_2) { + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Cmd', $data) && $data['Cmd'] !== null) { + $values_2 = array(); + foreach ($data['Cmd'] as $value_2) { $values_2[] = $value_2; } $object->setCmd($values_2); } - if (property_exists($data, 'Healthcheck') && $data->{'Healthcheck'} !== null) { - $object->setHealthcheck($this->denormalizer->denormalize($data->{'Healthcheck'}, 'Docker\\API\\Model\\HealthConfig', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('Healthcheck', $data) && $data['Healthcheck'] === null) { + $object->setHealthcheck(null); } - if (property_exists($data, 'ArgsEscaped') && $data->{'ArgsEscaped'} !== null) { - $object->setArgsEscaped($data->{'ArgsEscaped'}); + if (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] !== null) { + $object->setArgsEscaped($data['ArgsEscaped']); } - if (property_exists($data, 'Image') && $data->{'Image'} !== null) { - $object->setImage($data->{'Image'}); + elseif (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] === null) { + $object->setArgsEscaped(null); } - if (property_exists($data, 'Volumes') && $data->{'Volumes'} !== null) { - $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Volumes'} as $key_1 => $value_3) { + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Volumes'] as $key_1 => $value_3) { $values_3[$key_1] = $value_3; } $object->setVolumes($values_3); } - if (property_exists($data, 'WorkingDir') && $data->{'WorkingDir'} !== null) { - $object->setWorkingDir($data->{'WorkingDir'}); + 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']); } - if (property_exists($data, 'Entrypoint') && $data->{'Entrypoint'} !== null) { - $values_4 = []; - foreach ($data->{'Entrypoint'} as $value_4) { + elseif (\array_key_exists('WorkingDir', $data) && $data['WorkingDir'] === null) { + $object->setWorkingDir(null); + } + if (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] !== null) { + $values_4 = array(); + foreach ($data['Entrypoint'] as $value_4) { $values_4[] = $value_4; } $object->setEntrypoint($values_4); } - if (property_exists($data, 'NetworkDisabled') && $data->{'NetworkDisabled'} !== null) { - $object->setNetworkDisabled($data->{'NetworkDisabled'}); + 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']); } - if (property_exists($data, 'MacAddress') && $data->{'MacAddress'} !== null) { - $object->setMacAddress($data->{'MacAddress'}); + elseif (\array_key_exists('NetworkDisabled', $data) && $data['NetworkDisabled'] === null) { + $object->setNetworkDisabled(null); } - if (property_exists($data, 'OnBuild') && $data->{'OnBuild'} !== null) { - $values_5 = []; - foreach ($data->{'OnBuild'} as $value_5) { + 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 = array(); + foreach ($data['OnBuild'] as $value_5) { $values_5[] = $value_5; } $object->setOnBuild($values_5); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_2 => $value_6) { + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_2 => $value_6) { $values_6[$key_2] = $value_6; } $object->setLabels($values_6); } - if (property_exists($data, 'StopSignal') && $data->{'StopSignal'} !== null) { - $object->setStopSignal($data->{'StopSignal'}); + 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 (property_exists($data, 'StopTimeout') && $data->{'StopTimeout'} !== null) { - $object->setStopTimeout($data->{'StopTimeout'}); + if (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] !== null) { + $object->setStopTimeout($data['StopTimeout']); } - if (property_exists($data, 'Shell') && $data->{'Shell'} !== null) { - $values_7 = []; - foreach ($data->{'Shell'} as $value_7) { + elseif (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] === null) { + $object->setStopTimeout(null); + } + if (\array_key_exists('Shell', $data) && $data['Shell'] !== null) { + $values_7 = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getHostname()) { - $data->{'Hostname'} = $object->getHostname(); + $data = array(); + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); } - if (null !== $object->getDomainname()) { - $data->{'Domainname'} = $object->getDomainname(); + if ($object->isInitialized('domainname') && null !== $object->getDomainname()) { + $data['Domainname'] = $object->getDomainname(); } - if (null !== $object->getUser()) { - $data->{'User'} = $object->getUser(); + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); } - if (null !== $object->getAttachStdin()) { - $data->{'AttachStdin'} = $object->getAttachStdin(); + if ($object->isInitialized('attachStdin') && null !== $object->getAttachStdin()) { + $data['AttachStdin'] = $object->getAttachStdin(); } - if (null !== $object->getAttachStdout()) { - $data->{'AttachStdout'} = $object->getAttachStdout(); + if ($object->isInitialized('attachStdout') && null !== $object->getAttachStdout()) { + $data['AttachStdout'] = $object->getAttachStdout(); } - if (null !== $object->getAttachStderr()) { - $data->{'AttachStderr'} = $object->getAttachStderr(); + if ($object->isInitialized('attachStderr') && null !== $object->getAttachStderr()) { + $data['AttachStderr'] = $object->getAttachStderr(); } - if (null !== $object->getExposedPorts()) { - $values = new \stdClass(); + if ($object->isInitialized('exposedPorts') && null !== $object->getExposedPorts()) { + $values = array(); foreach ($object->getExposedPorts() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'ExposedPorts'} = $values; + $data['ExposedPorts'] = $values; } - if (null !== $object->getTty()) { - $data->{'Tty'} = $object->getTty(); + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); } - if (null !== $object->getOpenStdin()) { - $data->{'OpenStdin'} = $object->getOpenStdin(); + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); } - if (null !== $object->getStdinOnce()) { - $data->{'StdinOnce'} = $object->getStdinOnce(); + if ($object->isInitialized('stdinOnce') && null !== $object->getStdinOnce()) { + $data['StdinOnce'] = $object->getStdinOnce(); } - if (null !== $object->getEnv()) { - $values_1 = []; + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_1 = array(); foreach ($object->getEnv() as $value_1) { $values_1[] = $value_1; } - $data->{'Env'} = $values_1; + $data['Env'] = $values_1; } - if (null !== $object->getCmd()) { - $values_2 = []; + if ($object->isInitialized('cmd') && null !== $object->getCmd()) { + $values_2 = array(); foreach ($object->getCmd() as $value_2) { $values_2[] = $value_2; } - $data->{'Cmd'} = $values_2; + $data['Cmd'] = $values_2; } - if (null !== $object->getHealthcheck()) { - $data->{'Healthcheck'} = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context); + if ($object->isInitialized('healthcheck') && null !== $object->getHealthcheck()) { + $data['Healthcheck'] = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context); } - if (null !== $object->getArgsEscaped()) { - $data->{'ArgsEscaped'} = $object->getArgsEscaped(); + if ($object->isInitialized('argsEscaped') && null !== $object->getArgsEscaped()) { + $data['ArgsEscaped'] = $object->getArgsEscaped(); } - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); } - if (null !== $object->getVolumes()) { - $values_3 = new \stdClass(); + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values_3 = array(); foreach ($object->getVolumes() as $key_1 => $value_3) { - $values_3->{$key_1} = $value_3; + $values_3[$key_1] = $value_3; } - $data->{'Volumes'} = $values_3; + $data['Volumes'] = $values_3; } - if (null !== $object->getWorkingDir()) { - $data->{'WorkingDir'} = $object->getWorkingDir(); + if ($object->isInitialized('workingDir') && null !== $object->getWorkingDir()) { + $data['WorkingDir'] = $object->getWorkingDir(); } - if (null !== $object->getEntrypoint()) { - $values_4 = []; + if ($object->isInitialized('entrypoint') && null !== $object->getEntrypoint()) { + $values_4 = array(); foreach ($object->getEntrypoint() as $value_4) { $values_4[] = $value_4; } - $data->{'Entrypoint'} = $values_4; + $data['Entrypoint'] = $values_4; } - if (null !== $object->getNetworkDisabled()) { - $data->{'NetworkDisabled'} = $object->getNetworkDisabled(); + if ($object->isInitialized('networkDisabled') && null !== $object->getNetworkDisabled()) { + $data['NetworkDisabled'] = $object->getNetworkDisabled(); } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); } - if (null !== $object->getOnBuild()) { - $values_5 = []; + if ($object->isInitialized('onBuild') && null !== $object->getOnBuild()) { + $values_5 = array(); foreach ($object->getOnBuild() as $value_5) { $values_5[] = $value_5; } - $data->{'OnBuild'} = $values_5; + $data['OnBuild'] = $values_5; } - if (null !== $object->getLabels()) { - $values_6 = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_6 = array(); foreach ($object->getLabels() as $key_2 => $value_6) { - $values_6->{$key_2} = $value_6; + $values_6[$key_2] = $value_6; } - $data->{'Labels'} = $values_6; + $data['Labels'] = $values_6; } - if (null !== $object->getStopSignal()) { - $data->{'StopSignal'} = $object->getStopSignal(); + if ($object->isInitialized('stopSignal') && null !== $object->getStopSignal()) { + $data['StopSignal'] = $object->getStopSignal(); } - if (null !== $object->getStopTimeout()) { - $data->{'StopTimeout'} = $object->getStopTimeout(); + if ($object->isInitialized('stopTimeout') && null !== $object->getStopTimeout()) { + $data['StopTimeout'] = $object->getStopTimeout(); } - if (null !== $object->getShell()) { - $values_7 = []; + if ($object->isInitialized('shell') && null !== $object->getShell()) { + $values_7 = array(); foreach ($object->getShell() as $value_7) { $values_7[] = $value_7; } - $data->{'Shell'} = $values_7; + $data['Shell'] = $values_7; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ContainerConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainerCreateResponseNormalizer.php b/src/Normalizer/ContainerCreateResponseNormalizer.php new file mode 100644 index 00000000..22ad5997 --- /dev/null +++ b/src/Normalizer/ContainerCreateResponseNormalizer.php @@ -0,0 +1,80 @@ +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 = array(); + 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 = array()) + { + $data = array(); + $data['Id'] = $object->getId(); + $values = array(); + foreach ($object->getWarnings() as $value) { + $values[] = $value; + } + $data['Warnings'] = $values; + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ContainerCreateResponse' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainerStateNormalizer.php b/src/Normalizer/ContainerStateNormalizer.php new file mode 100644 index 00000000..ab27b718 --- /dev/null +++ b/src/Normalizer/ContainerStateNormalizer.php @@ -0,0 +1,166 @@ +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', 'json', $context)); + } + elseif (\array_key_exists('Health', $data) && $data['Health'] === null) { + $object->setHealth(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) + { + $data = array(); + 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; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ContainerState' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainerSummaryHostConfigNormalizer.php b/src/Normalizer/ContainerSummaryHostConfigNormalizer.php new file mode 100644 index 00000000..33b07d65 --- /dev/null +++ b/src/Normalizer/ContainerSummaryHostConfigNormalizer.php @@ -0,0 +1,67 @@ +setNetworkMode($data['NetworkMode']); + } + elseif (\array_key_exists('NetworkMode', $data) && $data['NetworkMode'] === null) { + $object->setNetworkMode(null); + } + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) + { + $data = array(); + if ($object->isInitialized('networkMode') && null !== $object->getNetworkMode()) { + $data['NetworkMode'] = $object->getNetworkMode(); + } + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ContainerSummaryHostConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainerSummaryItemHostConfigNormalizer.php b/src/Normalizer/ContainerSummaryItemHostConfigNormalizer.php deleted file mode 100644 index 35399650..00000000 --- a/src/Normalizer/ContainerSummaryItemHostConfigNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'NetworkMode'} !== null) { - $object->setNetworkMode($data->{'NetworkMode'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getNetworkMode()) { - $data->{'NetworkMode'} = $object->getNetworkMode(); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainerSummaryItemNetworkSettingsNormalizer.php b/src/Normalizer/ContainerSummaryItemNetworkSettingsNormalizer.php deleted file mode 100644 index 32bb2022..00000000 --- a/src/Normalizer/ContainerSummaryItemNetworkSettingsNormalizer.php +++ /dev/null @@ -1,65 +0,0 @@ -{'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', 'json', $context); - } - $object->setNetworks($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getNetworks()) { - $values = new \stdClass(); - foreach ($object->getNetworks() as $key => $value) { - $values->{$key} = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Networks'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/ContainerSummaryItemNormalizer.php b/src/Normalizer/ContainerSummaryItemNormalizer.php deleted file mode 100644 index 804c536e..00000000 --- a/src/Normalizer/ContainerSummaryItemNormalizer.php +++ /dev/null @@ -1,173 +0,0 @@ -{'Id'} !== null) { - $object->setId($data->{'Id'}); - } - if (property_exists($data, 'Names') && $data->{'Names'} !== null) { - $values = []; - foreach ($data->{'Names'} as $value) { - $values[] = $value; - } - $object->setNames($values); - } - if (property_exists($data, 'Image') && $data->{'Image'} !== null) { - $object->setImage($data->{'Image'}); - } - if (property_exists($data, 'ImageID') && $data->{'ImageID'} !== null) { - $object->setImageID($data->{'ImageID'}); - } - if (property_exists($data, 'Command') && $data->{'Command'} !== null) { - $object->setCommand($data->{'Command'}); - } - if (property_exists($data, 'Created') && $data->{'Created'} !== null) { - $object->setCreated($data->{'Created'}); - } - if (property_exists($data, 'Ports') && $data->{'Ports'} !== null) { - $values_1 = []; - foreach ($data->{'Ports'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\Port', 'json', $context); - } - $object->setPorts($values_1); - } - if (property_exists($data, 'SizeRw') && $data->{'SizeRw'} !== null) { - $object->setSizeRw($data->{'SizeRw'}); - } - if (property_exists($data, 'SizeRootFs') && $data->{'SizeRootFs'} !== null) { - $object->setSizeRootFs($data->{'SizeRootFs'}); - } - if (property_exists($data, 'Labels') && $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); - } - if (property_exists($data, 'State') && $data->{'State'} !== null) { - $object->setState($data->{'State'}); - } - if (property_exists($data, 'Status') && $data->{'Status'} !== null) { - $object->setStatus($data->{'Status'}); - } - if (property_exists($data, 'HostConfig') && $data->{'HostConfig'} !== null) { - $object->setHostConfig($this->denormalizer->denormalize($data->{'HostConfig'}, 'Docker\\API\\Model\\ContainerSummaryItemHostConfig', 'json', $context)); - } - if (property_exists($data, 'NetworkSettings') && $data->{'NetworkSettings'} !== null) { - $object->setNetworkSettings($this->denormalizer->denormalize($data->{'NetworkSettings'}, 'Docker\\API\\Model\\ContainerSummaryItemNetworkSettings', 'json', $context)); - } - if (property_exists($data, 'Mounts') && $data->{'Mounts'} !== null) { - $values_3 = []; - foreach ($data->{'Mounts'} as $value_3) { - $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\Mount', 'json', $context); - } - $object->setMounts($values_3); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getNames()) { - $values = []; - foreach ($object->getNames() as $value) { - $values[] = $value; - } - $data->{'Names'} = $values; - } - 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->getPorts()) { - $values_1 = []; - foreach ($object->getPorts() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); - } - $data->{'Ports'} = $values_1; - } - if (null !== $object->getSizeRw()) { - $data->{'SizeRw'} = $object->getSizeRw(); - } - if (null !== $object->getSizeRootFs()) { - $data->{'SizeRootFs'} = $object->getSizeRootFs(); - } - if (null !== $object->getLabels()) { - $values_2 = new \stdClass(); - foreach ($object->getLabels() as $key => $value_2) { - $values_2->{$key} = $value_2; - } - $data->{'Labels'} = $values_2; - } - if (null !== $object->getState()) { - $data->{'State'} = $object->getState(); - } - if (null !== $object->getStatus()) { - $data->{'Status'} = $object->getStatus(); - } - if (null !== $object->getHostConfig()) { - $data->{'HostConfig'} = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); - } - if (null !== $object->getNetworkSettings()) { - $data->{'NetworkSettings'} = $this->normalizer->normalize($object->getNetworkSettings(), 'json', $context); - } - if (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; - } -} diff --git a/src/Normalizer/ContainerSummaryNetworkSettingsNormalizer.php b/src/Normalizer/ContainerSummaryNetworkSettingsNormalizer.php new file mode 100644 index 00000000..15aa59be --- /dev/null +++ b/src/Normalizer/ContainerSummaryNetworkSettingsNormalizer.php @@ -0,0 +1,75 @@ + $value) { + $values[$key] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\EndpointSettings', '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 = array()) + { + $data = array(); + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values = array(); + 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 array('Docker\\API\\Model\\ContainerSummaryNetworkSettings' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainerSummaryNormalizer.php b/src/Normalizer/ContainerSummaryNormalizer.php new file mode 100644 index 00000000..bc7cc65d --- /dev/null +++ b/src/Normalizer/ContainerSummaryNormalizer.php @@ -0,0 +1,225 @@ +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 = array(); + 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 = array(); + foreach ($data['Ports'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\Port', '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(array(), \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', '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', '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 = array(); + foreach ($data['Mounts'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\MountPoint', '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 = array()) + { + $data = array(); + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); + } + if ($object->isInitialized('names') && null !== $object->getNames()) { + $values = array(); + 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 = array(); + 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 = array(); + 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 = array(); + 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 array('Docker\\API\\Model\\ContainerSummary' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainerWaitExitErrorNormalizer.php b/src/Normalizer/ContainerWaitExitErrorNormalizer.php new file mode 100644 index 00000000..d5729876 --- /dev/null +++ b/src/Normalizer/ContainerWaitExitErrorNormalizer.php @@ -0,0 +1,67 @@ +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 = array()) + { + $data = array(); + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['Message'] = $object->getMessage(); + } + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ContainerWaitExitError' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainerWaitResponseNormalizer.php b/src/Normalizer/ContainerWaitResponseNormalizer.php new file mode 100644 index 00000000..238f4686 --- /dev/null +++ b/src/Normalizer/ContainerWaitResponseNormalizer.php @@ -0,0 +1,74 @@ +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', '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 = array()) + { + $data = array(); + $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 array('Docker\\API\\Model\\ContainerWaitResponse' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainersCreatePostBodyNetworkingConfigNormalizer.php b/src/Normalizer/ContainersCreatePostBodyNetworkingConfigNormalizer.php deleted file mode 100644 index 94f43826..00000000 --- a/src/Normalizer/ContainersCreatePostBodyNetworkingConfigNormalizer.php +++ /dev/null @@ -1,65 +0,0 @@ -{'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', 'json', $context); - } - $object->setEndpointsConfig($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getEndpointsConfig()) { - $values = new \stdClass(); - foreach ($object->getEndpointsConfig() as $key => $value) { - $values->{$key} = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'EndpointsConfig'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersCreatePostBodyNormalizer.php b/src/Normalizer/ContainersCreatePostBodyNormalizer.php index 3024507c..9ebdc9a6 100644 --- a/src/Normalizer/ContainersCreatePostBodyNormalizer.php +++ b/src/Normalizer/ContainersCreatePostBodyNormalizer.php @@ -1,277 +1,365 @@ {'Hostname'} !== null) { - $object->setHostname($data->{'Hostname'}); + 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 (property_exists($data, 'Domainname') && $data->{'Domainname'} !== null) { - $object->setDomainname($data->{'Domainname'}); + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); } - if (property_exists($data, 'User') && $data->{'User'} !== null) { - $object->setUser($data->{'User'}); + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); } - if (property_exists($data, 'AttachStdin') && $data->{'AttachStdin'} !== null) { - $object->setAttachStdin($data->{'AttachStdin'}); + if (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] !== null) { + $object->setAttachStdin($data['AttachStdin']); } - if (property_exists($data, 'AttachStdout') && $data->{'AttachStdout'} !== null) { - $object->setAttachStdout($data->{'AttachStdout'}); + elseif (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] === null) { + $object->setAttachStdin(null); } - if (property_exists($data, 'AttachStderr') && $data->{'AttachStderr'} !== null) { - $object->setAttachStderr($data->{'AttachStderr'}); + if (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] !== null) { + $object->setAttachStdout($data['AttachStdout']); } - if (property_exists($data, 'ExposedPorts') && $data->{'ExposedPorts'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'ExposedPorts'} as $key => $value) { + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['ExposedPorts'] as $key => $value) { $values[$key] = $value; } $object->setExposedPorts($values); } - if (property_exists($data, 'Tty') && $data->{'Tty'} !== null) { - $object->setTty($data->{'Tty'}); + 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']); } - if (property_exists($data, 'OpenStdin') && $data->{'OpenStdin'} !== null) { - $object->setOpenStdin($data->{'OpenStdin'}); + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); } - if (property_exists($data, 'StdinOnce') && $data->{'StdinOnce'} !== null) { - $object->setStdinOnce($data->{'StdinOnce'}); + if (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] !== null) { + $object->setStdinOnce($data['StdinOnce']); } - if (property_exists($data, 'Env') && $data->{'Env'} !== null) { - $values_1 = []; - foreach ($data->{'Env'} as $value_1) { + elseif (\array_key_exists('StdinOnce', $data) && $data['StdinOnce'] === null) { + $object->setStdinOnce(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_1 = array(); + foreach ($data['Env'] as $value_1) { $values_1[] = $value_1; } $object->setEnv($values_1); } - if (property_exists($data, 'Cmd') && $data->{'Cmd'} !== null) { - $values_2 = []; - foreach ($data->{'Cmd'} as $value_2) { + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Cmd', $data) && $data['Cmd'] !== null) { + $values_2 = array(); + foreach ($data['Cmd'] as $value_2) { $values_2[] = $value_2; } $object->setCmd($values_2); } - if (property_exists($data, 'Healthcheck') && $data->{'Healthcheck'} !== null) { - $object->setHealthcheck($this->denormalizer->denormalize($data->{'Healthcheck'}, 'Docker\\API\\Model\\HealthConfig', 'json', $context)); + 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', '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']); } - if (property_exists($data, 'ArgsEscaped') && $data->{'ArgsEscaped'} !== null) { - $object->setArgsEscaped($data->{'ArgsEscaped'}); + elseif (\array_key_exists('ArgsEscaped', $data) && $data['ArgsEscaped'] === null) { + $object->setArgsEscaped(null); } - if (property_exists($data, 'Image') && $data->{'Image'} !== null) { - $object->setImage($data->{'Image'}); + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); } - if (property_exists($data, 'Volumes') && $data->{'Volumes'} !== null) { - $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Volumes'} as $key_1 => $value_3) { + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Volumes'] as $key_1 => $value_3) { $values_3[$key_1] = $value_3; } $object->setVolumes($values_3); } - if (property_exists($data, 'WorkingDir') && $data->{'WorkingDir'} !== null) { - $object->setWorkingDir($data->{'WorkingDir'}); + 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 (property_exists($data, 'Entrypoint') && $data->{'Entrypoint'} !== null) { - $values_4 = []; - foreach ($data->{'Entrypoint'} as $value_4) { + if (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] !== null) { + $values_4 = array(); + foreach ($data['Entrypoint'] as $value_4) { $values_4[] = $value_4; } $object->setEntrypoint($values_4); } - if (property_exists($data, 'NetworkDisabled') && $data->{'NetworkDisabled'} !== null) { - $object->setNetworkDisabled($data->{'NetworkDisabled'}); + 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']); } - if (property_exists($data, 'MacAddress') && $data->{'MacAddress'} !== null) { - $object->setMacAddress($data->{'MacAddress'}); + elseif (\array_key_exists('MacAddress', $data) && $data['MacAddress'] === null) { + $object->setMacAddress(null); } - if (property_exists($data, 'OnBuild') && $data->{'OnBuild'} !== null) { - $values_5 = []; - foreach ($data->{'OnBuild'} as $value_5) { + if (\array_key_exists('OnBuild', $data) && $data['OnBuild'] !== null) { + $values_5 = array(); + foreach ($data['OnBuild'] as $value_5) { $values_5[] = $value_5; } $object->setOnBuild($values_5); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_2 => $value_6) { + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_2 => $value_6) { $values_6[$key_2] = $value_6; } $object->setLabels($values_6); } - if (property_exists($data, 'StopSignal') && $data->{'StopSignal'} !== null) { - $object->setStopSignal($data->{'StopSignal'}); + 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 (property_exists($data, 'StopTimeout') && $data->{'StopTimeout'} !== null) { - $object->setStopTimeout($data->{'StopTimeout'}); + if (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] !== null) { + $object->setStopTimeout($data['StopTimeout']); } - if (property_exists($data, 'Shell') && $data->{'Shell'} !== null) { - $values_7 = []; - foreach ($data->{'Shell'} as $value_7) { + elseif (\array_key_exists('StopTimeout', $data) && $data['StopTimeout'] === null) { + $object->setStopTimeout(null); + } + if (\array_key_exists('Shell', $data) && $data['Shell'] !== null) { + $values_7 = array(); + foreach ($data['Shell'] as $value_7) { $values_7[] = $value_7; } $object->setShell($values_7); } - if (property_exists($data, 'HostConfig') && $data->{'HostConfig'} !== null) { - $object->setHostConfig($this->denormalizer->denormalize($data->{'HostConfig'}, 'Docker\\API\\Model\\HostConfig', 'json', $context)); + elseif (\array_key_exists('Shell', $data) && $data['Shell'] === null) { + $object->setShell(null); } - if (property_exists($data, 'NetworkingConfig') && $data->{'NetworkingConfig'} !== null) { - $object->setNetworkingConfig($this->denormalizer->denormalize($data->{'NetworkingConfig'}, 'Docker\\API\\Model\\ContainersCreatePostBodyNetworkingConfig', 'json', $context)); + if (\array_key_exists('HostConfig', $data) && $data['HostConfig'] !== null) { + $object->setHostConfig($this->denormalizer->denormalize($data['HostConfig'], 'Docker\\API\\Model\\HostConfig', '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', 'json', $context)); + } + elseif (\array_key_exists('NetworkingConfig', $data) && $data['NetworkingConfig'] === null) { + $object->setNetworkingConfig(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getHostname()) { - $data->{'Hostname'} = $object->getHostname(); + $data = array(); + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); } - if (null !== $object->getDomainname()) { - $data->{'Domainname'} = $object->getDomainname(); + if ($object->isInitialized('domainname') && null !== $object->getDomainname()) { + $data['Domainname'] = $object->getDomainname(); } - if (null !== $object->getUser()) { - $data->{'User'} = $object->getUser(); + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); } - if (null !== $object->getAttachStdin()) { - $data->{'AttachStdin'} = $object->getAttachStdin(); + if ($object->isInitialized('attachStdin') && null !== $object->getAttachStdin()) { + $data['AttachStdin'] = $object->getAttachStdin(); } - if (null !== $object->getAttachStdout()) { - $data->{'AttachStdout'} = $object->getAttachStdout(); + if ($object->isInitialized('attachStdout') && null !== $object->getAttachStdout()) { + $data['AttachStdout'] = $object->getAttachStdout(); } - if (null !== $object->getAttachStderr()) { - $data->{'AttachStderr'} = $object->getAttachStderr(); + if ($object->isInitialized('attachStderr') && null !== $object->getAttachStderr()) { + $data['AttachStderr'] = $object->getAttachStderr(); } - if (null !== $object->getExposedPorts()) { - $values = new \stdClass(); + if ($object->isInitialized('exposedPorts') && null !== $object->getExposedPorts()) { + $values = array(); foreach ($object->getExposedPorts() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'ExposedPorts'} = $values; + $data['ExposedPorts'] = $values; } - if (null !== $object->getTty()) { - $data->{'Tty'} = $object->getTty(); + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); } - if (null !== $object->getOpenStdin()) { - $data->{'OpenStdin'} = $object->getOpenStdin(); + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); } - if (null !== $object->getStdinOnce()) { - $data->{'StdinOnce'} = $object->getStdinOnce(); + if ($object->isInitialized('stdinOnce') && null !== $object->getStdinOnce()) { + $data['StdinOnce'] = $object->getStdinOnce(); } - if (null !== $object->getEnv()) { - $values_1 = []; + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_1 = array(); foreach ($object->getEnv() as $value_1) { $values_1[] = $value_1; } - $data->{'Env'} = $values_1; + $data['Env'] = $values_1; } - if (null !== $object->getCmd()) { - $values_2 = []; + if ($object->isInitialized('cmd') && null !== $object->getCmd()) { + $values_2 = array(); foreach ($object->getCmd() as $value_2) { $values_2[] = $value_2; } - $data->{'Cmd'} = $values_2; + $data['Cmd'] = $values_2; } - if (null !== $object->getHealthcheck()) { - $data->{'Healthcheck'} = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context); + if ($object->isInitialized('healthcheck') && null !== $object->getHealthcheck()) { + $data['Healthcheck'] = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context); } - if (null !== $object->getArgsEscaped()) { - $data->{'ArgsEscaped'} = $object->getArgsEscaped(); + if ($object->isInitialized('argsEscaped') && null !== $object->getArgsEscaped()) { + $data['ArgsEscaped'] = $object->getArgsEscaped(); } - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); } - if (null !== $object->getVolumes()) { - $values_3 = new \stdClass(); + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values_3 = array(); foreach ($object->getVolumes() as $key_1 => $value_3) { - $values_3->{$key_1} = $value_3; + $values_3[$key_1] = $value_3; } - $data->{'Volumes'} = $values_3; + $data['Volumes'] = $values_3; } - if (null !== $object->getWorkingDir()) { - $data->{'WorkingDir'} = $object->getWorkingDir(); + if ($object->isInitialized('workingDir') && null !== $object->getWorkingDir()) { + $data['WorkingDir'] = $object->getWorkingDir(); } - if (null !== $object->getEntrypoint()) { - $values_4 = []; + if ($object->isInitialized('entrypoint') && null !== $object->getEntrypoint()) { + $values_4 = array(); foreach ($object->getEntrypoint() as $value_4) { $values_4[] = $value_4; } - $data->{'Entrypoint'} = $values_4; + $data['Entrypoint'] = $values_4; } - if (null !== $object->getNetworkDisabled()) { - $data->{'NetworkDisabled'} = $object->getNetworkDisabled(); + if ($object->isInitialized('networkDisabled') && null !== $object->getNetworkDisabled()) { + $data['NetworkDisabled'] = $object->getNetworkDisabled(); } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); } - if (null !== $object->getOnBuild()) { - $values_5 = []; + if ($object->isInitialized('onBuild') && null !== $object->getOnBuild()) { + $values_5 = array(); foreach ($object->getOnBuild() as $value_5) { $values_5[] = $value_5; } - $data->{'OnBuild'} = $values_5; + $data['OnBuild'] = $values_5; } - if (null !== $object->getLabels()) { - $values_6 = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_6 = array(); foreach ($object->getLabels() as $key_2 => $value_6) { - $values_6->{$key_2} = $value_6; + $values_6[$key_2] = $value_6; } - $data->{'Labels'} = $values_6; + $data['Labels'] = $values_6; } - if (null !== $object->getStopSignal()) { - $data->{'StopSignal'} = $object->getStopSignal(); + if ($object->isInitialized('stopSignal') && null !== $object->getStopSignal()) { + $data['StopSignal'] = $object->getStopSignal(); } - if (null !== $object->getStopTimeout()) { - $data->{'StopTimeout'} = $object->getStopTimeout(); + if ($object->isInitialized('stopTimeout') && null !== $object->getStopTimeout()) { + $data['StopTimeout'] = $object->getStopTimeout(); } - if (null !== $object->getShell()) { - $values_7 = []; + if ($object->isInitialized('shell') && null !== $object->getShell()) { + $values_7 = array(); foreach ($object->getShell() as $value_7) { $values_7[] = $value_7; } - $data->{'Shell'} = $values_7; + $data['Shell'] = $values_7; } - if (null !== $object->getHostConfig()) { - $data->{'HostConfig'} = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); + if ($object->isInitialized('hostConfig') && null !== $object->getHostConfig()) { + $data['HostConfig'] = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); } - if (null !== $object->getNetworkingConfig()) { - $data->{'NetworkingConfig'} = $this->normalizer->normalize($object->getNetworkingConfig(), '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 array('Docker\\API\\Model\\ContainersCreatePostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainersCreatePostResponse201Normalizer.php b/src/Normalizer/ContainersCreatePostResponse201Normalizer.php deleted file mode 100644 index 6a11e779..00000000 --- a/src/Normalizer/ContainersCreatePostResponse201Normalizer.php +++ /dev/null @@ -1,71 +0,0 @@ -{'Id'} !== null) { - $object->setId($data->{'Id'}); - } - if (property_exists($data, 'Warnings') && $data->{'Warnings'} !== null) { - $values = []; - foreach ($data->{'Warnings'} as $value) { - $values[] = $value; - } - $object->setWarnings($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getWarnings()) { - $values = []; - foreach ($object->getWarnings() as $value) { - $values[] = $value; - } - $data->{'Warnings'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersIdArchiveGetResponse400Normalizer.php b/src/Normalizer/ContainersIdArchiveGetResponse400Normalizer.php deleted file mode 100644 index 522be888..00000000 --- a/src/Normalizer/ContainersIdArchiveGetResponse400Normalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'message'} !== null) { - $object->setMessage($data->{'message'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getMessage()) { - $data->{'message'} = $object->getMessage(); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersIdArchiveHeadResponse400Normalizer.php b/src/Normalizer/ContainersIdArchiveHeadResponse400Normalizer.php deleted file mode 100644 index acc43470..00000000 --- a/src/Normalizer/ContainersIdArchiveHeadResponse400Normalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'message'} !== null) { - $object->setMessage($data->{'message'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getMessage()) { - $data->{'message'} = $object->getMessage(); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersIdChangesGetResponse200ItemNormalizer.php b/src/Normalizer/ContainersIdChangesGetResponse200ItemNormalizer.php deleted file mode 100644 index d232f2f1..00000000 --- a/src/Normalizer/ContainersIdChangesGetResponse200ItemNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -{'Path'} !== null) { - $object->setPath($data->{'Path'}); - } - if (property_exists($data, 'Kind') && $data->{'Kind'} !== null) { - $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 $data; - } -} diff --git a/src/Normalizer/ContainersIdExecPostBodyNormalizer.php b/src/Normalizer/ContainersIdExecPostBodyNormalizer.php index 0b378336..22eaaee2 100644 --- a/src/Normalizer/ContainersIdExecPostBodyNormalizer.php +++ b/src/Normalizer/ContainersIdExecPostBodyNormalizer.php @@ -1,127 +1,181 @@ {'AttachStdin'} !== null) { - $object->setAttachStdin($data->{'AttachStdin'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] !== null) { + $object->setAttachStdin($data['AttachStdin']); } - if (property_exists($data, 'AttachStdout') && $data->{'AttachStdout'} !== null) { - $object->setAttachStdout($data->{'AttachStdout'}); + elseif (\array_key_exists('AttachStdin', $data) && $data['AttachStdin'] === null) { + $object->setAttachStdin(null); } - if (property_exists($data, 'AttachStderr') && $data->{'AttachStderr'} !== null) { - $object->setAttachStderr($data->{'AttachStderr'}); + if (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] !== null) { + $object->setAttachStdout($data['AttachStdout']); } - if (property_exists($data, 'DetachKeys') && $data->{'DetachKeys'} !== null) { - $object->setDetachKeys($data->{'DetachKeys'}); + elseif (\array_key_exists('AttachStdout', $data) && $data['AttachStdout'] === null) { + $object->setAttachStdout(null); } - if (property_exists($data, 'Tty') && $data->{'Tty'} !== null) { - $object->setTty($data->{'Tty'}); + if (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] !== null) { + $object->setAttachStderr($data['AttachStderr']); } - if (property_exists($data, 'Env') && $data->{'Env'} !== null) { - $values = []; - foreach ($data->{'Env'} as $value) { + elseif (\array_key_exists('AttachStderr', $data) && $data['AttachStderr'] === null) { + $object->setAttachStderr(null); + } + if (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] !== null) { + $values = array(); + foreach ($data['ConsoleSize'] as $value) { $values[] = $value; } - $object->setEnv($values); + $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 (property_exists($data, 'Cmd') && $data->{'Cmd'} !== null) { - $values_1 = []; - foreach ($data->{'Cmd'} as $value_1) { + 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 = array(); + foreach ($data['Env'] as $value_1) { $values_1[] = $value_1; } - $object->setCmd($values_1); + $object->setEnv($values_1); } - if (property_exists($data, 'Privileged') && $data->{'Privileged'} !== null) { - $object->setPrivileged($data->{'Privileged'}); + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); } - if (property_exists($data, 'User') && $data->{'User'} !== null) { - $object->setUser($data->{'User'}); + if (\array_key_exists('Cmd', $data) && $data['Cmd'] !== null) { + $values_2 = array(); + foreach ($data['Cmd'] as $value_2) { + $values_2[] = $value_2; + } + $object->setCmd($values_2); } - if (property_exists($data, 'WorkingDir') && $data->{'WorkingDir'} !== null) { - $object->setWorkingDir($data->{'WorkingDir'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getAttachStdin()) { - $data->{'AttachStdin'} = $object->getAttachStdin(); - } - if (null !== $object->getAttachStdout()) { - $data->{'AttachStdout'} = $object->getAttachStdout(); + $data = array(); + if ($object->isInitialized('attachStdin') && null !== $object->getAttachStdin()) { + $data['AttachStdin'] = $object->getAttachStdin(); } - if (null !== $object->getAttachStderr()) { - $data->{'AttachStderr'} = $object->getAttachStderr(); + if ($object->isInitialized('attachStdout') && null !== $object->getAttachStdout()) { + $data['AttachStdout'] = $object->getAttachStdout(); } - if (null !== $object->getDetachKeys()) { - $data->{'DetachKeys'} = $object->getDetachKeys(); + if ($object->isInitialized('attachStderr') && null !== $object->getAttachStderr()) { + $data['AttachStderr'] = $object->getAttachStderr(); } - if (null !== $object->getTty()) { - $data->{'Tty'} = $object->getTty(); - } - if (null !== $object->getEnv()) { - $values = []; - foreach ($object->getEnv() as $value) { + if ($object->isInitialized('consoleSize') && null !== $object->getConsoleSize()) { + $values = array(); + foreach ($object->getConsoleSize() as $value) { $values[] = $value; } - $data->{'Env'} = $values; + $data['ConsoleSize'] = $values; + } + if ($object->isInitialized('detachKeys') && null !== $object->getDetachKeys()) { + $data['DetachKeys'] = $object->getDetachKeys(); } - if (null !== $object->getCmd()) { - $values_1 = []; - foreach ($object->getCmd() as $value_1) { + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); + } + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_1 = array(); + foreach ($object->getEnv() as $value_1) { $values_1[] = $value_1; } - $data->{'Cmd'} = $values_1; + $data['Env'] = $values_1; + } + if ($object->isInitialized('cmd') && null !== $object->getCmd()) { + $values_2 = array(); + foreach ($object->getCmd() as $value_2) { + $values_2[] = $value_2; + } + $data['Cmd'] = $values_2; } - if (null !== $object->getPrivileged()) { - $data->{'Privileged'} = $object->getPrivileged(); + if ($object->isInitialized('privileged') && null !== $object->getPrivileged()) { + $data['Privileged'] = $object->getPrivileged(); } - if (null !== $object->getUser()) { - $data->{'User'} = $object->getUser(); + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); } - if (null !== $object->getWorkingDir()) { - $data->{'WorkingDir'} = $object->getWorkingDir(); + if ($object->isInitialized('workingDir') && null !== $object->getWorkingDir()) { + $data['WorkingDir'] = $object->getWorkingDir(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ContainersIdExecPostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainersIdJsonGetResponse200Normalizer.php b/src/Normalizer/ContainersIdJsonGetResponse200Normalizer.php index 6c37d13c..c3292c00 100644 --- a/src/Normalizer/ContainersIdJsonGetResponse200Normalizer.php +++ b/src/Normalizer/ContainersIdJsonGetResponse200Normalizer.php @@ -1,217 +1,307 @@ {'Id'} !== null) { - $object->setId($data->{'Id'}); + 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']); } - if (property_exists($data, 'Created') && $data->{'Created'} !== null) { - $object->setCreated($data->{'Created'}); + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); } - if (property_exists($data, 'Path') && $data->{'Path'} !== null) { - $object->setPath($data->{'Path'}); + if (\array_key_exists('Path', $data) && $data['Path'] !== null) { + $object->setPath($data['Path']); } - if (property_exists($data, 'Args') && $data->{'Args'} !== null) { - $values = []; - foreach ($data->{'Args'} as $value) { + elseif (\array_key_exists('Path', $data) && $data['Path'] === null) { + $object->setPath(null); + } + if (\array_key_exists('Args', $data) && $data['Args'] !== null) { + $values = array(); + foreach ($data['Args'] as $value) { $values[] = $value; } $object->setArgs($values); } - if (property_exists($data, 'State') && $data->{'State'} !== null) { - $object->setState($this->denormalizer->denormalize($data->{'State'}, 'Docker\\API\\Model\\ContainersIdJsonGetResponse200State', 'json', $context)); + 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', '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']); } - if (property_exists($data, 'Image') && $data->{'Image'} !== null) { - $object->setImage($data->{'Image'}); + elseif (\array_key_exists('HostsPath', $data) && $data['HostsPath'] === null) { + $object->setHostsPath(null); } - if (property_exists($data, 'ResolvConfPath') && $data->{'ResolvConfPath'} !== null) { - $object->setResolvConfPath($data->{'ResolvConfPath'}); + if (\array_key_exists('LogPath', $data) && $data['LogPath'] !== null) { + $object->setLogPath($data['LogPath']); } - if (property_exists($data, 'HostnamePath') && $data->{'HostnamePath'} !== null) { - $object->setHostnamePath($data->{'HostnamePath'}); + elseif (\array_key_exists('LogPath', $data) && $data['LogPath'] === null) { + $object->setLogPath(null); } - if (property_exists($data, 'HostsPath') && $data->{'HostsPath'} !== null) { - $object->setHostsPath($data->{'HostsPath'}); + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'LogPath') && $data->{'LogPath'} !== null) { - $object->setLogPath($data->{'LogPath'}); + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); } - if (property_exists($data, 'Node') && $data->{'Node'} !== null) { - $object->setNode($data->{'Node'}); + if (\array_key_exists('RestartCount', $data) && $data['RestartCount'] !== null) { + $object->setRestartCount($data['RestartCount']); } - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + elseif (\array_key_exists('RestartCount', $data) && $data['RestartCount'] === null) { + $object->setRestartCount(null); } - if (property_exists($data, 'RestartCount') && $data->{'RestartCount'} !== null) { - $object->setRestartCount($data->{'RestartCount'}); + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); } - if (property_exists($data, 'MountLabel') && $data->{'MountLabel'} !== null) { - $object->setMountLabel($data->{'MountLabel'}); + if (\array_key_exists('Platform', $data) && $data['Platform'] !== null) { + $object->setPlatform($data['Platform']); } - if (property_exists($data, 'ProcessLabel') && $data->{'ProcessLabel'} !== null) { - $object->setProcessLabel($data->{'ProcessLabel'}); + elseif (\array_key_exists('Platform', $data) && $data['Platform'] === null) { + $object->setPlatform(null); } - if (property_exists($data, 'AppArmorProfile') && $data->{'AppArmorProfile'} !== null) { - $object->setAppArmorProfile($data->{'AppArmorProfile'}); + if (\array_key_exists('MountLabel', $data) && $data['MountLabel'] !== null) { + $object->setMountLabel($data['MountLabel']); } - if (property_exists($data, 'ExecIDs') && $data->{'ExecIDs'} !== null) { - $object->setExecIDs($data->{'ExecIDs'}); + elseif (\array_key_exists('MountLabel', $data) && $data['MountLabel'] === null) { + $object->setMountLabel(null); } - if (property_exists($data, 'HostConfig') && $data->{'HostConfig'} !== null) { - $object->setHostConfig($this->denormalizer->denormalize($data->{'HostConfig'}, 'Docker\\API\\Model\\HostConfig', 'json', $context)); + if (\array_key_exists('ProcessLabel', $data) && $data['ProcessLabel'] !== null) { + $object->setProcessLabel($data['ProcessLabel']); } - if (property_exists($data, 'GraphDriver') && $data->{'GraphDriver'} !== null) { - $object->setGraphDriver($this->denormalizer->denormalize($data->{'GraphDriver'}, 'Docker\\API\\Model\\GraphDriverData', 'json', $context)); + elseif (\array_key_exists('ProcessLabel', $data) && $data['ProcessLabel'] === null) { + $object->setProcessLabel(null); } - if (property_exists($data, 'SizeRw') && $data->{'SizeRw'} !== null) { - $object->setSizeRw($data->{'SizeRw'}); + if (\array_key_exists('AppArmorProfile', $data) && $data['AppArmorProfile'] !== null) { + $object->setAppArmorProfile($data['AppArmorProfile']); } - if (property_exists($data, 'SizeRootFs') && $data->{'SizeRootFs'} !== null) { - $object->setSizeRootFs($data->{'SizeRootFs'}); + elseif (\array_key_exists('AppArmorProfile', $data) && $data['AppArmorProfile'] === null) { + $object->setAppArmorProfile(null); } - if (property_exists($data, 'Mounts') && $data->{'Mounts'} !== null) { - $values_1 = []; - foreach ($data->{'Mounts'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\MountPoint', 'json', $context); + if (\array_key_exists('ExecIDs', $data) && $data['ExecIDs'] !== null) { + $values_1 = array(); + foreach ($data['ExecIDs'] as $value_1) { + $values_1[] = $value_1; } - $object->setMounts($values_1); + $object->setExecIDs($values_1); } - if (property_exists($data, 'Config') && $data->{'Config'} !== null) { - $object->setConfig($this->denormalizer->denormalize($data->{'Config'}, 'Docker\\API\\Model\\ContainerConfig', 'json', $context)); + elseif (\array_key_exists('ExecIDs', $data) && $data['ExecIDs'] === null) { + $object->setExecIDs(null); } - if (property_exists($data, 'NetworkSettings') && $data->{'NetworkSettings'} !== null) { - $object->setNetworkSettings($this->denormalizer->denormalize($data->{'NetworkSettings'}, 'Docker\\API\\Model\\NetworkSettings', 'json', $context)); + if (\array_key_exists('HostConfig', $data) && $data['HostConfig'] !== null) { + $object->setHostConfig($this->denormalizer->denormalize($data['HostConfig'], 'Docker\\API\\Model\\HostConfig', '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\\GraphDriverData', '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 = array(); + foreach ($data['Mounts'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\MountPoint', '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', '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', 'json', $context)); + } + elseif (\array_key_exists('NetworkSettings', $data) && $data['NetworkSettings'] === null) { + $object->setNetworkSettings(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); + $data = array(); + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); + if ($object->isInitialized('created') && null !== $object->getCreated()) { + $data['Created'] = $object->getCreated(); } - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); + if ($object->isInitialized('path') && null !== $object->getPath()) { + $data['Path'] = $object->getPath(); } - if (null !== $object->getArgs()) { - $values = []; + if ($object->isInitialized('args') && null !== $object->getArgs()) { + $values = array(); foreach ($object->getArgs() as $value) { $values[] = $value; } - $data->{'Args'} = $values; + $data['Args'] = $values; } - if (null !== $object->getState()) { - $data->{'State'} = $this->normalizer->normalize($object->getState(), 'json', $context); + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $this->normalizer->normalize($object->getState(), 'json', $context); } - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); } - if (null !== $object->getResolvConfPath()) { - $data->{'ResolvConfPath'} = $object->getResolvConfPath(); + if ($object->isInitialized('resolvConfPath') && null !== $object->getResolvConfPath()) { + $data['ResolvConfPath'] = $object->getResolvConfPath(); } - if (null !== $object->getHostnamePath()) { - $data->{'HostnamePath'} = $object->getHostnamePath(); + if ($object->isInitialized('hostnamePath') && null !== $object->getHostnamePath()) { + $data['HostnamePath'] = $object->getHostnamePath(); } - if (null !== $object->getHostsPath()) { - $data->{'HostsPath'} = $object->getHostsPath(); + if ($object->isInitialized('hostsPath') && null !== $object->getHostsPath()) { + $data['HostsPath'] = $object->getHostsPath(); } - if (null !== $object->getLogPath()) { - $data->{'LogPath'} = $object->getLogPath(); + if ($object->isInitialized('logPath') && null !== $object->getLogPath()) { + $data['LogPath'] = $object->getLogPath(); } - if (null !== $object->getNode()) { - $data->{'Node'} = $object->getNode(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + if ($object->isInitialized('restartCount') && null !== $object->getRestartCount()) { + $data['RestartCount'] = $object->getRestartCount(); } - if (null !== $object->getRestartCount()) { - $data->{'RestartCount'} = $object->getRestartCount(); + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + if ($object->isInitialized('platform') && null !== $object->getPlatform()) { + $data['Platform'] = $object->getPlatform(); } - if (null !== $object->getMountLabel()) { - $data->{'MountLabel'} = $object->getMountLabel(); + if ($object->isInitialized('mountLabel') && null !== $object->getMountLabel()) { + $data['MountLabel'] = $object->getMountLabel(); } - if (null !== $object->getProcessLabel()) { - $data->{'ProcessLabel'} = $object->getProcessLabel(); + if ($object->isInitialized('processLabel') && null !== $object->getProcessLabel()) { + $data['ProcessLabel'] = $object->getProcessLabel(); } - if (null !== $object->getAppArmorProfile()) { - $data->{'AppArmorProfile'} = $object->getAppArmorProfile(); + if ($object->isInitialized('appArmorProfile') && null !== $object->getAppArmorProfile()) { + $data['AppArmorProfile'] = $object->getAppArmorProfile(); } - if (null !== $object->getExecIDs()) { - $data->{'ExecIDs'} = $object->getExecIDs(); + if ($object->isInitialized('execIDs') && null !== $object->getExecIDs()) { + $values_1 = array(); + foreach ($object->getExecIDs() as $value_1) { + $values_1[] = $value_1; + } + $data['ExecIDs'] = $values_1; } - if (null !== $object->getHostConfig()) { - $data->{'HostConfig'} = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); + if ($object->isInitialized('hostConfig') && null !== $object->getHostConfig()) { + $data['HostConfig'] = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); } - if (null !== $object->getGraphDriver()) { - $data->{'GraphDriver'} = $this->normalizer->normalize($object->getGraphDriver(), 'json', $context); + if ($object->isInitialized('graphDriver') && null !== $object->getGraphDriver()) { + $data['GraphDriver'] = $this->normalizer->normalize($object->getGraphDriver(), 'json', $context); } - if (null !== $object->getSizeRw()) { - $data->{'SizeRw'} = $object->getSizeRw(); + if ($object->isInitialized('sizeRw') && null !== $object->getSizeRw()) { + $data['SizeRw'] = $object->getSizeRw(); } - if (null !== $object->getSizeRootFs()) { - $data->{'SizeRootFs'} = $object->getSizeRootFs(); + if ($object->isInitialized('sizeRootFs') && null !== $object->getSizeRootFs()) { + $data['SizeRootFs'] = $object->getSizeRootFs(); } - if (null !== $object->getMounts()) { - $values_1 = []; - foreach ($object->getMounts() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + if ($object->isInitialized('mounts') && null !== $object->getMounts()) { + $values_2 = array(); + foreach ($object->getMounts() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'Mounts'} = $values_1; + $data['Mounts'] = $values_2; } - if (null !== $object->getConfig()) { - $data->{'Config'} = $this->normalizer->normalize($object->getConfig(), 'json', $context); + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $data['Config'] = $this->normalizer->normalize($object->getConfig(), 'json', $context); } - if (null !== $object->getNetworkSettings()) { - $data->{'NetworkSettings'} = $this->normalizer->normalize($object->getNetworkSettings(), '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 array('Docker\\API\\Model\\ContainersIdJsonGetResponse200' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainersIdJsonGetResponse200StateNormalizer.php b/src/Normalizer/ContainersIdJsonGetResponse200StateNormalizer.php deleted file mode 100644 index 983f3ef5..00000000 --- a/src/Normalizer/ContainersIdJsonGetResponse200StateNormalizer.php +++ /dev/null @@ -1,117 +0,0 @@ -{'Status'} !== null) { - $object->setStatus($data->{'Status'}); - } - if (property_exists($data, 'Running') && $data->{'Running'} !== null) { - $object->setRunning($data->{'Running'}); - } - if (property_exists($data, 'Paused') && $data->{'Paused'} !== null) { - $object->setPaused($data->{'Paused'}); - } - if (property_exists($data, 'Restarting') && $data->{'Restarting'} !== null) { - $object->setRestarting($data->{'Restarting'}); - } - if (property_exists($data, 'OOMKilled') && $data->{'OOMKilled'} !== null) { - $object->setOOMKilled($data->{'OOMKilled'}); - } - if (property_exists($data, 'Dead') && $data->{'Dead'} !== null) { - $object->setDead($data->{'Dead'}); - } - if (property_exists($data, 'Pid') && $data->{'Pid'} !== null) { - $object->setPid($data->{'Pid'}); - } - if (property_exists($data, 'ExitCode') && $data->{'ExitCode'} !== null) { - $object->setExitCode($data->{'ExitCode'}); - } - if (property_exists($data, 'Error') && $data->{'Error'} !== null) { - $object->setError($data->{'Error'}); - } - if (property_exists($data, 'StartedAt') && $data->{'StartedAt'} !== null) { - $object->setStartedAt($data->{'StartedAt'}); - } - if (property_exists($data, 'FinishedAt') && $data->{'FinishedAt'} !== null) { - $object->setFinishedAt($data->{'FinishedAt'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getStatus()) { - $data->{'Status'} = $object->getStatus(); - } - if (null !== $object->getRunning()) { - $data->{'Running'} = $object->getRunning(); - } - if (null !== $object->getPaused()) { - $data->{'Paused'} = $object->getPaused(); - } - if (null !== $object->getRestarting()) { - $data->{'Restarting'} = $object->getRestarting(); - } - if (null !== $object->getOOMKilled()) { - $data->{'OOMKilled'} = $object->getOOMKilled(); - } - if (null !== $object->getDead()) { - $data->{'Dead'} = $object->getDead(); - } - if (null !== $object->getPid()) { - $data->{'Pid'} = $object->getPid(); - } - if (null !== $object->getExitCode()) { - $data->{'ExitCode'} = $object->getExitCode(); - } - if (null !== $object->getError()) { - $data->{'Error'} = $object->getError(); - } - if (null !== $object->getStartedAt()) { - $data->{'StartedAt'} = $object->getStartedAt(); - } - if (null !== $object->getFinishedAt()) { - $data->{'FinishedAt'} = $object->getFinishedAt(); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersIdTopGetResponse200Normalizer.php b/src/Normalizer/ContainersIdTopGetResponse200Normalizer.php index 60540844..33e24125 100644 --- a/src/Normalizer/ContainersIdTopGetResponse200Normalizer.php +++ b/src/Normalizer/ContainersIdTopGetResponse200Normalizer.php @@ -1,54 +1,60 @@ {'Titles'} !== null) { - $values = []; - foreach ($data->{'Titles'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Titles', $data) && $data['Titles'] !== null) { + $values = array(); + foreach ($data['Titles'] as $value) { $values[] = $value; } $object->setTitles($values); } - if (property_exists($data, 'Processes') && $data->{'Processes'} !== null) { - $values_1 = []; - foreach ($data->{'Processes'} as $value_1) { - $values_2 = []; + elseif (\array_key_exists('Titles', $data) && $data['Titles'] === null) { + $object->setTitles(null); + } + if (\array_key_exists('Processes', $data) && $data['Processes'] !== null) { + $values_1 = array(); + foreach ($data['Processes'] as $value_1) { + $values_2 = array(); foreach ($value_1 as $value_2) { $values_2[] = $value_2; } @@ -56,32 +62,39 @@ public function denormalize($data, $class, $format = null, array $context = []) } $object->setProcesses($values_1); } - + elseif (\array_key_exists('Processes', $data) && $data['Processes'] === null) { + $object->setProcesses(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getTitles()) { - $values = []; + $data = array(); + if ($object->isInitialized('titles') && null !== $object->getTitles()) { + $values = array(); foreach ($object->getTitles() as $value) { $values[] = $value; } - $data->{'Titles'} = $values; + $data['Titles'] = $values; } - if (null !== $object->getProcesses()) { - $values_1 = []; + if ($object->isInitialized('processes') && null !== $object->getProcesses()) { + $values_1 = array(); foreach ($object->getProcesses() as $value_1) { - $values_2 = []; + $values_2 = array(); foreach ($value_1 as $value_2) { $values_2[] = $value_2; } $values_1[] = $values_2; } - $data->{'Processes'} = $values_1; + $data['Processes'] = $values_1; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ContainersIdTopGetResponse200' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainersIdUpdatePostBodyNormalizer.php b/src/Normalizer/ContainersIdUpdatePostBodyNormalizer.php index 38ba58f7..f7ad2c77 100644 --- a/src/Normalizer/ContainersIdUpdatePostBodyNormalizer.php +++ b/src/Normalizer/ContainersIdUpdatePostBodyNormalizer.php @@ -1,301 +1,418 @@ {'CpuShares'} !== null) { - $object->setCpuShares($data->{'CpuShares'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Memory') && $data->{'Memory'} !== null) { - $object->setMemory($data->{'Memory'}); + if (\array_key_exists('CpuShares', $data) && $data['CpuShares'] !== null) { + $object->setCpuShares($data['CpuShares']); } - if (property_exists($data, 'CgroupParent') && $data->{'CgroupParent'} !== null) { - $object->setCgroupParent($data->{'CgroupParent'}); + elseif (\array_key_exists('CpuShares', $data) && $data['CpuShares'] === null) { + $object->setCpuShares(null); } - if (property_exists($data, 'BlkioWeight') && $data->{'BlkioWeight'} !== null) { - $object->setBlkioWeight($data->{'BlkioWeight'}); + if (\array_key_exists('Memory', $data) && $data['Memory'] !== null) { + $object->setMemory($data['Memory']); } - if (property_exists($data, 'BlkioWeightDevice') && $data->{'BlkioWeightDevice'} !== null) { - $values = []; - foreach ($data->{'BlkioWeightDevice'} as $value) { + 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 = array(); + foreach ($data['BlkioWeightDevice'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\ResourcesBlkioWeightDeviceItem', 'json', $context); } $object->setBlkioWeightDevice($values); } - if (property_exists($data, 'BlkioDeviceReadBps') && $data->{'BlkioDeviceReadBps'} !== null) { - $values_1 = []; - foreach ($data->{'BlkioDeviceReadBps'} as $value_1) { + elseif (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] === null) { + $object->setBlkioWeightDevice(null); + } + if (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] !== null) { + $values_1 = array(); + foreach ($data['BlkioDeviceReadBps'] as $value_1) { $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); } $object->setBlkioDeviceReadBps($values_1); } - if (property_exists($data, 'BlkioDeviceWriteBps') && $data->{'BlkioDeviceWriteBps'} !== null) { - $values_2 = []; - foreach ($data->{'BlkioDeviceWriteBps'} as $value_2) { + elseif (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] === null) { + $object->setBlkioDeviceReadBps(null); + } + if (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] !== null) { + $values_2 = array(); + foreach ($data['BlkioDeviceWriteBps'] as $value_2) { $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); } $object->setBlkioDeviceWriteBps($values_2); } - if (property_exists($data, 'BlkioDeviceReadIOps') && $data->{'BlkioDeviceReadIOps'} !== null) { - $values_3 = []; - foreach ($data->{'BlkioDeviceReadIOps'} as $value_3) { + elseif (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] === null) { + $object->setBlkioDeviceWriteBps(null); + } + if (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] !== null) { + $values_3 = array(); + foreach ($data['BlkioDeviceReadIOps'] as $value_3) { $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); } $object->setBlkioDeviceReadIOps($values_3); } - if (property_exists($data, 'BlkioDeviceWriteIOps') && $data->{'BlkioDeviceWriteIOps'} !== null) { - $values_4 = []; - foreach ($data->{'BlkioDeviceWriteIOps'} as $value_4) { + elseif (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] === null) { + $object->setBlkioDeviceReadIOps(null); + } + if (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] !== null) { + $values_4 = array(); + foreach ($data['BlkioDeviceWriteIOps'] as $value_4) { $values_4[] = $this->denormalizer->denormalize($value_4, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); } $object->setBlkioDeviceWriteIOps($values_4); } - if (property_exists($data, 'CpuPeriod') && $data->{'CpuPeriod'} !== null) { - $object->setCpuPeriod($data->{'CpuPeriod'}); + 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 (property_exists($data, 'CpuQuota') && $data->{'CpuQuota'} !== null) { - $object->setCpuQuota($data->{'CpuQuota'}); + if (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] !== null) { + $object->setCpuRealtimePeriod($data['CpuRealtimePeriod']); } - if (property_exists($data, 'CpuRealtimePeriod') && $data->{'CpuRealtimePeriod'} !== null) { - $object->setCpuRealtimePeriod($data->{'CpuRealtimePeriod'}); + elseif (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] === null) { + $object->setCpuRealtimePeriod(null); } - if (property_exists($data, 'CpuRealtimeRuntime') && $data->{'CpuRealtimeRuntime'} !== null) { - $object->setCpuRealtimeRuntime($data->{'CpuRealtimeRuntime'}); + if (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] !== null) { + $object->setCpuRealtimeRuntime($data['CpuRealtimeRuntime']); } - if (property_exists($data, 'CpusetCpus') && $data->{'CpusetCpus'} !== null) { - $object->setCpusetCpus($data->{'CpusetCpus'}); + elseif (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] === null) { + $object->setCpuRealtimeRuntime(null); } - if (property_exists($data, 'CpusetMems') && $data->{'CpusetMems'} !== null) { - $object->setCpusetMems($data->{'CpusetMems'}); + if (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] !== null) { + $object->setCpusetCpus($data['CpusetCpus']); } - if (property_exists($data, 'Devices') && $data->{'Devices'} !== null) { - $values_5 = []; - foreach ($data->{'Devices'} as $value_5) { + 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 = array(); + foreach ($data['Devices'] as $value_5) { $values_5[] = $this->denormalizer->denormalize($value_5, 'Docker\\API\\Model\\DeviceMapping', 'json', $context); } $object->setDevices($values_5); } - if (property_exists($data, 'DeviceCgroupRules') && $data->{'DeviceCgroupRules'} !== null) { - $values_6 = []; - foreach ($data->{'DeviceCgroupRules'} as $value_6) { + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } + if (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] !== null) { + $values_6 = array(); + foreach ($data['DeviceCgroupRules'] as $value_6) { $values_6[] = $value_6; } $object->setDeviceCgroupRules($values_6); } - if (property_exists($data, 'DiskQuota') && $data->{'DiskQuota'} !== null) { - $object->setDiskQuota($data->{'DiskQuota'}); + elseif (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] === null) { + $object->setDeviceCgroupRules(null); + } + if (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] !== null) { + $values_7 = array(); + foreach ($data['DeviceRequests'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, 'Docker\\API\\Model\\DeviceRequest', 'json', $context); + } + $object->setDeviceRequests($values_7); } - if (property_exists($data, 'KernelMemory') && $data->{'KernelMemory'} !== null) { - $object->setKernelMemory($data->{'KernelMemory'}); + elseif (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] === null) { + $object->setDeviceRequests(null); } - if (property_exists($data, 'MemoryReservation') && $data->{'MemoryReservation'} !== null) { - $object->setMemoryReservation($data->{'MemoryReservation'}); + if (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] !== null) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); } - if (property_exists($data, 'MemorySwap') && $data->{'MemorySwap'} !== null) { - $object->setMemorySwap($data->{'MemorySwap'}); + elseif (\array_key_exists('KernelMemoryTCP', $data) && $data['KernelMemoryTCP'] === null) { + $object->setKernelMemoryTCP(null); } - if (property_exists($data, 'MemorySwappiness') && $data->{'MemorySwappiness'} !== null) { - $object->setMemorySwappiness($data->{'MemorySwappiness'}); + if (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] !== null) { + $object->setMemoryReservation($data['MemoryReservation']); } - if (property_exists($data, 'NanoCPUs') && $data->{'NanoCPUs'} !== null) { - $object->setNanoCPUs($data->{'NanoCPUs'}); + elseif (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] === null) { + $object->setMemoryReservation(null); } - if (property_exists($data, 'OomKillDisable') && $data->{'OomKillDisable'} !== null) { - $object->setOomKillDisable($data->{'OomKillDisable'}); + if (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] !== null) { + $object->setMemorySwap($data['MemorySwap']); } - if (property_exists($data, 'PidsLimit') && $data->{'PidsLimit'} !== null) { - $object->setPidsLimit($data->{'PidsLimit'}); + elseif (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] === null) { + $object->setMemorySwap(null); } - if (property_exists($data, 'Ulimits') && $data->{'Ulimits'} !== null) { - $values_7 = []; - foreach ($data->{'Ulimits'} as $value_7) { - $values_7[] = $this->denormalizer->denormalize($value_7, 'Docker\\API\\Model\\ResourcesUlimitsItem', 'json', $context); + 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 = array(); + foreach ($data['Ulimits'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, 'Docker\\API\\Model\\ResourcesUlimitsItem', 'json', $context); } - $object->setUlimits($values_7); + $object->setUlimits($values_8); } - if (property_exists($data, 'CpuCount') && $data->{'CpuCount'} !== null) { - $object->setCpuCount($data->{'CpuCount'}); + elseif (\array_key_exists('Ulimits', $data) && $data['Ulimits'] === null) { + $object->setUlimits(null); } - if (property_exists($data, 'CpuPercent') && $data->{'CpuPercent'} !== null) { - $object->setCpuPercent($data->{'CpuPercent'}); + if (\array_key_exists('CpuCount', $data) && $data['CpuCount'] !== null) { + $object->setCpuCount($data['CpuCount']); } - if (property_exists($data, 'IOMaximumIOps') && $data->{'IOMaximumIOps'} !== null) { - $object->setIOMaximumIOps($data->{'IOMaximumIOps'}); + elseif (\array_key_exists('CpuCount', $data) && $data['CpuCount'] === null) { + $object->setCpuCount(null); } - if (property_exists($data, 'IOMaximumBandwidth') && $data->{'IOMaximumBandwidth'} !== null) { - $object->setIOMaximumBandwidth($data->{'IOMaximumBandwidth'}); + if (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] !== null) { + $object->setCpuPercent($data['CpuPercent']); } - if (property_exists($data, 'RestartPolicy') && $data->{'RestartPolicy'} !== null) { - $object->setRestartPolicy($this->denormalizer->denormalize($data->{'RestartPolicy'}, 'Docker\\API\\Model\\RestartPolicy', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] === null) { + $object->setRestartPolicy(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getCpuShares()) { - $data->{'CpuShares'} = $object->getCpuShares(); + $data = array(); + if ($object->isInitialized('cpuShares') && null !== $object->getCpuShares()) { + $data['CpuShares'] = $object->getCpuShares(); } - if (null !== $object->getMemory()) { - $data->{'Memory'} = $object->getMemory(); + if ($object->isInitialized('memory') && null !== $object->getMemory()) { + $data['Memory'] = $object->getMemory(); } - if (null !== $object->getCgroupParent()) { - $data->{'CgroupParent'} = $object->getCgroupParent(); + if ($object->isInitialized('cgroupParent') && null !== $object->getCgroupParent()) { + $data['CgroupParent'] = $object->getCgroupParent(); } - if (null !== $object->getBlkioWeight()) { - $data->{'BlkioWeight'} = $object->getBlkioWeight(); + if ($object->isInitialized('blkioWeight') && null !== $object->getBlkioWeight()) { + $data['BlkioWeight'] = $object->getBlkioWeight(); } - if (null !== $object->getBlkioWeightDevice()) { - $values = []; + if ($object->isInitialized('blkioWeightDevice') && null !== $object->getBlkioWeightDevice()) { + $values = array(); foreach ($object->getBlkioWeightDevice() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'BlkioWeightDevice'} = $values; + $data['BlkioWeightDevice'] = $values; } - if (null !== $object->getBlkioDeviceReadBps()) { - $values_1 = []; + if ($object->isInitialized('blkioDeviceReadBps') && null !== $object->getBlkioDeviceReadBps()) { + $values_1 = array(); foreach ($object->getBlkioDeviceReadBps() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'BlkioDeviceReadBps'} = $values_1; + $data['BlkioDeviceReadBps'] = $values_1; } - if (null !== $object->getBlkioDeviceWriteBps()) { - $values_2 = []; + if ($object->isInitialized('blkioDeviceWriteBps') && null !== $object->getBlkioDeviceWriteBps()) { + $values_2 = array(); foreach ($object->getBlkioDeviceWriteBps() as $value_2) { $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'BlkioDeviceWriteBps'} = $values_2; + $data['BlkioDeviceWriteBps'] = $values_2; } - if (null !== $object->getBlkioDeviceReadIOps()) { - $values_3 = []; + if ($object->isInitialized('blkioDeviceReadIOps') && null !== $object->getBlkioDeviceReadIOps()) { + $values_3 = array(); foreach ($object->getBlkioDeviceReadIOps() as $value_3) { $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'BlkioDeviceReadIOps'} = $values_3; + $data['BlkioDeviceReadIOps'] = $values_3; } - if (null !== $object->getBlkioDeviceWriteIOps()) { - $values_4 = []; + if ($object->isInitialized('blkioDeviceWriteIOps') && null !== $object->getBlkioDeviceWriteIOps()) { + $values_4 = array(); foreach ($object->getBlkioDeviceWriteIOps() as $value_4) { $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); } - $data->{'BlkioDeviceWriteIOps'} = $values_4; + $data['BlkioDeviceWriteIOps'] = $values_4; } - if (null !== $object->getCpuPeriod()) { - $data->{'CpuPeriod'} = $object->getCpuPeriod(); + if ($object->isInitialized('cpuPeriod') && null !== $object->getCpuPeriod()) { + $data['CpuPeriod'] = $object->getCpuPeriod(); } - if (null !== $object->getCpuQuota()) { - $data->{'CpuQuota'} = $object->getCpuQuota(); + if ($object->isInitialized('cpuQuota') && null !== $object->getCpuQuota()) { + $data['CpuQuota'] = $object->getCpuQuota(); } - if (null !== $object->getCpuRealtimePeriod()) { - $data->{'CpuRealtimePeriod'} = $object->getCpuRealtimePeriod(); + if ($object->isInitialized('cpuRealtimePeriod') && null !== $object->getCpuRealtimePeriod()) { + $data['CpuRealtimePeriod'] = $object->getCpuRealtimePeriod(); } - if (null !== $object->getCpuRealtimeRuntime()) { - $data->{'CpuRealtimeRuntime'} = $object->getCpuRealtimeRuntime(); + if ($object->isInitialized('cpuRealtimeRuntime') && null !== $object->getCpuRealtimeRuntime()) { + $data['CpuRealtimeRuntime'] = $object->getCpuRealtimeRuntime(); } - if (null !== $object->getCpusetCpus()) { - $data->{'CpusetCpus'} = $object->getCpusetCpus(); + if ($object->isInitialized('cpusetCpus') && null !== $object->getCpusetCpus()) { + $data['CpusetCpus'] = $object->getCpusetCpus(); } - if (null !== $object->getCpusetMems()) { - $data->{'CpusetMems'} = $object->getCpusetMems(); + if ($object->isInitialized('cpusetMems') && null !== $object->getCpusetMems()) { + $data['CpusetMems'] = $object->getCpusetMems(); } - if (null !== $object->getDevices()) { - $values_5 = []; + if ($object->isInitialized('devices') && null !== $object->getDevices()) { + $values_5 = array(); foreach ($object->getDevices() as $value_5) { $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); } - $data->{'Devices'} = $values_5; + $data['Devices'] = $values_5; } - if (null !== $object->getDeviceCgroupRules()) { - $values_6 = []; + if ($object->isInitialized('deviceCgroupRules') && null !== $object->getDeviceCgroupRules()) { + $values_6 = array(); foreach ($object->getDeviceCgroupRules() as $value_6) { $values_6[] = $value_6; } - $data->{'DeviceCgroupRules'} = $values_6; + $data['DeviceCgroupRules'] = $values_6; + } + if ($object->isInitialized('deviceRequests') && null !== $object->getDeviceRequests()) { + $values_7 = array(); + foreach ($object->getDeviceRequests() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $data['DeviceRequests'] = $values_7; } - if (null !== $object->getDiskQuota()) { - $data->{'DiskQuota'} = $object->getDiskQuota(); + if ($object->isInitialized('kernelMemoryTCP') && null !== $object->getKernelMemoryTCP()) { + $data['KernelMemoryTCP'] = $object->getKernelMemoryTCP(); } - if (null !== $object->getKernelMemory()) { - $data->{'KernelMemory'} = $object->getKernelMemory(); + if ($object->isInitialized('memoryReservation') && null !== $object->getMemoryReservation()) { + $data['MemoryReservation'] = $object->getMemoryReservation(); } - if (null !== $object->getMemoryReservation()) { - $data->{'MemoryReservation'} = $object->getMemoryReservation(); + if ($object->isInitialized('memorySwap') && null !== $object->getMemorySwap()) { + $data['MemorySwap'] = $object->getMemorySwap(); } - if (null !== $object->getMemorySwap()) { - $data->{'MemorySwap'} = $object->getMemorySwap(); + if ($object->isInitialized('memorySwappiness') && null !== $object->getMemorySwappiness()) { + $data['MemorySwappiness'] = $object->getMemorySwappiness(); } - if (null !== $object->getMemorySwappiness()) { - $data->{'MemorySwappiness'} = $object->getMemorySwappiness(); + if ($object->isInitialized('nanoCpus') && null !== $object->getNanoCpus()) { + $data['NanoCpus'] = $object->getNanoCpus(); } - if (null !== $object->getNanoCPUs()) { - $data->{'NanoCPUs'} = $object->getNanoCPUs(); + if ($object->isInitialized('oomKillDisable') && null !== $object->getOomKillDisable()) { + $data['OomKillDisable'] = $object->getOomKillDisable(); } - if (null !== $object->getOomKillDisable()) { - $data->{'OomKillDisable'} = $object->getOomKillDisable(); + if ($object->isInitialized('init') && null !== $object->getInit()) { + $data['Init'] = $object->getInit(); } - if (null !== $object->getPidsLimit()) { - $data->{'PidsLimit'} = $object->getPidsLimit(); + if ($object->isInitialized('pidsLimit') && null !== $object->getPidsLimit()) { + $data['PidsLimit'] = $object->getPidsLimit(); } - if (null !== $object->getUlimits()) { - $values_7 = []; - foreach ($object->getUlimits() as $value_7) { - $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + if ($object->isInitialized('ulimits') && null !== $object->getUlimits()) { + $values_8 = array(); + foreach ($object->getUlimits() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); } - $data->{'Ulimits'} = $values_7; + $data['Ulimits'] = $values_8; } - if (null !== $object->getCpuCount()) { - $data->{'CpuCount'} = $object->getCpuCount(); + if ($object->isInitialized('cpuCount') && null !== $object->getCpuCount()) { + $data['CpuCount'] = $object->getCpuCount(); } - if (null !== $object->getCpuPercent()) { - $data->{'CpuPercent'} = $object->getCpuPercent(); + if ($object->isInitialized('cpuPercent') && null !== $object->getCpuPercent()) { + $data['CpuPercent'] = $object->getCpuPercent(); } - if (null !== $object->getIOMaximumIOps()) { - $data->{'IOMaximumIOps'} = $object->getIOMaximumIOps(); + if ($object->isInitialized('iOMaximumIOps') && null !== $object->getIOMaximumIOps()) { + $data['IOMaximumIOps'] = $object->getIOMaximumIOps(); } - if (null !== $object->getIOMaximumBandwidth()) { - $data->{'IOMaximumBandwidth'} = $object->getIOMaximumBandwidth(); + if ($object->isInitialized('iOMaximumBandwidth') && null !== $object->getIOMaximumBandwidth()) { + $data['IOMaximumBandwidth'] = $object->getIOMaximumBandwidth(); } - if (null !== $object->getRestartPolicy()) { - $data->{'RestartPolicy'} = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); + 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 array('Docker\\API\\Model\\ContainersIdUpdatePostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainersIdUpdatePostResponse200Normalizer.php b/src/Normalizer/ContainersIdUpdatePostResponse200Normalizer.php index d5e2d09e..4341668a 100644 --- a/src/Normalizer/ContainersIdUpdatePostResponse200Normalizer.php +++ b/src/Normalizer/ContainersIdUpdatePostResponse200Normalizer.php @@ -1,65 +1,75 @@ {'Warnings'} !== null) { - $values = []; - foreach ($data->{'Warnings'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getWarnings()) { - $values = []; + $data = array(); + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values = array(); foreach ($object->getWarnings() as $value) { $values[] = $value; } - $data->{'Warnings'} = $values; + $data['Warnings'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ContainersIdUpdatePostResponse200' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ContainersIdWaitPostResponse200ErrorNormalizer.php b/src/Normalizer/ContainersIdWaitPostResponse200ErrorNormalizer.php deleted file mode 100644 index 52af6a05..00000000 --- a/src/Normalizer/ContainersIdWaitPostResponse200ErrorNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'Message'} !== null) { - $object->setMessage($data->{'Message'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getMessage()) { - $data->{'Message'} = $object->getMessage(); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersIdWaitPostResponse200Normalizer.php b/src/Normalizer/ContainersIdWaitPostResponse200Normalizer.php deleted file mode 100644 index b884c957..00000000 --- a/src/Normalizer/ContainersIdWaitPostResponse200Normalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -{'StatusCode'} !== null) { - $object->setStatusCode($data->{'StatusCode'}); - } - if (property_exists($data, 'Error') && $data->{'Error'} !== null) { - $object->setError($this->denormalizer->denormalize($data->{'Error'}, 'Docker\\API\\Model\\ContainersIdWaitPostResponse200Error', 'json', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getStatusCode()) { - $data->{'StatusCode'} = $object->getStatusCode(); - } - if (null !== $object->getError()) { - $data->{'Error'} = $this->normalizer->normalize($object->getError(), 'json', $context); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersPrunePostResponse200Normalizer.php b/src/Normalizer/ContainersPrunePostResponse200Normalizer.php index 29ae6de9..9c6664a7 100644 --- a/src/Normalizer/ContainersPrunePostResponse200Normalizer.php +++ b/src/Normalizer/ContainersPrunePostResponse200Normalizer.php @@ -1,71 +1,84 @@ {'ContainersDeleted'} !== null) { - $values = []; - foreach ($data->{'ContainersDeleted'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ContainersDeleted', $data) && $data['ContainersDeleted'] !== null) { + $values = array(); + foreach ($data['ContainersDeleted'] as $value) { $values[] = $value; } $object->setContainersDeleted($values); } - if (property_exists($data, 'SpaceReclaimed') && $data->{'SpaceReclaimed'} !== null) { - $object->setSpaceReclaimed($data->{'SpaceReclaimed'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getContainersDeleted()) { - $values = []; + $data = array(); + if ($object->isInitialized('containersDeleted') && null !== $object->getContainersDeleted()) { + $values = array(); foreach ($object->getContainersDeleted() as $value) { $values[] = $value; } - $data->{'ContainersDeleted'} = $values; + $data['ContainersDeleted'] = $values; } - if (null !== $object->getSpaceReclaimed()) { - $data->{'SpaceReclaimed'} = $object->getSpaceReclaimed(); + if ($object->isInitialized('spaceReclaimed') && null !== $object->getSpaceReclaimed()) { + $data['SpaceReclaimed'] = $object->getSpaceReclaimed(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ContainersPrunePostResponse200' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/CreateImageInfoNormalizer.php b/src/Normalizer/CreateImageInfoNormalizer.php index 6510661d..9fb1e418 100644 --- a/src/Normalizer/CreateImageInfoNormalizer.php +++ b/src/Normalizer/CreateImageInfoNormalizer.php @@ -1,81 +1,112 @@ {'id'} !== null) { - $object->setId($data->{'id'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'error') && $data->{'error'} !== null) { - $object->setError($data->{'error'}); + if (\array_key_exists('id', $data) && $data['id'] !== null) { + $object->setId($data['id']); } - if (property_exists($data, 'status') && $data->{'status'} !== null) { - $object->setStatus($data->{'status'}); + elseif (\array_key_exists('id', $data) && $data['id'] === null) { + $object->setId(null); } - if (property_exists($data, 'progress') && $data->{'progress'} !== null) { - $object->setProgress($data->{'progress'}); + if (\array_key_exists('error', $data) && $data['error'] !== null) { + $object->setError($data['error']); } - if (property_exists($data, 'progressDetail') && $data->{'progressDetail'} !== null) { - $object->setProgressDetail($this->denormalizer->denormalize($data->{'progressDetail'}, 'Docker\\API\\Model\\ProgressDetail', 'json', $context)); + 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', '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', 'json', $context)); + } + elseif (\array_key_exists('progressDetail', $data) && $data['progressDetail'] === null) { + $object->setProgressDetail(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'id'} = $object->getId(); + $data = array(); + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); } - if (null !== $object->getError()) { - $data->{'error'} = $object->getError(); + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['error'] = $object->getError(); } - if (null !== $object->getStatus()) { - $data->{'status'} = $object->getStatus(); + if ($object->isInitialized('errorDetail') && null !== $object->getErrorDetail()) { + $data['errorDetail'] = $this->normalizer->normalize($object->getErrorDetail(), 'json', $context); } - if (null !== $object->getProgress()) { - $data->{'progress'} = $object->getProgress(); + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['status'] = $object->getStatus(); } - if (null !== $object->getProgressDetail()) { - $data->{'progressDetail'} = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); + 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 array('Docker\\API\\Model\\CreateImageInfo' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/DeviceMappingNormalizer.php b/src/Normalizer/DeviceMappingNormalizer.php index 8c30df2a..15e9fcf4 100644 --- a/src/Normalizer/DeviceMappingNormalizer.php +++ b/src/Normalizer/DeviceMappingNormalizer.php @@ -1,69 +1,85 @@ {'PathOnHost'} !== null) { - $object->setPathOnHost($data->{'PathOnHost'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'PathInContainer') && $data->{'PathInContainer'} !== null) { - $object->setPathInContainer($data->{'PathInContainer'}); + if (\array_key_exists('PathOnHost', $data) && $data['PathOnHost'] !== null) { + $object->setPathOnHost($data['PathOnHost']); } - if (property_exists($data, 'CgroupPermissions') && $data->{'CgroupPermissions'} !== null) { - $object->setCgroupPermissions($data->{'CgroupPermissions'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getPathOnHost()) { - $data->{'PathOnHost'} = $object->getPathOnHost(); + $data = array(); + if ($object->isInitialized('pathOnHost') && null !== $object->getPathOnHost()) { + $data['PathOnHost'] = $object->getPathOnHost(); } - if (null !== $object->getPathInContainer()) { - $data->{'PathInContainer'} = $object->getPathInContainer(); + if ($object->isInitialized('pathInContainer') && null !== $object->getPathInContainer()) { + $data['PathInContainer'] = $object->getPathInContainer(); } - if (null !== $object->getCgroupPermissions()) { - $data->{'CgroupPermissions'} = $object->getCgroupPermissions(); + if ($object->isInitialized('cgroupPermissions') && null !== $object->getCgroupPermissions()) { + $data['CgroupPermissions'] = $object->getCgroupPermissions(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\DeviceMapping' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/DeviceRequestNormalizer.php b/src/Normalizer/DeviceRequestNormalizer.php new file mode 100644 index 00000000..f71dd435 --- /dev/null +++ b/src/Normalizer/DeviceRequestNormalizer.php @@ -0,0 +1,135 @@ +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 = array(); + 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 = array(); + foreach ($data['Capabilities'] as $value_1) { + $values_2 = array(); + 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(array(), \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 = array()) + { + $data = array(); + 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 = array(); + foreach ($object->getDeviceIDs() as $value) { + $values[] = $value; + } + $data['DeviceIDs'] = $values; + } + if ($object->isInitialized('capabilities') && null !== $object->getCapabilities()) { + $values_1 = array(); + foreach ($object->getCapabilities() as $value_1) { + $values_2 = array(); + 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 = array(); + 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 array('Docker\\API\\Model\\DeviceRequest' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/DistributionInspectNormalizer.php b/src/Normalizer/DistributionInspectNormalizer.php new file mode 100644 index 00000000..fd0560a0 --- /dev/null +++ b/src/Normalizer/DistributionInspectNormalizer.php @@ -0,0 +1,80 @@ +setDescriptor($this->denormalizer->denormalize($data['Descriptor'], 'Docker\\API\\Model\\OCIDescriptor', 'json', $context)); + } + elseif (\array_key_exists('Descriptor', $data) && $data['Descriptor'] === null) { + $object->setDescriptor(null); + } + if (\array_key_exists('Platforms', $data) && $data['Platforms'] !== null) { + $values = array(); + foreach ($data['Platforms'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\OCIPlatform', '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 = array()) + { + $data = array(); + $data['Descriptor'] = $this->normalizer->normalize($object->getDescriptor(), 'json', $context); + $values = array(); + 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 array('Docker\\API\\Model\\DistributionInspect' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/DistributionNameJsonGetResponse200DescriptorNormalizer.php b/src/Normalizer/DistributionNameJsonGetResponse200DescriptorNormalizer.php deleted file mode 100644 index 22ae13a0..00000000 --- a/src/Normalizer/DistributionNameJsonGetResponse200DescriptorNormalizer.php +++ /dev/null @@ -1,83 +0,0 @@ -{'MediaType'} !== null) { - $object->setMediaType($data->{'MediaType'}); - } - if (property_exists($data, 'Size') && $data->{'Size'} !== null) { - $object->setSize($data->{'Size'}); - } - if (property_exists($data, 'Digest') && $data->{'Digest'} !== null) { - $object->setDigest($data->{'Digest'}); - } - if (property_exists($data, 'URLs') && $data->{'URLs'} !== null) { - $values = []; - foreach ($data->{'URLs'} as $value) { - $values[] = $value; - } - $object->setURLs($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getMediaType()) { - $data->{'MediaType'} = $object->getMediaType(); - } - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); - } - if (null !== $object->getDigest()) { - $data->{'Digest'} = $object->getDigest(); - } - if (null !== $object->getURLs()) { - $values = []; - foreach ($object->getURLs() as $value) { - $values[] = $value; - } - $data->{'URLs'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/DistributionNameJsonGetResponse200Normalizer.php b/src/Normalizer/DistributionNameJsonGetResponse200Normalizer.php deleted file mode 100644 index 81fc207e..00000000 --- a/src/Normalizer/DistributionNameJsonGetResponse200Normalizer.php +++ /dev/null @@ -1,71 +0,0 @@ -{'Descriptor'} !== null) { - $object->setDescriptor($this->denormalizer->denormalize($data->{'Descriptor'}, 'Docker\\API\\Model\\DistributionNameJsonGetResponse200Descriptor', 'json', $context)); - } - if (property_exists($data, 'Platforms') && $data->{'Platforms'} !== null) { - $values = []; - foreach ($data->{'Platforms'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\DistributionNameJsonGetResponse200PlatformsItem', 'json', $context); - } - $object->setPlatforms($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getDescriptor()) { - $data->{'Descriptor'} = $this->normalizer->normalize($object->getDescriptor(), 'json', $context); - } - if (null !== $object->getPlatforms()) { - $values = []; - foreach ($object->getPlatforms() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Platforms'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/DistributionNameJsonGetResponse200PlatformsItemNormalizer.php b/src/Normalizer/DistributionNameJsonGetResponse200PlatformsItemNormalizer.php deleted file mode 100644 index b9d5662d..00000000 --- a/src/Normalizer/DistributionNameJsonGetResponse200PlatformsItemNormalizer.php +++ /dev/null @@ -1,103 +0,0 @@ -{'Architecture'} !== null) { - $object->setArchitecture($data->{'Architecture'}); - } - if (property_exists($data, 'OS') && $data->{'OS'} !== null) { - $object->setOS($data->{'OS'}); - } - if (property_exists($data, 'OSVersion') && $data->{'OSVersion'} !== null) { - $object->setOSVersion($data->{'OSVersion'}); - } - if (property_exists($data, 'OSFeatures') && $data->{'OSFeatures'} !== null) { - $values = []; - foreach ($data->{'OSFeatures'} as $value) { - $values[] = $value; - } - $object->setOSFeatures($values); - } - if (property_exists($data, 'Variant') && $data->{'Variant'} !== null) { - $object->setVariant($data->{'Variant'}); - } - if (property_exists($data, 'Features') && $data->{'Features'} !== null) { - $values_1 = []; - foreach ($data->{'Features'} as $value_1) { - $values_1[] = $value_1; - } - $object->setFeatures($values_1); - } - - 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(); - } - if (null !== $object->getOSVersion()) { - $data->{'OSVersion'} = $object->getOSVersion(); - } - if (null !== $object->getOSFeatures()) { - $values = []; - foreach ($object->getOSFeatures() as $value) { - $values[] = $value; - } - $data->{'OSFeatures'} = $values; - } - if (null !== $object->getVariant()) { - $data->{'Variant'} = $object->getVariant(); - } - if (null !== $object->getFeatures()) { - $values_1 = []; - foreach ($object->getFeatures() as $value_1) { - $values_1[] = $value_1; - } - $data->{'Features'} = $values_1; - } - - return $data; - } -} diff --git a/src/Normalizer/DriverNormalizer.php b/src/Normalizer/DriverNormalizer.php index 1450dc88..8a9cfe8c 100644 --- a/src/Normalizer/DriverNormalizer.php +++ b/src/Normalizer/DriverNormalizer.php @@ -1,71 +1,82 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Options') && $data->{'Options'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject(array(), \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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getOptions()) { - $values = new \stdClass(); + $data = array(); + $data['Name'] = $object->getName(); + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = array(); foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Options'} = $values; + $data['Options'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\Driver' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/EndpointIPAMConfigNormalizer.php b/src/Normalizer/EndpointIPAMConfigNormalizer.php index 01c7bfc7..98a3572b 100644 --- a/src/Normalizer/EndpointIPAMConfigNormalizer.php +++ b/src/Normalizer/EndpointIPAMConfigNormalizer.php @@ -1,77 +1,93 @@ {'IPv4Address'} !== null) { - $object->setIPv4Address($data->{'IPv4Address'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('IPv4Address', $data) && $data['IPv4Address'] !== null) { + $object->setIPv4Address($data['IPv4Address']); } - if (property_exists($data, 'IPv6Address') && $data->{'IPv6Address'} !== null) { - $object->setIPv6Address($data->{'IPv6Address'}); + elseif (\array_key_exists('IPv4Address', $data) && $data['IPv4Address'] === null) { + $object->setIPv4Address(null); } - if (property_exists($data, 'LinkLocalIPs') && $data->{'LinkLocalIPs'} !== null) { - $values = []; - foreach ($data->{'LinkLocalIPs'} as $value) { + 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 = array(); + foreach ($data['LinkLocalIPs'] as $value) { $values[] = $value; } $object->setLinkLocalIPs($values); } - + elseif (\array_key_exists('LinkLocalIPs', $data) && $data['LinkLocalIPs'] === null) { + $object->setLinkLocalIPs(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getIPv4Address()) { - $data->{'IPv4Address'} = $object->getIPv4Address(); + $data = array(); + if ($object->isInitialized('iPv4Address') && null !== $object->getIPv4Address()) { + $data['IPv4Address'] = $object->getIPv4Address(); } - if (null !== $object->getIPv6Address()) { - $data->{'IPv6Address'} = $object->getIPv6Address(); + if ($object->isInitialized('iPv6Address') && null !== $object->getIPv6Address()) { + $data['IPv6Address'] = $object->getIPv6Address(); } - if (null !== $object->getLinkLocalIPs()) { - $values = []; + if ($object->isInitialized('linkLocalIPs') && null !== $object->getLinkLocalIPs()) { + $values = array(); foreach ($object->getLinkLocalIPs() as $value) { $values[] = $value; } - $data->{'LinkLocalIPs'} = $values; + $data['LinkLocalIPs'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\EndpointIPAMConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/EndpointPortConfigNormalizer.php b/src/Normalizer/EndpointPortConfigNormalizer.php index 4af7fdfb..894e2cc7 100644 --- a/src/Normalizer/EndpointPortConfigNormalizer.php +++ b/src/Normalizer/EndpointPortConfigNormalizer.php @@ -1,81 +1,103 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Protocol') && $data->{'Protocol'} !== null) { - $object->setProtocol($data->{'Protocol'}); + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'TargetPort') && $data->{'TargetPort'} !== null) { - $object->setTargetPort($data->{'TargetPort'}); + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); } - if (property_exists($data, 'PublishedPort') && $data->{'PublishedPort'} !== null) { - $object->setPublishedPort($data->{'PublishedPort'}); + if (\array_key_exists('Protocol', $data) && $data['Protocol'] !== null) { + $object->setProtocol($data['Protocol']); } - if (property_exists($data, 'PublishMode') && $data->{'PublishMode'} !== null) { - $object->setPublishMode($data->{'PublishMode'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getProtocol()) { - $data->{'Protocol'} = $object->getProtocol(); + if ($object->isInitialized('protocol') && null !== $object->getProtocol()) { + $data['Protocol'] = $object->getProtocol(); } - if (null !== $object->getTargetPort()) { - $data->{'TargetPort'} = $object->getTargetPort(); + if ($object->isInitialized('targetPort') && null !== $object->getTargetPort()) { + $data['TargetPort'] = $object->getTargetPort(); } - if (null !== $object->getPublishedPort()) { - $data->{'PublishedPort'} = $object->getPublishedPort(); + if ($object->isInitialized('publishedPort') && null !== $object->getPublishedPort()) { + $data['PublishedPort'] = $object->getPublishedPort(); } - if (null !== $object->getPublishMode()) { - $data->{'PublishMode'} = $object->getPublishMode(); + if ($object->isInitialized('publishMode') && null !== $object->getPublishMode()) { + $data['PublishMode'] = $object->getPublishMode(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\EndpointPortConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/EndpointSettingsNormalizer.php b/src/Normalizer/EndpointSettingsNormalizer.php index 26ef1fb3..d562b67a 100644 --- a/src/Normalizer/EndpointSettingsNormalizer.php +++ b/src/Normalizer/EndpointSettingsNormalizer.php @@ -1,153 +1,199 @@ {'IPAMConfig'} !== null) { - $object->setIPAMConfig($this->denormalizer->denormalize($data->{'IPAMConfig'}, 'Docker\\API\\Model\\EndpointIPAMConfig', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Links') && $data->{'Links'} !== null) { - $values = []; - foreach ($data->{'Links'} as $value) { + if (\array_key_exists('IPAMConfig', $data) && $data['IPAMConfig'] !== null) { + $object->setIPAMConfig($this->denormalizer->denormalize($data['IPAMConfig'], 'Docker\\API\\Model\\EndpointIPAMConfig', 'json', $context)); + } + elseif (\array_key_exists('IPAMConfig', $data) && $data['IPAMConfig'] === null) { + $object->setIPAMConfig(null); + } + if (\array_key_exists('Links', $data) && $data['Links'] !== null) { + $values = array(); + foreach ($data['Links'] as $value) { $values[] = $value; } $object->setLinks($values); } - if (property_exists($data, 'Aliases') && $data->{'Aliases'} !== null) { - $values_1 = []; - foreach ($data->{'Aliases'} as $value_1) { + elseif (\array_key_exists('Links', $data) && $data['Links'] === null) { + $object->setLinks(null); + } + if (\array_key_exists('Aliases', $data) && $data['Aliases'] !== null) { + $values_1 = array(); + foreach ($data['Aliases'] as $value_1) { $values_1[] = $value_1; } $object->setAliases($values_1); } - if (property_exists($data, 'NetworkID') && $data->{'NetworkID'} !== null) { - $object->setNetworkID($data->{'NetworkID'}); + elseif (\array_key_exists('Aliases', $data) && $data['Aliases'] === null) { + $object->setAliases(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 (property_exists($data, 'EndpointID') && $data->{'EndpointID'} !== null) { - $object->setEndpointID($data->{'EndpointID'}); + if (\array_key_exists('Gateway', $data) && $data['Gateway'] !== null) { + $object->setGateway($data['Gateway']); } - if (property_exists($data, 'Gateway') && $data->{'Gateway'} !== null) { - $object->setGateway($data->{'Gateway'}); + elseif (\array_key_exists('Gateway', $data) && $data['Gateway'] === null) { + $object->setGateway(null); } - if (property_exists($data, 'IPAddress') && $data->{'IPAddress'} !== null) { - $object->setIPAddress($data->{'IPAddress'}); + if (\array_key_exists('IPAddress', $data) && $data['IPAddress'] !== null) { + $object->setIPAddress($data['IPAddress']); } - if (property_exists($data, 'IPPrefixLen') && $data->{'IPPrefixLen'} !== null) { - $object->setIPPrefixLen($data->{'IPPrefixLen'}); + elseif (\array_key_exists('IPAddress', $data) && $data['IPAddress'] === null) { + $object->setIPAddress(null); } - if (property_exists($data, 'IPv6Gateway') && $data->{'IPv6Gateway'} !== null) { - $object->setIPv6Gateway($data->{'IPv6Gateway'}); + if (\array_key_exists('IPPrefixLen', $data) && $data['IPPrefixLen'] !== null) { + $object->setIPPrefixLen($data['IPPrefixLen']); } - if (property_exists($data, 'GlobalIPv6Address') && $data->{'GlobalIPv6Address'} !== null) { - $object->setGlobalIPv6Address($data->{'GlobalIPv6Address'}); + elseif (\array_key_exists('IPPrefixLen', $data) && $data['IPPrefixLen'] === null) { + $object->setIPPrefixLen(null); } - if (property_exists($data, 'GlobalIPv6PrefixLen') && $data->{'GlobalIPv6PrefixLen'} !== null) { - $object->setGlobalIPv6PrefixLen($data->{'GlobalIPv6PrefixLen'}); + if (\array_key_exists('IPv6Gateway', $data) && $data['IPv6Gateway'] !== null) { + $object->setIPv6Gateway($data['IPv6Gateway']); } - if (property_exists($data, 'MacAddress') && $data->{'MacAddress'} !== null) { - $object->setMacAddress($data->{'MacAddress'}); + elseif (\array_key_exists('IPv6Gateway', $data) && $data['IPv6Gateway'] === null) { + $object->setIPv6Gateway(null); } - if (property_exists($data, 'DriverOpts') && $data->{'DriverOpts'} !== null) { - $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'DriverOpts'} as $key => $value_2) { + 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('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('DriverOpts', $data) && $data['DriverOpts'] !== null) { + $values_2 = new \ArrayObject(array(), \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); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getIPAMConfig()) { - $data->{'IPAMConfig'} = $this->normalizer->normalize($object->getIPAMConfig(), 'json', $context); + $data = array(); + if ($object->isInitialized('iPAMConfig') && null !== $object->getIPAMConfig()) { + $data['IPAMConfig'] = $this->normalizer->normalize($object->getIPAMConfig(), 'json', $context); } - if (null !== $object->getLinks()) { - $values = []; + if ($object->isInitialized('links') && null !== $object->getLinks()) { + $values = array(); foreach ($object->getLinks() as $value) { $values[] = $value; } - $data->{'Links'} = $values; + $data['Links'] = $values; } - if (null !== $object->getAliases()) { - $values_1 = []; + if ($object->isInitialized('aliases') && null !== $object->getAliases()) { + $values_1 = array(); foreach ($object->getAliases() as $value_1) { $values_1[] = $value_1; } - $data->{'Aliases'} = $values_1; + $data['Aliases'] = $values_1; } - if (null !== $object->getNetworkID()) { - $data->{'NetworkID'} = $object->getNetworkID(); + if ($object->isInitialized('networkID') && null !== $object->getNetworkID()) { + $data['NetworkID'] = $object->getNetworkID(); } - if (null !== $object->getEndpointID()) { - $data->{'EndpointID'} = $object->getEndpointID(); + if ($object->isInitialized('endpointID') && null !== $object->getEndpointID()) { + $data['EndpointID'] = $object->getEndpointID(); } - if (null !== $object->getGateway()) { - $data->{'Gateway'} = $object->getGateway(); + if ($object->isInitialized('gateway') && null !== $object->getGateway()) { + $data['Gateway'] = $object->getGateway(); } - if (null !== $object->getIPAddress()) { - $data->{'IPAddress'} = $object->getIPAddress(); + if ($object->isInitialized('iPAddress') && null !== $object->getIPAddress()) { + $data['IPAddress'] = $object->getIPAddress(); } - if (null !== $object->getIPPrefixLen()) { - $data->{'IPPrefixLen'} = $object->getIPPrefixLen(); + if ($object->isInitialized('iPPrefixLen') && null !== $object->getIPPrefixLen()) { + $data['IPPrefixLen'] = $object->getIPPrefixLen(); } - if (null !== $object->getIPv6Gateway()) { - $data->{'IPv6Gateway'} = $object->getIPv6Gateway(); + if ($object->isInitialized('iPv6Gateway') && null !== $object->getIPv6Gateway()) { + $data['IPv6Gateway'] = $object->getIPv6Gateway(); } - if (null !== $object->getGlobalIPv6Address()) { - $data->{'GlobalIPv6Address'} = $object->getGlobalIPv6Address(); + if ($object->isInitialized('globalIPv6Address') && null !== $object->getGlobalIPv6Address()) { + $data['GlobalIPv6Address'] = $object->getGlobalIPv6Address(); } - if (null !== $object->getGlobalIPv6PrefixLen()) { - $data->{'GlobalIPv6PrefixLen'} = $object->getGlobalIPv6PrefixLen(); + if ($object->isInitialized('globalIPv6PrefixLen') && null !== $object->getGlobalIPv6PrefixLen()) { + $data['GlobalIPv6PrefixLen'] = $object->getGlobalIPv6PrefixLen(); } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); } - if (null !== $object->getDriverOpts()) { - $values_2 = new \stdClass(); + if ($object->isInitialized('driverOpts') && null !== $object->getDriverOpts()) { + $values_2 = array(); foreach ($object->getDriverOpts() as $key => $value_2) { - $values_2->{$key} = $value_2; + $values_2[$key] = $value_2; } - $data->{'DriverOpts'} = $values_2; + $data['DriverOpts'] = $values_2; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\EndpointSettings' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/EndpointSpecNormalizer.php b/src/Normalizer/EndpointSpecNormalizer.php index 55138de3..523afc33 100644 --- a/src/Normalizer/EndpointSpecNormalizer.php +++ b/src/Normalizer/EndpointSpecNormalizer.php @@ -1,71 +1,84 @@ {'Mode'} !== null) { - $object->setMode($data->{'Mode'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($data['Mode']); } - if (property_exists($data, 'Ports') && $data->{'Ports'} !== null) { - $values = []; - foreach ($data->{'Ports'} as $value) { + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); + } + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { + $values = array(); + foreach ($data['Ports'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\EndpointPortConfig', 'json', $context); } $object->setPorts($values); } - + elseif (\array_key_exists('Ports', $data) && $data['Ports'] === null) { + $object->setPorts(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getMode()) { - $data->{'Mode'} = $object->getMode(); + $data = array(); + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); } - if (null !== $object->getPorts()) { - $values = []; + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values = array(); foreach ($object->getPorts() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'Ports'} = $values; + $data['Ports'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\EndpointSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/EngineDescriptionNormalizer.php b/src/Normalizer/EngineDescriptionNormalizer.php index 181a6989..b0c4eaea 100644 --- a/src/Normalizer/EngineDescriptionNormalizer.php +++ b/src/Normalizer/EngineDescriptionNormalizer.php @@ -1,85 +1,101 @@ {'EngineVersion'} !== null) { - $object->setEngineVersion($data->{'EngineVersion'}); + 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 (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'Plugins') && $data->{'Plugins'} !== null) { - $values_1 = []; - foreach ($data->{'Plugins'} as $value_1) { + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Plugins', $data) && $data['Plugins'] !== null) { + $values_1 = array(); + foreach ($data['Plugins'] as $value_1) { $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\EngineDescriptionPluginsItem', 'json', $context); } $object->setPlugins($values_1); } - + elseif (\array_key_exists('Plugins', $data) && $data['Plugins'] === null) { + $object->setPlugins(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getEngineVersion()) { - $data->{'EngineVersion'} = $object->getEngineVersion(); + $data = array(); + if ($object->isInitialized('engineVersion') && null !== $object->getEngineVersion()) { + $data['EngineVersion'] = $object->getEngineVersion(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getPlugins()) { - $values_1 = []; + if ($object->isInitialized('plugins') && null !== $object->getPlugins()) { + $values_1 = array(); foreach ($object->getPlugins() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'Plugins'} = $values_1; + $data['Plugins'] = $values_1; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\EngineDescription' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/EngineDescriptionPluginsItemNormalizer.php b/src/Normalizer/EngineDescriptionPluginsItemNormalizer.php index 1972bec7..88910091 100644 --- a/src/Normalizer/EngineDescriptionPluginsItemNormalizer.php +++ b/src/Normalizer/EngineDescriptionPluginsItemNormalizer.php @@ -1,63 +1,76 @@ {'Type'} !== null) { - $object->setType($data->{'Type'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + $data = array(); + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\EngineDescriptionPluginsItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ErrorDetailNormalizer.php b/src/Normalizer/ErrorDetailNormalizer.php index 9a9d855a..68dc73d3 100644 --- a/src/Normalizer/ErrorDetailNormalizer.php +++ b/src/Normalizer/ErrorDetailNormalizer.php @@ -1,63 +1,76 @@ {'code'} !== null) { - $object->setCode($data->{'code'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'message') && $data->{'message'} !== null) { - $object->setMessage($data->{'message'}); + 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; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getCode()) { - $data->{'code'} = $object->getCode(); + $data = array(); + if ($object->isInitialized('code') && null !== $object->getCode()) { + $data['code'] = $object->getCode(); } - if (null !== $object->getMessage()) { - $data->{'message'} = $object->getMessage(); + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['message'] = $object->getMessage(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ErrorDetail' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ErrorResponseNormalizer.php b/src/Normalizer/ErrorResponseNormalizer.php index 39e8e130..5e55dfaf 100644 --- a/src/Normalizer/ErrorResponseNormalizer.php +++ b/src/Normalizer/ErrorResponseNormalizer.php @@ -1,57 +1,65 @@ {'message'} !== null) { - $object->setMessage($data->{'message'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getMessage()) { - $data->{'message'} = $object->getMessage(); - } - + $data = array(); + $data['message'] = $object->getMessage(); return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ErrorResponse' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/EventActorNormalizer.php b/src/Normalizer/EventActorNormalizer.php new file mode 100644 index 00000000..9f284f3f --- /dev/null +++ b/src/Normalizer/EventActorNormalizer.php @@ -0,0 +1,84 @@ +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(array(), \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 = array()) + { + $data = array(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); + } + if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { + $values = array(); + foreach ($object->getAttributes() as $key => $value) { + $values[$key] = $value; + } + $data['Attributes'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\EventActor' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/EventMessageNormalizer.php b/src/Normalizer/EventMessageNormalizer.php new file mode 100644 index 00000000..c5c7c6ef --- /dev/null +++ b/src/Normalizer/EventMessageNormalizer.php @@ -0,0 +1,112 @@ +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', '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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\EventMessage' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/EventsGetResponse200ActorNormalizer.php b/src/Normalizer/EventsGetResponse200ActorNormalizer.php deleted file mode 100644 index 9ca4966f..00000000 --- a/src/Normalizer/EventsGetResponse200ActorNormalizer.php +++ /dev/null @@ -1,71 +0,0 @@ -{'ID'} !== null) { - $object->setID($data->{'ID'}); - } - if (property_exists($data, 'Attributes') && $data->{'Attributes'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Attributes'} as $key => $value) { - $values[$key] = $value; - } - $object->setAttributes($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); - } - if (null !== $object->getAttributes()) { - $values = new \stdClass(); - foreach ($object->getAttributes() as $key => $value) { - $values->{$key} = $value; - } - $data->{'Attributes'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/EventsGetResponse200Normalizer.php b/src/Normalizer/EventsGetResponse200Normalizer.php deleted file mode 100644 index 0e79adac..00000000 --- a/src/Normalizer/EventsGetResponse200Normalizer.php +++ /dev/null @@ -1,81 +0,0 @@ -{'Type'} !== null) { - $object->setType($data->{'Type'}); - } - if (property_exists($data, 'Action') && $data->{'Action'} !== null) { - $object->setAction($data->{'Action'}); - } - if (property_exists($data, 'Actor') && $data->{'Actor'} !== null) { - $object->setActor($this->denormalizer->denormalize($data->{'Actor'}, 'Docker\\API\\Model\\EventsGetResponse200Actor', 'json', $context)); - } - if (property_exists($data, 'time') && $data->{'time'} !== null) { - $object->setTime($data->{'time'}); - } - if (property_exists($data, 'timeNano') && $data->{'timeNano'} !== null) { - $object->setTimeNano($data->{'timeNano'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); - } - if (null !== $object->getAction()) { - $data->{'Action'} = $object->getAction(); - } - if (null !== $object->getActor()) { - $data->{'Actor'} = $this->normalizer->normalize($object->getActor(), 'json', $context); - } - if (null !== $object->getTime()) { - $data->{'time'} = $object->getTime(); - } - if (null !== $object->getTimeNano()) { - $data->{'timeNano'} = $object->getTimeNano(); - } - - return $data; - } -} diff --git a/src/Normalizer/ExecIdJsonGetResponse200Normalizer.php b/src/Normalizer/ExecIdJsonGetResponse200Normalizer.php index dc2b18db..0b0c25e5 100644 --- a/src/Normalizer/ExecIdJsonGetResponse200Normalizer.php +++ b/src/Normalizer/ExecIdJsonGetResponse200Normalizer.php @@ -1,117 +1,157 @@ {'CanRemove'} !== null) { - $object->setCanRemove($data->{'CanRemove'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'DetachKeys') && $data->{'DetachKeys'} !== null) { - $object->setDetachKeys($data->{'DetachKeys'}); + if (\array_key_exists('CanRemove', $data) && $data['CanRemove'] !== null) { + $object->setCanRemove($data['CanRemove']); } - if (property_exists($data, 'ID') && $data->{'ID'} !== null) { - $object->setID($data->{'ID'}); + elseif (\array_key_exists('CanRemove', $data) && $data['CanRemove'] === null) { + $object->setCanRemove(null); } - if (property_exists($data, 'Running') && $data->{'Running'} !== null) { - $object->setRunning($data->{'Running'}); + if (\array_key_exists('DetachKeys', $data) && $data['DetachKeys'] !== null) { + $object->setDetachKeys($data['DetachKeys']); } - if (property_exists($data, 'ExitCode') && $data->{'ExitCode'} !== null) { - $object->setExitCode($data->{'ExitCode'}); + elseif (\array_key_exists('DetachKeys', $data) && $data['DetachKeys'] === null) { + $object->setDetachKeys(null); } - if (property_exists($data, 'ProcessConfig') && $data->{'ProcessConfig'} !== null) { - $object->setProcessConfig($this->denormalizer->denormalize($data->{'ProcessConfig'}, 'Docker\\API\\Model\\ProcessConfig', 'json', $context)); + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); } - if (property_exists($data, 'OpenStdin') && $data->{'OpenStdin'} !== null) { - $object->setOpenStdin($data->{'OpenStdin'}); + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); } - if (property_exists($data, 'OpenStderr') && $data->{'OpenStderr'} !== null) { - $object->setOpenStderr($data->{'OpenStderr'}); + if (\array_key_exists('Running', $data) && $data['Running'] !== null) { + $object->setRunning($data['Running']); } - if (property_exists($data, 'OpenStdout') && $data->{'OpenStdout'} !== null) { - $object->setOpenStdout($data->{'OpenStdout'}); + elseif (\array_key_exists('Running', $data) && $data['Running'] === null) { + $object->setRunning(null); } - if (property_exists($data, 'ContainerID') && $data->{'ContainerID'} !== null) { - $object->setContainerID($data->{'ContainerID'}); + if (\array_key_exists('ExitCode', $data) && $data['ExitCode'] !== null) { + $object->setExitCode($data['ExitCode']); } - if (property_exists($data, 'Pid') && $data->{'Pid'} !== null) { - $object->setPid($data->{'Pid'}); + 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', '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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getCanRemove()) { - $data->{'CanRemove'} = $object->getCanRemove(); + $data = array(); + if ($object->isInitialized('canRemove') && null !== $object->getCanRemove()) { + $data['CanRemove'] = $object->getCanRemove(); } - if (null !== $object->getDetachKeys()) { - $data->{'DetachKeys'} = $object->getDetachKeys(); + if ($object->isInitialized('detachKeys') && null !== $object->getDetachKeys()) { + $data['DetachKeys'] = $object->getDetachKeys(); } - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); } - if (null !== $object->getRunning()) { - $data->{'Running'} = $object->getRunning(); + if ($object->isInitialized('running') && null !== $object->getRunning()) { + $data['Running'] = $object->getRunning(); } - if (null !== $object->getExitCode()) { - $data->{'ExitCode'} = $object->getExitCode(); + if ($object->isInitialized('exitCode') && null !== $object->getExitCode()) { + $data['ExitCode'] = $object->getExitCode(); } - if (null !== $object->getProcessConfig()) { - $data->{'ProcessConfig'} = $this->normalizer->normalize($object->getProcessConfig(), 'json', $context); + if ($object->isInitialized('processConfig') && null !== $object->getProcessConfig()) { + $data['ProcessConfig'] = $this->normalizer->normalize($object->getProcessConfig(), 'json', $context); } - if (null !== $object->getOpenStdin()) { - $data->{'OpenStdin'} = $object->getOpenStdin(); + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); } - if (null !== $object->getOpenStderr()) { - $data->{'OpenStderr'} = $object->getOpenStderr(); + if ($object->isInitialized('openStderr') && null !== $object->getOpenStderr()) { + $data['OpenStderr'] = $object->getOpenStderr(); } - if (null !== $object->getOpenStdout()) { - $data->{'OpenStdout'} = $object->getOpenStdout(); + if ($object->isInitialized('openStdout') && null !== $object->getOpenStdout()) { + $data['OpenStdout'] = $object->getOpenStdout(); } - if (null !== $object->getContainerID()) { - $data->{'ContainerID'} = $object->getContainerID(); + if ($object->isInitialized('containerID') && null !== $object->getContainerID()) { + $data['ContainerID'] = $object->getContainerID(); } - if (null !== $object->getPid()) { - $data->{'Pid'} = $object->getPid(); + if ($object->isInitialized('pid') && null !== $object->getPid()) { + $data['Pid'] = $object->getPid(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ExecIdJsonGetResponse200' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ExecIdStartPostBodyNormalizer.php b/src/Normalizer/ExecIdStartPostBodyNormalizer.php index 7f5de7c4..30269eec 100644 --- a/src/Normalizer/ExecIdStartPostBodyNormalizer.php +++ b/src/Normalizer/ExecIdStartPostBodyNormalizer.php @@ -1,63 +1,93 @@ {'Detach'} !== null) { - $object->setDetach($data->{'Detach'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Tty') && $data->{'Tty'} !== null) { - $object->setTty($data->{'Tty'}); + 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 = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getDetach()) { - $data->{'Detach'} = $object->getDetach(); + $data = array(); + if ($object->isInitialized('detach') && null !== $object->getDetach()) { + $data['Detach'] = $object->getDetach(); } - if (null !== $object->getTty()) { - $data->{'Tty'} = $object->getTty(); + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['Tty'] = $object->getTty(); + } + if ($object->isInitialized('consoleSize') && null !== $object->getConsoleSize()) { + $values = array(); + foreach ($object->getConsoleSize() as $value) { + $values[] = $value; + } + $data['ConsoleSize'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ExecIdStartPostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/FilesystemChangeNormalizer.php b/src/Normalizer/FilesystemChangeNormalizer.php new file mode 100644 index 00000000..38f1a73e --- /dev/null +++ b/src/Normalizer/FilesystemChangeNormalizer.php @@ -0,0 +1,72 @@ +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 = array()) + { + $data = array(); + $data['Path'] = $object->getPath(); + $data['Kind'] = $object->getKind(); + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\FilesystemChange' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/GenericResourcesItemDiscreteResourceSpecNormalizer.php b/src/Normalizer/GenericResourcesItemDiscreteResourceSpecNormalizer.php index 7047a956..e939195b 100644 --- a/src/Normalizer/GenericResourcesItemDiscreteResourceSpecNormalizer.php +++ b/src/Normalizer/GenericResourcesItemDiscreteResourceSpecNormalizer.php @@ -1,63 +1,76 @@ {'Kind'} !== null) { - $object->setKind($data->{'Kind'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $object->setValue($data->{'Value'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getKind()) { - $data->{'Kind'} = $object->getKind(); + $data = array(); + if ($object->isInitialized('kind') && null !== $object->getKind()) { + $data['Kind'] = $object->getKind(); } - if (null !== $object->getValue()) { - $data->{'Value'} = $object->getValue(); + if ($object->isInitialized('value') && null !== $object->getValue()) { + $data['Value'] = $object->getValue(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\GenericResourcesItemDiscreteResourceSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/GenericResourcesItemNamedResourceSpecNormalizer.php b/src/Normalizer/GenericResourcesItemNamedResourceSpecNormalizer.php index 51978ce3..af12028a 100644 --- a/src/Normalizer/GenericResourcesItemNamedResourceSpecNormalizer.php +++ b/src/Normalizer/GenericResourcesItemNamedResourceSpecNormalizer.php @@ -1,63 +1,76 @@ {'Kind'} !== null) { - $object->setKind($data->{'Kind'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $object->setValue($data->{'Value'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getKind()) { - $data->{'Kind'} = $object->getKind(); + $data = array(); + if ($object->isInitialized('kind') && null !== $object->getKind()) { + $data['Kind'] = $object->getKind(); } - if (null !== $object->getValue()) { - $data->{'Value'} = $object->getValue(); + if ($object->isInitialized('value') && null !== $object->getValue()) { + $data['Value'] = $object->getValue(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\GenericResourcesItemNamedResourceSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/GenericResourcesItemNormalizer.php b/src/Normalizer/GenericResourcesItemNormalizer.php index 32ef2fc8..d4845d38 100644 --- a/src/Normalizer/GenericResourcesItemNormalizer.php +++ b/src/Normalizer/GenericResourcesItemNormalizer.php @@ -1,63 +1,76 @@ {'NamedResourceSpec'} !== null) { - $object->setNamedResourceSpec($this->denormalizer->denormalize($data->{'NamedResourceSpec'}, 'Docker\\API\\Model\\GenericResourcesItemNamedResourceSpec', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'DiscreteResourceSpec') && $data->{'DiscreteResourceSpec'} !== null) { - $object->setDiscreteResourceSpec($this->denormalizer->denormalize($data->{'DiscreteResourceSpec'}, 'Docker\\API\\Model\\GenericResourcesItemDiscreteResourceSpec', 'json', $context)); + if (\array_key_exists('NamedResourceSpec', $data) && $data['NamedResourceSpec'] !== null) { + $object->setNamedResourceSpec($this->denormalizer->denormalize($data['NamedResourceSpec'], 'Docker\\API\\Model\\GenericResourcesItemNamedResourceSpec', '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', 'json', $context)); + } + elseif (\array_key_exists('DiscreteResourceSpec', $data) && $data['DiscreteResourceSpec'] === null) { + $object->setDiscreteResourceSpec(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getNamedResourceSpec()) { - $data->{'NamedResourceSpec'} = $this->normalizer->normalize($object->getNamedResourceSpec(), 'json', $context); + $data = array(); + if ($object->isInitialized('namedResourceSpec') && null !== $object->getNamedResourceSpec()) { + $data['NamedResourceSpec'] = $this->normalizer->normalize($object->getNamedResourceSpec(), 'json', $context); } - if (null !== $object->getDiscreteResourceSpec()) { - $data->{'DiscreteResourceSpec'} = $this->normalizer->normalize($object->getDiscreteResourceSpec(), '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 array('Docker\\API\\Model\\GenericResourcesItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/GraphDriverDataNormalizer.php b/src/Normalizer/GraphDriverDataNormalizer.php index dd2df29f..30a30970 100644 --- a/src/Normalizer/GraphDriverDataNormalizer.php +++ b/src/Normalizer/GraphDriverDataNormalizer.php @@ -1,71 +1,80 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Data') && $data->{'Data'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Data'} as $key => $value) { + if (\array_key_exists('Data', $data) && $data['Data'] !== null) { + $values = new \ArrayObject(array(), \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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getData()) { - $values = new \stdClass(); - foreach ($object->getData() as $key => $value) { - $values->{$key} = $value; - } - $data->{'Data'} = $values; + $data = array(); + $data['Name'] = $object->getName(); + $values = array(); + foreach ($object->getData() as $key => $value) { + $values[$key] = $value; } - + $data['Data'] = $values; return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\GraphDriverData' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/HealthConfigNormalizer.php b/src/Normalizer/HealthConfigNormalizer.php index 14b6b9c9..2bbb2316 100644 --- a/src/Normalizer/HealthConfigNormalizer.php +++ b/src/Normalizer/HealthConfigNormalizer.php @@ -1,89 +1,111 @@ {'Test'} !== null) { - $values = []; - foreach ($data->{'Test'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Test', $data) && $data['Test'] !== null) { + $values = array(); + foreach ($data['Test'] as $value) { $values[] = $value; } $object->setTest($values); } - if (property_exists($data, 'Interval') && $data->{'Interval'} !== null) { - $object->setInterval($data->{'Interval'}); + elseif (\array_key_exists('Test', $data) && $data['Test'] === null) { + $object->setTest(null); } - if (property_exists($data, 'Timeout') && $data->{'Timeout'} !== null) { - $object->setTimeout($data->{'Timeout'}); + if (\array_key_exists('Interval', $data) && $data['Interval'] !== null) { + $object->setInterval($data['Interval']); } - if (property_exists($data, 'Retries') && $data->{'Retries'} !== null) { - $object->setRetries($data->{'Retries'}); + elseif (\array_key_exists('Interval', $data) && $data['Interval'] === null) { + $object->setInterval(null); } - if (property_exists($data, 'StartPeriod') && $data->{'StartPeriod'} !== null) { - $object->setStartPeriod($data->{'StartPeriod'}); + 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); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getTest()) { - $values = []; + $data = array(); + if ($object->isInitialized('test') && null !== $object->getTest()) { + $values = array(); foreach ($object->getTest() as $value) { $values[] = $value; } - $data->{'Test'} = $values; + $data['Test'] = $values; } - if (null !== $object->getInterval()) { - $data->{'Interval'} = $object->getInterval(); + if ($object->isInitialized('interval') && null !== $object->getInterval()) { + $data['Interval'] = $object->getInterval(); } - if (null !== $object->getTimeout()) { - $data->{'Timeout'} = $object->getTimeout(); + if ($object->isInitialized('timeout') && null !== $object->getTimeout()) { + $data['Timeout'] = $object->getTimeout(); } - if (null !== $object->getRetries()) { - $data->{'Retries'} = $object->getRetries(); + if ($object->isInitialized('retries') && null !== $object->getRetries()) { + $data['Retries'] = $object->getRetries(); } - if (null !== $object->getStartPeriod()) { - $data->{'StartPeriod'} = $object->getStartPeriod(); + if ($object->isInitialized('startPeriod') && null !== $object->getStartPeriod()) { + $data['StartPeriod'] = $object->getStartPeriod(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\HealthConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/HealthNormalizer.php b/src/Normalizer/HealthNormalizer.php new file mode 100644 index 00000000..88e72852 --- /dev/null +++ b/src/Normalizer/HealthNormalizer.php @@ -0,0 +1,93 @@ +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 = array(); + foreach ($data['Log'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\HealthcheckResult', '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 = array()) + { + $data = array(); + 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 = array(); + 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 array('Docker\\API\\Model\\Health' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/HealthcheckResultNormalizer.php b/src/Normalizer/HealthcheckResultNormalizer.php new file mode 100644 index 00000000..a5780551 --- /dev/null +++ b/src/Normalizer/HealthcheckResultNormalizer.php @@ -0,0 +1,94 @@ +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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\HealthcheckResult' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/HostConfigLogConfigNormalizer.php b/src/Normalizer/HostConfigLogConfigNormalizer.php index d9ebf12e..ea8dcc55 100644 --- a/src/Normalizer/HostConfigLogConfigNormalizer.php +++ b/src/Normalizer/HostConfigLogConfigNormalizer.php @@ -1,71 +1,84 @@ {'Type'} !== null) { - $object->setType($data->{'Type'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); } - if (property_exists($data, 'Config') && $data->{'Config'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Config'} as $key => $value) { + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $values = new \ArrayObject(array(), \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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + $data = array(); + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); } - if (null !== $object->getConfig()) { - $values = new \stdClass(); + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $values = array(); foreach ($object->getConfig() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Config'} = $values; + $data['Config'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\HostConfigLogConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/HostConfigNormalizer.php b/src/Normalizer/HostConfigNormalizer.php index 52bdece6..b445964e 100644 --- a/src/Normalizer/HostConfigNormalizer.php +++ b/src/Normalizer/HostConfigNormalizer.php @@ -1,649 +1,928 @@ {'CpuShares'} !== null) { - $object->setCpuShares($data->{'CpuShares'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CpuShares', $data) && $data['CpuShares'] !== null) { + $object->setCpuShares($data['CpuShares']); } - if (property_exists($data, 'Memory') && $data->{'Memory'} !== null) { - $object->setMemory($data->{'Memory'}); + elseif (\array_key_exists('CpuShares', $data) && $data['CpuShares'] === null) { + $object->setCpuShares(null); } - if (property_exists($data, 'CgroupParent') && $data->{'CgroupParent'} !== null) { - $object->setCgroupParent($data->{'CgroupParent'}); + if (\array_key_exists('Memory', $data) && $data['Memory'] !== null) { + $object->setMemory($data['Memory']); } - if (property_exists($data, 'BlkioWeight') && $data->{'BlkioWeight'} !== null) { - $object->setBlkioWeight($data->{'BlkioWeight'}); + elseif (\array_key_exists('Memory', $data) && $data['Memory'] === null) { + $object->setMemory(null); } - if (property_exists($data, 'BlkioWeightDevice') && $data->{'BlkioWeightDevice'} !== null) { - $values = []; - foreach ($data->{'BlkioWeightDevice'} as $value) { + 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 = array(); + foreach ($data['BlkioWeightDevice'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\ResourcesBlkioWeightDeviceItem', 'json', $context); } $object->setBlkioWeightDevice($values); } - if (property_exists($data, 'BlkioDeviceReadBps') && $data->{'BlkioDeviceReadBps'} !== null) { - $values_1 = []; - foreach ($data->{'BlkioDeviceReadBps'} as $value_1) { + elseif (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] === null) { + $object->setBlkioWeightDevice(null); + } + if (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] !== null) { + $values_1 = array(); + foreach ($data['BlkioDeviceReadBps'] as $value_1) { $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); } $object->setBlkioDeviceReadBps($values_1); } - if (property_exists($data, 'BlkioDeviceWriteBps') && $data->{'BlkioDeviceWriteBps'} !== null) { - $values_2 = []; - foreach ($data->{'BlkioDeviceWriteBps'} as $value_2) { + elseif (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] === null) { + $object->setBlkioDeviceReadBps(null); + } + if (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] !== null) { + $values_2 = array(); + foreach ($data['BlkioDeviceWriteBps'] as $value_2) { $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); } $object->setBlkioDeviceWriteBps($values_2); } - if (property_exists($data, 'BlkioDeviceReadIOps') && $data->{'BlkioDeviceReadIOps'} !== null) { - $values_3 = []; - foreach ($data->{'BlkioDeviceReadIOps'} as $value_3) { + elseif (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] === null) { + $object->setBlkioDeviceWriteBps(null); + } + if (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] !== null) { + $values_3 = array(); + foreach ($data['BlkioDeviceReadIOps'] as $value_3) { $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); } $object->setBlkioDeviceReadIOps($values_3); } - if (property_exists($data, 'BlkioDeviceWriteIOps') && $data->{'BlkioDeviceWriteIOps'} !== null) { - $values_4 = []; - foreach ($data->{'BlkioDeviceWriteIOps'} as $value_4) { + elseif (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] === null) { + $object->setBlkioDeviceReadIOps(null); + } + if (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] !== null) { + $values_4 = array(); + foreach ($data['BlkioDeviceWriteIOps'] as $value_4) { $values_4[] = $this->denormalizer->denormalize($value_4, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); } $object->setBlkioDeviceWriteIOps($values_4); } - if (property_exists($data, 'CpuPeriod') && $data->{'CpuPeriod'} !== null) { - $object->setCpuPeriod($data->{'CpuPeriod'}); + 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']); } - if (property_exists($data, 'CpuQuota') && $data->{'CpuQuota'} !== null) { - $object->setCpuQuota($data->{'CpuQuota'}); + elseif (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] === null) { + $object->setCpuRealtimeRuntime(null); } - if (property_exists($data, 'CpuRealtimePeriod') && $data->{'CpuRealtimePeriod'} !== null) { - $object->setCpuRealtimePeriod($data->{'CpuRealtimePeriod'}); + if (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] !== null) { + $object->setCpusetCpus($data['CpusetCpus']); } - if (property_exists($data, 'CpuRealtimeRuntime') && $data->{'CpuRealtimeRuntime'} !== null) { - $object->setCpuRealtimeRuntime($data->{'CpuRealtimeRuntime'}); + elseif (\array_key_exists('CpusetCpus', $data) && $data['CpusetCpus'] === null) { + $object->setCpusetCpus(null); } - if (property_exists($data, 'CpusetCpus') && $data->{'CpusetCpus'} !== null) { - $object->setCpusetCpus($data->{'CpusetCpus'}); + if (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] !== null) { + $object->setCpusetMems($data['CpusetMems']); } - if (property_exists($data, 'CpusetMems') && $data->{'CpusetMems'} !== null) { - $object->setCpusetMems($data->{'CpusetMems'}); + elseif (\array_key_exists('CpusetMems', $data) && $data['CpusetMems'] === null) { + $object->setCpusetMems(null); } - if (property_exists($data, 'Devices') && $data->{'Devices'} !== null) { - $values_5 = []; - foreach ($data->{'Devices'} as $value_5) { + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { + $values_5 = array(); + foreach ($data['Devices'] as $value_5) { $values_5[] = $this->denormalizer->denormalize($value_5, 'Docker\\API\\Model\\DeviceMapping', 'json', $context); } $object->setDevices($values_5); } - if (property_exists($data, 'DeviceCgroupRules') && $data->{'DeviceCgroupRules'} !== null) { - $values_6 = []; - foreach ($data->{'DeviceCgroupRules'} as $value_6) { + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } + if (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] !== null) { + $values_6 = array(); + foreach ($data['DeviceCgroupRules'] as $value_6) { $values_6[] = $value_6; } $object->setDeviceCgroupRules($values_6); } - if (property_exists($data, 'DiskQuota') && $data->{'DiskQuota'} !== null) { - $object->setDiskQuota($data->{'DiskQuota'}); + elseif (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] === null) { + $object->setDeviceCgroupRules(null); + } + if (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] !== null) { + $values_7 = array(); + foreach ($data['DeviceRequests'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, 'Docker\\API\\Model\\DeviceRequest', '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']); } - if (property_exists($data, 'KernelMemory') && $data->{'KernelMemory'} !== null) { - $object->setKernelMemory($data->{'KernelMemory'}); + elseif (\array_key_exists('MemoryReservation', $data) && $data['MemoryReservation'] === null) { + $object->setMemoryReservation(null); } - if (property_exists($data, 'MemoryReservation') && $data->{'MemoryReservation'} !== null) { - $object->setMemoryReservation($data->{'MemoryReservation'}); + if (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] !== null) { + $object->setMemorySwap($data['MemorySwap']); } - if (property_exists($data, 'MemorySwap') && $data->{'MemorySwap'} !== null) { - $object->setMemorySwap($data->{'MemorySwap'}); + elseif (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] === null) { + $object->setMemorySwap(null); } - if (property_exists($data, 'MemorySwappiness') && $data->{'MemorySwappiness'} !== null) { - $object->setMemorySwappiness($data->{'MemorySwappiness'}); + if (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] !== null) { + $object->setMemorySwappiness($data['MemorySwappiness']); } - if (property_exists($data, 'NanoCPUs') && $data->{'NanoCPUs'} !== null) { - $object->setNanoCPUs($data->{'NanoCPUs'}); + elseif (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] === null) { + $object->setMemorySwappiness(null); } - if (property_exists($data, 'OomKillDisable') && $data->{'OomKillDisable'} !== null) { - $object->setOomKillDisable($data->{'OomKillDisable'}); + if (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] !== null) { + $object->setNanoCpus($data['NanoCpus']); } - if (property_exists($data, 'PidsLimit') && $data->{'PidsLimit'} !== null) { - $object->setPidsLimit($data->{'PidsLimit'}); + elseif (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] === null) { + $object->setNanoCpus(null); } - if (property_exists($data, 'Ulimits') && $data->{'Ulimits'} !== null) { - $values_7 = []; - foreach ($data->{'Ulimits'} as $value_7) { - $values_7[] = $this->denormalizer->denormalize($value_7, 'Docker\\API\\Model\\ResourcesUlimitsItem', 'json', $context); + 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 = array(); + foreach ($data['Ulimits'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, 'Docker\\API\\Model\\ResourcesUlimitsItem', 'json', $context); } - $object->setUlimits($values_7); + $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']); } - if (property_exists($data, 'CpuCount') && $data->{'CpuCount'} !== null) { - $object->setCpuCount($data->{'CpuCount'}); + elseif (\array_key_exists('CpuCount', $data) && $data['CpuCount'] === null) { + $object->setCpuCount(null); } - if (property_exists($data, 'CpuPercent') && $data->{'CpuPercent'} !== null) { - $object->setCpuPercent($data->{'CpuPercent'}); + if (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] !== null) { + $object->setCpuPercent($data['CpuPercent']); } - if (property_exists($data, 'IOMaximumIOps') && $data->{'IOMaximumIOps'} !== null) { - $object->setIOMaximumIOps($data->{'IOMaximumIOps'}); + elseif (\array_key_exists('CpuPercent', $data) && $data['CpuPercent'] === null) { + $object->setCpuPercent(null); } - if (property_exists($data, 'IOMaximumBandwidth') && $data->{'IOMaximumBandwidth'} !== null) { - $object->setIOMaximumBandwidth($data->{'IOMaximumBandwidth'}); + if (\array_key_exists('IOMaximumIOps', $data) && $data['IOMaximumIOps'] !== null) { + $object->setIOMaximumIOps($data['IOMaximumIOps']); } - if (property_exists($data, 'Binds') && $data->{'Binds'} !== null) { - $values_8 = []; - foreach ($data->{'Binds'} as $value_8) { - $values_8[] = $value_8; + 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 = array(); + foreach ($data['Binds'] as $value_9) { + $values_9[] = $value_9; } - $object->setBinds($values_8); + $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', 'json', $context)); } - if (property_exists($data, 'ContainerIDFile') && $data->{'ContainerIDFile'} !== null) { - $object->setContainerIDFile($data->{'ContainerIDFile'}); + elseif (\array_key_exists('LogConfig', $data) && $data['LogConfig'] === null) { + $object->setLogConfig(null); } - if (property_exists($data, 'LogConfig') && $data->{'LogConfig'} !== null) { - $object->setLogConfig($this->denormalizer->denormalize($data->{'LogConfig'}, 'Docker\\API\\Model\\HostConfigLogConfig', 'json', $context)); + if (\array_key_exists('NetworkMode', $data) && $data['NetworkMode'] !== null) { + $object->setNetworkMode($data['NetworkMode']); } - if (property_exists($data, 'NetworkMode') && $data->{'NetworkMode'} !== null) { - $object->setNetworkMode($data->{'NetworkMode'}); + elseif (\array_key_exists('NetworkMode', $data) && $data['NetworkMode'] === null) { + $object->setNetworkMode(null); } - if (property_exists($data, 'PortBindings') && $data->{'PortBindings'} !== null) { - $values_9 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'PortBindings'} as $key => $value_9) { - $values_10 = []; - foreach ($value_9 as $value_10) { - $values_10[] = $this->denormalizer->denormalize($value_10, 'Docker\\API\\Model\\PortBinding', 'json', $context); + if (\array_key_exists('PortBindings', $data) && $data['PortBindings'] !== null) { + $values_10 = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['PortBindings'] as $key => $value_10) { + $values_11 = array(); + foreach ($value_10 as $value_11) { + $values_11[] = $this->denormalizer->denormalize($value_11, 'Docker\\API\\Model\\PortBinding', 'json', $context); } - $values_9[$key] = $values_10; + $values_10[$key] = $values_11; } - $object->setPortBindings($values_9); + $object->setPortBindings($values_10); } - if (property_exists($data, 'RestartPolicy') && $data->{'RestartPolicy'} !== null) { - $object->setRestartPolicy($this->denormalizer->denormalize($data->{'RestartPolicy'}, 'Docker\\API\\Model\\RestartPolicy', 'json', $context)); + elseif (\array_key_exists('PortBindings', $data) && $data['PortBindings'] === null) { + $object->setPortBindings(null); } - if (property_exists($data, 'AutoRemove') && $data->{'AutoRemove'} !== null) { - $object->setAutoRemove($data->{'AutoRemove'}); + if (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] !== null) { + $object->setRestartPolicy($this->denormalizer->denormalize($data['RestartPolicy'], 'Docker\\API\\Model\\RestartPolicy', 'json', $context)); } - if (property_exists($data, 'VolumeDriver') && $data->{'VolumeDriver'} !== null) { - $object->setVolumeDriver($data->{'VolumeDriver'}); + elseif (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] === null) { + $object->setRestartPolicy(null); } - if (property_exists($data, 'VolumesFrom') && $data->{'VolumesFrom'} !== null) { - $values_11 = []; - foreach ($data->{'VolumesFrom'} as $value_11) { - $values_11[] = $value_11; - } - $object->setVolumesFrom($values_11); + 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 (property_exists($data, 'Mounts') && $data->{'Mounts'} !== null) { - $values_12 = []; - foreach ($data->{'Mounts'} as $value_12) { - $values_12[] = $this->denormalizer->denormalize($value_12, 'Docker\\API\\Model\\Mount', 'json', $context); + if (\array_key_exists('VolumesFrom', $data) && $data['VolumesFrom'] !== null) { + $values_12 = array(); + foreach ($data['VolumesFrom'] as $value_12) { + $values_12[] = $value_12; } - $object->setMounts($values_12); + $object->setVolumesFrom($values_12); } - if (property_exists($data, 'CapAdd') && $data->{'CapAdd'} !== null) { - $values_13 = []; - foreach ($data->{'CapAdd'} as $value_13) { - $values_13[] = $value_13; + elseif (\array_key_exists('VolumesFrom', $data) && $data['VolumesFrom'] === null) { + $object->setVolumesFrom(null); + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values_13 = array(); + foreach ($data['Mounts'] as $value_13) { + $values_13[] = $this->denormalizer->denormalize($value_13, 'Docker\\API\\Model\\Mount', 'json', $context); } - $object->setCapAdd($values_13); + $object->setMounts($values_13); + } + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); } - if (property_exists($data, 'CapDrop') && $data->{'CapDrop'} !== null) { - $values_14 = []; - foreach ($data->{'CapDrop'} as $value_14) { + if (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] !== null) { + $values_14 = array(); + foreach ($data['ConsoleSize'] as $value_14) { $values_14[] = $value_14; } - $object->setCapDrop($values_14); + $object->setConsoleSize($values_14); + } + elseif (\array_key_exists('ConsoleSize', $data) && $data['ConsoleSize'] === null) { + $object->setConsoleSize(null); } - if (property_exists($data, 'Dns') && $data->{'Dns'} !== null) { - $values_15 = []; - foreach ($data->{'Dns'} as $value_15) { - $values_15[] = $value_15; + if (\array_key_exists('Annotations', $data) && $data['Annotations'] !== null) { + $values_15 = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Annotations'] as $key_1 => $value_15) { + $values_15[$key_1] = $value_15; } - $object->setDns($values_15); + $object->setAnnotations($values_15); } - if (property_exists($data, 'DnsOptions') && $data->{'DnsOptions'} !== null) { - $values_16 = []; - foreach ($data->{'DnsOptions'} as $value_16) { + elseif (\array_key_exists('Annotations', $data) && $data['Annotations'] === null) { + $object->setAnnotations(null); + } + if (\array_key_exists('CapAdd', $data) && $data['CapAdd'] !== null) { + $values_16 = array(); + foreach ($data['CapAdd'] as $value_16) { $values_16[] = $value_16; } - $object->setDnsOptions($values_16); + $object->setCapAdd($values_16); + } + elseif (\array_key_exists('CapAdd', $data) && $data['CapAdd'] === null) { + $object->setCapAdd(null); } - if (property_exists($data, 'DnsSearch') && $data->{'DnsSearch'} !== null) { - $values_17 = []; - foreach ($data->{'DnsSearch'} as $value_17) { + if (\array_key_exists('CapDrop', $data) && $data['CapDrop'] !== null) { + $values_17 = array(); + foreach ($data['CapDrop'] as $value_17) { $values_17[] = $value_17; } - $object->setDnsSearch($values_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']); } - if (property_exists($data, 'ExtraHosts') && $data->{'ExtraHosts'} !== null) { - $values_18 = []; - foreach ($data->{'ExtraHosts'} as $value_18) { + elseif (\array_key_exists('CgroupnsMode', $data) && $data['CgroupnsMode'] === null) { + $object->setCgroupnsMode(null); + } + if (\array_key_exists('Dns', $data) && $data['Dns'] !== null) { + $values_18 = array(); + foreach ($data['Dns'] as $value_18) { $values_18[] = $value_18; } - $object->setExtraHosts($values_18); + $object->setDns($values_18); + } + elseif (\array_key_exists('Dns', $data) && $data['Dns'] === null) { + $object->setDns(null); } - if (property_exists($data, 'GroupAdd') && $data->{'GroupAdd'} !== null) { - $values_19 = []; - foreach ($data->{'GroupAdd'} as $value_19) { + if (\array_key_exists('DnsOptions', $data) && $data['DnsOptions'] !== null) { + $values_19 = array(); + foreach ($data['DnsOptions'] as $value_19) { $values_19[] = $value_19; } - $object->setGroupAdd($values_19); - } - if (property_exists($data, 'IpcMode') && $data->{'IpcMode'} !== null) { - $object->setIpcMode($data->{'IpcMode'}); + $object->setDnsOptions($values_19); } - if (property_exists($data, 'Cgroup') && $data->{'Cgroup'} !== null) { - $object->setCgroup($data->{'Cgroup'}); + elseif (\array_key_exists('DnsOptions', $data) && $data['DnsOptions'] === null) { + $object->setDnsOptions(null); } - if (property_exists($data, 'Links') && $data->{'Links'} !== null) { - $values_20 = []; - foreach ($data->{'Links'} as $value_20) { + if (\array_key_exists('DnsSearch', $data) && $data['DnsSearch'] !== null) { + $values_20 = array(); + foreach ($data['DnsSearch'] as $value_20) { $values_20[] = $value_20; } - $object->setLinks($values_20); + $object->setDnsSearch($values_20); } - if (property_exists($data, 'OomScoreAdj') && $data->{'OomScoreAdj'} !== null) { - $object->setOomScoreAdj($data->{'OomScoreAdj'}); + elseif (\array_key_exists('DnsSearch', $data) && $data['DnsSearch'] === null) { + $object->setDnsSearch(null); } - if (property_exists($data, 'PidMode') && $data->{'PidMode'} !== null) { - $object->setPidMode($data->{'PidMode'}); + if (\array_key_exists('ExtraHosts', $data) && $data['ExtraHosts'] !== null) { + $values_21 = array(); + foreach ($data['ExtraHosts'] as $value_21) { + $values_21[] = $value_21; + } + $object->setExtraHosts($values_21); } - if (property_exists($data, 'Privileged') && $data->{'Privileged'} !== null) { - $object->setPrivileged($data->{'Privileged'}); + elseif (\array_key_exists('ExtraHosts', $data) && $data['ExtraHosts'] === null) { + $object->setExtraHosts(null); } - if (property_exists($data, 'PublishAllPorts') && $data->{'PublishAllPorts'} !== null) { - $object->setPublishAllPorts($data->{'PublishAllPorts'}); + if (\array_key_exists('GroupAdd', $data) && $data['GroupAdd'] !== null) { + $values_22 = array(); + foreach ($data['GroupAdd'] as $value_22) { + $values_22[] = $value_22; + } + $object->setGroupAdd($values_22); } - if (property_exists($data, 'ReadonlyRootfs') && $data->{'ReadonlyRootfs'} !== null) { - $object->setReadonlyRootfs($data->{'ReadonlyRootfs'}); + elseif (\array_key_exists('GroupAdd', $data) && $data['GroupAdd'] === null) { + $object->setGroupAdd(null); } - if (property_exists($data, 'SecurityOpt') && $data->{'SecurityOpt'} !== null) { - $values_21 = []; - foreach ($data->{'SecurityOpt'} as $value_21) { - $values_21[] = $value_21; + 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 = array(); + foreach ($data['Links'] as $value_23) { + $values_23[] = $value_23; } - $object->setSecurityOpt($values_21); + $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 (property_exists($data, 'StorageOpt') && $data->{'StorageOpt'} !== null) { - $values_22 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'StorageOpt'} as $key_1 => $value_22) { - $values_22[$key_1] = $value_22; + 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 = array(); + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['StorageOpt'] as $key_2 => $value_25) { + $values_25[$key_2] = $value_25; } - $object->setStorageOpt($values_22); + $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(array(), \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']); } - if (property_exists($data, 'Tmpfs') && $data->{'Tmpfs'} !== null) { - $values_23 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Tmpfs'} as $key_2 => $value_23) { - $values_23[$key_2] = $value_23; + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Sysctls'] as $key_4 => $value_27) { + $values_27[$key_4] = $value_27; } - $object->setTmpfs($values_23); + $object->setSysctls($values_27); + } + elseif (\array_key_exists('Sysctls', $data) && $data['Sysctls'] === null) { + $object->setSysctls(null); } - if (property_exists($data, 'UTSMode') && $data->{'UTSMode'} !== null) { - $object->setUTSMode($data->{'UTSMode'}); + if (\array_key_exists('Runtime', $data) && $data['Runtime'] !== null) { + $object->setRuntime($data['Runtime']); } - if (property_exists($data, 'UsernsMode') && $data->{'UsernsMode'} !== null) { - $object->setUsernsMode($data->{'UsernsMode'}); + elseif (\array_key_exists('Runtime', $data) && $data['Runtime'] === null) { + $object->setRuntime(null); } - if (property_exists($data, 'ShmSize') && $data->{'ShmSize'} !== null) { - $object->setShmSize($data->{'ShmSize'}); + if (\array_key_exists('Isolation', $data) && $data['Isolation'] !== null) { + $object->setIsolation($data['Isolation']); } - if (property_exists($data, 'Sysctls') && $data->{'Sysctls'} !== null) { - $values_24 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Sysctls'} as $key_3 => $value_24) { - $values_24[$key_3] = $value_24; + elseif (\array_key_exists('Isolation', $data) && $data['Isolation'] === null) { + $object->setIsolation(null); + } + if (\array_key_exists('MaskedPaths', $data) && $data['MaskedPaths'] !== null) { + $values_28 = array(); + foreach ($data['MaskedPaths'] as $value_28) { + $values_28[] = $value_28; } - $object->setSysctls($values_24); + $object->setMaskedPaths($values_28); } - if (property_exists($data, 'Runtime') && $data->{'Runtime'} !== null) { - $object->setRuntime($data->{'Runtime'}); + elseif (\array_key_exists('MaskedPaths', $data) && $data['MaskedPaths'] === null) { + $object->setMaskedPaths(null); } - if (property_exists($data, 'ConsoleSize') && $data->{'ConsoleSize'} !== null) { - $values_25 = []; - foreach ($data->{'ConsoleSize'} as $value_25) { - $values_25[] = $value_25; + if (\array_key_exists('ReadonlyPaths', $data) && $data['ReadonlyPaths'] !== null) { + $values_29 = array(); + foreach ($data['ReadonlyPaths'] as $value_29) { + $values_29[] = $value_29; } - $object->setConsoleSize($values_25); + $object->setReadonlyPaths($values_29); } - if (property_exists($data, 'Isolation') && $data->{'Isolation'} !== null) { - $object->setIsolation($data->{'Isolation'}); + elseif (\array_key_exists('ReadonlyPaths', $data) && $data['ReadonlyPaths'] === null) { + $object->setReadonlyPaths(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getCpuShares()) { - $data->{'CpuShares'} = $object->getCpuShares(); + $data = array(); + if ($object->isInitialized('cpuShares') && null !== $object->getCpuShares()) { + $data['CpuShares'] = $object->getCpuShares(); } - if (null !== $object->getMemory()) { - $data->{'Memory'} = $object->getMemory(); + if ($object->isInitialized('memory') && null !== $object->getMemory()) { + $data['Memory'] = $object->getMemory(); } - if (null !== $object->getCgroupParent()) { - $data->{'CgroupParent'} = $object->getCgroupParent(); + if ($object->isInitialized('cgroupParent') && null !== $object->getCgroupParent()) { + $data['CgroupParent'] = $object->getCgroupParent(); } - if (null !== $object->getBlkioWeight()) { - $data->{'BlkioWeight'} = $object->getBlkioWeight(); + if ($object->isInitialized('blkioWeight') && null !== $object->getBlkioWeight()) { + $data['BlkioWeight'] = $object->getBlkioWeight(); } - if (null !== $object->getBlkioWeightDevice()) { - $values = []; + if ($object->isInitialized('blkioWeightDevice') && null !== $object->getBlkioWeightDevice()) { + $values = array(); foreach ($object->getBlkioWeightDevice() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'BlkioWeightDevice'} = $values; + $data['BlkioWeightDevice'] = $values; } - if (null !== $object->getBlkioDeviceReadBps()) { - $values_1 = []; + if ($object->isInitialized('blkioDeviceReadBps') && null !== $object->getBlkioDeviceReadBps()) { + $values_1 = array(); foreach ($object->getBlkioDeviceReadBps() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'BlkioDeviceReadBps'} = $values_1; + $data['BlkioDeviceReadBps'] = $values_1; } - if (null !== $object->getBlkioDeviceWriteBps()) { - $values_2 = []; + if ($object->isInitialized('blkioDeviceWriteBps') && null !== $object->getBlkioDeviceWriteBps()) { + $values_2 = array(); foreach ($object->getBlkioDeviceWriteBps() as $value_2) { $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'BlkioDeviceWriteBps'} = $values_2; + $data['BlkioDeviceWriteBps'] = $values_2; } - if (null !== $object->getBlkioDeviceReadIOps()) { - $values_3 = []; + if ($object->isInitialized('blkioDeviceReadIOps') && null !== $object->getBlkioDeviceReadIOps()) { + $values_3 = array(); foreach ($object->getBlkioDeviceReadIOps() as $value_3) { $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'BlkioDeviceReadIOps'} = $values_3; + $data['BlkioDeviceReadIOps'] = $values_3; } - if (null !== $object->getBlkioDeviceWriteIOps()) { - $values_4 = []; + if ($object->isInitialized('blkioDeviceWriteIOps') && null !== $object->getBlkioDeviceWriteIOps()) { + $values_4 = array(); foreach ($object->getBlkioDeviceWriteIOps() as $value_4) { $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); } - $data->{'BlkioDeviceWriteIOps'} = $values_4; + $data['BlkioDeviceWriteIOps'] = $values_4; } - if (null !== $object->getCpuPeriod()) { - $data->{'CpuPeriod'} = $object->getCpuPeriod(); + if ($object->isInitialized('cpuPeriod') && null !== $object->getCpuPeriod()) { + $data['CpuPeriod'] = $object->getCpuPeriod(); } - if (null !== $object->getCpuQuota()) { - $data->{'CpuQuota'} = $object->getCpuQuota(); + if ($object->isInitialized('cpuQuota') && null !== $object->getCpuQuota()) { + $data['CpuQuota'] = $object->getCpuQuota(); } - if (null !== $object->getCpuRealtimePeriod()) { - $data->{'CpuRealtimePeriod'} = $object->getCpuRealtimePeriod(); + if ($object->isInitialized('cpuRealtimePeriod') && null !== $object->getCpuRealtimePeriod()) { + $data['CpuRealtimePeriod'] = $object->getCpuRealtimePeriod(); } - if (null !== $object->getCpuRealtimeRuntime()) { - $data->{'CpuRealtimeRuntime'} = $object->getCpuRealtimeRuntime(); + if ($object->isInitialized('cpuRealtimeRuntime') && null !== $object->getCpuRealtimeRuntime()) { + $data['CpuRealtimeRuntime'] = $object->getCpuRealtimeRuntime(); } - if (null !== $object->getCpusetCpus()) { - $data->{'CpusetCpus'} = $object->getCpusetCpus(); + if ($object->isInitialized('cpusetCpus') && null !== $object->getCpusetCpus()) { + $data['CpusetCpus'] = $object->getCpusetCpus(); } - if (null !== $object->getCpusetMems()) { - $data->{'CpusetMems'} = $object->getCpusetMems(); + if ($object->isInitialized('cpusetMems') && null !== $object->getCpusetMems()) { + $data['CpusetMems'] = $object->getCpusetMems(); } - if (null !== $object->getDevices()) { - $values_5 = []; + if ($object->isInitialized('devices') && null !== $object->getDevices()) { + $values_5 = array(); foreach ($object->getDevices() as $value_5) { $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); } - $data->{'Devices'} = $values_5; + $data['Devices'] = $values_5; } - if (null !== $object->getDeviceCgroupRules()) { - $values_6 = []; + if ($object->isInitialized('deviceCgroupRules') && null !== $object->getDeviceCgroupRules()) { + $values_6 = array(); foreach ($object->getDeviceCgroupRules() as $value_6) { $values_6[] = $value_6; } - $data->{'DeviceCgroupRules'} = $values_6; + $data['DeviceCgroupRules'] = $values_6; } - if (null !== $object->getDiskQuota()) { - $data->{'DiskQuota'} = $object->getDiskQuota(); + if ($object->isInitialized('deviceRequests') && null !== $object->getDeviceRequests()) { + $values_7 = array(); + foreach ($object->getDeviceRequests() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $data['DeviceRequests'] = $values_7; } - if (null !== $object->getKernelMemory()) { - $data->{'KernelMemory'} = $object->getKernelMemory(); + if ($object->isInitialized('kernelMemoryTCP') && null !== $object->getKernelMemoryTCP()) { + $data['KernelMemoryTCP'] = $object->getKernelMemoryTCP(); } - if (null !== $object->getMemoryReservation()) { - $data->{'MemoryReservation'} = $object->getMemoryReservation(); + if ($object->isInitialized('memoryReservation') && null !== $object->getMemoryReservation()) { + $data['MemoryReservation'] = $object->getMemoryReservation(); } - if (null !== $object->getMemorySwap()) { - $data->{'MemorySwap'} = $object->getMemorySwap(); + if ($object->isInitialized('memorySwap') && null !== $object->getMemorySwap()) { + $data['MemorySwap'] = $object->getMemorySwap(); } - if (null !== $object->getMemorySwappiness()) { - $data->{'MemorySwappiness'} = $object->getMemorySwappiness(); + if ($object->isInitialized('memorySwappiness') && null !== $object->getMemorySwappiness()) { + $data['MemorySwappiness'] = $object->getMemorySwappiness(); } - if (null !== $object->getNanoCPUs()) { - $data->{'NanoCPUs'} = $object->getNanoCPUs(); + if ($object->isInitialized('nanoCpus') && null !== $object->getNanoCpus()) { + $data['NanoCpus'] = $object->getNanoCpus(); } - if (null !== $object->getOomKillDisable()) { - $data->{'OomKillDisable'} = $object->getOomKillDisable(); + if ($object->isInitialized('oomKillDisable') && null !== $object->getOomKillDisable()) { + $data['OomKillDisable'] = $object->getOomKillDisable(); } - if (null !== $object->getPidsLimit()) { - $data->{'PidsLimit'} = $object->getPidsLimit(); + if ($object->isInitialized('init') && null !== $object->getInit()) { + $data['Init'] = $object->getInit(); } - if (null !== $object->getUlimits()) { - $values_7 = []; - foreach ($object->getUlimits() as $value_7) { - $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + if ($object->isInitialized('pidsLimit') && null !== $object->getPidsLimit()) { + $data['PidsLimit'] = $object->getPidsLimit(); + } + if ($object->isInitialized('ulimits') && null !== $object->getUlimits()) { + $values_8 = array(); + foreach ($object->getUlimits() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); } - $data->{'Ulimits'} = $values_7; + $data['Ulimits'] = $values_8; } - if (null !== $object->getCpuCount()) { - $data->{'CpuCount'} = $object->getCpuCount(); + if ($object->isInitialized('cpuCount') && null !== $object->getCpuCount()) { + $data['CpuCount'] = $object->getCpuCount(); } - if (null !== $object->getCpuPercent()) { - $data->{'CpuPercent'} = $object->getCpuPercent(); + if ($object->isInitialized('cpuPercent') && null !== $object->getCpuPercent()) { + $data['CpuPercent'] = $object->getCpuPercent(); } - if (null !== $object->getIOMaximumIOps()) { - $data->{'IOMaximumIOps'} = $object->getIOMaximumIOps(); + if ($object->isInitialized('iOMaximumIOps') && null !== $object->getIOMaximumIOps()) { + $data['IOMaximumIOps'] = $object->getIOMaximumIOps(); } - if (null !== $object->getIOMaximumBandwidth()) { - $data->{'IOMaximumBandwidth'} = $object->getIOMaximumBandwidth(); + if ($object->isInitialized('iOMaximumBandwidth') && null !== $object->getIOMaximumBandwidth()) { + $data['IOMaximumBandwidth'] = $object->getIOMaximumBandwidth(); } - if (null !== $object->getBinds()) { - $values_8 = []; - foreach ($object->getBinds() as $value_8) { - $values_8[] = $value_8; + if ($object->isInitialized('binds') && null !== $object->getBinds()) { + $values_9 = array(); + foreach ($object->getBinds() as $value_9) { + $values_9[] = $value_9; } - $data->{'Binds'} = $values_8; + $data['Binds'] = $values_9; } - if (null !== $object->getContainerIDFile()) { - $data->{'ContainerIDFile'} = $object->getContainerIDFile(); + if ($object->isInitialized('containerIDFile') && null !== $object->getContainerIDFile()) { + $data['ContainerIDFile'] = $object->getContainerIDFile(); } - if (null !== $object->getLogConfig()) { - $data->{'LogConfig'} = $this->normalizer->normalize($object->getLogConfig(), 'json', $context); + if ($object->isInitialized('logConfig') && null !== $object->getLogConfig()) { + $data['LogConfig'] = $this->normalizer->normalize($object->getLogConfig(), 'json', $context); } - if (null !== $object->getNetworkMode()) { - $data->{'NetworkMode'} = $object->getNetworkMode(); + if ($object->isInitialized('networkMode') && null !== $object->getNetworkMode()) { + $data['NetworkMode'] = $object->getNetworkMode(); } - if (null !== $object->getPortBindings()) { - $values_9 = new \stdClass(); - foreach ($object->getPortBindings() as $key => $value_9) { - $values_10 = []; - foreach ($value_9 as $value_10) { - $values_10[] = $this->normalizer->normalize($value_10, 'json', $context); + if ($object->isInitialized('portBindings') && null !== $object->getPortBindings()) { + $values_10 = array(); + foreach ($object->getPortBindings() as $key => $value_10) { + $values_11 = array(); + foreach ($value_10 as $value_11) { + $values_11[] = $this->normalizer->normalize($value_11, 'json', $context); } - $values_9->{$key} = $values_10; + $values_10[$key] = $values_11; } - $data->{'PortBindings'} = $values_9; + $data['PortBindings'] = $values_10; } - if (null !== $object->getRestartPolicy()) { - $data->{'RestartPolicy'} = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); + if ($object->isInitialized('restartPolicy') && null !== $object->getRestartPolicy()) { + $data['RestartPolicy'] = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); } - if (null !== $object->getAutoRemove()) { - $data->{'AutoRemove'} = $object->getAutoRemove(); + if ($object->isInitialized('autoRemove') && null !== $object->getAutoRemove()) { + $data['AutoRemove'] = $object->getAutoRemove(); } - if (null !== $object->getVolumeDriver()) { - $data->{'VolumeDriver'} = $object->getVolumeDriver(); + if ($object->isInitialized('volumeDriver') && null !== $object->getVolumeDriver()) { + $data['VolumeDriver'] = $object->getVolumeDriver(); } - if (null !== $object->getVolumesFrom()) { - $values_11 = []; - foreach ($object->getVolumesFrom() as $value_11) { - $values_11[] = $value_11; + if ($object->isInitialized('volumesFrom') && null !== $object->getVolumesFrom()) { + $values_12 = array(); + foreach ($object->getVolumesFrom() as $value_12) { + $values_12[] = $value_12; } - $data->{'VolumesFrom'} = $values_11; + $data['VolumesFrom'] = $values_12; } - if (null !== $object->getMounts()) { - $values_12 = []; - foreach ($object->getMounts() as $value_12) { - $values_12[] = $this->normalizer->normalize($value_12, 'json', $context); + if ($object->isInitialized('mounts') && null !== $object->getMounts()) { + $values_13 = array(); + foreach ($object->getMounts() as $value_13) { + $values_13[] = $this->normalizer->normalize($value_13, 'json', $context); } - $data->{'Mounts'} = $values_12; + $data['Mounts'] = $values_13; } - if (null !== $object->getCapAdd()) { - $values_13 = []; - foreach ($object->getCapAdd() as $value_13) { - $values_13[] = $value_13; - } - $data->{'CapAdd'} = $values_13; - } - if (null !== $object->getCapDrop()) { - $values_14 = []; - foreach ($object->getCapDrop() as $value_14) { + if ($object->isInitialized('consoleSize') && null !== $object->getConsoleSize()) { + $values_14 = array(); + foreach ($object->getConsoleSize() as $value_14) { $values_14[] = $value_14; } - $data->{'CapDrop'} = $values_14; + $data['ConsoleSize'] = $values_14; } - if (null !== $object->getDns()) { - $values_15 = []; - foreach ($object->getDns() as $value_15) { - $values_15[] = $value_15; + if ($object->isInitialized('annotations') && null !== $object->getAnnotations()) { + $values_15 = array(); + foreach ($object->getAnnotations() as $key_1 => $value_15) { + $values_15[$key_1] = $value_15; } - $data->{'Dns'} = $values_15; + $data['Annotations'] = $values_15; } - if (null !== $object->getDnsOptions()) { - $values_16 = []; - foreach ($object->getDnsOptions() as $value_16) { + if ($object->isInitialized('capAdd') && null !== $object->getCapAdd()) { + $values_16 = array(); + foreach ($object->getCapAdd() as $value_16) { $values_16[] = $value_16; } - $data->{'DnsOptions'} = $values_16; + $data['CapAdd'] = $values_16; } - if (null !== $object->getDnsSearch()) { - $values_17 = []; - foreach ($object->getDnsSearch() as $value_17) { + if ($object->isInitialized('capDrop') && null !== $object->getCapDrop()) { + $values_17 = array(); + foreach ($object->getCapDrop() as $value_17) { $values_17[] = $value_17; } - $data->{'DnsSearch'} = $values_17; + $data['CapDrop'] = $values_17; + } + if ($object->isInitialized('cgroupnsMode') && null !== $object->getCgroupnsMode()) { + $data['CgroupnsMode'] = $object->getCgroupnsMode(); } - if (null !== $object->getExtraHosts()) { - $values_18 = []; - foreach ($object->getExtraHosts() as $value_18) { + if ($object->isInitialized('dns') && null !== $object->getDns()) { + $values_18 = array(); + foreach ($object->getDns() as $value_18) { $values_18[] = $value_18; } - $data->{'ExtraHosts'} = $values_18; + $data['Dns'] = $values_18; } - if (null !== $object->getGroupAdd()) { - $values_19 = []; - foreach ($object->getGroupAdd() as $value_19) { + if ($object->isInitialized('dnsOptions') && null !== $object->getDnsOptions()) { + $values_19 = array(); + foreach ($object->getDnsOptions() as $value_19) { $values_19[] = $value_19; } - $data->{'GroupAdd'} = $values_19; + $data['DnsOptions'] = $values_19; } - if (null !== $object->getIpcMode()) { - $data->{'IpcMode'} = $object->getIpcMode(); + if ($object->isInitialized('dnsSearch') && null !== $object->getDnsSearch()) { + $values_20 = array(); + foreach ($object->getDnsSearch() as $value_20) { + $values_20[] = $value_20; + } + $data['DnsSearch'] = $values_20; } - if (null !== $object->getCgroup()) { - $data->{'Cgroup'} = $object->getCgroup(); + if ($object->isInitialized('extraHosts') && null !== $object->getExtraHosts()) { + $values_21 = array(); + foreach ($object->getExtraHosts() as $value_21) { + $values_21[] = $value_21; + } + $data['ExtraHosts'] = $values_21; } - if (null !== $object->getLinks()) { - $values_20 = []; - foreach ($object->getLinks() as $value_20) { - $values_20[] = $value_20; + if ($object->isInitialized('groupAdd') && null !== $object->getGroupAdd()) { + $values_22 = array(); + foreach ($object->getGroupAdd() as $value_22) { + $values_22[] = $value_22; } - $data->{'Links'} = $values_20; + $data['GroupAdd'] = $values_22; } - if (null !== $object->getOomScoreAdj()) { - $data->{'OomScoreAdj'} = $object->getOomScoreAdj(); + if ($object->isInitialized('ipcMode') && null !== $object->getIpcMode()) { + $data['IpcMode'] = $object->getIpcMode(); } - if (null !== $object->getPidMode()) { - $data->{'PidMode'} = $object->getPidMode(); + if ($object->isInitialized('cgroup') && null !== $object->getCgroup()) { + $data['Cgroup'] = $object->getCgroup(); } - if (null !== $object->getPrivileged()) { - $data->{'Privileged'} = $object->getPrivileged(); + if ($object->isInitialized('links') && null !== $object->getLinks()) { + $values_23 = array(); + foreach ($object->getLinks() as $value_23) { + $values_23[] = $value_23; + } + $data['Links'] = $values_23; } - if (null !== $object->getPublishAllPorts()) { - $data->{'PublishAllPorts'} = $object->getPublishAllPorts(); + if ($object->isInitialized('oomScoreAdj') && null !== $object->getOomScoreAdj()) { + $data['OomScoreAdj'] = $object->getOomScoreAdj(); } - if (null !== $object->getReadonlyRootfs()) { - $data->{'ReadonlyRootfs'} = $object->getReadonlyRootfs(); + if ($object->isInitialized('pidMode') && null !== $object->getPidMode()) { + $data['PidMode'] = $object->getPidMode(); } - if (null !== $object->getSecurityOpt()) { - $values_21 = []; - foreach ($object->getSecurityOpt() as $value_21) { - $values_21[] = $value_21; + 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 = array(); + foreach ($object->getSecurityOpt() as $value_24) { + $values_24[] = $value_24; } - $data->{'SecurityOpt'} = $values_21; + $data['SecurityOpt'] = $values_24; } - if (null !== $object->getStorageOpt()) { - $values_22 = new \stdClass(); - foreach ($object->getStorageOpt() as $key_1 => $value_22) { - $values_22->{$key_1} = $value_22; + if ($object->isInitialized('storageOpt') && null !== $object->getStorageOpt()) { + $values_25 = array(); + foreach ($object->getStorageOpt() as $key_2 => $value_25) { + $values_25[$key_2] = $value_25; } - $data->{'StorageOpt'} = $values_22; + $data['StorageOpt'] = $values_25; } - if (null !== $object->getTmpfs()) { - $values_23 = new \stdClass(); - foreach ($object->getTmpfs() as $key_2 => $value_23) { - $values_23->{$key_2} = $value_23; + if ($object->isInitialized('tmpfs') && null !== $object->getTmpfs()) { + $values_26 = array(); + foreach ($object->getTmpfs() as $key_3 => $value_26) { + $values_26[$key_3] = $value_26; } - $data->{'Tmpfs'} = $values_23; + $data['Tmpfs'] = $values_26; } - if (null !== $object->getUTSMode()) { - $data->{'UTSMode'} = $object->getUTSMode(); + if ($object->isInitialized('uTSMode') && null !== $object->getUTSMode()) { + $data['UTSMode'] = $object->getUTSMode(); } - if (null !== $object->getUsernsMode()) { - $data->{'UsernsMode'} = $object->getUsernsMode(); + if ($object->isInitialized('usernsMode') && null !== $object->getUsernsMode()) { + $data['UsernsMode'] = $object->getUsernsMode(); } - if (null !== $object->getShmSize()) { - $data->{'ShmSize'} = $object->getShmSize(); + if ($object->isInitialized('shmSize') && null !== $object->getShmSize()) { + $data['ShmSize'] = $object->getShmSize(); } - if (null !== $object->getSysctls()) { - $values_24 = new \stdClass(); - foreach ($object->getSysctls() as $key_3 => $value_24) { - $values_24->{$key_3} = $value_24; + if ($object->isInitialized('sysctls') && null !== $object->getSysctls()) { + $values_27 = array(); + foreach ($object->getSysctls() as $key_4 => $value_27) { + $values_27[$key_4] = $value_27; } - $data->{'Sysctls'} = $values_24; + $data['Sysctls'] = $values_27; } - if (null !== $object->getRuntime()) { - $data->{'Runtime'} = $object->getRuntime(); + if ($object->isInitialized('runtime') && null !== $object->getRuntime()) { + $data['Runtime'] = $object->getRuntime(); } - if (null !== $object->getConsoleSize()) { - $values_25 = []; - foreach ($object->getConsoleSize() as $value_25) { - $values_25[] = $value_25; + if ($object->isInitialized('isolation') && null !== $object->getIsolation()) { + $data['Isolation'] = $object->getIsolation(); + } + if ($object->isInitialized('maskedPaths') && null !== $object->getMaskedPaths()) { + $values_28 = array(); + foreach ($object->getMaskedPaths() as $value_28) { + $values_28[] = $value_28; } - $data->{'ConsoleSize'} = $values_25; + $data['MaskedPaths'] = $values_28; } - if (null !== $object->getIsolation()) { - $data->{'Isolation'} = $object->getIsolation(); + if ($object->isInitialized('readonlyPaths') && null !== $object->getReadonlyPaths()) { + $values_29 = array(); + foreach ($object->getReadonlyPaths() as $value_29) { + $values_29[] = $value_29; + } + $data['ReadonlyPaths'] = $values_29; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\HostConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/IPAMConfigNormalizer.php b/src/Normalizer/IPAMConfigNormalizer.php new file mode 100644 index 00000000..1232d2e9 --- /dev/null +++ b/src/Normalizer/IPAMConfigNormalizer.php @@ -0,0 +1,102 @@ +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(array(), \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 = array()) + { + $data = array(); + 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 = array(); + foreach ($object->getAuxiliaryAddresses() as $key => $value) { + $values[$key] = $value; + } + $data['AuxiliaryAddresses'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\IPAMConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/IPAMNormalizer.php b/src/Normalizer/IPAMNormalizer.php index 086bbc00..c4c937c2 100644 --- a/src/Normalizer/IPAMNormalizer.php +++ b/src/Normalizer/IPAMNormalizer.php @@ -1,101 +1,101 @@ {'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); } - if (property_exists($data, 'Config') && $data->{'Config'} !== null) { - $values = []; - foreach ($data->{'Config'} as $value) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; - } - $values[] = $values_1; + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); + } + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $values = array(); + foreach ($data['Config'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\IPAMConfig', 'json', $context); } $object->setConfig($values); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { - $values_2 = []; - foreach ($data->{'Options'} 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; + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value_1) { + $values_1[$key] = $value_1; } - $object->setOptions($values_2); + $object->setOptions($values_1); + } + elseif (\array_key_exists('Options', $data) && $data['Options'] === null) { + $object->setOptions(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + $data = array(); + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); } - if (null !== $object->getConfig()) { - $values = []; + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $values = array(); foreach ($object->getConfig() as $value) { - $values_1 = new \stdClass(); - foreach ($value as $key => $value_1) { - $values_1->{$key} = $value_1; - } - $values[] = $values_1; + $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'Config'} = $values; + $data['Config'] = $values; } - if (null !== $object->getOptions()) { - $values_2 = []; - foreach ($object->getOptions() as $value_2) { - $values_3 = new \stdClass(); - foreach ($value_2 as $key_1 => $value_3) { - $values_3->{$key_1} = $value_3; - } - $values_2[] = $values_3; + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values_1 = array(); + foreach ($object->getOptions() as $key => $value_1) { + $values_1[$key] = $value_1; } - $data->{'Options'} = $values_2; + $data['Options'] = $values_1; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\IPAM' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/IdResponseNormalizer.php b/src/Normalizer/IdResponseNormalizer.php index 1b185197..c3ff109a 100644 --- a/src/Normalizer/IdResponseNormalizer.php +++ b/src/Normalizer/IdResponseNormalizer.php @@ -1,57 +1,65 @@ {'Id'} !== null) { - $object->setId($data->{'Id'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - + $data = array(); + $data['Id'] = $object->getId(); return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\IdResponse' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ImageDeleteResponseItemNormalizer.php b/src/Normalizer/ImageDeleteResponseItemNormalizer.php index f3592462..9351fe4c 100644 --- a/src/Normalizer/ImageDeleteResponseItemNormalizer.php +++ b/src/Normalizer/ImageDeleteResponseItemNormalizer.php @@ -1,63 +1,76 @@ {'Untagged'} !== null) { - $object->setUntagged($data->{'Untagged'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Deleted') && $data->{'Deleted'} !== null) { - $object->setDeleted($data->{'Deleted'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getUntagged()) { - $data->{'Untagged'} = $object->getUntagged(); + $data = array(); + if ($object->isInitialized('untagged') && null !== $object->getUntagged()) { + $data['Untagged'] = $object->getUntagged(); } - if (null !== $object->getDeleted()) { - $data->{'Deleted'} = $object->getDeleted(); + if ($object->isInitialized('deleted') && null !== $object->getDeleted()) { + $data['Deleted'] = $object->getDeleted(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ImageDeleteResponseItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ImageIDNormalizer.php b/src/Normalizer/ImageIDNormalizer.php index 9bd6d9b5..57e9528a 100644 --- a/src/Normalizer/ImageIDNormalizer.php +++ b/src/Normalizer/ImageIDNormalizer.php @@ -1,57 +1,67 @@ {'ID'} !== null) { - $object->setID($data->{'ID'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $data = array(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ImageID' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ImageInspectMetadataNormalizer.php b/src/Normalizer/ImageInspectMetadataNormalizer.php new file mode 100644 index 00000000..3c0150df --- /dev/null +++ b/src/Normalizer/ImageInspectMetadataNormalizer.php @@ -0,0 +1,67 @@ +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 = array()) + { + $data = array(); + if ($object->isInitialized('lastTagTime') && null !== $object->getLastTagTime()) { + $data['LastTagTime'] = $object->getLastTagTime(); + } + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ImageInspectMetadata' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ImageInspectNormalizer.php b/src/Normalizer/ImageInspectNormalizer.php new file mode 100644 index 00000000..1229e4b7 --- /dev/null +++ b/src/Normalizer/ImageInspectNormalizer.php @@ -0,0 +1,254 @@ +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 = array(); + 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 = array(); + 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('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('ContainerConfig', $data) && $data['ContainerConfig'] !== null) { + $object->setContainerConfig($this->denormalizer->denormalize($data['ContainerConfig'], 'Docker\\API\\Model\\ContainerConfig', 'json', $context)); + } + elseif (\array_key_exists('ContainerConfig', $data) && $data['ContainerConfig'] === null) { + $object->setContainerConfig(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\\ContainerConfig', '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\\GraphDriverData', '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', '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', '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 = array()) + { + $data = array(); + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); + } + if ($object->isInitialized('repoTags') && null !== $object->getRepoTags()) { + $values = array(); + foreach ($object->getRepoTags() as $value) { + $values[] = $value; + } + $data['RepoTags'] = $values; + } + if ($object->isInitialized('repoDigests') && null !== $object->getRepoDigests()) { + $values_1 = array(); + 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('container') && null !== $object->getContainer()) { + $data['Container'] = $object->getContainer(); + } + if ($object->isInitialized('containerConfig') && null !== $object->getContainerConfig()) { + $data['ContainerConfig'] = $this->normalizer->normalize($object->getContainerConfig(), 'json', $context); + } + 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 array('Docker\\API\\Model\\ImageInspect' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ImageInspectRootFSNormalizer.php b/src/Normalizer/ImageInspectRootFSNormalizer.php new file mode 100644 index 00000000..cad63362 --- /dev/null +++ b/src/Normalizer/ImageInspectRootFSNormalizer.php @@ -0,0 +1,82 @@ +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 = array(); + 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 = array()) + { + $data = array(); + $data['Type'] = $object->getType(); + if ($object->isInitialized('layers') && null !== $object->getLayers()) { + $values = array(); + foreach ($object->getLayers() as $value) { + $values[] = $value; + } + $data['Layers'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ImageInspectRootFS' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ImageMetadataNormalizer.php b/src/Normalizer/ImageMetadataNormalizer.php deleted file mode 100644 index b641670c..00000000 --- a/src/Normalizer/ImageMetadataNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'LastTagTime'} !== null) { - $object->setLastTagTime($data->{'LastTagTime'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getLastTagTime()) { - $data->{'LastTagTime'} = $object->getLastTagTime(); - } - - return $data; - } -} diff --git a/src/Normalizer/ImageNormalizer.php b/src/Normalizer/ImageNormalizer.php deleted file mode 100644 index 35c7ed01..00000000 --- a/src/Normalizer/ImageNormalizer.php +++ /dev/null @@ -1,181 +0,0 @@ -{'Id'} !== null) { - $object->setId($data->{'Id'}); - } - if (property_exists($data, 'RepoTags') && $data->{'RepoTags'} !== null) { - $values = []; - foreach ($data->{'RepoTags'} as $value) { - $values[] = $value; - } - $object->setRepoTags($values); - } - if (property_exists($data, 'RepoDigests') && $data->{'RepoDigests'} !== null) { - $values_1 = []; - foreach ($data->{'RepoDigests'} as $value_1) { - $values_1[] = $value_1; - } - $object->setRepoDigests($values_1); - } - if (property_exists($data, 'Parent') && $data->{'Parent'} !== null) { - $object->setParent($data->{'Parent'}); - } - if (property_exists($data, 'Comment') && $data->{'Comment'} !== null) { - $object->setComment($data->{'Comment'}); - } - if (property_exists($data, 'Created') && $data->{'Created'} !== null) { - $object->setCreated($data->{'Created'}); - } - if (property_exists($data, 'Container') && $data->{'Container'} !== null) { - $object->setContainer($data->{'Container'}); - } - if (property_exists($data, 'ContainerConfig') && $data->{'ContainerConfig'} !== null) { - $object->setContainerConfig($this->denormalizer->denormalize($data->{'ContainerConfig'}, 'Docker\\API\\Model\\ContainerConfig', 'json', $context)); - } - if (property_exists($data, 'DockerVersion') && $data->{'DockerVersion'} !== null) { - $object->setDockerVersion($data->{'DockerVersion'}); - } - if (property_exists($data, 'Author') && $data->{'Author'} !== null) { - $object->setAuthor($data->{'Author'}); - } - if (property_exists($data, 'Config') && $data->{'Config'} !== null) { - $object->setConfig($this->denormalizer->denormalize($data->{'Config'}, 'Docker\\API\\Model\\ContainerConfig', 'json', $context)); - } - if (property_exists($data, 'Architecture') && $data->{'Architecture'} !== null) { - $object->setArchitecture($data->{'Architecture'}); - } - if (property_exists($data, 'Os') && $data->{'Os'} !== null) { - $object->setOs($data->{'Os'}); - } - if (property_exists($data, 'OsVersion') && $data->{'OsVersion'} !== null) { - $object->setOsVersion($data->{'OsVersion'}); - } - if (property_exists($data, 'Size') && $data->{'Size'} !== null) { - $object->setSize($data->{'Size'}); - } - if (property_exists($data, 'VirtualSize') && $data->{'VirtualSize'} !== null) { - $object->setVirtualSize($data->{'VirtualSize'}); - } - if (property_exists($data, 'GraphDriver') && $data->{'GraphDriver'} !== null) { - $object->setGraphDriver($this->denormalizer->denormalize($data->{'GraphDriver'}, 'Docker\\API\\Model\\GraphDriverData', 'json', $context)); - } - if (property_exists($data, 'RootFS') && $data->{'RootFS'} !== null) { - $object->setRootFS($this->denormalizer->denormalize($data->{'RootFS'}, 'Docker\\API\\Model\\ImageRootFS', 'json', $context)); - } - if (property_exists($data, 'Metadata') && $data->{'Metadata'} !== null) { - $object->setMetadata($this->denormalizer->denormalize($data->{'Metadata'}, 'Docker\\API\\Model\\ImageMetadata', 'json', $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->getRepoTags()) { - $values = []; - foreach ($object->getRepoTags() as $value) { - $values[] = $value; - } - $data->{'RepoTags'} = $values; - } - if (null !== $object->getRepoDigests()) { - $values_1 = []; - foreach ($object->getRepoDigests() as $value_1) { - $values_1[] = $value_1; - } - $data->{'RepoDigests'} = $values_1; - } - if (null !== $object->getParent()) { - $data->{'Parent'} = $object->getParent(); - } - if (null !== $object->getComment()) { - $data->{'Comment'} = $object->getComment(); - } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); - } - if (null !== $object->getContainer()) { - $data->{'Container'} = $object->getContainer(); - } - if (null !== $object->getContainerConfig()) { - $data->{'ContainerConfig'} = $this->normalizer->normalize($object->getContainerConfig(), 'json', $context); - } - if (null !== $object->getDockerVersion()) { - $data->{'DockerVersion'} = $object->getDockerVersion(); - } - if (null !== $object->getAuthor()) { - $data->{'Author'} = $object->getAuthor(); - } - if (null !== $object->getConfig()) { - $data->{'Config'} = $this->normalizer->normalize($object->getConfig(), 'json', $context); - } - if (null !== $object->getArchitecture()) { - $data->{'Architecture'} = $object->getArchitecture(); - } - if (null !== $object->getOs()) { - $data->{'Os'} = $object->getOs(); - } - if (null !== $object->getOsVersion()) { - $data->{'OsVersion'} = $object->getOsVersion(); - } - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); - } - if (null !== $object->getVirtualSize()) { - $data->{'VirtualSize'} = $object->getVirtualSize(); - } - if (null !== $object->getGraphDriver()) { - $data->{'GraphDriver'} = $this->normalizer->normalize($object->getGraphDriver(), 'json', $context); - } - if (null !== $object->getRootFS()) { - $data->{'RootFS'} = $this->normalizer->normalize($object->getRootFS(), 'json', $context); - } - if (null !== $object->getMetadata()) { - $data->{'Metadata'} = $this->normalizer->normalize($object->getMetadata(), 'json', $context); - } - - return $data; - } -} diff --git a/src/Normalizer/ImageRootFSNormalizer.php b/src/Normalizer/ImageRootFSNormalizer.php deleted file mode 100644 index 75074971..00000000 --- a/src/Normalizer/ImageRootFSNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -{'Type'} !== null) { - $object->setType($data->{'Type'}); - } - if (property_exists($data, 'Layers') && $data->{'Layers'} !== null) { - $values = []; - foreach ($data->{'Layers'} as $value) { - $values[] = $value; - } - $object->setLayers($values); - } - if (property_exists($data, 'BaseLayer') && $data->{'BaseLayer'} !== null) { - $object->setBaseLayer($data->{'BaseLayer'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); - } - if (null !== $object->getLayers()) { - $values = []; - foreach ($object->getLayers() as $value) { - $values[] = $value; - } - $data->{'Layers'} = $values; - } - if (null !== $object->getBaseLayer()) { - $data->{'BaseLayer'} = $object->getBaseLayer(); - } - - return $data; - } -} diff --git a/src/Normalizer/ImageSummaryNormalizer.php b/src/Normalizer/ImageSummaryNormalizer.php index 82706799..7074ae22 100644 --- a/src/Normalizer/ImageSummaryNormalizer.php +++ b/src/Normalizer/ImageSummaryNormalizer.php @@ -1,135 +1,154 @@ {'Id'} !== null) { - $object->setId($data->{'Id'}); + 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 (property_exists($data, 'ParentId') && $data->{'ParentId'} !== null) { - $object->setParentId($data->{'ParentId'}); + if (\array_key_exists('ParentId', $data) && $data['ParentId'] !== null) { + $object->setParentId($data['ParentId']); } - if (property_exists($data, 'RepoTags') && $data->{'RepoTags'} !== null) { - $values = []; - foreach ($data->{'RepoTags'} as $value) { + elseif (\array_key_exists('ParentId', $data) && $data['ParentId'] === null) { + $object->setParentId(null); + } + if (\array_key_exists('RepoTags', $data) && $data['RepoTags'] !== null) { + $values = array(); + foreach ($data['RepoTags'] as $value) { $values[] = $value; } $object->setRepoTags($values); } - if (property_exists($data, 'RepoDigests') && $data->{'RepoDigests'} !== null) { - $values_1 = []; - foreach ($data->{'RepoDigests'} as $value_1) { + elseif (\array_key_exists('RepoTags', $data) && $data['RepoTags'] === null) { + $object->setRepoTags(null); + } + if (\array_key_exists('RepoDigests', $data) && $data['RepoDigests'] !== null) { + $values_1 = array(); + foreach ($data['RepoDigests'] as $value_1) { $values_1[] = $value_1; } $object->setRepoDigests($values_1); } - if (property_exists($data, 'Created') && $data->{'Created'} !== null) { - $object->setCreated($data->{'Created'}); + elseif (\array_key_exists('RepoDigests', $data) && $data['RepoDigests'] === null) { + $object->setRepoDigests(null); } - if (property_exists($data, 'Size') && $data->{'Size'} !== null) { - $object->setSize($data->{'Size'}); + if (\array_key_exists('Created', $data) && $data['Created'] !== null) { + $object->setCreated($data['Created']); } - if (property_exists($data, 'SharedSize') && $data->{'SharedSize'} !== null) { - $object->setSharedSize($data->{'SharedSize'}); + elseif (\array_key_exists('Created', $data) && $data['Created'] === null) { + $object->setCreated(null); } - if (property_exists($data, 'VirtualSize') && $data->{'VirtualSize'} !== null) { - $object->setVirtualSize($data->{'VirtualSize'}); + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); } - if (property_exists($data, 'Labels') && $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('Size', $data) && $data['Size'] === null) { + $object->setSize(null); } - if (property_exists($data, 'Containers') && $data->{'Containers'} !== null) { - $object->setContainers($data->{'Containers'}); + if (\array_key_exists('SharedSize', $data) && $data['SharedSize'] !== null) { + $object->setSharedSize($data['SharedSize']); } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); + elseif (\array_key_exists('SharedSize', $data) && $data['SharedSize'] === null) { + $object->setSharedSize(null); } - if (null !== $object->getParentId()) { - $data->{'ParentId'} = $object->getParentId(); + if (\array_key_exists('VirtualSize', $data) && $data['VirtualSize'] !== null) { + $object->setVirtualSize($data['VirtualSize']); } - if (null !== $object->getRepoTags()) { - $values = []; - foreach ($object->getRepoTags() as $value) { - $values[] = $value; - } - $data->{'RepoTags'} = $values; + elseif (\array_key_exists('VirtualSize', $data) && $data['VirtualSize'] === null) { + $object->setVirtualSize(null); } - if (null !== $object->getRepoDigests()) { - $values_1 = []; - foreach ($object->getRepoDigests() as $value_1) { - $values_1[] = $value_1; + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values_2 = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value_2) { + $values_2[$key] = $value_2; } - $data->{'RepoDigests'} = $values_1; - } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); - } - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); - } - if (null !== $object->getSharedSize()) { - $data->{'SharedSize'} = $object->getSharedSize(); + $object->setLabels($values_2); } - if (null !== $object->getVirtualSize()) { - $data->{'VirtualSize'} = $object->getVirtualSize(); + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); } - if (null !== $object->getLabels()) { - $values_2 = new \stdClass(); - foreach ($object->getLabels() as $key => $value_2) { - $values_2->{$key} = $value_2; - } - $data->{'Labels'} = $values_2; + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $object->setContainers($data['Containers']); } - if (null !== $object->getContainers()) { - $data->{'Containers'} = $object->getContainers(); + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); } - + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) + { + $data = array(); + $data['Id'] = $object->getId(); + $data['ParentId'] = $object->getParentId(); + $values = array(); + foreach ($object->getRepoTags() as $value) { + $values[] = $value; + } + $data['RepoTags'] = $values; + $values_1 = array(); + 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 = array(); + foreach ($object->getLabels() as $key => $value_2) { + $values_2[$key] = $value_2; + } + $data['Labels'] = $values_2; + $data['Containers'] = $object->getContainers(); return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ImageSummary' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ImagesNameHistoryGetResponse200ItemNormalizer.php b/src/Normalizer/ImagesNameHistoryGetResponse200ItemNormalizer.php index 4dbeb964..d77052b4 100644 --- a/src/Normalizer/ImagesNameHistoryGetResponse200ItemNormalizer.php +++ b/src/Normalizer/ImagesNameHistoryGetResponse200ItemNormalizer.php @@ -1,95 +1,108 @@ {'Id'} !== null) { - $object->setId($data->{'Id'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Created') && $data->{'Created'} !== null) { - $object->setCreated($data->{'Created'}); + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); } - if (property_exists($data, 'CreatedBy') && $data->{'CreatedBy'} !== null) { - $object->setCreatedBy($data->{'CreatedBy'}); + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); } - if (property_exists($data, 'Tags') && $data->{'Tags'} !== null) { - $values = []; - foreach ($data->{'Tags'} as $value) { + 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 = array(); + foreach ($data['Tags'] as $value) { $values[] = $value; } $object->setTags($values); } - if (property_exists($data, 'Size') && $data->{'Size'} !== null) { - $object->setSize($data->{'Size'}); - } - if (property_exists($data, 'Comment') && $data->{'Comment'} !== null) { - $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(); + elseif (\array_key_exists('Tags', $data) && $data['Tags'] === null) { + $object->setTags(null); } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); + if (\array_key_exists('Size', $data) && $data['Size'] !== null) { + $object->setSize($data['Size']); } - if (null !== $object->getCreatedBy()) { - $data->{'CreatedBy'} = $object->getCreatedBy(); + elseif (\array_key_exists('Size', $data) && $data['Size'] === null) { + $object->setSize(null); } - if (null !== $object->getTags()) { - $values = []; - foreach ($object->getTags() as $value) { - $values[] = $value; - } - $data->{'Tags'} = $values; + if (\array_key_exists('Comment', $data) && $data['Comment'] !== null) { + $object->setComment($data['Comment']); } - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); + elseif (\array_key_exists('Comment', $data) && $data['Comment'] === null) { + $object->setComment(null); } - if (null !== $object->getComment()) { - $data->{'Comment'} = $object->getComment(); + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) + { + $data = array(); + $data['Id'] = $object->getId(); + $data['Created'] = $object->getCreated(); + $data['CreatedBy'] = $object->getCreatedBy(); + $values = array(); + 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 array('Docker\\API\\Model\\ImagesNameHistoryGetResponse200Item' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ImagesPrunePostResponse200Normalizer.php b/src/Normalizer/ImagesPrunePostResponse200Normalizer.php index 11ea6825..09e8d0a4 100644 --- a/src/Normalizer/ImagesPrunePostResponse200Normalizer.php +++ b/src/Normalizer/ImagesPrunePostResponse200Normalizer.php @@ -1,71 +1,84 @@ {'ImagesDeleted'} !== null) { - $values = []; - foreach ($data->{'ImagesDeleted'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ImagesDeleted', $data) && $data['ImagesDeleted'] !== null) { + $values = array(); + foreach ($data['ImagesDeleted'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\ImageDeleteResponseItem', 'json', $context); } $object->setImagesDeleted($values); } - if (property_exists($data, 'SpaceReclaimed') && $data->{'SpaceReclaimed'} !== null) { - $object->setSpaceReclaimed($data->{'SpaceReclaimed'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getImagesDeleted()) { - $values = []; + $data = array(); + if ($object->isInitialized('imagesDeleted') && null !== $object->getImagesDeleted()) { + $values = array(); foreach ($object->getImagesDeleted() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'ImagesDeleted'} = $values; + $data['ImagesDeleted'] = $values; } - if (null !== $object->getSpaceReclaimed()) { - $data->{'SpaceReclaimed'} = $object->getSpaceReclaimed(); + if ($object->isInitialized('spaceReclaimed') && null !== $object->getSpaceReclaimed()) { + $data['SpaceReclaimed'] = $object->getSpaceReclaimed(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ImagesPrunePostResponse200' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ImagesSearchGetResponse200ItemNormalizer.php b/src/Normalizer/ImagesSearchGetResponse200ItemNormalizer.php index df4cef7f..685899ab 100644 --- a/src/Normalizer/ImagesSearchGetResponse200ItemNormalizer.php +++ b/src/Normalizer/ImagesSearchGetResponse200ItemNormalizer.php @@ -1,81 +1,103 @@ {'description'} !== null) { - $object->setDescription($data->{'description'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'is_official') && $data->{'is_official'} !== null) { - $object->setIsOfficial($data->{'is_official'}); + if (\array_key_exists('description', $data) && $data['description'] !== null) { + $object->setDescription($data['description']); } - if (property_exists($data, 'is_automated') && $data->{'is_automated'} !== null) { - $object->setIsAutomated($data->{'is_automated'}); + elseif (\array_key_exists('description', $data) && $data['description'] === null) { + $object->setDescription(null); } - if (property_exists($data, 'name') && $data->{'name'} !== null) { - $object->setName($data->{'name'}); + if (\array_key_exists('is_official', $data) && $data['is_official'] !== null) { + $object->setIsOfficial($data['is_official']); } - if (property_exists($data, 'star_count') && $data->{'star_count'} !== null) { - $object->setStarCount($data->{'star_count'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getDescription()) { - $data->{'description'} = $object->getDescription(); + $data = array(); + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['description'] = $object->getDescription(); } - if (null !== $object->getIsOfficial()) { - $data->{'is_official'} = $object->getIsOfficial(); + if ($object->isInitialized('isOfficial') && null !== $object->getIsOfficial()) { + $data['is_official'] = $object->getIsOfficial(); } - if (null !== $object->getIsAutomated()) { - $data->{'is_automated'} = $object->getIsAutomated(); + if ($object->isInitialized('isAutomated') && null !== $object->getIsAutomated()) { + $data['is_automated'] = $object->getIsAutomated(); } - if (null !== $object->getName()) { - $data->{'name'} = $object->getName(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); } - if (null !== $object->getStarCount()) { - $data->{'star_count'} = $object->getStarCount(); + if ($object->isInitialized('starCount') && null !== $object->getStarCount()) { + $data['star_count'] = $object->getStarCount(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ImagesSearchGetResponse200Item' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/IndexInfoNormalizer.php b/src/Normalizer/IndexInfoNormalizer.php index 4aaea82e..95438f7d 100644 --- a/src/Normalizer/IndexInfoNormalizer.php +++ b/src/Normalizer/IndexInfoNormalizer.php @@ -1,83 +1,102 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Mirrors') && $data->{'Mirrors'} !== null) { - $values = []; - foreach ($data->{'Mirrors'} as $value) { + if (\array_key_exists('Mirrors', $data) && $data['Mirrors'] !== null) { + $values = array(); + foreach ($data['Mirrors'] as $value) { $values[] = $value; } $object->setMirrors($values); } - if (property_exists($data, 'Secure') && $data->{'Secure'} !== null) { - $object->setSecure($data->{'Secure'}); + elseif (\array_key_exists('Mirrors', $data) && $data['Mirrors'] === null) { + $object->setMirrors(null); } - if (property_exists($data, 'Official') && $data->{'Official'} !== null) { - $object->setOfficial($data->{'Official'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getMirrors()) { - $values = []; + if ($object->isInitialized('mirrors') && null !== $object->getMirrors()) { + $values = array(); foreach ($object->getMirrors() as $value) { $values[] = $value; } - $data->{'Mirrors'} = $values; + $data['Mirrors'] = $values; } - if (null !== $object->getSecure()) { - $data->{'Secure'} = $object->getSecure(); + if ($object->isInitialized('secure') && null !== $object->getSecure()) { + $data['Secure'] = $object->getSecure(); } - if (null !== $object->getOfficial()) { - $data->{'Official'} = $object->getOfficial(); + if ($object->isInitialized('official') && null !== $object->getOfficial()) { + $data['Official'] = $object->getOfficial(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\IndexInfo' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/JaneObjectNormalizer.php b/src/Normalizer/JaneObjectNormalizer.php new file mode 100644 index 00000000..bfd96ad4 --- /dev/null +++ b/src/Normalizer/JaneObjectNormalizer.php @@ -0,0 +1,62 @@ + 'Docker\\API\\Normalizer\\PortNormalizer', 'Docker\\API\\Model\\MountPoint' => 'Docker\\API\\Normalizer\\MountPointNormalizer', 'Docker\\API\\Model\\DeviceMapping' => 'Docker\\API\\Normalizer\\DeviceMappingNormalizer', 'Docker\\API\\Model\\DeviceRequest' => 'Docker\\API\\Normalizer\\DeviceRequestNormalizer', 'Docker\\API\\Model\\ThrottleDevice' => 'Docker\\API\\Normalizer\\ThrottleDeviceNormalizer', 'Docker\\API\\Model\\Mount' => 'Docker\\API\\Normalizer\\MountNormalizer', 'Docker\\API\\Model\\MountBindOptions' => 'Docker\\API\\Normalizer\\MountBindOptionsNormalizer', 'Docker\\API\\Model\\MountVolumeOptions' => 'Docker\\API\\Normalizer\\MountVolumeOptionsNormalizer', 'Docker\\API\\Model\\MountVolumeOptionsDriverConfig' => 'Docker\\API\\Normalizer\\MountVolumeOptionsDriverConfigNormalizer', 'Docker\\API\\Model\\MountTmpfsOptions' => 'Docker\\API\\Normalizer\\MountTmpfsOptionsNormalizer', 'Docker\\API\\Model\\RestartPolicy' => 'Docker\\API\\Normalizer\\RestartPolicyNormalizer', 'Docker\\API\\Model\\Resources' => 'Docker\\API\\Normalizer\\ResourcesNormalizer', 'Docker\\API\\Model\\ResourcesBlkioWeightDeviceItem' => 'Docker\\API\\Normalizer\\ResourcesBlkioWeightDeviceItemNormalizer', 'Docker\\API\\Model\\ResourcesUlimitsItem' => 'Docker\\API\\Normalizer\\ResourcesUlimitsItemNormalizer', 'Docker\\API\\Model\\Limit' => 'Docker\\API\\Normalizer\\LimitNormalizer', 'Docker\\API\\Model\\ResourceObject' => 'Docker\\API\\Normalizer\\ResourceObjectNormalizer', 'Docker\\API\\Model\\GenericResourcesItem' => 'Docker\\API\\Normalizer\\GenericResourcesItemNormalizer', 'Docker\\API\\Model\\GenericResourcesItemNamedResourceSpec' => 'Docker\\API\\Normalizer\\GenericResourcesItemNamedResourceSpecNormalizer', 'Docker\\API\\Model\\GenericResourcesItemDiscreteResourceSpec' => 'Docker\\API\\Normalizer\\GenericResourcesItemDiscreteResourceSpecNormalizer', 'Docker\\API\\Model\\HealthConfig' => 'Docker\\API\\Normalizer\\HealthConfigNormalizer', 'Docker\\API\\Model\\Health' => 'Docker\\API\\Normalizer\\HealthNormalizer', 'Docker\\API\\Model\\HealthcheckResult' => 'Docker\\API\\Normalizer\\HealthcheckResultNormalizer', 'Docker\\API\\Model\\HostConfig' => 'Docker\\API\\Normalizer\\HostConfigNormalizer', 'Docker\\API\\Model\\HostConfigLogConfig' => 'Docker\\API\\Normalizer\\HostConfigLogConfigNormalizer', 'Docker\\API\\Model\\ContainerConfig' => 'Docker\\API\\Normalizer\\ContainerConfigNormalizer', 'Docker\\API\\Model\\NetworkingConfig' => 'Docker\\API\\Normalizer\\NetworkingConfigNormalizer', 'Docker\\API\\Model\\NetworkSettings' => 'Docker\\API\\Normalizer\\NetworkSettingsNormalizer', 'Docker\\API\\Model\\Address' => 'Docker\\API\\Normalizer\\AddressNormalizer', 'Docker\\API\\Model\\PortBinding' => 'Docker\\API\\Normalizer\\PortBindingNormalizer', 'Docker\\API\\Model\\GraphDriverData' => 'Docker\\API\\Normalizer\\GraphDriverDataNormalizer', 'Docker\\API\\Model\\FilesystemChange' => 'Docker\\API\\Normalizer\\FilesystemChangeNormalizer', 'Docker\\API\\Model\\ImageInspect' => 'Docker\\API\\Normalizer\\ImageInspectNormalizer', 'Docker\\API\\Model\\ImageInspectRootFS' => 'Docker\\API\\Normalizer\\ImageInspectRootFSNormalizer', 'Docker\\API\\Model\\ImageInspectMetadata' => 'Docker\\API\\Normalizer\\ImageInspectMetadataNormalizer', 'Docker\\API\\Model\\ImageSummary' => 'Docker\\API\\Normalizer\\ImageSummaryNormalizer', 'Docker\\API\\Model\\AuthConfig' => 'Docker\\API\\Normalizer\\AuthConfigNormalizer', 'Docker\\API\\Model\\ProcessConfig' => 'Docker\\API\\Normalizer\\ProcessConfigNormalizer', 'Docker\\API\\Model\\Volume' => 'Docker\\API\\Normalizer\\VolumeNormalizer', 'Docker\\API\\Model\\VolumeUsageData' => 'Docker\\API\\Normalizer\\VolumeUsageDataNormalizer', 'Docker\\API\\Model\\VolumeCreateOptions' => 'Docker\\API\\Normalizer\\VolumeCreateOptionsNormalizer', 'Docker\\API\\Model\\VolumeListResponse' => 'Docker\\API\\Normalizer\\VolumeListResponseNormalizer', 'Docker\\API\\Model\\Network' => 'Docker\\API\\Normalizer\\NetworkNormalizer', 'Docker\\API\\Model\\IPAM' => 'Docker\\API\\Normalizer\\IPAMNormalizer', 'Docker\\API\\Model\\IPAMConfig' => 'Docker\\API\\Normalizer\\IPAMConfigNormalizer', 'Docker\\API\\Model\\NetworkContainer' => 'Docker\\API\\Normalizer\\NetworkContainerNormalizer', 'Docker\\API\\Model\\BuildInfo' => 'Docker\\API\\Normalizer\\BuildInfoNormalizer', 'Docker\\API\\Model\\BuildCache' => 'Docker\\API\\Normalizer\\BuildCacheNormalizer', 'Docker\\API\\Model\\ImageID' => 'Docker\\API\\Normalizer\\ImageIDNormalizer', 'Docker\\API\\Model\\CreateImageInfo' => 'Docker\\API\\Normalizer\\CreateImageInfoNormalizer', 'Docker\\API\\Model\\PushImageInfo' => 'Docker\\API\\Normalizer\\PushImageInfoNormalizer', 'Docker\\API\\Model\\ErrorDetail' => 'Docker\\API\\Normalizer\\ErrorDetailNormalizer', 'Docker\\API\\Model\\ProgressDetail' => 'Docker\\API\\Normalizer\\ProgressDetailNormalizer', 'Docker\\API\\Model\\ErrorResponse' => 'Docker\\API\\Normalizer\\ErrorResponseNormalizer', 'Docker\\API\\Model\\IdResponse' => 'Docker\\API\\Normalizer\\IdResponseNormalizer', 'Docker\\API\\Model\\EndpointSettings' => 'Docker\\API\\Normalizer\\EndpointSettingsNormalizer', 'Docker\\API\\Model\\EndpointIPAMConfig' => 'Docker\\API\\Normalizer\\EndpointIPAMConfigNormalizer', 'Docker\\API\\Model\\PluginMount' => 'Docker\\API\\Normalizer\\PluginMountNormalizer', 'Docker\\API\\Model\\PluginDevice' => 'Docker\\API\\Normalizer\\PluginDeviceNormalizer', 'Docker\\API\\Model\\PluginEnv' => 'Docker\\API\\Normalizer\\PluginEnvNormalizer', 'Docker\\API\\Model\\PluginInterfaceType' => 'Docker\\API\\Normalizer\\PluginInterfaceTypeNormalizer', 'Docker\\API\\Model\\PluginPrivilege' => 'Docker\\API\\Normalizer\\PluginPrivilegeNormalizer', 'Docker\\API\\Model\\Plugin' => 'Docker\\API\\Normalizer\\PluginNormalizer', 'Docker\\API\\Model\\PluginSettings' => 'Docker\\API\\Normalizer\\PluginSettingsNormalizer', 'Docker\\API\\Model\\PluginConfig' => 'Docker\\API\\Normalizer\\PluginConfigNormalizer', 'Docker\\API\\Model\\PluginConfigInterface' => 'Docker\\API\\Normalizer\\PluginConfigInterfaceNormalizer', 'Docker\\API\\Model\\PluginConfigUser' => 'Docker\\API\\Normalizer\\PluginConfigUserNormalizer', 'Docker\\API\\Model\\PluginConfigNetwork' => 'Docker\\API\\Normalizer\\PluginConfigNetworkNormalizer', 'Docker\\API\\Model\\PluginConfigLinux' => 'Docker\\API\\Normalizer\\PluginConfigLinuxNormalizer', 'Docker\\API\\Model\\PluginConfigArgs' => 'Docker\\API\\Normalizer\\PluginConfigArgsNormalizer', 'Docker\\API\\Model\\PluginConfigRootfs' => 'Docker\\API\\Normalizer\\PluginConfigRootfsNormalizer', 'Docker\\API\\Model\\ObjectVersion' => 'Docker\\API\\Normalizer\\ObjectVersionNormalizer', 'Docker\\API\\Model\\NodeSpec' => 'Docker\\API\\Normalizer\\NodeSpecNormalizer', 'Docker\\API\\Model\\Node' => 'Docker\\API\\Normalizer\\NodeNormalizer', 'Docker\\API\\Model\\NodeDescription' => 'Docker\\API\\Normalizer\\NodeDescriptionNormalizer', 'Docker\\API\\Model\\Platform' => 'Docker\\API\\Normalizer\\PlatformNormalizer', 'Docker\\API\\Model\\EngineDescription' => 'Docker\\API\\Normalizer\\EngineDescriptionNormalizer', 'Docker\\API\\Model\\EngineDescriptionPluginsItem' => 'Docker\\API\\Normalizer\\EngineDescriptionPluginsItemNormalizer', 'Docker\\API\\Model\\TLSInfo' => 'Docker\\API\\Normalizer\\TLSInfoNormalizer', 'Docker\\API\\Model\\NodeStatus' => 'Docker\\API\\Normalizer\\NodeStatusNormalizer', 'Docker\\API\\Model\\ManagerStatus' => 'Docker\\API\\Normalizer\\ManagerStatusNormalizer', 'Docker\\API\\Model\\SwarmSpec' => 'Docker\\API\\Normalizer\\SwarmSpecNormalizer', 'Docker\\API\\Model\\SwarmSpecOrchestration' => 'Docker\\API\\Normalizer\\SwarmSpecOrchestrationNormalizer', 'Docker\\API\\Model\\SwarmSpecRaft' => 'Docker\\API\\Normalizer\\SwarmSpecRaftNormalizer', 'Docker\\API\\Model\\SwarmSpecDispatcher' => 'Docker\\API\\Normalizer\\SwarmSpecDispatcherNormalizer', 'Docker\\API\\Model\\SwarmSpecCAConfig' => 'Docker\\API\\Normalizer\\SwarmSpecCAConfigNormalizer', 'Docker\\API\\Model\\SwarmSpecCAConfigExternalCAsItem' => 'Docker\\API\\Normalizer\\SwarmSpecCAConfigExternalCAsItemNormalizer', 'Docker\\API\\Model\\SwarmSpecEncryptionConfig' => 'Docker\\API\\Normalizer\\SwarmSpecEncryptionConfigNormalizer', 'Docker\\API\\Model\\SwarmSpecTaskDefaults' => 'Docker\\API\\Normalizer\\SwarmSpecTaskDefaultsNormalizer', 'Docker\\API\\Model\\SwarmSpecTaskDefaultsLogDriver' => 'Docker\\API\\Normalizer\\SwarmSpecTaskDefaultsLogDriverNormalizer', 'Docker\\API\\Model\\ClusterInfo' => 'Docker\\API\\Normalizer\\ClusterInfoNormalizer', 'Docker\\API\\Model\\JoinTokens' => 'Docker\\API\\Normalizer\\JoinTokensNormalizer', 'Docker\\API\\Model\\Swarm' => 'Docker\\API\\Normalizer\\SwarmNormalizer', 'Docker\\API\\Model\\TaskSpec' => 'Docker\\API\\Normalizer\\TaskSpecNormalizer', 'Docker\\API\\Model\\TaskSpecPluginSpec' => 'Docker\\API\\Normalizer\\TaskSpecPluginSpecNormalizer', 'Docker\\API\\Model\\TaskSpecContainerSpec' => 'Docker\\API\\Normalizer\\TaskSpecContainerSpecNormalizer', 'Docker\\API\\Model\\TaskSpecContainerSpecPrivileges' => 'Docker\\API\\Normalizer\\TaskSpecContainerSpecPrivilegesNormalizer', 'Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesCredentialSpec' => 'Docker\\API\\Normalizer\\TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer', 'Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesSELinuxContext' => 'Docker\\API\\Normalizer\\TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer', 'Docker\\API\\Model\\TaskSpecContainerSpecDNSConfig' => 'Docker\\API\\Normalizer\\TaskSpecContainerSpecDNSConfigNormalizer', 'Docker\\API\\Model\\TaskSpecContainerSpecSecretsItem' => 'Docker\\API\\Normalizer\\TaskSpecContainerSpecSecretsItemNormalizer', 'Docker\\API\\Model\\TaskSpecContainerSpecSecretsItemFile' => 'Docker\\API\\Normalizer\\TaskSpecContainerSpecSecretsItemFileNormalizer', 'Docker\\API\\Model\\TaskSpecContainerSpecConfigsItem' => 'Docker\\API\\Normalizer\\TaskSpecContainerSpecConfigsItemNormalizer', 'Docker\\API\\Model\\TaskSpecContainerSpecConfigsItemFile' => 'Docker\\API\\Normalizer\\TaskSpecContainerSpecConfigsItemFileNormalizer', 'Docker\\API\\Model\\TaskSpecContainerSpecUlimitsItem' => 'Docker\\API\\Normalizer\\TaskSpecContainerSpecUlimitsItemNormalizer', 'Docker\\API\\Model\\TaskSpecNetworkAttachmentSpec' => 'Docker\\API\\Normalizer\\TaskSpecNetworkAttachmentSpecNormalizer', 'Docker\\API\\Model\\TaskSpecResources' => 'Docker\\API\\Normalizer\\TaskSpecResourcesNormalizer', 'Docker\\API\\Model\\TaskSpecRestartPolicy' => 'Docker\\API\\Normalizer\\TaskSpecRestartPolicyNormalizer', 'Docker\\API\\Model\\TaskSpecPlacement' => 'Docker\\API\\Normalizer\\TaskSpecPlacementNormalizer', 'Docker\\API\\Model\\TaskSpecPlacementPreferencesItem' => 'Docker\\API\\Normalizer\\TaskSpecPlacementPreferencesItemNormalizer', 'Docker\\API\\Model\\TaskSpecPlacementPreferencesItemSpread' => 'Docker\\API\\Normalizer\\TaskSpecPlacementPreferencesItemSpreadNormalizer', 'Docker\\API\\Model\\TaskSpecLogDriver' => 'Docker\\API\\Normalizer\\TaskSpecLogDriverNormalizer', 'Docker\\API\\Model\\Task' => 'Docker\\API\\Normalizer\\TaskNormalizer', 'Docker\\API\\Model\\TaskStatus' => 'Docker\\API\\Normalizer\\TaskStatusNormalizer', 'Docker\\API\\Model\\TaskStatusContainerStatus' => 'Docker\\API\\Normalizer\\TaskStatusContainerStatusNormalizer', 'Docker\\API\\Model\\ServiceSpec' => 'Docker\\API\\Normalizer\\ServiceSpecNormalizer', 'Docker\\API\\Model\\ServiceSpecMode' => 'Docker\\API\\Normalizer\\ServiceSpecModeNormalizer', 'Docker\\API\\Model\\ServiceSpecModeReplicated' => 'Docker\\API\\Normalizer\\ServiceSpecModeReplicatedNormalizer', 'Docker\\API\\Model\\ServiceSpecModeReplicatedJob' => 'Docker\\API\\Normalizer\\ServiceSpecModeReplicatedJobNormalizer', 'Docker\\API\\Model\\ServiceSpecUpdateConfig' => 'Docker\\API\\Normalizer\\ServiceSpecUpdateConfigNormalizer', 'Docker\\API\\Model\\ServiceSpecRollbackConfig' => 'Docker\\API\\Normalizer\\ServiceSpecRollbackConfigNormalizer', 'Docker\\API\\Model\\EndpointPortConfig' => 'Docker\\API\\Normalizer\\EndpointPortConfigNormalizer', 'Docker\\API\\Model\\EndpointSpec' => 'Docker\\API\\Normalizer\\EndpointSpecNormalizer', 'Docker\\API\\Model\\Service' => 'Docker\\API\\Normalizer\\ServiceNormalizer', 'Docker\\API\\Model\\ServiceEndpoint' => 'Docker\\API\\Normalizer\\ServiceEndpointNormalizer', 'Docker\\API\\Model\\ServiceEndpointVirtualIPsItem' => 'Docker\\API\\Normalizer\\ServiceEndpointVirtualIPsItemNormalizer', 'Docker\\API\\Model\\ServiceUpdateStatus' => 'Docker\\API\\Normalizer\\ServiceUpdateStatusNormalizer', 'Docker\\API\\Model\\ServiceServiceStatus' => 'Docker\\API\\Normalizer\\ServiceServiceStatusNormalizer', 'Docker\\API\\Model\\ServiceJobStatus' => 'Docker\\API\\Normalizer\\ServiceJobStatusNormalizer', 'Docker\\API\\Model\\ImageDeleteResponseItem' => 'Docker\\API\\Normalizer\\ImageDeleteResponseItemNormalizer', 'Docker\\API\\Model\\ServiceUpdateResponse' => 'Docker\\API\\Normalizer\\ServiceUpdateResponseNormalizer', 'Docker\\API\\Model\\ContainerSummary' => 'Docker\\API\\Normalizer\\ContainerSummaryNormalizer', 'Docker\\API\\Model\\ContainerSummaryHostConfig' => 'Docker\\API\\Normalizer\\ContainerSummaryHostConfigNormalizer', 'Docker\\API\\Model\\ContainerSummaryNetworkSettings' => 'Docker\\API\\Normalizer\\ContainerSummaryNetworkSettingsNormalizer', 'Docker\\API\\Model\\Driver' => 'Docker\\API\\Normalizer\\DriverNormalizer', 'Docker\\API\\Model\\SecretSpec' => 'Docker\\API\\Normalizer\\SecretSpecNormalizer', 'Docker\\API\\Model\\Secret' => 'Docker\\API\\Normalizer\\SecretNormalizer', 'Docker\\API\\Model\\ConfigSpec' => 'Docker\\API\\Normalizer\\ConfigSpecNormalizer', 'Docker\\API\\Model\\Config' => 'Docker\\API\\Normalizer\\ConfigNormalizer', 'Docker\\API\\Model\\ContainerState' => 'Docker\\API\\Normalizer\\ContainerStateNormalizer', 'Docker\\API\\Model\\ContainerCreateResponse' => 'Docker\\API\\Normalizer\\ContainerCreateResponseNormalizer', 'Docker\\API\\Model\\ContainerWaitResponse' => 'Docker\\API\\Normalizer\\ContainerWaitResponseNormalizer', 'Docker\\API\\Model\\ContainerWaitExitError' => 'Docker\\API\\Normalizer\\ContainerWaitExitErrorNormalizer', 'Docker\\API\\Model\\SystemVersion' => 'Docker\\API\\Normalizer\\SystemVersionNormalizer', 'Docker\\API\\Model\\SystemVersionPlatform' => 'Docker\\API\\Normalizer\\SystemVersionPlatformNormalizer', 'Docker\\API\\Model\\SystemVersionComponentsItem' => 'Docker\\API\\Normalizer\\SystemVersionComponentsItemNormalizer', 'Docker\\API\\Model\\SystemInfo' => 'Docker\\API\\Normalizer\\SystemInfoNormalizer', 'Docker\\API\\Model\\SystemInfoDefaultAddressPoolsItem' => 'Docker\\API\\Normalizer\\SystemInfoDefaultAddressPoolsItemNormalizer', 'Docker\\API\\Model\\PluginsInfo' => 'Docker\\API\\Normalizer\\PluginsInfoNormalizer', 'Docker\\API\\Model\\RegistryServiceConfig' => 'Docker\\API\\Normalizer\\RegistryServiceConfigNormalizer', 'Docker\\API\\Model\\IndexInfo' => 'Docker\\API\\Normalizer\\IndexInfoNormalizer', 'Docker\\API\\Model\\Runtime' => 'Docker\\API\\Normalizer\\RuntimeNormalizer', 'Docker\\API\\Model\\Commit' => 'Docker\\API\\Normalizer\\CommitNormalizer', 'Docker\\API\\Model\\SwarmInfo' => 'Docker\\API\\Normalizer\\SwarmInfoNormalizer', 'Docker\\API\\Model\\PeerNode' => 'Docker\\API\\Normalizer\\PeerNodeNormalizer', 'Docker\\API\\Model\\NetworkAttachmentConfig' => 'Docker\\API\\Normalizer\\NetworkAttachmentConfigNormalizer', 'Docker\\API\\Model\\EventActor' => 'Docker\\API\\Normalizer\\EventActorNormalizer', 'Docker\\API\\Model\\EventMessage' => 'Docker\\API\\Normalizer\\EventMessageNormalizer', 'Docker\\API\\Model\\OCIDescriptor' => 'Docker\\API\\Normalizer\\OCIDescriptorNormalizer', 'Docker\\API\\Model\\OCIPlatform' => 'Docker\\API\\Normalizer\\OCIPlatformNormalizer', 'Docker\\API\\Model\\DistributionInspect' => 'Docker\\API\\Normalizer\\DistributionInspectNormalizer', 'Docker\\API\\Model\\ClusterVolume' => 'Docker\\API\\Normalizer\\ClusterVolumeNormalizer', 'Docker\\API\\Model\\ClusterVolumeInfo' => 'Docker\\API\\Normalizer\\ClusterVolumeInfoNormalizer', 'Docker\\API\\Model\\ClusterVolumePublishStatusItem' => 'Docker\\API\\Normalizer\\ClusterVolumePublishStatusItemNormalizer', 'Docker\\API\\Model\\ClusterVolumeSpec' => 'Docker\\API\\Normalizer\\ClusterVolumeSpecNormalizer', 'Docker\\API\\Model\\ClusterVolumeSpecAccessMode' => 'Docker\\API\\Normalizer\\ClusterVolumeSpecAccessModeNormalizer', 'Docker\\API\\Model\\ClusterVolumeSpecAccessModeSecretsItem' => 'Docker\\API\\Normalizer\\ClusterVolumeSpecAccessModeSecretsItemNormalizer', 'Docker\\API\\Model\\ClusterVolumeSpecAccessModeAccessibilityRequirements' => 'Docker\\API\\Normalizer\\ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer', 'Docker\\API\\Model\\ClusterVolumeSpecAccessModeCapacityRange' => 'Docker\\API\\Normalizer\\ClusterVolumeSpecAccessModeCapacityRangeNormalizer', 'Docker\\API\\Model\\ContainersCreatePostBody' => 'Docker\\API\\Normalizer\\ContainersCreatePostBodyNormalizer', 'Docker\\API\\Model\\ContainersIdJsonGetResponse200' => 'Docker\\API\\Normalizer\\ContainersIdJsonGetResponse200Normalizer', 'Docker\\API\\Model\\ContainersIdTopGetResponse200' => 'Docker\\API\\Normalizer\\ContainersIdTopGetResponse200Normalizer', 'Docker\\API\\Model\\ContainersIdUpdatePostBody' => 'Docker\\API\\Normalizer\\ContainersIdUpdatePostBodyNormalizer', 'Docker\\API\\Model\\ContainersIdUpdatePostResponse200' => 'Docker\\API\\Normalizer\\ContainersIdUpdatePostResponse200Normalizer', 'Docker\\API\\Model\\ContainersPrunePostResponse200' => 'Docker\\API\\Normalizer\\ContainersPrunePostResponse200Normalizer', 'Docker\\API\\Model\\BuildPrunePostResponse200' => 'Docker\\API\\Normalizer\\BuildPrunePostResponse200Normalizer', 'Docker\\API\\Model\\ImagesNameHistoryGetResponse200Item' => 'Docker\\API\\Normalizer\\ImagesNameHistoryGetResponse200ItemNormalizer', 'Docker\\API\\Model\\ImagesSearchGetResponse200Item' => 'Docker\\API\\Normalizer\\ImagesSearchGetResponse200ItemNormalizer', 'Docker\\API\\Model\\ImagesPrunePostResponse200' => 'Docker\\API\\Normalizer\\ImagesPrunePostResponse200Normalizer', 'Docker\\API\\Model\\AuthPostResponse200' => 'Docker\\API\\Normalizer\\AuthPostResponse200Normalizer', 'Docker\\API\\Model\\SystemDfGetResponse200' => 'Docker\\API\\Normalizer\\SystemDfGetResponse200Normalizer', 'Docker\\API\\Model\\ContainersIdExecPostBody' => 'Docker\\API\\Normalizer\\ContainersIdExecPostBodyNormalizer', 'Docker\\API\\Model\\ExecIdStartPostBody' => 'Docker\\API\\Normalizer\\ExecIdStartPostBodyNormalizer', 'Docker\\API\\Model\\ExecIdJsonGetResponse200' => 'Docker\\API\\Normalizer\\ExecIdJsonGetResponse200Normalizer', 'Docker\\API\\Model\\VolumesNamePutBody' => 'Docker\\API\\Normalizer\\VolumesNamePutBodyNormalizer', 'Docker\\API\\Model\\VolumesPrunePostResponse200' => 'Docker\\API\\Normalizer\\VolumesPrunePostResponse200Normalizer', 'Docker\\API\\Model\\NetworksCreatePostBody' => 'Docker\\API\\Normalizer\\NetworksCreatePostBodyNormalizer', 'Docker\\API\\Model\\NetworksCreatePostResponse201' => 'Docker\\API\\Normalizer\\NetworksCreatePostResponse201Normalizer', 'Docker\\API\\Model\\NetworksIdConnectPostBody' => 'Docker\\API\\Normalizer\\NetworksIdConnectPostBodyNormalizer', 'Docker\\API\\Model\\NetworksIdDisconnectPostBody' => 'Docker\\API\\Normalizer\\NetworksIdDisconnectPostBodyNormalizer', 'Docker\\API\\Model\\NetworksPrunePostResponse200' => 'Docker\\API\\Normalizer\\NetworksPrunePostResponse200Normalizer', 'Docker\\API\\Model\\SwarmInitPostBody' => 'Docker\\API\\Normalizer\\SwarmInitPostBodyNormalizer', 'Docker\\API\\Model\\SwarmJoinPostBody' => 'Docker\\API\\Normalizer\\SwarmJoinPostBodyNormalizer', 'Docker\\API\\Model\\SwarmUnlockkeyGetResponse200' => 'Docker\\API\\Normalizer\\SwarmUnlockkeyGetResponse200Normalizer', 'Docker\\API\\Model\\SwarmUnlockPostBody' => 'Docker\\API\\Normalizer\\SwarmUnlockPostBodyNormalizer', 'Docker\\API\\Model\\ServicesCreatePostBody' => 'Docker\\API\\Normalizer\\ServicesCreatePostBodyNormalizer', 'Docker\\API\\Model\\ServicesCreatePostResponse201' => 'Docker\\API\\Normalizer\\ServicesCreatePostResponse201Normalizer', 'Docker\\API\\Model\\ServicesIdUpdatePostBody' => 'Docker\\API\\Normalizer\\ServicesIdUpdatePostBodyNormalizer', 'Docker\\API\\Model\\SecretsCreatePostBody' => 'Docker\\API\\Normalizer\\SecretsCreatePostBodyNormalizer', 'Docker\\API\\Model\\ConfigsCreatePostBody' => 'Docker\\API\\Normalizer\\ConfigsCreatePostBodyNormalizer', '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => '\\Docker\\API\\Runtime\\Normalizer\\ReferenceNormalizer'), $normalizersCache = array(); + public function supportsDenormalization($data, $type, $format = null, array $context = array()) : bool + { + return array_key_exists($type, $this->normalizers); + } + public function supportsNormalization($data, $format = null, array $context = array()) : 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 = array()) + { + $normalizerClass = $this->normalizers[get_class($object)]; + $normalizer = $this->getNormalizer($normalizerClass); + return $normalizer->normalize($object, $format, $context); + } + /** + * @return mixed + */ + public function denormalize($data, $class, $format = null, array $context = array()) + { + $denormalizerClass = $this->normalizers[$class]; + $denormalizer = $this->getNormalizer($denormalizerClass); + return $denormalizer->denormalize($data, $class, $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 array('Docker\\API\\Model\\Port' => false, 'Docker\\API\\Model\\MountPoint' => false, 'Docker\\API\\Model\\DeviceMapping' => false, 'Docker\\API\\Model\\DeviceRequest' => false, 'Docker\\API\\Model\\ThrottleDevice' => false, 'Docker\\API\\Model\\Mount' => false, 'Docker\\API\\Model\\MountBindOptions' => false, 'Docker\\API\\Model\\MountVolumeOptions' => false, 'Docker\\API\\Model\\MountVolumeOptionsDriverConfig' => false, 'Docker\\API\\Model\\MountTmpfsOptions' => false, 'Docker\\API\\Model\\RestartPolicy' => false, 'Docker\\API\\Model\\Resources' => false, 'Docker\\API\\Model\\ResourcesBlkioWeightDeviceItem' => false, 'Docker\\API\\Model\\ResourcesUlimitsItem' => false, 'Docker\\API\\Model\\Limit' => false, 'Docker\\API\\Model\\ResourceObject' => false, 'Docker\\API\\Model\\GenericResourcesItem' => false, 'Docker\\API\\Model\\GenericResourcesItemNamedResourceSpec' => false, 'Docker\\API\\Model\\GenericResourcesItemDiscreteResourceSpec' => false, 'Docker\\API\\Model\\HealthConfig' => false, 'Docker\\API\\Model\\Health' => false, 'Docker\\API\\Model\\HealthcheckResult' => false, 'Docker\\API\\Model\\HostConfig' => false, 'Docker\\API\\Model\\HostConfigLogConfig' => false, 'Docker\\API\\Model\\ContainerConfig' => false, 'Docker\\API\\Model\\NetworkingConfig' => false, 'Docker\\API\\Model\\NetworkSettings' => false, 'Docker\\API\\Model\\Address' => false, 'Docker\\API\\Model\\PortBinding' => false, 'Docker\\API\\Model\\GraphDriverData' => false, 'Docker\\API\\Model\\FilesystemChange' => false, 'Docker\\API\\Model\\ImageInspect' => false, 'Docker\\API\\Model\\ImageInspectRootFS' => false, 'Docker\\API\\Model\\ImageInspectMetadata' => false, 'Docker\\API\\Model\\ImageSummary' => false, 'Docker\\API\\Model\\AuthConfig' => false, 'Docker\\API\\Model\\ProcessConfig' => false, 'Docker\\API\\Model\\Volume' => false, 'Docker\\API\\Model\\VolumeUsageData' => false, 'Docker\\API\\Model\\VolumeCreateOptions' => false, 'Docker\\API\\Model\\VolumeListResponse' => false, 'Docker\\API\\Model\\Network' => false, 'Docker\\API\\Model\\IPAM' => false, 'Docker\\API\\Model\\IPAMConfig' => false, 'Docker\\API\\Model\\NetworkContainer' => false, 'Docker\\API\\Model\\BuildInfo' => false, 'Docker\\API\\Model\\BuildCache' => false, 'Docker\\API\\Model\\ImageID' => false, 'Docker\\API\\Model\\CreateImageInfo' => false, 'Docker\\API\\Model\\PushImageInfo' => false, 'Docker\\API\\Model\\ErrorDetail' => false, 'Docker\\API\\Model\\ProgressDetail' => false, 'Docker\\API\\Model\\ErrorResponse' => false, 'Docker\\API\\Model\\IdResponse' => false, 'Docker\\API\\Model\\EndpointSettings' => false, 'Docker\\API\\Model\\EndpointIPAMConfig' => false, 'Docker\\API\\Model\\PluginMount' => false, 'Docker\\API\\Model\\PluginDevice' => false, 'Docker\\API\\Model\\PluginEnv' => false, 'Docker\\API\\Model\\PluginInterfaceType' => false, 'Docker\\API\\Model\\PluginPrivilege' => false, 'Docker\\API\\Model\\Plugin' => false, 'Docker\\API\\Model\\PluginSettings' => false, 'Docker\\API\\Model\\PluginConfig' => false, 'Docker\\API\\Model\\PluginConfigInterface' => false, 'Docker\\API\\Model\\PluginConfigUser' => false, 'Docker\\API\\Model\\PluginConfigNetwork' => false, 'Docker\\API\\Model\\PluginConfigLinux' => false, 'Docker\\API\\Model\\PluginConfigArgs' => false, 'Docker\\API\\Model\\PluginConfigRootfs' => false, 'Docker\\API\\Model\\ObjectVersion' => false, 'Docker\\API\\Model\\NodeSpec' => false, 'Docker\\API\\Model\\Node' => false, 'Docker\\API\\Model\\NodeDescription' => false, 'Docker\\API\\Model\\Platform' => false, 'Docker\\API\\Model\\EngineDescription' => false, 'Docker\\API\\Model\\EngineDescriptionPluginsItem' => false, 'Docker\\API\\Model\\TLSInfo' => false, 'Docker\\API\\Model\\NodeStatus' => false, 'Docker\\API\\Model\\ManagerStatus' => false, 'Docker\\API\\Model\\SwarmSpec' => false, 'Docker\\API\\Model\\SwarmSpecOrchestration' => false, 'Docker\\API\\Model\\SwarmSpecRaft' => false, 'Docker\\API\\Model\\SwarmSpecDispatcher' => false, 'Docker\\API\\Model\\SwarmSpecCAConfig' => false, 'Docker\\API\\Model\\SwarmSpecCAConfigExternalCAsItem' => false, 'Docker\\API\\Model\\SwarmSpecEncryptionConfig' => false, 'Docker\\API\\Model\\SwarmSpecTaskDefaults' => false, 'Docker\\API\\Model\\SwarmSpecTaskDefaultsLogDriver' => false, 'Docker\\API\\Model\\ClusterInfo' => false, 'Docker\\API\\Model\\JoinTokens' => false, 'Docker\\API\\Model\\Swarm' => false, 'Docker\\API\\Model\\TaskSpec' => false, 'Docker\\API\\Model\\TaskSpecPluginSpec' => false, 'Docker\\API\\Model\\TaskSpecContainerSpec' => false, 'Docker\\API\\Model\\TaskSpecContainerSpecPrivileges' => false, 'Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesCredentialSpec' => false, 'Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesSELinuxContext' => false, 'Docker\\API\\Model\\TaskSpecContainerSpecDNSConfig' => false, 'Docker\\API\\Model\\TaskSpecContainerSpecSecretsItem' => false, 'Docker\\API\\Model\\TaskSpecContainerSpecSecretsItemFile' => false, 'Docker\\API\\Model\\TaskSpecContainerSpecConfigsItem' => false, 'Docker\\API\\Model\\TaskSpecContainerSpecConfigsItemFile' => false, 'Docker\\API\\Model\\TaskSpecContainerSpecUlimitsItem' => false, 'Docker\\API\\Model\\TaskSpecNetworkAttachmentSpec' => false, 'Docker\\API\\Model\\TaskSpecResources' => false, 'Docker\\API\\Model\\TaskSpecRestartPolicy' => false, 'Docker\\API\\Model\\TaskSpecPlacement' => false, 'Docker\\API\\Model\\TaskSpecPlacementPreferencesItem' => false, 'Docker\\API\\Model\\TaskSpecPlacementPreferencesItemSpread' => false, 'Docker\\API\\Model\\TaskSpecLogDriver' => false, 'Docker\\API\\Model\\Task' => false, 'Docker\\API\\Model\\TaskStatus' => false, 'Docker\\API\\Model\\TaskStatusContainerStatus' => false, 'Docker\\API\\Model\\ServiceSpec' => false, 'Docker\\API\\Model\\ServiceSpecMode' => false, 'Docker\\API\\Model\\ServiceSpecModeReplicated' => false, 'Docker\\API\\Model\\ServiceSpecModeReplicatedJob' => false, 'Docker\\API\\Model\\ServiceSpecUpdateConfig' => false, 'Docker\\API\\Model\\ServiceSpecRollbackConfig' => false, 'Docker\\API\\Model\\EndpointPortConfig' => false, 'Docker\\API\\Model\\EndpointSpec' => false, 'Docker\\API\\Model\\Service' => false, 'Docker\\API\\Model\\ServiceEndpoint' => false, 'Docker\\API\\Model\\ServiceEndpointVirtualIPsItem' => false, 'Docker\\API\\Model\\ServiceUpdateStatus' => false, 'Docker\\API\\Model\\ServiceServiceStatus' => false, 'Docker\\API\\Model\\ServiceJobStatus' => false, 'Docker\\API\\Model\\ImageDeleteResponseItem' => false, 'Docker\\API\\Model\\ServiceUpdateResponse' => false, 'Docker\\API\\Model\\ContainerSummary' => false, 'Docker\\API\\Model\\ContainerSummaryHostConfig' => false, 'Docker\\API\\Model\\ContainerSummaryNetworkSettings' => false, 'Docker\\API\\Model\\Driver' => false, 'Docker\\API\\Model\\SecretSpec' => false, 'Docker\\API\\Model\\Secret' => false, 'Docker\\API\\Model\\ConfigSpec' => false, 'Docker\\API\\Model\\Config' => false, 'Docker\\API\\Model\\ContainerState' => false, 'Docker\\API\\Model\\ContainerCreateResponse' => false, 'Docker\\API\\Model\\ContainerWaitResponse' => false, 'Docker\\API\\Model\\ContainerWaitExitError' => false, 'Docker\\API\\Model\\SystemVersion' => false, 'Docker\\API\\Model\\SystemVersionPlatform' => false, 'Docker\\API\\Model\\SystemVersionComponentsItem' => false, 'Docker\\API\\Model\\SystemInfo' => false, 'Docker\\API\\Model\\SystemInfoDefaultAddressPoolsItem' => false, 'Docker\\API\\Model\\PluginsInfo' => false, 'Docker\\API\\Model\\RegistryServiceConfig' => false, 'Docker\\API\\Model\\IndexInfo' => false, 'Docker\\API\\Model\\Runtime' => false, 'Docker\\API\\Model\\Commit' => false, 'Docker\\API\\Model\\SwarmInfo' => false, 'Docker\\API\\Model\\PeerNode' => false, 'Docker\\API\\Model\\NetworkAttachmentConfig' => false, 'Docker\\API\\Model\\EventActor' => false, 'Docker\\API\\Model\\EventMessage' => false, 'Docker\\API\\Model\\OCIDescriptor' => false, 'Docker\\API\\Model\\OCIPlatform' => false, 'Docker\\API\\Model\\DistributionInspect' => false, 'Docker\\API\\Model\\ClusterVolume' => false, 'Docker\\API\\Model\\ClusterVolumeInfo' => false, 'Docker\\API\\Model\\ClusterVolumePublishStatusItem' => false, 'Docker\\API\\Model\\ClusterVolumeSpec' => false, 'Docker\\API\\Model\\ClusterVolumeSpecAccessMode' => false, 'Docker\\API\\Model\\ClusterVolumeSpecAccessModeSecretsItem' => false, 'Docker\\API\\Model\\ClusterVolumeSpecAccessModeAccessibilityRequirements' => false, 'Docker\\API\\Model\\ClusterVolumeSpecAccessModeCapacityRange' => false, 'Docker\\API\\Model\\ContainersCreatePostBody' => false, 'Docker\\API\\Model\\ContainersIdJsonGetResponse200' => false, 'Docker\\API\\Model\\ContainersIdTopGetResponse200' => false, 'Docker\\API\\Model\\ContainersIdUpdatePostBody' => false, 'Docker\\API\\Model\\ContainersIdUpdatePostResponse200' => false, 'Docker\\API\\Model\\ContainersPrunePostResponse200' => false, 'Docker\\API\\Model\\BuildPrunePostResponse200' => false, 'Docker\\API\\Model\\ImagesNameHistoryGetResponse200Item' => false, 'Docker\\API\\Model\\ImagesSearchGetResponse200Item' => false, 'Docker\\API\\Model\\ImagesPrunePostResponse200' => false, 'Docker\\API\\Model\\AuthPostResponse200' => false, 'Docker\\API\\Model\\SystemDfGetResponse200' => false, 'Docker\\API\\Model\\ContainersIdExecPostBody' => false, 'Docker\\API\\Model\\ExecIdStartPostBody' => false, 'Docker\\API\\Model\\ExecIdJsonGetResponse200' => false, 'Docker\\API\\Model\\VolumesNamePutBody' => false, 'Docker\\API\\Model\\VolumesPrunePostResponse200' => false, 'Docker\\API\\Model\\NetworksCreatePostBody' => false, 'Docker\\API\\Model\\NetworksCreatePostResponse201' => false, 'Docker\\API\\Model\\NetworksIdConnectPostBody' => false, 'Docker\\API\\Model\\NetworksIdDisconnectPostBody' => false, 'Docker\\API\\Model\\NetworksPrunePostResponse200' => false, 'Docker\\API\\Model\\SwarmInitPostBody' => false, 'Docker\\API\\Model\\SwarmJoinPostBody' => false, 'Docker\\API\\Model\\SwarmUnlockkeyGetResponse200' => false, 'Docker\\API\\Model\\SwarmUnlockPostBody' => false, 'Docker\\API\\Model\\ServicesCreatePostBody' => false, 'Docker\\API\\Model\\ServicesCreatePostResponse201' => false, 'Docker\\API\\Model\\ServicesIdUpdatePostBody' => false, 'Docker\\API\\Model\\SecretsCreatePostBody' => false, 'Docker\\API\\Model\\ConfigsCreatePostBody' => false, '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/JoinTokensNormalizer.php b/src/Normalizer/JoinTokensNormalizer.php index fab6c93f..dc140574 100644 --- a/src/Normalizer/JoinTokensNormalizer.php +++ b/src/Normalizer/JoinTokensNormalizer.php @@ -1,63 +1,76 @@ {'Worker'} !== null) { - $object->setWorker($data->{'Worker'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Manager') && $data->{'Manager'} !== null) { - $object->setManager($data->{'Manager'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getWorker()) { - $data->{'Worker'} = $object->getWorker(); + $data = array(); + if ($object->isInitialized('worker') && null !== $object->getWorker()) { + $data['Worker'] = $object->getWorker(); } - if (null !== $object->getManager()) { - $data->{'Manager'} = $object->getManager(); + if ($object->isInitialized('manager') && null !== $object->getManager()) { + $data['Manager'] = $object->getManager(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\JoinTokens' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/LimitNormalizer.php b/src/Normalizer/LimitNormalizer.php new file mode 100644 index 00000000..91c1c56d --- /dev/null +++ b/src/Normalizer/LimitNormalizer.php @@ -0,0 +1,85 @@ +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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\Limit' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ManagerStatusNormalizer.php b/src/Normalizer/ManagerStatusNormalizer.php index ac2c9bf9..728a8f74 100644 --- a/src/Normalizer/ManagerStatusNormalizer.php +++ b/src/Normalizer/ManagerStatusNormalizer.php @@ -1,69 +1,85 @@ {'Leader'} !== null) { - $object->setLeader($data->{'Leader'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Reachability') && $data->{'Reachability'} !== null) { - $object->setReachability($data->{'Reachability'}); + if (\array_key_exists('Leader', $data) && $data['Leader'] !== null) { + $object->setLeader($data['Leader']); } - if (property_exists($data, 'Addr') && $data->{'Addr'} !== null) { - $object->setAddr($data->{'Addr'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getLeader()) { - $data->{'Leader'} = $object->getLeader(); + $data = array(); + if ($object->isInitialized('leader') && null !== $object->getLeader()) { + $data['Leader'] = $object->getLeader(); } - if (null !== $object->getReachability()) { - $data->{'Reachability'} = $object->getReachability(); + if ($object->isInitialized('reachability') && null !== $object->getReachability()) { + $data['Reachability'] = $object->getReachability(); } - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ManagerStatus' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/MountBindOptionsNormalizer.php b/src/Normalizer/MountBindOptionsNormalizer.php index 1d1d1f79..aa1ee3da 100644 --- a/src/Normalizer/MountBindOptionsNormalizer.php +++ b/src/Normalizer/MountBindOptionsNormalizer.php @@ -1,57 +1,85 @@ {'Propagation'} !== null) { - $object->setPropagation($data->{'Propagation'}); + 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); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getPropagation()) { - $data->{'Propagation'} = $object->getPropagation(); + $data = array(); + 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(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\MountBindOptions' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/MountNormalizer.php b/src/Normalizer/MountNormalizer.php index e2cb656e..dce8e11c 100644 --- a/src/Normalizer/MountNormalizer.php +++ b/src/Normalizer/MountNormalizer.php @@ -1,99 +1,130 @@ {'Target'} !== null) { - $object->setTarget($data->{'Target'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Source') && $data->{'Source'} !== null) { - $object->setSource($data->{'Source'}); + if (\array_key_exists('Target', $data) && $data['Target'] !== null) { + $object->setTarget($data['Target']); } - if (property_exists($data, 'Type') && $data->{'Type'} !== null) { - $object->setType($data->{'Type'}); + elseif (\array_key_exists('Target', $data) && $data['Target'] === null) { + $object->setTarget(null); } - if (property_exists($data, 'ReadOnly') && $data->{'ReadOnly'} !== null) { - $object->setReadOnly($data->{'ReadOnly'}); + if (\array_key_exists('Source', $data) && $data['Source'] !== null) { + $object->setSource($data['Source']); } - if (property_exists($data, 'Consistency') && $data->{'Consistency'} !== null) { - $object->setConsistency($data->{'Consistency'}); + elseif (\array_key_exists('Source', $data) && $data['Source'] === null) { + $object->setSource(null); } - if (property_exists($data, 'BindOptions') && $data->{'BindOptions'} !== null) { - $object->setBindOptions($this->denormalizer->denormalize($data->{'BindOptions'}, 'Docker\\API\\Model\\MountBindOptions', 'json', $context)); + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); } - if (property_exists($data, 'VolumeOptions') && $data->{'VolumeOptions'} !== null) { - $object->setVolumeOptions($this->denormalizer->denormalize($data->{'VolumeOptions'}, 'Docker\\API\\Model\\MountVolumeOptions', 'json', $context)); + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); } - if (property_exists($data, 'TmpfsOptions') && $data->{'TmpfsOptions'} !== null) { - $object->setTmpfsOptions($this->denormalizer->denormalize($data->{'TmpfsOptions'}, 'Docker\\API\\Model\\MountTmpfsOptions', 'json', $context)); + 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', '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', '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', 'json', $context)); + } + elseif (\array_key_exists('TmpfsOptions', $data) && $data['TmpfsOptions'] === null) { + $object->setTmpfsOptions(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getTarget()) { - $data->{'Target'} = $object->getTarget(); + $data = array(); + if ($object->isInitialized('target') && null !== $object->getTarget()) { + $data['Target'] = $object->getTarget(); } - if (null !== $object->getSource()) { - $data->{'Source'} = $object->getSource(); + if ($object->isInitialized('source') && null !== $object->getSource()) { + $data['Source'] = $object->getSource(); } - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); } - if (null !== $object->getReadOnly()) { - $data->{'ReadOnly'} = $object->getReadOnly(); + if ($object->isInitialized('readOnly') && null !== $object->getReadOnly()) { + $data['ReadOnly'] = $object->getReadOnly(); } - if (null !== $object->getConsistency()) { - $data->{'Consistency'} = $object->getConsistency(); + if ($object->isInitialized('consistency') && null !== $object->getConsistency()) { + $data['Consistency'] = $object->getConsistency(); } - if (null !== $object->getBindOptions()) { - $data->{'BindOptions'} = $this->normalizer->normalize($object->getBindOptions(), 'json', $context); + if ($object->isInitialized('bindOptions') && null !== $object->getBindOptions()) { + $data['BindOptions'] = $this->normalizer->normalize($object->getBindOptions(), 'json', $context); } - if (null !== $object->getVolumeOptions()) { - $data->{'VolumeOptions'} = $this->normalizer->normalize($object->getVolumeOptions(), 'json', $context); + if ($object->isInitialized('volumeOptions') && null !== $object->getVolumeOptions()) { + $data['VolumeOptions'] = $this->normalizer->normalize($object->getVolumeOptions(), 'json', $context); } - if (null !== $object->getTmpfsOptions()) { - $data->{'TmpfsOptions'} = $this->normalizer->normalize($object->getTmpfsOptions(), '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 array('Docker\\API\\Model\\Mount' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/MountPointNormalizer.php b/src/Normalizer/MountPointNormalizer.php index 5a5f2cf7..1803b4a8 100644 --- a/src/Normalizer/MountPointNormalizer.php +++ b/src/Normalizer/MountPointNormalizer.php @@ -1,99 +1,130 @@ {'Type'} !== null) { - $object->setType($data->{'Type'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (\array_key_exists('Type', $data) && $data['Type'] !== null) { + $object->setType($data['Type']); } - if (property_exists($data, 'Source') && $data->{'Source'} !== null) { - $object->setSource($data->{'Source'}); + elseif (\array_key_exists('Type', $data) && $data['Type'] === null) { + $object->setType(null); } - if (property_exists($data, 'Destination') && $data->{'Destination'} !== null) { - $object->setDestination($data->{'Destination'}); + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($data->{'Mode'}); + if (\array_key_exists('Source', $data) && $data['Source'] !== null) { + $object->setSource($data['Source']); } - if (property_exists($data, 'RW') && $data->{'RW'} !== null) { - $object->setRW($data->{'RW'}); + elseif (\array_key_exists('Source', $data) && $data['Source'] === null) { + $object->setSource(null); } - if (property_exists($data, 'Propagation') && $data->{'Propagation'} !== null) { - $object->setPropagation($data->{'Propagation'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + $data = array(); + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getSource()) { - $data->{'Source'} = $object->getSource(); + if ($object->isInitialized('source') && null !== $object->getSource()) { + $data['Source'] = $object->getSource(); } - if (null !== $object->getDestination()) { - $data->{'Destination'} = $object->getDestination(); + if ($object->isInitialized('destination') && null !== $object->getDestination()) { + $data['Destination'] = $object->getDestination(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $object->getMode(); + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); } - if (null !== $object->getRW()) { - $data->{'RW'} = $object->getRW(); + if ($object->isInitialized('rW') && null !== $object->getRW()) { + $data['RW'] = $object->getRW(); } - if (null !== $object->getPropagation()) { - $data->{'Propagation'} = $object->getPropagation(); + if ($object->isInitialized('propagation') && null !== $object->getPropagation()) { + $data['Propagation'] = $object->getPropagation(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\MountPoint' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/MountTmpfsOptionsNormalizer.php b/src/Normalizer/MountTmpfsOptionsNormalizer.php index fd9f9347..d1342daf 100644 --- a/src/Normalizer/MountTmpfsOptionsNormalizer.php +++ b/src/Normalizer/MountTmpfsOptionsNormalizer.php @@ -1,63 +1,76 @@ {'SizeBytes'} !== null) { - $object->setSizeBytes($data->{'SizeBytes'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($data->{'Mode'}); + 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); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getSizeBytes()) { - $data->{'SizeBytes'} = $object->getSizeBytes(); + $data = array(); + if ($object->isInitialized('sizeBytes') && null !== $object->getSizeBytes()) { + $data['SizeBytes'] = $object->getSizeBytes(); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $object->getMode(); + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\MountTmpfsOptions' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/MountVolumeOptionsDriverConfigNormalizer.php b/src/Normalizer/MountVolumeOptionsDriverConfigNormalizer.php index 0297f51e..85f5ecff 100644 --- a/src/Normalizer/MountVolumeOptionsDriverConfigNormalizer.php +++ b/src/Normalizer/MountVolumeOptionsDriverConfigNormalizer.php @@ -1,71 +1,84 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject(array(), \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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getOptions()) { - $values = new \stdClass(); + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = array(); foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Options'} = $values; + $data['Options'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\MountVolumeOptionsDriverConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/MountVolumeOptionsNormalizer.php b/src/Normalizer/MountVolumeOptionsNormalizer.php index cb7a42ac..f12ee8b1 100644 --- a/src/Normalizer/MountVolumeOptionsNormalizer.php +++ b/src/Normalizer/MountVolumeOptionsNormalizer.php @@ -1,77 +1,93 @@ {'NoCopy'} !== null) { - $object->setNoCopy($data->{'NoCopy'}); + 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 (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'DriverConfig') && $data->{'DriverConfig'} !== null) { - $object->setDriverConfig($this->denormalizer->denormalize($data->{'DriverConfig'}, 'Docker\\API\\Model\\MountVolumeOptionsDriverConfig', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('DriverConfig', $data) && $data['DriverConfig'] === null) { + $object->setDriverConfig(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getNoCopy()) { - $data->{'NoCopy'} = $object->getNoCopy(); + $data = array(); + if ($object->isInitialized('noCopy') && null !== $object->getNoCopy()) { + $data['NoCopy'] = $object->getNoCopy(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getDriverConfig()) { - $data->{'DriverConfig'} = $this->normalizer->normalize($object->getDriverConfig(), 'json', $context); + if ($object->isInitialized('driverConfig') && null !== $object->getDriverConfig()) { + $data['DriverConfig'] = $this->normalizer->normalize($object->getDriverConfig(), 'json', $context); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\MountVolumeOptions' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NetworkAttachmentConfigNormalizer.php b/src/Normalizer/NetworkAttachmentConfigNormalizer.php new file mode 100644 index 00000000..219324b5 --- /dev/null +++ b/src/Normalizer/NetworkAttachmentConfigNormalizer.php @@ -0,0 +1,101 @@ +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 = array(); + 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(array(), \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 = array()) + { + $data = array(); + if ($object->isInitialized('target') && null !== $object->getTarget()) { + $data['Target'] = $object->getTarget(); + } + if ($object->isInitialized('aliases') && null !== $object->getAliases()) { + $values = array(); + foreach ($object->getAliases() as $value) { + $values[] = $value; + } + $data['Aliases'] = $values; + } + if ($object->isInitialized('driverOpts') && null !== $object->getDriverOpts()) { + $values_1 = array(); + foreach ($object->getDriverOpts() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $data['DriverOpts'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\NetworkAttachmentConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NetworkContainerNormalizer.php b/src/Normalizer/NetworkContainerNormalizer.php index d1bc94a4..70d5bd71 100644 --- a/src/Normalizer/NetworkContainerNormalizer.php +++ b/src/Normalizer/NetworkContainerNormalizer.php @@ -1,81 +1,103 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'EndpointID') && $data->{'EndpointID'} !== null) { - $object->setEndpointID($data->{'EndpointID'}); + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'MacAddress') && $data->{'MacAddress'} !== null) { - $object->setMacAddress($data->{'MacAddress'}); + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); } - if (property_exists($data, 'IPv4Address') && $data->{'IPv4Address'} !== null) { - $object->setIPv4Address($data->{'IPv4Address'}); + if (\array_key_exists('EndpointID', $data) && $data['EndpointID'] !== null) { + $object->setEndpointID($data['EndpointID']); } - if (property_exists($data, 'IPv6Address') && $data->{'IPv6Address'} !== null) { - $object->setIPv6Address($data->{'IPv6Address'}); + 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; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getEndpointID()) { - $data->{'EndpointID'} = $object->getEndpointID(); + if ($object->isInitialized('endpointID') && null !== $object->getEndpointID()) { + $data['EndpointID'] = $object->getEndpointID(); } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); } - if (null !== $object->getIPv4Address()) { - $data->{'IPv4Address'} = $object->getIPv4Address(); + if ($object->isInitialized('iPv4Address') && null !== $object->getIPv4Address()) { + $data['IPv4Address'] = $object->getIPv4Address(); } - if (null !== $object->getIPv6Address()) { - $data->{'IPv6Address'} = $object->getIPv6Address(); + if ($object->isInitialized('iPv6Address') && null !== $object->getIPv6Address()) { + $data['IPv6Address'] = $object->getIPv6Address(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\NetworkContainer' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NetworkNormalizer.php b/src/Normalizer/NetworkNormalizer.php index 3e881b32..a88676c0 100644 --- a/src/Normalizer/NetworkNormalizer.php +++ b/src/Normalizer/NetworkNormalizer.php @@ -1,153 +1,199 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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']); } - if (property_exists($data, 'Id') && $data->{'Id'} !== null) { - $object->setId($data->{'Id'}); + elseif (\array_key_exists('Scope', $data) && $data['Scope'] === null) { + $object->setScope(null); } - if (property_exists($data, 'Created') && $data->{'Created'} !== null) { - $object->setCreated($data->{'Created'}); + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); } - if (property_exists($data, 'Scope') && $data->{'Scope'} !== null) { - $object->setScope($data->{'Scope'}); + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); + if (\array_key_exists('EnableIPv6', $data) && $data['EnableIPv6'] !== null) { + $object->setEnableIPv6($data['EnableIPv6']); } - if (property_exists($data, 'EnableIPv6') && $data->{'EnableIPv6'} !== null) { - $object->setEnableIPv6($data->{'EnableIPv6'}); + elseif (\array_key_exists('EnableIPv6', $data) && $data['EnableIPv6'] === null) { + $object->setEnableIPv6(null); } - if (property_exists($data, 'IPAM') && $data->{'IPAM'} !== null) { - $object->setIPAM($this->denormalizer->denormalize($data->{'IPAM'}, 'Docker\\API\\Model\\IPAM', 'json', $context)); + if (\array_key_exists('IPAM', $data) && $data['IPAM'] !== null) { + $object->setIPAM($this->denormalizer->denormalize($data['IPAM'], 'Docker\\API\\Model\\IPAM', 'json', $context)); } - if (property_exists($data, 'Internal') && $data->{'Internal'} !== null) { - $object->setInternal($data->{'Internal'}); + elseif (\array_key_exists('IPAM', $data) && $data['IPAM'] === null) { + $object->setIPAM(null); } - if (property_exists($data, 'Attachable') && $data->{'Attachable'} !== null) { - $object->setAttachable($data->{'Attachable'}); + if (\array_key_exists('Internal', $data) && $data['Internal'] !== null) { + $object->setInternal($data['Internal']); } - if (property_exists($data, 'Ingress') && $data->{'Ingress'} !== null) { - $object->setIngress($data->{'Ingress'}); + elseif (\array_key_exists('Internal', $data) && $data['Internal'] === null) { + $object->setInternal(null); } - if (property_exists($data, 'Containers') && $data->{'Containers'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Containers'} as $key => $value) { + 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('Containers', $data) && $data['Containers'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Containers'] as $key => $value) { $values[$key] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\NetworkContainer', 'json', $context); } $object->setContainers($values); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key_1 => $value_1) { + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key_1 => $value_1) { $values_1[$key_1] = $value_1; } $object->setOptions($values_1); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_2 => $value_2) { + 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(array(), \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); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); + if ($object->isInitialized('created') && null !== $object->getCreated()) { + $data['Created'] = $object->getCreated(); } - if (null !== $object->getScope()) { - $data->{'Scope'} = $object->getScope(); + if ($object->isInitialized('scope') && null !== $object->getScope()) { + $data['Scope'] = $object->getScope(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); } - if (null !== $object->getEnableIPv6()) { - $data->{'EnableIPv6'} = $object->getEnableIPv6(); + if ($object->isInitialized('enableIPv6') && null !== $object->getEnableIPv6()) { + $data['EnableIPv6'] = $object->getEnableIPv6(); } - if (null !== $object->getIPAM()) { - $data->{'IPAM'} = $this->normalizer->normalize($object->getIPAM(), 'json', $context); + if ($object->isInitialized('iPAM') && null !== $object->getIPAM()) { + $data['IPAM'] = $this->normalizer->normalize($object->getIPAM(), 'json', $context); } - if (null !== $object->getInternal()) { - $data->{'Internal'} = $object->getInternal(); + if ($object->isInitialized('internal') && null !== $object->getInternal()) { + $data['Internal'] = $object->getInternal(); } - if (null !== $object->getAttachable()) { - $data->{'Attachable'} = $object->getAttachable(); + if ($object->isInitialized('attachable') && null !== $object->getAttachable()) { + $data['Attachable'] = $object->getAttachable(); } - if (null !== $object->getIngress()) { - $data->{'Ingress'} = $object->getIngress(); + if ($object->isInitialized('ingress') && null !== $object->getIngress()) { + $data['Ingress'] = $object->getIngress(); } - if (null !== $object->getContainers()) { - $values = new \stdClass(); + if ($object->isInitialized('containers') && null !== $object->getContainers()) { + $values = array(); foreach ($object->getContainers() as $key => $value) { - $values->{$key} = $this->normalizer->normalize($value, 'json', $context); + $values[$key] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'Containers'} = $values; + $data['Containers'] = $values; } - if (null !== $object->getOptions()) { - $values_1 = new \stdClass(); + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values_1 = array(); foreach ($object->getOptions() as $key_1 => $value_1) { - $values_1->{$key_1} = $value_1; + $values_1[$key_1] = $value_1; } - $data->{'Options'} = $values_1; + $data['Options'] = $values_1; } - if (null !== $object->getLabels()) { - $values_2 = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_2 = array(); foreach ($object->getLabels() as $key_2 => $value_2) { - $values_2->{$key_2} = $value_2; + $values_2[$key_2] = $value_2; } - $data->{'Labels'} = $values_2; + $data['Labels'] = $values_2; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\Network' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NetworkSettingsNormalizer.php b/src/Normalizer/NetworkSettingsNormalizer.php index 6d82a9e6..45d9935b 100644 --- a/src/Normalizer/NetworkSettingsNormalizer.php +++ b/src/Normalizer/NetworkSettingsNormalizer.php @@ -1,62 +1,80 @@ {'Bridge'} !== null) { - $object->setBridge($data->{'Bridge'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Bridge', $data) && $data['Bridge'] !== null) { + $object->setBridge($data['Bridge']); } - if (property_exists($data, 'SandboxID') && $data->{'SandboxID'} !== null) { - $object->setSandboxID($data->{'SandboxID'}); + elseif (\array_key_exists('Bridge', $data) && $data['Bridge'] === null) { + $object->setBridge(null); } - if (property_exists($data, 'HairpinMode') && $data->{'HairpinMode'} !== null) { - $object->setHairpinMode($data->{'HairpinMode'}); + if (\array_key_exists('SandboxID', $data) && $data['SandboxID'] !== null) { + $object->setSandboxID($data['SandboxID']); } - if (property_exists($data, 'LinkLocalIPv6Address') && $data->{'LinkLocalIPv6Address'} !== null) { - $object->setLinkLocalIPv6Address($data->{'LinkLocalIPv6Address'}); + elseif (\array_key_exists('SandboxID', $data) && $data['SandboxID'] === null) { + $object->setSandboxID(null); } - if (property_exists($data, 'LinkLocalIPv6PrefixLen') && $data->{'LinkLocalIPv6PrefixLen'} !== null) { - $object->setLinkLocalIPv6PrefixLen($data->{'LinkLocalIPv6PrefixLen'}); + if (\array_key_exists('HairpinMode', $data) && $data['HairpinMode'] !== null) { + $object->setHairpinMode($data['HairpinMode']); } - if (property_exists($data, 'Ports') && $data->{'Ports'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Ports'} as $key => $value) { - $values_1 = []; + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Ports'] as $key => $value) { + $values_1 = array(); foreach ($value as $value_1) { $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PortBinding', 'json', $context); } @@ -64,136 +82,179 @@ public function denormalize($data, $class, $format = null, array $context = []) } $object->setPorts($values); } - if (property_exists($data, 'SandboxKey') && $data->{'SandboxKey'} !== null) { - $object->setSandboxKey($data->{'SandboxKey'}); + 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']); } - if (property_exists($data, 'SecondaryIPAddresses') && $data->{'SecondaryIPAddresses'} !== null) { - $values_2 = []; - foreach ($data->{'SecondaryIPAddresses'} as $value_2) { + elseif (\array_key_exists('SandboxKey', $data) && $data['SandboxKey'] === null) { + $object->setSandboxKey(null); + } + if (\array_key_exists('SecondaryIPAddresses', $data) && $data['SecondaryIPAddresses'] !== null) { + $values_2 = array(); + foreach ($data['SecondaryIPAddresses'] as $value_2) { $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\Address', 'json', $context); } $object->setSecondaryIPAddresses($values_2); } - if (property_exists($data, 'SecondaryIPv6Addresses') && $data->{'SecondaryIPv6Addresses'} !== null) { - $values_3 = []; - foreach ($data->{'SecondaryIPv6Addresses'} as $value_3) { + elseif (\array_key_exists('SecondaryIPAddresses', $data) && $data['SecondaryIPAddresses'] === null) { + $object->setSecondaryIPAddresses(null); + } + if (\array_key_exists('SecondaryIPv6Addresses', $data) && $data['SecondaryIPv6Addresses'] !== null) { + $values_3 = array(); + foreach ($data['SecondaryIPv6Addresses'] as $value_3) { $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\Address', 'json', $context); } $object->setSecondaryIPv6Addresses($values_3); } - if (property_exists($data, 'EndpointID') && $data->{'EndpointID'} !== null) { - $object->setEndpointID($data->{'EndpointID'}); + elseif (\array_key_exists('SecondaryIPv6Addresses', $data) && $data['SecondaryIPv6Addresses'] === null) { + $object->setSecondaryIPv6Addresses(null); } - if (property_exists($data, 'Gateway') && $data->{'Gateway'} !== null) { - $object->setGateway($data->{'Gateway'}); + if (\array_key_exists('EndpointID', $data) && $data['EndpointID'] !== null) { + $object->setEndpointID($data['EndpointID']); } - if (property_exists($data, 'GlobalIPv6Address') && $data->{'GlobalIPv6Address'} !== null) { - $object->setGlobalIPv6Address($data->{'GlobalIPv6Address'}); + elseif (\array_key_exists('EndpointID', $data) && $data['EndpointID'] === null) { + $object->setEndpointID(null); } - if (property_exists($data, 'GlobalIPv6PrefixLen') && $data->{'GlobalIPv6PrefixLen'} !== null) { - $object->setGlobalIPv6PrefixLen($data->{'GlobalIPv6PrefixLen'}); + if (\array_key_exists('Gateway', $data) && $data['Gateway'] !== null) { + $object->setGateway($data['Gateway']); } - if (property_exists($data, 'IPAddress') && $data->{'IPAddress'} !== null) { - $object->setIPAddress($data->{'IPAddress'}); + elseif (\array_key_exists('Gateway', $data) && $data['Gateway'] === null) { + $object->setGateway(null); } - if (property_exists($data, 'IPPrefixLen') && $data->{'IPPrefixLen'} !== null) { - $object->setIPPrefixLen($data->{'IPPrefixLen'}); + if (\array_key_exists('GlobalIPv6Address', $data) && $data['GlobalIPv6Address'] !== null) { + $object->setGlobalIPv6Address($data['GlobalIPv6Address']); } - if (property_exists($data, 'IPv6Gateway') && $data->{'IPv6Gateway'} !== null) { - $object->setIPv6Gateway($data->{'IPv6Gateway'}); + elseif (\array_key_exists('GlobalIPv6Address', $data) && $data['GlobalIPv6Address'] === null) { + $object->setGlobalIPv6Address(null); } - if (property_exists($data, 'MacAddress') && $data->{'MacAddress'} !== null) { - $object->setMacAddress($data->{'MacAddress'}); + if (\array_key_exists('GlobalIPv6PrefixLen', $data) && $data['GlobalIPv6PrefixLen'] !== null) { + $object->setGlobalIPv6PrefixLen($data['GlobalIPv6PrefixLen']); } - if (property_exists($data, 'Networks') && $data->{'Networks'} !== null) { - $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Networks'} as $key_1 => $value_4) { + 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(array(), \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', 'json', $context); } $object->setNetworks($values_4); } - + elseif (\array_key_exists('Networks', $data) && $data['Networks'] === null) { + $object->setNetworks(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getBridge()) { - $data->{'Bridge'} = $object->getBridge(); + $data = array(); + if ($object->isInitialized('bridge') && null !== $object->getBridge()) { + $data['Bridge'] = $object->getBridge(); } - if (null !== $object->getSandboxID()) { - $data->{'SandboxID'} = $object->getSandboxID(); + if ($object->isInitialized('sandboxID') && null !== $object->getSandboxID()) { + $data['SandboxID'] = $object->getSandboxID(); } - if (null !== $object->getHairpinMode()) { - $data->{'HairpinMode'} = $object->getHairpinMode(); + if ($object->isInitialized('hairpinMode') && null !== $object->getHairpinMode()) { + $data['HairpinMode'] = $object->getHairpinMode(); } - if (null !== $object->getLinkLocalIPv6Address()) { - $data->{'LinkLocalIPv6Address'} = $object->getLinkLocalIPv6Address(); + if ($object->isInitialized('linkLocalIPv6Address') && null !== $object->getLinkLocalIPv6Address()) { + $data['LinkLocalIPv6Address'] = $object->getLinkLocalIPv6Address(); } - if (null !== $object->getLinkLocalIPv6PrefixLen()) { - $data->{'LinkLocalIPv6PrefixLen'} = $object->getLinkLocalIPv6PrefixLen(); + if ($object->isInitialized('linkLocalIPv6PrefixLen') && null !== $object->getLinkLocalIPv6PrefixLen()) { + $data['LinkLocalIPv6PrefixLen'] = $object->getLinkLocalIPv6PrefixLen(); } - if (null !== $object->getPorts()) { - $values = new \stdClass(); + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values = array(); foreach ($object->getPorts() as $key => $value) { - $values_1 = []; + $values_1 = array(); foreach ($value as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $values->{$key} = $values_1; + $values[$key] = $values_1; } - $data->{'Ports'} = $values; + $data['Ports'] = $values; } - if (null !== $object->getSandboxKey()) { - $data->{'SandboxKey'} = $object->getSandboxKey(); + if ($object->isInitialized('sandboxKey') && null !== $object->getSandboxKey()) { + $data['SandboxKey'] = $object->getSandboxKey(); } - if (null !== $object->getSecondaryIPAddresses()) { - $values_2 = []; + if ($object->isInitialized('secondaryIPAddresses') && null !== $object->getSecondaryIPAddresses()) { + $values_2 = array(); foreach ($object->getSecondaryIPAddresses() as $value_2) { $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'SecondaryIPAddresses'} = $values_2; + $data['SecondaryIPAddresses'] = $values_2; } - if (null !== $object->getSecondaryIPv6Addresses()) { - $values_3 = []; + if ($object->isInitialized('secondaryIPv6Addresses') && null !== $object->getSecondaryIPv6Addresses()) { + $values_3 = array(); foreach ($object->getSecondaryIPv6Addresses() as $value_3) { $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'SecondaryIPv6Addresses'} = $values_3; + $data['SecondaryIPv6Addresses'] = $values_3; } - if (null !== $object->getEndpointID()) { - $data->{'EndpointID'} = $object->getEndpointID(); + if ($object->isInitialized('endpointID') && null !== $object->getEndpointID()) { + $data['EndpointID'] = $object->getEndpointID(); } - if (null !== $object->getGateway()) { - $data->{'Gateway'} = $object->getGateway(); + if ($object->isInitialized('gateway') && null !== $object->getGateway()) { + $data['Gateway'] = $object->getGateway(); } - if (null !== $object->getGlobalIPv6Address()) { - $data->{'GlobalIPv6Address'} = $object->getGlobalIPv6Address(); + if ($object->isInitialized('globalIPv6Address') && null !== $object->getGlobalIPv6Address()) { + $data['GlobalIPv6Address'] = $object->getGlobalIPv6Address(); } - if (null !== $object->getGlobalIPv6PrefixLen()) { - $data->{'GlobalIPv6PrefixLen'} = $object->getGlobalIPv6PrefixLen(); + if ($object->isInitialized('globalIPv6PrefixLen') && null !== $object->getGlobalIPv6PrefixLen()) { + $data['GlobalIPv6PrefixLen'] = $object->getGlobalIPv6PrefixLen(); } - if (null !== $object->getIPAddress()) { - $data->{'IPAddress'} = $object->getIPAddress(); + if ($object->isInitialized('iPAddress') && null !== $object->getIPAddress()) { + $data['IPAddress'] = $object->getIPAddress(); } - if (null !== $object->getIPPrefixLen()) { - $data->{'IPPrefixLen'} = $object->getIPPrefixLen(); + if ($object->isInitialized('iPPrefixLen') && null !== $object->getIPPrefixLen()) { + $data['IPPrefixLen'] = $object->getIPPrefixLen(); } - if (null !== $object->getIPv6Gateway()) { - $data->{'IPv6Gateway'} = $object->getIPv6Gateway(); + if ($object->isInitialized('iPv6Gateway') && null !== $object->getIPv6Gateway()) { + $data['IPv6Gateway'] = $object->getIPv6Gateway(); } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); + if ($object->isInitialized('macAddress') && null !== $object->getMacAddress()) { + $data['MacAddress'] = $object->getMacAddress(); } - if (null !== $object->getNetworks()) { - $values_4 = new \stdClass(); + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values_4 = array(); foreach ($object->getNetworks() as $key_1 => $value_4) { - $values_4->{$key_1} = $this->normalizer->normalize($value_4, 'json', $context); + $values_4[$key_1] = $this->normalizer->normalize($value_4, 'json', $context); } - $data->{'Networks'} = $values_4; + $data['Networks'] = $values_4; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\NetworkSettings' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NetworkingConfigNormalizer.php b/src/Normalizer/NetworkingConfigNormalizer.php new file mode 100644 index 00000000..53a2cd8a --- /dev/null +++ b/src/Normalizer/NetworkingConfigNormalizer.php @@ -0,0 +1,75 @@ + $value) { + $values[$key] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\EndpointSettings', '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 = array()) + { + $data = array(); + if ($object->isInitialized('endpointsConfig') && null !== $object->getEndpointsConfig()) { + $values = array(); + 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 array('Docker\\API\\Model\\NetworkingConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NetworksCreatePostBodyNormalizer.php b/src/Normalizer/NetworksCreatePostBodyNormalizer.php index 3b8ab3a1..7b22d875 100644 --- a/src/Normalizer/NetworksCreatePostBodyNormalizer.php +++ b/src/Normalizer/NetworksCreatePostBodyNormalizer.php @@ -1,127 +1,162 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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('CheckDuplicate', $data) && $data['CheckDuplicate'] !== null) { + $object->setCheckDuplicate($data['CheckDuplicate']); + } + elseif (\array_key_exists('CheckDuplicate', $data) && $data['CheckDuplicate'] === null) { + $object->setCheckDuplicate(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 (property_exists($data, 'CheckDuplicate') && $data->{'CheckDuplicate'} !== null) { - $object->setCheckDuplicate($data->{'CheckDuplicate'}); + if (\array_key_exists('Internal', $data) && $data['Internal'] !== null) { + $object->setInternal($data['Internal']); } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); + elseif (\array_key_exists('Internal', $data) && $data['Internal'] === null) { + $object->setInternal(null); } - if (property_exists($data, 'Internal') && $data->{'Internal'} !== null) { - $object->setInternal($data->{'Internal'}); + if (\array_key_exists('Attachable', $data) && $data['Attachable'] !== null) { + $object->setAttachable($data['Attachable']); } - if (property_exists($data, 'Attachable') && $data->{'Attachable'} !== null) { - $object->setAttachable($data->{'Attachable'}); + elseif (\array_key_exists('Attachable', $data) && $data['Attachable'] === null) { + $object->setAttachable(null); } - if (property_exists($data, 'Ingress') && $data->{'Ingress'} !== null) { - $object->setIngress($data->{'Ingress'}); + if (\array_key_exists('Ingress', $data) && $data['Ingress'] !== null) { + $object->setIngress($data['Ingress']); } - if (property_exists($data, 'IPAM') && $data->{'IPAM'} !== null) { - $object->setIPAM($this->denormalizer->denormalize($data->{'IPAM'}, 'Docker\\API\\Model\\IPAM', 'json', $context)); + elseif (\array_key_exists('Ingress', $data) && $data['Ingress'] === null) { + $object->setIngress(null); } - if (property_exists($data, 'EnableIPv6') && $data->{'EnableIPv6'} !== null) { - $object->setEnableIPv6($data->{'EnableIPv6'}); + if (\array_key_exists('IPAM', $data) && $data['IPAM'] !== null) { + $object->setIPAM($this->denormalizer->denormalize($data['IPAM'], 'Docker\\API\\Model\\IPAM', 'json', $context)); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { + elseif (\array_key_exists('IPAM', $data) && $data['IPAM'] === null) { + $object->setIPAM(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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { $values[$key] = $value; } $object->setOptions($values); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_1 => $value_1) { + 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(array(), \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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + $data['Name'] = $object->getName(); + if ($object->isInitialized('checkDuplicate') && null !== $object->getCheckDuplicate()) { + $data['CheckDuplicate'] = $object->getCheckDuplicate(); } - if (null !== $object->getCheckDuplicate()) { - $data->{'CheckDuplicate'} = $object->getCheckDuplicate(); + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + if ($object->isInitialized('internal') && null !== $object->getInternal()) { + $data['Internal'] = $object->getInternal(); } - if (null !== $object->getInternal()) { - $data->{'Internal'} = $object->getInternal(); + if ($object->isInitialized('attachable') && null !== $object->getAttachable()) { + $data['Attachable'] = $object->getAttachable(); } - if (null !== $object->getAttachable()) { - $data->{'Attachable'} = $object->getAttachable(); + if ($object->isInitialized('ingress') && null !== $object->getIngress()) { + $data['Ingress'] = $object->getIngress(); } - if (null !== $object->getIngress()) { - $data->{'Ingress'} = $object->getIngress(); + if ($object->isInitialized('iPAM') && null !== $object->getIPAM()) { + $data['IPAM'] = $this->normalizer->normalize($object->getIPAM(), 'json', $context); } - if (null !== $object->getIPAM()) { - $data->{'IPAM'} = $this->normalizer->normalize($object->getIPAM(), 'json', $context); + if ($object->isInitialized('enableIPv6') && null !== $object->getEnableIPv6()) { + $data['EnableIPv6'] = $object->getEnableIPv6(); } - if (null !== $object->getEnableIPv6()) { - $data->{'EnableIPv6'} = $object->getEnableIPv6(); - } - if (null !== $object->getOptions()) { - $values = new \stdClass(); + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = array(); foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Options'} = $values; + $data['Options'] = $values; } - if (null !== $object->getLabels()) { - $values_1 = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_1 = array(); foreach ($object->getLabels() as $key_1 => $value_1) { - $values_1->{$key_1} = $value_1; + $values_1[$key_1] = $value_1; } - $data->{'Labels'} = $values_1; + $data['Labels'] = $values_1; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\NetworksCreatePostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NetworksCreatePostResponse201Normalizer.php b/src/Normalizer/NetworksCreatePostResponse201Normalizer.php index 2daf0463..fb762285 100644 --- a/src/Normalizer/NetworksCreatePostResponse201Normalizer.php +++ b/src/Normalizer/NetworksCreatePostResponse201Normalizer.php @@ -1,63 +1,76 @@ {'Id'} !== null) { - $object->setId($data->{'Id'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Warning') && $data->{'Warning'} !== null) { - $object->setWarning($data->{'Warning'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); + $data = array(); + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['Id'] = $object->getId(); } - if (null !== $object->getWarning()) { - $data->{'Warning'} = $object->getWarning(); + if ($object->isInitialized('warning') && null !== $object->getWarning()) { + $data['Warning'] = $object->getWarning(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\NetworksCreatePostResponse201' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NetworksIdConnectPostBodyNormalizer.php b/src/Normalizer/NetworksIdConnectPostBodyNormalizer.php index 90362a2a..0b5ecf16 100644 --- a/src/Normalizer/NetworksIdConnectPostBodyNormalizer.php +++ b/src/Normalizer/NetworksIdConnectPostBodyNormalizer.php @@ -1,63 +1,76 @@ {'Container'} !== null) { - $object->setContainer($data->{'Container'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'EndpointConfig') && $data->{'EndpointConfig'} !== null) { - $object->setEndpointConfig($this->denormalizer->denormalize($data->{'EndpointConfig'}, 'Docker\\API\\Model\\EndpointSettings', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('EndpointConfig', $data) && $data['EndpointConfig'] === null) { + $object->setEndpointConfig(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getContainer()) { - $data->{'Container'} = $object->getContainer(); + $data = array(); + if ($object->isInitialized('container') && null !== $object->getContainer()) { + $data['Container'] = $object->getContainer(); } - if (null !== $object->getEndpointConfig()) { - $data->{'EndpointConfig'} = $this->normalizer->normalize($object->getEndpointConfig(), 'json', $context); + 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 array('Docker\\API\\Model\\NetworksIdConnectPostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NetworksIdDisconnectPostBodyNormalizer.php b/src/Normalizer/NetworksIdDisconnectPostBodyNormalizer.php index eb3ac16a..04fc3fb9 100644 --- a/src/Normalizer/NetworksIdDisconnectPostBodyNormalizer.php +++ b/src/Normalizer/NetworksIdDisconnectPostBodyNormalizer.php @@ -1,63 +1,76 @@ {'Container'} !== null) { - $object->setContainer($data->{'Container'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Force') && $data->{'Force'} !== null) { - $object->setForce($data->{'Force'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getContainer()) { - $data->{'Container'} = $object->getContainer(); + $data = array(); + if ($object->isInitialized('container') && null !== $object->getContainer()) { + $data['Container'] = $object->getContainer(); } - if (null !== $object->getForce()) { - $data->{'Force'} = $object->getForce(); + if ($object->isInitialized('force') && null !== $object->getForce()) { + $data['Force'] = $object->getForce(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\NetworksIdDisconnectPostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NetworksPrunePostResponse200Normalizer.php b/src/Normalizer/NetworksPrunePostResponse200Normalizer.php index e3b56751..fcab7eb3 100644 --- a/src/Normalizer/NetworksPrunePostResponse200Normalizer.php +++ b/src/Normalizer/NetworksPrunePostResponse200Normalizer.php @@ -1,65 +1,75 @@ {'NetworksDeleted'} !== null) { - $values = []; - foreach ($data->{'NetworksDeleted'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NetworksDeleted', $data) && $data['NetworksDeleted'] !== null) { + $values = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getNetworksDeleted()) { - $values = []; + $data = array(); + if ($object->isInitialized('networksDeleted') && null !== $object->getNetworksDeleted()) { + $values = array(); foreach ($object->getNetworksDeleted() as $value) { $values[] = $value; } - $data->{'NetworksDeleted'} = $values; + $data['NetworksDeleted'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\NetworksPrunePostResponse200' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NodeDescriptionNormalizer.php b/src/Normalizer/NodeDescriptionNormalizer.php index be714cde..a96469cb 100644 --- a/src/Normalizer/NodeDescriptionNormalizer.php +++ b/src/Normalizer/NodeDescriptionNormalizer.php @@ -1,81 +1,103 @@ {'Hostname'} !== null) { - $object->setHostname($data->{'Hostname'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Platform') && $data->{'Platform'} !== null) { - $object->setPlatform($this->denormalizer->denormalize($data->{'Platform'}, 'Docker\\API\\Model\\Platform', 'json', $context)); + if (\array_key_exists('Hostname', $data) && $data['Hostname'] !== null) { + $object->setHostname($data['Hostname']); } - if (property_exists($data, 'Resources') && $data->{'Resources'} !== null) { - $object->setResources($this->denormalizer->denormalize($data->{'Resources'}, 'Docker\\API\\Model\\ResourceObject', 'json', $context)); + elseif (\array_key_exists('Hostname', $data) && $data['Hostname'] === null) { + $object->setHostname(null); } - if (property_exists($data, 'Engine') && $data->{'Engine'} !== null) { - $object->setEngine($this->denormalizer->denormalize($data->{'Engine'}, 'Docker\\API\\Model\\EngineDescription', 'json', $context)); + if (\array_key_exists('Platform', $data) && $data['Platform'] !== null) { + $object->setPlatform($this->denormalizer->denormalize($data['Platform'], 'Docker\\API\\Model\\Platform', 'json', $context)); } - if (property_exists($data, 'TLSInfo') && $data->{'TLSInfo'} !== null) { - $object->setTLSInfo($this->denormalizer->denormalize($data->{'TLSInfo'}, 'Docker\\API\\Model\\TLSInfo', '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', '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', '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', 'json', $context)); + } + elseif (\array_key_exists('TLSInfo', $data) && $data['TLSInfo'] === null) { + $object->setTLSInfo(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getHostname()) { - $data->{'Hostname'} = $object->getHostname(); + $data = array(); + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); } - if (null !== $object->getPlatform()) { - $data->{'Platform'} = $this->normalizer->normalize($object->getPlatform(), 'json', $context); + if ($object->isInitialized('platform') && null !== $object->getPlatform()) { + $data['Platform'] = $this->normalizer->normalize($object->getPlatform(), 'json', $context); } - if (null !== $object->getResources()) { - $data->{'Resources'} = $this->normalizer->normalize($object->getResources(), 'json', $context); + if ($object->isInitialized('resources') && null !== $object->getResources()) { + $data['Resources'] = $this->normalizer->normalize($object->getResources(), 'json', $context); } - if (null !== $object->getEngine()) { - $data->{'Engine'} = $this->normalizer->normalize($object->getEngine(), 'json', $context); + if ($object->isInitialized('engine') && null !== $object->getEngine()) { + $data['Engine'] = $this->normalizer->normalize($object->getEngine(), 'json', $context); } - if (null !== $object->getTLSInfo()) { - $data->{'TLSInfo'} = $this->normalizer->normalize($object->getTLSInfo(), '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 array('Docker\\API\\Model\\NodeDescription' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NodeNormalizer.php b/src/Normalizer/NodeNormalizer.php index 015a881e..255f2797 100644 --- a/src/Normalizer/NodeNormalizer.php +++ b/src/Normalizer/NodeNormalizer.php @@ -1,99 +1,130 @@ {'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\NodeSpec', 'json', $context)); + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($this->denormalizer->denormalize($data->{'Description'}, 'Docker\\API\\Model\\NodeDescription', 'json', $context)); + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); } - if (property_exists($data, 'Status') && $data->{'Status'} !== null) { - $object->setStatus($this->denormalizer->denormalize($data->{'Status'}, 'Docker\\API\\Model\\NodeStatus', 'json', $context)); + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); } - if (property_exists($data, 'ManagerStatus') && $data->{'ManagerStatus'} !== null) { - $object->setManagerStatus($this->denormalizer->denormalize($data->{'ManagerStatus'}, 'Docker\\API\\Model\\ManagerStatus', 'json', $context)); + 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', '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', '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', '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', 'json', $context)); + } + elseif (\array_key_exists('ManagerStatus', $data) && $data['ManagerStatus'] === null) { + $object->setManagerStatus(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $data = array(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); } - if (null !== $object->getDescription()) { - $data->{'Description'} = $this->normalizer->normalize($object->getDescription(), 'json', $context); + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['Description'] = $this->normalizer->normalize($object->getDescription(), 'json', $context); } - if (null !== $object->getStatus()) { - $data->{'Status'} = $this->normalizer->normalize($object->getStatus(), 'json', $context); + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['Status'] = $this->normalizer->normalize($object->getStatus(), 'json', $context); } - if (null !== $object->getManagerStatus()) { - $data->{'ManagerStatus'} = $this->normalizer->normalize($object->getManagerStatus(), '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 array('Docker\\API\\Model\\Node' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NodeSpecNormalizer.php b/src/Normalizer/NodeSpecNormalizer.php index 9a789ac0..1773fd8a 100644 --- a/src/Normalizer/NodeSpecNormalizer.php +++ b/src/Normalizer/NodeSpecNormalizer.php @@ -1,83 +1,102 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'Role') && $data->{'Role'} !== null) { - $object->setRole($data->{'Role'}); + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); } - if (property_exists($data, 'Availability') && $data->{'Availability'} !== null) { - $object->setAvailability($data->{'Availability'}); + 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; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getRole()) { - $data->{'Role'} = $object->getRole(); + if ($object->isInitialized('role') && null !== $object->getRole()) { + $data['Role'] = $object->getRole(); } - if (null !== $object->getAvailability()) { - $data->{'Availability'} = $object->getAvailability(); + if ($object->isInitialized('availability') && null !== $object->getAvailability()) { + $data['Availability'] = $object->getAvailability(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\NodeSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NodeStatusNormalizer.php b/src/Normalizer/NodeStatusNormalizer.php index 01a9700a..466b45f5 100644 --- a/src/Normalizer/NodeStatusNormalizer.php +++ b/src/Normalizer/NodeStatusNormalizer.php @@ -1,69 +1,85 @@ {'State'} !== null) { - $object->setState($data->{'State'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Message') && $data->{'Message'} !== null) { - $object->setMessage($data->{'Message'}); + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); } - if (property_exists($data, 'Addr') && $data->{'Addr'} !== null) { - $object->setAddr($data->{'Addr'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getState()) { - $data->{'State'} = $object->getState(); + $data = array(); + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); } - if (null !== $object->getMessage()) { - $data->{'Message'} = $object->getMessage(); + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['Message'] = $object->getMessage(); } - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\NodeStatus' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/NormalizerFactory.php b/src/Normalizer/NormalizerFactory.php deleted file mode 100644 index f7c2dc70..00000000 --- a/src/Normalizer/NormalizerFactory.php +++ /dev/null @@ -1,206 +0,0 @@ -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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\OCIDescriptor' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/OCIPlatformNormalizer.php b/src/Normalizer/OCIPlatformNormalizer.php new file mode 100644 index 00000000..b0b25f66 --- /dev/null +++ b/src/Normalizer/OCIPlatformNormalizer.php @@ -0,0 +1,111 @@ +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 = array(); + 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 = array()) + { + $data = array(); + 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 = array(); + 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 array('Docker\\API\\Model\\OCIPlatform' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ObjectVersionNormalizer.php b/src/Normalizer/ObjectVersionNormalizer.php index db361da6..fca10635 100644 --- a/src/Normalizer/ObjectVersionNormalizer.php +++ b/src/Normalizer/ObjectVersionNormalizer.php @@ -1,57 +1,67 @@ {'Index'} !== null) { - $object->setIndex($data->{'Index'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getIndex()) { - $data->{'Index'} = $object->getIndex(); + $data = array(); + if ($object->isInitialized('index') && null !== $object->getIndex()) { + $data['Index'] = $object->getIndex(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ObjectVersion' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PeerNodeNormalizer.php b/src/Normalizer/PeerNodeNormalizer.php index 985a93fb..499d3b9c 100644 --- a/src/Normalizer/PeerNodeNormalizer.php +++ b/src/Normalizer/PeerNodeNormalizer.php @@ -1,63 +1,76 @@ {'NodeID'} !== null) { - $object->setNodeID($data->{'NodeID'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Addr') && $data->{'Addr'} !== null) { - $object->setAddr($data->{'Addr'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getNodeID()) { - $data->{'NodeID'} = $object->getNodeID(); + $data = array(); + if ($object->isInitialized('nodeID') && null !== $object->getNodeID()) { + $data['NodeID'] = $object->getNodeID(); } - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PeerNode' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PlatformNormalizer.php b/src/Normalizer/PlatformNormalizer.php index 32492468..1edf4d6d 100644 --- a/src/Normalizer/PlatformNormalizer.php +++ b/src/Normalizer/PlatformNormalizer.php @@ -1,63 +1,76 @@ {'Architecture'} !== null) { - $object->setArchitecture($data->{'Architecture'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'OS') && $data->{'OS'} !== null) { - $object->setOS($data->{'OS'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getArchitecture()) { - $data->{'Architecture'} = $object->getArchitecture(); + $data = array(); + if ($object->isInitialized('architecture') && null !== $object->getArchitecture()) { + $data['Architecture'] = $object->getArchitecture(); } - if (null !== $object->getOS()) { - $data->{'OS'} = $object->getOS(); + if ($object->isInitialized('oS') && null !== $object->getOS()) { + $data['OS'] = $object->getOS(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\Platform' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginConfigArgsNormalizer.php b/src/Normalizer/PluginConfigArgsNormalizer.php index a435ac5c..56e096d7 100644 --- a/src/Normalizer/PluginConfigArgsNormalizer.php +++ b/src/Normalizer/PluginConfigArgsNormalizer.php @@ -1,91 +1,102 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); } - if (property_exists($data, 'Settable') && $data->{'Settable'} !== null) { - $values = []; - foreach ($data->{'Settable'} as $value) { + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Settable', $data) && $data['Settable'] !== null) { + $values = array(); + foreach ($data['Settable'] as $value) { $values[] = $value; } $object->setSettable($values); } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $values_1 = []; - foreach ($data->{'Value'} as $value_1) { + elseif (\array_key_exists('Settable', $data) && $data['Settable'] === null) { + $object->setSettable(null); + } + if (\array_key_exists('Value', $data) && $data['Value'] !== null) { + $values_1 = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); + $data = array(); + $data['Name'] = $object->getName(); + $data['Description'] = $object->getDescription(); + $values = array(); + foreach ($object->getSettable() as $value) { + $values[] = $value; } - if (null !== $object->getSettable()) { - $values = []; - foreach ($object->getSettable() as $value) { - $values[] = $value; - } - $data->{'Settable'} = $values; + $data['Settable'] = $values; + $values_1 = array(); + foreach ($object->getValue() as $value_1) { + $values_1[] = $value_1; } - if (null !== $object->getValue()) { - $values_1 = []; - foreach ($object->getValue() as $value_1) { - $values_1[] = $value_1; - } - $data->{'Value'} = $values_1; - } - + $data['Value'] = $values_1; return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PluginConfigArgs' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginConfigInterfaceNormalizer.php b/src/Normalizer/PluginConfigInterfaceNormalizer.php index 01fc0d06..0e2ee424 100644 --- a/src/Normalizer/PluginConfigInterfaceNormalizer.php +++ b/src/Normalizer/PluginConfigInterfaceNormalizer.php @@ -1,71 +1,89 @@ {'Types'} !== null) { - $values = []; - foreach ($data->{'Types'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Types', $data) && $data['Types'] !== null) { + $values = array(); + foreach ($data['Types'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\PluginInterfaceType', 'json', $context); } $object->setTypes($values); } - if (property_exists($data, 'Socket') && $data->{'Socket'} !== null) { - $object->setSocket($data->{'Socket'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getTypes()) { - $values = []; - foreach ($object->getTypes() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Types'} = $values; + $data = array(); + $values = array(); + foreach ($object->getTypes() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - if (null !== $object->getSocket()) { - $data->{'Socket'} = $object->getSocket(); + $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 array('Docker\\API\\Model\\PluginConfigInterface' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginConfigLinuxNormalizer.php b/src/Normalizer/PluginConfigLinuxNormalizer.php index 7fc450e5..dcb564cf 100644 --- a/src/Normalizer/PluginConfigLinuxNormalizer.php +++ b/src/Normalizer/PluginConfigLinuxNormalizer.php @@ -1,85 +1,95 @@ {'Capabilities'} !== null) { - $values = []; - foreach ($data->{'Capabilities'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Capabilities', $data) && $data['Capabilities'] !== null) { + $values = array(); + foreach ($data['Capabilities'] as $value) { $values[] = $value; } $object->setCapabilities($values); } - if (property_exists($data, 'AllowAllDevices') && $data->{'AllowAllDevices'} !== null) { - $object->setAllowAllDevices($data->{'AllowAllDevices'}); + 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 (property_exists($data, 'Devices') && $data->{'Devices'} !== null) { - $values_1 = []; - foreach ($data->{'Devices'} as $value_1) { + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { + $values_1 = array(); + foreach ($data['Devices'] as $value_1) { $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PluginDevice', 'json', $context); } $object->setDevices($values_1); } - + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getCapabilities()) { - $values = []; - foreach ($object->getCapabilities() as $value) { - $values[] = $value; - } - $data->{'Capabilities'} = $values; + $data = array(); + $values = array(); + foreach ($object->getCapabilities() as $value) { + $values[] = $value; } - if (null !== $object->getAllowAllDevices()) { - $data->{'AllowAllDevices'} = $object->getAllowAllDevices(); + $data['Capabilities'] = $values; + $data['AllowAllDevices'] = $object->getAllowAllDevices(); + $values_1 = array(); + foreach ($object->getDevices() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - if (null !== $object->getDevices()) { - $values_1 = []; - foreach ($object->getDevices() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); - } - $data->{'Devices'} = $values_1; - } - + $data['Devices'] = $values_1; return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PluginConfigLinux' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginConfigNetworkNormalizer.php b/src/Normalizer/PluginConfigNetworkNormalizer.php index f3942c2d..2abf6b89 100644 --- a/src/Normalizer/PluginConfigNetworkNormalizer.php +++ b/src/Normalizer/PluginConfigNetworkNormalizer.php @@ -1,57 +1,65 @@ {'Type'} !== null) { - $object->setType($data->{'Type'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); - } - + $data = array(); + $data['Type'] = $object->getType(); return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PluginConfigNetwork' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginConfigNormalizer.php b/src/Normalizer/PluginConfigNormalizer.php index 055ed079..512a00d9 100644 --- a/src/Normalizer/PluginConfigNormalizer.php +++ b/src/Normalizer/PluginConfigNormalizer.php @@ -1,171 +1,200 @@ {'DockerVersion'} !== null) { - $object->setDockerVersion($data->{'DockerVersion'}); + 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']); } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); } - if (property_exists($data, 'Documentation') && $data->{'Documentation'} !== null) { - $object->setDocumentation($data->{'Documentation'}); + if (\array_key_exists('Documentation', $data) && $data['Documentation'] !== null) { + $object->setDocumentation($data['Documentation']); } - if (property_exists($data, 'Interface') && $data->{'Interface'} !== null) { - $object->setInterface($this->denormalizer->denormalize($data->{'Interface'}, 'Docker\\API\\Model\\PluginConfigInterface', 'json', $context)); + elseif (\array_key_exists('Documentation', $data) && $data['Documentation'] === null) { + $object->setDocumentation(null); } - if (property_exists($data, 'Entrypoint') && $data->{'Entrypoint'} !== null) { - $values = []; - foreach ($data->{'Entrypoint'} as $value) { + if (\array_key_exists('Interface', $data) && $data['Interface'] !== null) { + $object->setInterface($this->denormalizer->denormalize($data['Interface'], 'Docker\\API\\Model\\PluginConfigInterface', 'json', $context)); + } + elseif (\array_key_exists('Interface', $data) && $data['Interface'] === null) { + $object->setInterface(null); + } + if (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] !== null) { + $values = array(); + foreach ($data['Entrypoint'] as $value) { $values[] = $value; } $object->setEntrypoint($values); } - if (property_exists($data, 'WorkDir') && $data->{'WorkDir'} !== null) { - $object->setWorkDir($data->{'WorkDir'}); + elseif (\array_key_exists('Entrypoint', $data) && $data['Entrypoint'] === null) { + $object->setEntrypoint(null); } - if (property_exists($data, 'User') && $data->{'User'} !== null) { - $object->setUser($this->denormalizer->denormalize($data->{'User'}, 'Docker\\API\\Model\\PluginConfigUser', 'json', $context)); + if (\array_key_exists('WorkDir', $data) && $data['WorkDir'] !== null) { + $object->setWorkDir($data['WorkDir']); } - if (property_exists($data, 'Network') && $data->{'Network'} !== null) { - $object->setNetwork($this->denormalizer->denormalize($data->{'Network'}, 'Docker\\API\\Model\\PluginConfigNetwork', 'json', $context)); + elseif (\array_key_exists('WorkDir', $data) && $data['WorkDir'] === null) { + $object->setWorkDir(null); } - if (property_exists($data, 'Linux') && $data->{'Linux'} !== null) { - $object->setLinux($this->denormalizer->denormalize($data->{'Linux'}, 'Docker\\API\\Model\\PluginConfigLinux', 'json', $context)); + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($this->denormalizer->denormalize($data['User'], 'Docker\\API\\Model\\PluginConfigUser', 'json', $context)); } - if (property_exists($data, 'PropagatedMount') && $data->{'PropagatedMount'} !== null) { - $object->setPropagatedMount($data->{'PropagatedMount'}); + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); } - if (property_exists($data, 'IpcHost') && $data->{'IpcHost'} !== null) { - $object->setIpcHost($data->{'IpcHost'}); + if (\array_key_exists('Network', $data) && $data['Network'] !== null) { + $object->setNetwork($this->denormalizer->denormalize($data['Network'], 'Docker\\API\\Model\\PluginConfigNetwork', 'json', $context)); } - if (property_exists($data, 'PidHost') && $data->{'PidHost'} !== null) { - $object->setPidHost($data->{'PidHost'}); + elseif (\array_key_exists('Network', $data) && $data['Network'] === null) { + $object->setNetwork(null); } - if (property_exists($data, 'Mounts') && $data->{'Mounts'} !== null) { - $values_1 = []; - foreach ($data->{'Mounts'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PluginMount', 'json', $context); - } - $object->setMounts($values_1); + if (\array_key_exists('Linux', $data) && $data['Linux'] !== null) { + $object->setLinux($this->denormalizer->denormalize($data['Linux'], 'Docker\\API\\Model\\PluginConfigLinux', 'json', $context)); } - if (property_exists($data, 'Env') && $data->{'Env'} !== null) { - $values_2 = []; - foreach ($data->{'Env'} as $value_2) { - $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\PluginEnv', 'json', $context); - } - $object->setEnv($values_2); + elseif (\array_key_exists('Linux', $data) && $data['Linux'] === null) { + $object->setLinux(null); } - if (property_exists($data, 'Args') && $data->{'Args'} !== null) { - $object->setArgs($this->denormalizer->denormalize($data->{'Args'}, 'Docker\\API\\Model\\PluginConfigArgs', 'json', $context)); + if (\array_key_exists('PropagatedMount', $data) && $data['PropagatedMount'] !== null) { + $object->setPropagatedMount($data['PropagatedMount']); } - if (property_exists($data, 'rootfs') && $data->{'rootfs'} !== null) { - $object->setRootfs($this->denormalizer->denormalize($data->{'rootfs'}, 'Docker\\API\\Model\\PluginConfigRootfs', 'json', $context)); + elseif (\array_key_exists('PropagatedMount', $data) && $data['PropagatedMount'] === null) { + $object->setPropagatedMount(null); } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getDockerVersion()) { - $data->{'DockerVersion'} = $object->getDockerVersion(); + if (\array_key_exists('IpcHost', $data) && $data['IpcHost'] !== null) { + $object->setIpcHost($data['IpcHost']); } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); + elseif (\array_key_exists('IpcHost', $data) && $data['IpcHost'] === null) { + $object->setIpcHost(null); } - if (null !== $object->getDocumentation()) { - $data->{'Documentation'} = $object->getDocumentation(); + if (\array_key_exists('PidHost', $data) && $data['PidHost'] !== null) { + $object->setPidHost($data['PidHost']); } - if (null !== $object->getInterface()) { - $data->{'Interface'} = $this->normalizer->normalize($object->getInterface(), 'json', $context); + elseif (\array_key_exists('PidHost', $data) && $data['PidHost'] === null) { + $object->setPidHost(null); } - if (null !== $object->getEntrypoint()) { - $values = []; - foreach ($object->getEntrypoint() as $value) { - $values[] = $value; + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values_1 = array(); + foreach ($data['Mounts'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PluginMount', 'json', $context); } - $data->{'Entrypoint'} = $values; - } - if (null !== $object->getWorkDir()) { - $data->{'WorkDir'} = $object->getWorkDir(); - } - if (null !== $object->getUser()) { - $data->{'User'} = $this->normalizer->normalize($object->getUser(), 'json', $context); - } - if (null !== $object->getNetwork()) { - $data->{'Network'} = $this->normalizer->normalize($object->getNetwork(), 'json', $context); + $object->setMounts($values_1); } - if (null !== $object->getLinux()) { - $data->{'Linux'} = $this->normalizer->normalize($object->getLinux(), 'json', $context); + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); } - if (null !== $object->getPropagatedMount()) { - $data->{'PropagatedMount'} = $object->getPropagatedMount(); + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_2 = array(); + foreach ($data['Env'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\PluginEnv', 'json', $context); + } + $object->setEnv($values_2); } - if (null !== $object->getIpcHost()) { - $data->{'IpcHost'} = $object->getIpcHost(); + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); } - if (null !== $object->getPidHost()) { - $data->{'PidHost'} = $object->getPidHost(); + if (\array_key_exists('Args', $data) && $data['Args'] !== null) { + $object->setArgs($this->denormalizer->denormalize($data['Args'], 'Docker\\API\\Model\\PluginConfigArgs', 'json', $context)); } - if (null !== $object->getMounts()) { - $values_1 = []; - foreach ($object->getMounts() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); - } - $data->{'Mounts'} = $values_1; + elseif (\array_key_exists('Args', $data) && $data['Args'] === null) { + $object->setArgs(null); } - if (null !== $object->getEnv()) { - $values_2 = []; - foreach ($object->getEnv() as $value_2) { - $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); - } - $data->{'Env'} = $values_2; + if (\array_key_exists('rootfs', $data) && $data['rootfs'] !== null) { + $object->setRootfs($this->denormalizer->denormalize($data['rootfs'], 'Docker\\API\\Model\\PluginConfigRootfs', 'json', $context)); } - if (null !== $object->getArgs()) { - $data->{'Args'} = $this->normalizer->normalize($object->getArgs(), 'json', $context); + elseif (\array_key_exists('rootfs', $data) && $data['rootfs'] === null) { + $object->setRootfs(null); } - if (null !== $object->getRootfs()) { - $data->{'rootfs'} = $this->normalizer->normalize($object->getRootfs(), 'json', $context); + return $object; + } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) + { + $data = array(); + 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 = array(); + 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 = array(); + foreach ($object->getMounts() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['Mounts'] = $values_1; + $values_2 = array(); + 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 array('Docker\\API\\Model\\PluginConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginConfigRootfsNormalizer.php b/src/Normalizer/PluginConfigRootfsNormalizer.php index a2ab1f4c..4e8a339b 100644 --- a/src/Normalizer/PluginConfigRootfsNormalizer.php +++ b/src/Normalizer/PluginConfigRootfsNormalizer.php @@ -1,71 +1,84 @@ {'type'} !== null) { - $object->setType($data->{'type'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('type', $data) && $data['type'] !== null) { + $object->setType($data['type']); } - if (property_exists($data, 'diff_ids') && $data->{'diff_ids'} !== null) { - $values = []; - foreach ($data->{'diff_ids'} as $value) { + elseif (\array_key_exists('type', $data) && $data['type'] === null) { + $object->setType(null); + } + if (\array_key_exists('diff_ids', $data) && $data['diff_ids'] !== null) { + $values = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'type'} = $object->getType(); + $data = array(); + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['type'] = $object->getType(); } - if (null !== $object->getDiffIds()) { - $values = []; + if ($object->isInitialized('diffIds') && null !== $object->getDiffIds()) { + $values = array(); foreach ($object->getDiffIds() as $value) { $values[] = $value; } - $data->{'diff_ids'} = $values; + $data['diff_ids'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PluginConfigRootfs' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginConfigUserNormalizer.php b/src/Normalizer/PluginConfigUserNormalizer.php index ea2ab039..030b76c5 100644 --- a/src/Normalizer/PluginConfigUserNormalizer.php +++ b/src/Normalizer/PluginConfigUserNormalizer.php @@ -1,63 +1,76 @@ {'UID'} !== null) { - $object->setUID($data->{'UID'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'GID') && $data->{'GID'} !== null) { - $object->setGID($data->{'GID'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getUID()) { - $data->{'UID'} = $object->getUID(); + $data = array(); + if ($object->isInitialized('uID') && null !== $object->getUID()) { + $data['UID'] = $object->getUID(); } - if (null !== $object->getGID()) { - $data->{'GID'} = $object->getGID(); + if ($object->isInitialized('gID') && null !== $object->getGID()) { + $data['GID'] = $object->getGID(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PluginConfigUser' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginDeviceNormalizer.php b/src/Normalizer/PluginDeviceNormalizer.php index 8cdcd29e..5be54e63 100644 --- a/src/Normalizer/PluginDeviceNormalizer.php +++ b/src/Normalizer/PluginDeviceNormalizer.php @@ -1,83 +1,94 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); } - if (property_exists($data, 'Settable') && $data->{'Settable'} !== null) { - $values = []; - foreach ($data->{'Settable'} as $value) { + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Settable', $data) && $data['Settable'] !== null) { + $values = array(); + foreach ($data['Settable'] as $value) { $values[] = $value; } $object->setSettable($values); } - if (property_exists($data, 'Path') && $data->{'Path'} !== null) { - $object->setPath($data->{'Path'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + $data['Name'] = $object->getName(); + $data['Description'] = $object->getDescription(); + $values = array(); + foreach ($object->getSettable() as $value) { + $values[] = $value; } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); - } - if (null !== $object->getSettable()) { - $values = []; - foreach ($object->getSettable() as $value) { - $values[] = $value; - } - $data->{'Settable'} = $values; - } - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); - } - + $data['Settable'] = $values; + $data['Path'] = $object->getPath(); return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PluginDevice' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginEnvNormalizer.php b/src/Normalizer/PluginEnvNormalizer.php index adc6614c..5f98417b 100644 --- a/src/Normalizer/PluginEnvNormalizer.php +++ b/src/Normalizer/PluginEnvNormalizer.php @@ -1,83 +1,94 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); + if (\array_key_exists('Description', $data) && $data['Description'] !== null) { + $object->setDescription($data['Description']); } - if (property_exists($data, 'Settable') && $data->{'Settable'} !== null) { - $values = []; - foreach ($data->{'Settable'} as $value) { + elseif (\array_key_exists('Description', $data) && $data['Description'] === null) { + $object->setDescription(null); + } + if (\array_key_exists('Settable', $data) && $data['Settable'] !== null) { + $values = array(); + foreach ($data['Settable'] as $value) { $values[] = $value; } $object->setSettable($values); } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $object->setValue($data->{'Value'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + $data['Name'] = $object->getName(); + $data['Description'] = $object->getDescription(); + $values = array(); + foreach ($object->getSettable() as $value) { + $values[] = $value; } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); - } - if (null !== $object->getSettable()) { - $values = []; - foreach ($object->getSettable() as $value) { - $values[] = $value; - } - $data->{'Settable'} = $values; - } - if (null !== $object->getValue()) { - $data->{'Value'} = $object->getValue(); - } - + $data['Settable'] = $values; + $data['Value'] = $object->getValue(); return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PluginEnv' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginInterfaceTypeNormalizer.php b/src/Normalizer/PluginInterfaceTypeNormalizer.php index db789e61..bbd0811a 100644 --- a/src/Normalizer/PluginInterfaceTypeNormalizer.php +++ b/src/Normalizer/PluginInterfaceTypeNormalizer.php @@ -1,69 +1,79 @@ {'Prefix'} !== null) { - $object->setPrefix($data->{'Prefix'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Capability') && $data->{'Capability'} !== null) { - $object->setCapability($data->{'Capability'}); + if (\array_key_exists('Prefix', $data) && $data['Prefix'] !== null) { + $object->setPrefix($data['Prefix']); } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($data->{'Version'}); + elseif (\array_key_exists('Prefix', $data) && $data['Prefix'] === null) { + $object->setPrefix(null); } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getPrefix()) { - $data->{'Prefix'} = $object->getPrefix(); + if (\array_key_exists('Capability', $data) && $data['Capability'] !== null) { + $object->setCapability($data['Capability']); } - if (null !== $object->getCapability()) { - $data->{'Capability'} = $object->getCapability(); + elseif (\array_key_exists('Capability', $data) && $data['Capability'] === null) { + $object->setCapability(null); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $object->getVersion(); + 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 = array()) + { + $data = array(); + $data['Prefix'] = $object->getPrefix(); + $data['Capability'] = $object->getCapability(); + $data['Version'] = $object->getVersion(); return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PluginInterfaceType' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginMountNormalizer.php b/src/Normalizer/PluginMountNormalizer.php index c6d1fef8..f02ca636 100644 --- a/src/Normalizer/PluginMountNormalizer.php +++ b/src/Normalizer/PluginMountNormalizer.php @@ -1,109 +1,123 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); } - if (property_exists($data, 'Settable') && $data->{'Settable'} !== null) { - $values = []; - foreach ($data->{'Settable'} as $value) { + 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 = array(); + foreach ($data['Settable'] as $value) { $values[] = $value; } $object->setSettable($values); } - if (property_exists($data, 'Source') && $data->{'Source'} !== null) { - $object->setSource($data->{'Source'}); + 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 (property_exists($data, 'Destination') && $data->{'Destination'} !== null) { - $object->setDestination($data->{'Destination'}); + if (\array_key_exists('Destination', $data) && $data['Destination'] !== null) { + $object->setDestination($data['Destination']); } - if (property_exists($data, 'Type') && $data->{'Type'} !== null) { - $object->setType($data->{'Type'}); + elseif (\array_key_exists('Destination', $data) && $data['Destination'] === null) { + $object->setDestination(null); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { - $values_1 = []; - foreach ($data->{'Options'} as $value_1) { + 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 = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); - } - if (null !== $object->getSettable()) { - $values = []; - foreach ($object->getSettable() as $value) { - $values[] = $value; - } - $data->{'Settable'} = $values; - } - if (null !== $object->getSource()) { - $data->{'Source'} = $object->getSource(); + $data = array(); + $data['Name'] = $object->getName(); + $data['Description'] = $object->getDescription(); + $values = array(); + foreach ($object->getSettable() as $value) { + $values[] = $value; } - if (null !== $object->getDestination()) { - $data->{'Destination'} = $object->getDestination(); + $data['Settable'] = $values; + $data['Source'] = $object->getSource(); + $data['Destination'] = $object->getDestination(); + $data['Type'] = $object->getType(); + $values_1 = array(); + foreach ($object->getOptions() as $value_1) { + $values_1[] = $value_1; } - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); - } - if (null !== $object->getOptions()) { - $values_1 = []; - foreach ($object->getOptions() as $value_1) { - $values_1[] = $value_1; - } - $data->{'Options'} = $values_1; - } - + $data['Options'] = $values_1; return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PluginMount' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginNormalizer.php b/src/Normalizer/PluginNormalizer.php index f24ad2fd..172fd9e9 100644 --- a/src/Normalizer/PluginNormalizer.php +++ b/src/Normalizer/PluginNormalizer.php @@ -1,87 +1,104 @@ {'Id'} !== null) { - $object->setId($data->{'Id'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (\array_key_exists('Id', $data) && $data['Id'] !== null) { + $object->setId($data['Id']); } - if (property_exists($data, 'Enabled') && $data->{'Enabled'} !== null) { - $object->setEnabled($data->{'Enabled'}); + elseif (\array_key_exists('Id', $data) && $data['Id'] === null) { + $object->setId(null); } - if (property_exists($data, 'Settings') && $data->{'Settings'} !== null) { - $object->setSettings($this->denormalizer->denormalize($data->{'Settings'}, 'Docker\\API\\Model\\PluginSettings', 'json', $context)); + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'PluginReference') && $data->{'PluginReference'} !== null) { - $object->setPluginReference($data->{'PluginReference'}); + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); } - if (property_exists($data, 'Config') && $data->{'Config'} !== null) { - $object->setConfig($this->denormalizer->denormalize($data->{'Config'}, 'Docker\\API\\Model\\PluginConfig', 'json', $context)); + if (\array_key_exists('Enabled', $data) && $data['Enabled'] !== null) { + $object->setEnabled($data['Enabled']); } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); + elseif (\array_key_exists('Enabled', $data) && $data['Enabled'] === null) { + $object->setEnabled(null); } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + if (\array_key_exists('Settings', $data) && $data['Settings'] !== null) { + $object->setSettings($this->denormalizer->denormalize($data['Settings'], 'Docker\\API\\Model\\PluginSettings', 'json', $context)); } - if (null !== $object->getEnabled()) { - $data->{'Enabled'} = $object->getEnabled(); + elseif (\array_key_exists('Settings', $data) && $data['Settings'] === null) { + $object->setSettings(null); } - if (null !== $object->getSettings()) { - $data->{'Settings'} = $this->normalizer->normalize($object->getSettings(), 'json', $context); + if (\array_key_exists('PluginReference', $data) && $data['PluginReference'] !== null) { + $object->setPluginReference($data['PluginReference']); } - if (null !== $object->getPluginReference()) { - $data->{'PluginReference'} = $object->getPluginReference(); + elseif (\array_key_exists('PluginReference', $data) && $data['PluginReference'] === null) { + $object->setPluginReference(null); } - if (null !== $object->getConfig()) { - $data->{'Config'} = $this->normalizer->normalize($object->getConfig(), 'json', $context); + if (\array_key_exists('Config', $data) && $data['Config'] !== null) { + $object->setConfig($this->denormalizer->denormalize($data['Config'], 'Docker\\API\\Model\\PluginConfig', '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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\Plugin' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginPrivilegeNormalizer.php b/src/Normalizer/PluginPrivilegeNormalizer.php new file mode 100644 index 00000000..af78cf0f --- /dev/null +++ b/src/Normalizer/PluginPrivilegeNormalizer.php @@ -0,0 +1,93 @@ +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 = array(); + 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 = array()) + { + $data = array(); + 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 = array(); + foreach ($object->getValue() as $value) { + $values[] = $value; + } + $data['Value'] = $values; + } + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PluginPrivilege' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginSettingsNormalizer.php b/src/Normalizer/PluginSettingsNormalizer.php index 5c1f47ff..06b93951 100644 --- a/src/Normalizer/PluginSettingsNormalizer.php +++ b/src/Normalizer/PluginSettingsNormalizer.php @@ -1,107 +1,118 @@ {'Mounts'} !== null) { - $values = []; - foreach ($data->{'Mounts'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Mounts', $data) && $data['Mounts'] !== null) { + $values = array(); + foreach ($data['Mounts'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\PluginMount', 'json', $context); } $object->setMounts($values); } - if (property_exists($data, 'Env') && $data->{'Env'} !== null) { - $values_1 = []; - foreach ($data->{'Env'} as $value_1) { + elseif (\array_key_exists('Mounts', $data) && $data['Mounts'] === null) { + $object->setMounts(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_1 = array(); + foreach ($data['Env'] as $value_1) { $values_1[] = $value_1; } $object->setEnv($values_1); } - if (property_exists($data, 'Args') && $data->{'Args'} !== null) { - $values_2 = []; - foreach ($data->{'Args'} as $value_2) { + elseif (\array_key_exists('Env', $data) && $data['Env'] === null) { + $object->setEnv(null); + } + if (\array_key_exists('Args', $data) && $data['Args'] !== null) { + $values_2 = array(); + foreach ($data['Args'] as $value_2) { $values_2[] = $value_2; } $object->setArgs($values_2); } - if (property_exists($data, 'Devices') && $data->{'Devices'} !== null) { - $values_3 = []; - foreach ($data->{'Devices'} as $value_3) { + elseif (\array_key_exists('Args', $data) && $data['Args'] === null) { + $object->setArgs(null); + } + if (\array_key_exists('Devices', $data) && $data['Devices'] !== null) { + $values_3 = array(); + foreach ($data['Devices'] as $value_3) { $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\PluginDevice', 'json', $context); } $object->setDevices($values_3); } - + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getMounts()) { - $values = []; - foreach ($object->getMounts() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Mounts'} = $values; + $data = array(); + $values = array(); + foreach ($object->getMounts() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - if (null !== $object->getEnv()) { - $values_1 = []; - foreach ($object->getEnv() as $value_1) { - $values_1[] = $value_1; - } - $data->{'Env'} = $values_1; + $data['Mounts'] = $values; + $values_1 = array(); + foreach ($object->getEnv() as $value_1) { + $values_1[] = $value_1; } - if (null !== $object->getArgs()) { - $values_2 = []; - foreach ($object->getArgs() as $value_2) { - $values_2[] = $value_2; - } - $data->{'Args'} = $values_2; + $data['Env'] = $values_1; + $values_2 = array(); + foreach ($object->getArgs() as $value_2) { + $values_2[] = $value_2; } - if (null !== $object->getDevices()) { - $values_3 = []; - foreach ($object->getDevices() as $value_3) { - $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); - } - $data->{'Devices'} = $values_3; + $data['Args'] = $values_2; + $values_3 = array(); + 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 array('Docker\\API\\Model\\PluginSettings' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginsInfoNormalizer.php b/src/Normalizer/PluginsInfoNormalizer.php index 748ac1aa..e7d32240 100644 --- a/src/Normalizer/PluginsInfoNormalizer.php +++ b/src/Normalizer/PluginsInfoNormalizer.php @@ -1,107 +1,126 @@ {'Volume'} !== null) { - $values = []; - foreach ($data->{'Volume'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Volume', $data) && $data['Volume'] !== null) { + $values = array(); + foreach ($data['Volume'] as $value) { $values[] = $value; } $object->setVolume($values); } - if (property_exists($data, 'Network') && $data->{'Network'} !== null) { - $values_1 = []; - foreach ($data->{'Network'} as $value_1) { + elseif (\array_key_exists('Volume', $data) && $data['Volume'] === null) { + $object->setVolume(null); + } + if (\array_key_exists('Network', $data) && $data['Network'] !== null) { + $values_1 = array(); + foreach ($data['Network'] as $value_1) { $values_1[] = $value_1; } $object->setNetwork($values_1); } - if (property_exists($data, 'Authorization') && $data->{'Authorization'} !== null) { - $values_2 = []; - foreach ($data->{'Authorization'} as $value_2) { + elseif (\array_key_exists('Network', $data) && $data['Network'] === null) { + $object->setNetwork(null); + } + if (\array_key_exists('Authorization', $data) && $data['Authorization'] !== null) { + $values_2 = array(); + foreach ($data['Authorization'] as $value_2) { $values_2[] = $value_2; } $object->setAuthorization($values_2); } - if (property_exists($data, 'Log') && $data->{'Log'} !== null) { - $values_3 = []; - foreach ($data->{'Log'} as $value_3) { + elseif (\array_key_exists('Authorization', $data) && $data['Authorization'] === null) { + $object->setAuthorization(null); + } + if (\array_key_exists('Log', $data) && $data['Log'] !== null) { + $values_3 = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getVolume()) { - $values = []; + $data = array(); + if ($object->isInitialized('volume') && null !== $object->getVolume()) { + $values = array(); foreach ($object->getVolume() as $value) { $values[] = $value; } - $data->{'Volume'} = $values; + $data['Volume'] = $values; } - if (null !== $object->getNetwork()) { - $values_1 = []; + if ($object->isInitialized('network') && null !== $object->getNetwork()) { + $values_1 = array(); foreach ($object->getNetwork() as $value_1) { $values_1[] = $value_1; } - $data->{'Network'} = $values_1; + $data['Network'] = $values_1; } - if (null !== $object->getAuthorization()) { - $values_2 = []; + if ($object->isInitialized('authorization') && null !== $object->getAuthorization()) { + $values_2 = array(); foreach ($object->getAuthorization() as $value_2) { $values_2[] = $value_2; } - $data->{'Authorization'} = $values_2; + $data['Authorization'] = $values_2; } - if (null !== $object->getLog()) { - $values_3 = []; + if ($object->isInitialized('log') && null !== $object->getLog()) { + $values_3 = array(); foreach ($object->getLog() as $value_3) { $values_3[] = $value_3; } - $data->{'Log'} = $values_3; + $data['Log'] = $values_3; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PluginsInfo' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PluginsNameUpgradePostBodyItemNormalizer.php b/src/Normalizer/PluginsNameUpgradePostBodyItemNormalizer.php deleted file mode 100644 index 324b8ebf..00000000 --- a/src/Normalizer/PluginsNameUpgradePostBodyItemNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); - } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $values = []; - foreach ($data->{'Value'} as $value) { - $values[] = $value; - } - $object->setValue($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->getDescription()) { - $data->{'Description'} = $object->getDescription(); - } - if (null !== $object->getValue()) { - $values = []; - foreach ($object->getValue() as $value) { - $values[] = $value; - } - $data->{'Value'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/PluginsPrivilegesGetResponse200ItemNormalizer.php b/src/Normalizer/PluginsPrivilegesGetResponse200ItemNormalizer.php deleted file mode 100644 index 5c361ccb..00000000 --- a/src/Normalizer/PluginsPrivilegesGetResponse200ItemNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); - } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $values = []; - foreach ($data->{'Value'} as $value) { - $values[] = $value; - } - $object->setValue($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->getDescription()) { - $data->{'Description'} = $object->getDescription(); - } - if (null !== $object->getValue()) { - $values = []; - foreach ($object->getValue() as $value) { - $values[] = $value; - } - $data->{'Value'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/PluginsPullPostBodyItemNormalizer.php b/src/Normalizer/PluginsPullPostBodyItemNormalizer.php deleted file mode 100644 index ca126dd9..00000000 --- a/src/Normalizer/PluginsPullPostBodyItemNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); - } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $values = []; - foreach ($data->{'Value'} as $value) { - $values[] = $value; - } - $object->setValue($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->getDescription()) { - $data->{'Description'} = $object->getDescription(); - } - if (null !== $object->getValue()) { - $values = []; - foreach ($object->getValue() as $value) { - $values[] = $value; - } - $data->{'Value'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/PortBindingNormalizer.php b/src/Normalizer/PortBindingNormalizer.php index b10dedf5..6c976c05 100644 --- a/src/Normalizer/PortBindingNormalizer.php +++ b/src/Normalizer/PortBindingNormalizer.php @@ -1,63 +1,76 @@ {'HostIp'} !== null) { - $object->setHostIp($data->{'HostIp'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'HostPort') && $data->{'HostPort'} !== null) { - $object->setHostPort($data->{'HostPort'}); + 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; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getHostIp()) { - $data->{'HostIp'} = $object->getHostIp(); + $data = array(); + if ($object->isInitialized('hostIp') && null !== $object->getHostIp()) { + $data['HostIp'] = $object->getHostIp(); } - if (null !== $object->getHostPort()) { - $data->{'HostPort'} = $object->getHostPort(); + if ($object->isInitialized('hostPort') && null !== $object->getHostPort()) { + $data['HostPort'] = $object->getHostPort(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\PortBinding' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PortNormalizer.php b/src/Normalizer/PortNormalizer.php index 4f6a07fd..0e845827 100644 --- a/src/Normalizer/PortNormalizer.php +++ b/src/Normalizer/PortNormalizer.php @@ -1,75 +1,90 @@ {'IP'} !== null) { - $object->setIP($data->{'IP'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'PrivatePort') && $data->{'PrivatePort'} !== null) { - $object->setPrivatePort($data->{'PrivatePort'}); + if (\array_key_exists('IP', $data) && $data['IP'] !== null) { + $object->setIP($data['IP']); } - if (property_exists($data, 'PublicPort') && $data->{'PublicPort'} !== null) { - $object->setPublicPort($data->{'PublicPort'}); + elseif (\array_key_exists('IP', $data) && $data['IP'] === null) { + $object->setIP(null); } - if (property_exists($data, 'Type') && $data->{'Type'} !== null) { - $object->setType($data->{'Type'}); + 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; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getIP()) { - $data->{'IP'} = $object->getIP(); - } - if (null !== $object->getPrivatePort()) { - $data->{'PrivatePort'} = $object->getPrivatePort(); + $data = array(); + if ($object->isInitialized('iP') && null !== $object->getIP()) { + $data['IP'] = $object->getIP(); } - if (null !== $object->getPublicPort()) { - $data->{'PublicPort'} = $object->getPublicPort(); + $data['PrivatePort'] = $object->getPrivatePort(); + if ($object->isInitialized('publicPort') && null !== $object->getPublicPort()) { + $data['PublicPort'] = $object->getPublicPort(); } - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); - } - + $data['Type'] = $object->getType(); return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\Port' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ProcessConfigNormalizer.php b/src/Normalizer/ProcessConfigNormalizer.php index d545c545..b95d7de6 100644 --- a/src/Normalizer/ProcessConfigNormalizer.php +++ b/src/Normalizer/ProcessConfigNormalizer.php @@ -1,89 +1,111 @@ {'privileged'} !== null) { - $object->setPrivileged($data->{'privileged'}); + 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 (property_exists($data, 'user') && $data->{'user'} !== null) { - $object->setUser($data->{'user'}); + if (\array_key_exists('user', $data) && $data['user'] !== null) { + $object->setUser($data['user']); } - if (property_exists($data, 'tty') && $data->{'tty'} !== null) { - $object->setTty($data->{'tty'}); + elseif (\array_key_exists('user', $data) && $data['user'] === null) { + $object->setUser(null); } - if (property_exists($data, 'entrypoint') && $data->{'entrypoint'} !== null) { - $object->setEntrypoint($data->{'entrypoint'}); + if (\array_key_exists('tty', $data) && $data['tty'] !== null) { + $object->setTty($data['tty']); } - if (property_exists($data, 'arguments') && $data->{'arguments'} !== null) { - $values = []; - foreach ($data->{'arguments'} as $value) { + 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 = array(); + foreach ($data['arguments'] as $value) { $values[] = $value; } $object->setArguments($values); } - + elseif (\array_key_exists('arguments', $data) && $data['arguments'] === null) { + $object->setArguments(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getPrivileged()) { - $data->{'privileged'} = $object->getPrivileged(); + $data = array(); + if ($object->isInitialized('privileged') && null !== $object->getPrivileged()) { + $data['privileged'] = $object->getPrivileged(); } - if (null !== $object->getUser()) { - $data->{'user'} = $object->getUser(); + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['user'] = $object->getUser(); } - if (null !== $object->getTty()) { - $data->{'tty'} = $object->getTty(); + if ($object->isInitialized('tty') && null !== $object->getTty()) { + $data['tty'] = $object->getTty(); } - if (null !== $object->getEntrypoint()) { - $data->{'entrypoint'} = $object->getEntrypoint(); + if ($object->isInitialized('entrypoint') && null !== $object->getEntrypoint()) { + $data['entrypoint'] = $object->getEntrypoint(); } - if (null !== $object->getArguments()) { - $values = []; + if ($object->isInitialized('arguments') && null !== $object->getArguments()) { + $values = array(); foreach ($object->getArguments() as $value) { $values[] = $value; } - $data->{'arguments'} = $values; + $data['arguments'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ProcessConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ProgressDetailNormalizer.php b/src/Normalizer/ProgressDetailNormalizer.php index e96a0441..bce3ff16 100644 --- a/src/Normalizer/ProgressDetailNormalizer.php +++ b/src/Normalizer/ProgressDetailNormalizer.php @@ -1,63 +1,76 @@ {'current'} !== null) { - $object->setCurrent($data->{'current'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'total') && $data->{'total'} !== null) { - $object->setTotal($data->{'total'}); + 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; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getCurrent()) { - $data->{'current'} = $object->getCurrent(); + $data = array(); + if ($object->isInitialized('current') && null !== $object->getCurrent()) { + $data['current'] = $object->getCurrent(); } - if (null !== $object->getTotal()) { - $data->{'total'} = $object->getTotal(); + if ($object->isInitialized('total') && null !== $object->getTotal()) { + $data['total'] = $object->getTotal(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ProgressDetail' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/PushImageInfoNormalizer.php b/src/Normalizer/PushImageInfoNormalizer.php index 91891730..371d3bac 100644 --- a/src/Normalizer/PushImageInfoNormalizer.php +++ b/src/Normalizer/PushImageInfoNormalizer.php @@ -1,75 +1,94 @@ {'error'} !== null) { - $object->setError($data->{'error'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'status') && $data->{'status'} !== null) { - $object->setStatus($data->{'status'}); + if (\array_key_exists('error', $data) && $data['error'] !== null) { + $object->setError($data['error']); } - if (property_exists($data, 'progress') && $data->{'progress'} !== null) { - $object->setProgress($data->{'progress'}); + elseif (\array_key_exists('error', $data) && $data['error'] === null) { + $object->setError(null); } - if (property_exists($data, 'progressDetail') && $data->{'progressDetail'} !== null) { - $object->setProgressDetail($this->denormalizer->denormalize($data->{'progressDetail'}, 'Docker\\API\\Model\\ProgressDetail', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('progressDetail', $data) && $data['progressDetail'] === null) { + $object->setProgressDetail(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getError()) { - $data->{'error'} = $object->getError(); + $data = array(); + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['error'] = $object->getError(); } - if (null !== $object->getStatus()) { - $data->{'status'} = $object->getStatus(); + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['status'] = $object->getStatus(); } - if (null !== $object->getProgress()) { - $data->{'progress'} = $object->getProgress(); + if ($object->isInitialized('progress') && null !== $object->getProgress()) { + $data['progress'] = $object->getProgress(); } - if (null !== $object->getProgressDetail()) { - $data->{'progressDetail'} = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); + 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 array('Docker\\API\\Model\\PushImageInfo' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/RegistryServiceConfigNormalizer.php b/src/Normalizer/RegistryServiceConfigNormalizer.php index c4b2bf06..258a1690 100644 --- a/src/Normalizer/RegistryServiceConfigNormalizer.php +++ b/src/Normalizer/RegistryServiceConfigNormalizer.php @@ -1,121 +1,143 @@ {'AllowNondistributableArtifactsCIDRs'} !== null) { - $values = []; - foreach ($data->{'AllowNondistributableArtifactsCIDRs'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AllowNondistributableArtifactsCIDRs', $data) && $data['AllowNondistributableArtifactsCIDRs'] !== null) { + $values = array(); + foreach ($data['AllowNondistributableArtifactsCIDRs'] as $value) { $values[] = $value; } $object->setAllowNondistributableArtifactsCIDRs($values); } - if (property_exists($data, 'AllowNondistributableArtifactsHostnames') && $data->{'AllowNondistributableArtifactsHostnames'} !== null) { - $values_1 = []; - foreach ($data->{'AllowNondistributableArtifactsHostnames'} as $value_1) { + elseif (\array_key_exists('AllowNondistributableArtifactsCIDRs', $data) && $data['AllowNondistributableArtifactsCIDRs'] === null) { + $object->setAllowNondistributableArtifactsCIDRs(null); + } + if (\array_key_exists('AllowNondistributableArtifactsHostnames', $data) && $data['AllowNondistributableArtifactsHostnames'] !== null) { + $values_1 = array(); + foreach ($data['AllowNondistributableArtifactsHostnames'] as $value_1) { $values_1[] = $value_1; } $object->setAllowNondistributableArtifactsHostnames($values_1); } - if (property_exists($data, 'InsecureRegistryCIDRs') && $data->{'InsecureRegistryCIDRs'} !== null) { - $values_2 = []; - foreach ($data->{'InsecureRegistryCIDRs'} as $value_2) { + elseif (\array_key_exists('AllowNondistributableArtifactsHostnames', $data) && $data['AllowNondistributableArtifactsHostnames'] === null) { + $object->setAllowNondistributableArtifactsHostnames(null); + } + if (\array_key_exists('InsecureRegistryCIDRs', $data) && $data['InsecureRegistryCIDRs'] !== null) { + $values_2 = array(); + foreach ($data['InsecureRegistryCIDRs'] as $value_2) { $values_2[] = $value_2; } $object->setInsecureRegistryCIDRs($values_2); } - if (property_exists($data, 'IndexConfigs') && $data->{'IndexConfigs'} !== null) { - $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'IndexConfigs'} as $key => $value_3) { + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['IndexConfigs'] as $key => $value_3) { $values_3[$key] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\IndexInfo', 'json', $context); } $object->setIndexConfigs($values_3); } - if (property_exists($data, 'Mirrors') && $data->{'Mirrors'} !== null) { - $values_4 = []; - foreach ($data->{'Mirrors'} as $value_4) { + elseif (\array_key_exists('IndexConfigs', $data) && $data['IndexConfigs'] === null) { + $object->setIndexConfigs(null); + } + if (\array_key_exists('Mirrors', $data) && $data['Mirrors'] !== null) { + $values_4 = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getAllowNondistributableArtifactsCIDRs()) { - $values = []; + $data = array(); + if ($object->isInitialized('allowNondistributableArtifactsCIDRs') && null !== $object->getAllowNondistributableArtifactsCIDRs()) { + $values = array(); foreach ($object->getAllowNondistributableArtifactsCIDRs() as $value) { $values[] = $value; } - $data->{'AllowNondistributableArtifactsCIDRs'} = $values; + $data['AllowNondistributableArtifactsCIDRs'] = $values; } - if (null !== $object->getAllowNondistributableArtifactsHostnames()) { - $values_1 = []; + if ($object->isInitialized('allowNondistributableArtifactsHostnames') && null !== $object->getAllowNondistributableArtifactsHostnames()) { + $values_1 = array(); foreach ($object->getAllowNondistributableArtifactsHostnames() as $value_1) { $values_1[] = $value_1; } - $data->{'AllowNondistributableArtifactsHostnames'} = $values_1; + $data['AllowNondistributableArtifactsHostnames'] = $values_1; } - if (null !== $object->getInsecureRegistryCIDRs()) { - $values_2 = []; + if ($object->isInitialized('insecureRegistryCIDRs') && null !== $object->getInsecureRegistryCIDRs()) { + $values_2 = array(); foreach ($object->getInsecureRegistryCIDRs() as $value_2) { $values_2[] = $value_2; } - $data->{'InsecureRegistryCIDRs'} = $values_2; + $data['InsecureRegistryCIDRs'] = $values_2; } - if (null !== $object->getIndexConfigs()) { - $values_3 = new \stdClass(); + if ($object->isInitialized('indexConfigs') && null !== $object->getIndexConfigs()) { + $values_3 = array(); foreach ($object->getIndexConfigs() as $key => $value_3) { - $values_3->{$key} = $this->normalizer->normalize($value_3, 'json', $context); + $values_3[$key] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'IndexConfigs'} = $values_3; + $data['IndexConfigs'] = $values_3; } - if (null !== $object->getMirrors()) { - $values_4 = []; + if ($object->isInitialized('mirrors') && null !== $object->getMirrors()) { + $values_4 = array(); foreach ($object->getMirrors() as $value_4) { $values_4[] = $value_4; } - $data->{'Mirrors'} = $values_4; + $data['Mirrors'] = $values_4; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\RegistryServiceConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ResourceObjectNormalizer.php b/src/Normalizer/ResourceObjectNormalizer.php index f9149445..cf06fc79 100644 --- a/src/Normalizer/ResourceObjectNormalizer.php +++ b/src/Normalizer/ResourceObjectNormalizer.php @@ -1,77 +1,93 @@ {'NanoCPUs'} !== null) { - $object->setNanoCPUs($data->{'NanoCPUs'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NanoCPUs', $data) && $data['NanoCPUs'] !== null) { + $object->setNanoCPUs($data['NanoCPUs']); } - if (property_exists($data, 'MemoryBytes') && $data->{'MemoryBytes'} !== null) { - $object->setMemoryBytes($data->{'MemoryBytes'}); + elseif (\array_key_exists('NanoCPUs', $data) && $data['NanoCPUs'] === null) { + $object->setNanoCPUs(null); } - if (property_exists($data, 'GenericResources') && $data->{'GenericResources'} !== null) { - $values = []; - foreach ($data->{'GenericResources'} as $value) { + 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 = array(); + foreach ($data['GenericResources'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\GenericResourcesItem', 'json', $context); } $object->setGenericResources($values); } - + elseif (\array_key_exists('GenericResources', $data) && $data['GenericResources'] === null) { + $object->setGenericResources(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getNanoCPUs()) { - $data->{'NanoCPUs'} = $object->getNanoCPUs(); + $data = array(); + if ($object->isInitialized('nanoCPUs') && null !== $object->getNanoCPUs()) { + $data['NanoCPUs'] = $object->getNanoCPUs(); } - if (null !== $object->getMemoryBytes()) { - $data->{'MemoryBytes'} = $object->getMemoryBytes(); + if ($object->isInitialized('memoryBytes') && null !== $object->getMemoryBytes()) { + $data['MemoryBytes'] = $object->getMemoryBytes(); } - if (null !== $object->getGenericResources()) { - $values = []; + if ($object->isInitialized('genericResources') && null !== $object->getGenericResources()) { + $values = array(); foreach ($object->getGenericResources() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'GenericResources'} = $values; + $data['GenericResources'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ResourceObject' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ResourcesBlkioWeightDeviceItemNormalizer.php b/src/Normalizer/ResourcesBlkioWeightDeviceItemNormalizer.php index 73570f9c..9f594294 100644 --- a/src/Normalizer/ResourcesBlkioWeightDeviceItemNormalizer.php +++ b/src/Normalizer/ResourcesBlkioWeightDeviceItemNormalizer.php @@ -1,63 +1,76 @@ {'Path'} !== null) { - $object->setPath($data->{'Path'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Weight') && $data->{'Weight'} !== null) { - $object->setWeight($data->{'Weight'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); + $data = array(); + if ($object->isInitialized('path') && null !== $object->getPath()) { + $data['Path'] = $object->getPath(); } - if (null !== $object->getWeight()) { - $data->{'Weight'} = $object->getWeight(); + if ($object->isInitialized('weight') && null !== $object->getWeight()) { + $data['Weight'] = $object->getWeight(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ResourcesBlkioWeightDeviceItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ResourcesNormalizer.php b/src/Normalizer/ResourcesNormalizer.php index 5d706503..a97b5e6b 100644 --- a/src/Normalizer/ResourcesNormalizer.php +++ b/src/Normalizer/ResourcesNormalizer.php @@ -1,295 +1,409 @@ {'CpuShares'} !== null) { - $object->setCpuShares($data->{'CpuShares'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Memory') && $data->{'Memory'} !== null) { - $object->setMemory($data->{'Memory'}); + if (\array_key_exists('CpuShares', $data) && $data['CpuShares'] !== null) { + $object->setCpuShares($data['CpuShares']); } - if (property_exists($data, 'CgroupParent') && $data->{'CgroupParent'} !== null) { - $object->setCgroupParent($data->{'CgroupParent'}); + elseif (\array_key_exists('CpuShares', $data) && $data['CpuShares'] === null) { + $object->setCpuShares(null); } - if (property_exists($data, 'BlkioWeight') && $data->{'BlkioWeight'} !== null) { - $object->setBlkioWeight($data->{'BlkioWeight'}); + if (\array_key_exists('Memory', $data) && $data['Memory'] !== null) { + $object->setMemory($data['Memory']); } - if (property_exists($data, 'BlkioWeightDevice') && $data->{'BlkioWeightDevice'} !== null) { - $values = []; - foreach ($data->{'BlkioWeightDevice'} as $value) { + 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 = array(); + foreach ($data['BlkioWeightDevice'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\ResourcesBlkioWeightDeviceItem', 'json', $context); } $object->setBlkioWeightDevice($values); } - if (property_exists($data, 'BlkioDeviceReadBps') && $data->{'BlkioDeviceReadBps'} !== null) { - $values_1 = []; - foreach ($data->{'BlkioDeviceReadBps'} as $value_1) { + elseif (\array_key_exists('BlkioWeightDevice', $data) && $data['BlkioWeightDevice'] === null) { + $object->setBlkioWeightDevice(null); + } + if (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] !== null) { + $values_1 = array(); + foreach ($data['BlkioDeviceReadBps'] as $value_1) { $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); } $object->setBlkioDeviceReadBps($values_1); } - if (property_exists($data, 'BlkioDeviceWriteBps') && $data->{'BlkioDeviceWriteBps'} !== null) { - $values_2 = []; - foreach ($data->{'BlkioDeviceWriteBps'} as $value_2) { + elseif (\array_key_exists('BlkioDeviceReadBps', $data) && $data['BlkioDeviceReadBps'] === null) { + $object->setBlkioDeviceReadBps(null); + } + if (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] !== null) { + $values_2 = array(); + foreach ($data['BlkioDeviceWriteBps'] as $value_2) { $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); } $object->setBlkioDeviceWriteBps($values_2); } - if (property_exists($data, 'BlkioDeviceReadIOps') && $data->{'BlkioDeviceReadIOps'} !== null) { - $values_3 = []; - foreach ($data->{'BlkioDeviceReadIOps'} as $value_3) { + elseif (\array_key_exists('BlkioDeviceWriteBps', $data) && $data['BlkioDeviceWriteBps'] === null) { + $object->setBlkioDeviceWriteBps(null); + } + if (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] !== null) { + $values_3 = array(); + foreach ($data['BlkioDeviceReadIOps'] as $value_3) { $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); } $object->setBlkioDeviceReadIOps($values_3); } - if (property_exists($data, 'BlkioDeviceWriteIOps') && $data->{'BlkioDeviceWriteIOps'} !== null) { - $values_4 = []; - foreach ($data->{'BlkioDeviceWriteIOps'} as $value_4) { + elseif (\array_key_exists('BlkioDeviceReadIOps', $data) && $data['BlkioDeviceReadIOps'] === null) { + $object->setBlkioDeviceReadIOps(null); + } + if (\array_key_exists('BlkioDeviceWriteIOps', $data) && $data['BlkioDeviceWriteIOps'] !== null) { + $values_4 = array(); + foreach ($data['BlkioDeviceWriteIOps'] as $value_4) { $values_4[] = $this->denormalizer->denormalize($value_4, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); } $object->setBlkioDeviceWriteIOps($values_4); } - if (property_exists($data, 'CpuPeriod') && $data->{'CpuPeriod'} !== null) { - $object->setCpuPeriod($data->{'CpuPeriod'}); + 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']); } - if (property_exists($data, 'CpuQuota') && $data->{'CpuQuota'} !== null) { - $object->setCpuQuota($data->{'CpuQuota'}); + elseif (\array_key_exists('CpuQuota', $data) && $data['CpuQuota'] === null) { + $object->setCpuQuota(null); } - if (property_exists($data, 'CpuRealtimePeriod') && $data->{'CpuRealtimePeriod'} !== null) { - $object->setCpuRealtimePeriod($data->{'CpuRealtimePeriod'}); + if (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] !== null) { + $object->setCpuRealtimePeriod($data['CpuRealtimePeriod']); } - if (property_exists($data, 'CpuRealtimeRuntime') && $data->{'CpuRealtimeRuntime'} !== null) { - $object->setCpuRealtimeRuntime($data->{'CpuRealtimeRuntime'}); + elseif (\array_key_exists('CpuRealtimePeriod', $data) && $data['CpuRealtimePeriod'] === null) { + $object->setCpuRealtimePeriod(null); } - if (property_exists($data, 'CpusetCpus') && $data->{'CpusetCpus'} !== null) { - $object->setCpusetCpus($data->{'CpusetCpus'}); + if (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] !== null) { + $object->setCpuRealtimeRuntime($data['CpuRealtimeRuntime']); } - if (property_exists($data, 'CpusetMems') && $data->{'CpusetMems'} !== null) { - $object->setCpusetMems($data->{'CpusetMems'}); + elseif (\array_key_exists('CpuRealtimeRuntime', $data) && $data['CpuRealtimeRuntime'] === null) { + $object->setCpuRealtimeRuntime(null); } - if (property_exists($data, 'Devices') && $data->{'Devices'} !== null) { - $values_5 = []; - foreach ($data->{'Devices'} as $value_5) { + 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 = array(); + foreach ($data['Devices'] as $value_5) { $values_5[] = $this->denormalizer->denormalize($value_5, 'Docker\\API\\Model\\DeviceMapping', 'json', $context); } $object->setDevices($values_5); } - if (property_exists($data, 'DeviceCgroupRules') && $data->{'DeviceCgroupRules'} !== null) { - $values_6 = []; - foreach ($data->{'DeviceCgroupRules'} as $value_6) { + elseif (\array_key_exists('Devices', $data) && $data['Devices'] === null) { + $object->setDevices(null); + } + if (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] !== null) { + $values_6 = array(); + foreach ($data['DeviceCgroupRules'] as $value_6) { $values_6[] = $value_6; } $object->setDeviceCgroupRules($values_6); } - if (property_exists($data, 'DiskQuota') && $data->{'DiskQuota'} !== null) { - $object->setDiskQuota($data->{'DiskQuota'}); + elseif (\array_key_exists('DeviceCgroupRules', $data) && $data['DeviceCgroupRules'] === null) { + $object->setDeviceCgroupRules(null); + } + if (\array_key_exists('DeviceRequests', $data) && $data['DeviceRequests'] !== null) { + $values_7 = array(); + foreach ($data['DeviceRequests'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, 'Docker\\API\\Model\\DeviceRequest', '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']); } - if (property_exists($data, 'KernelMemory') && $data->{'KernelMemory'} !== null) { - $object->setKernelMemory($data->{'KernelMemory'}); + elseif (\array_key_exists('MemorySwap', $data) && $data['MemorySwap'] === null) { + $object->setMemorySwap(null); } - if (property_exists($data, 'MemoryReservation') && $data->{'MemoryReservation'} !== null) { - $object->setMemoryReservation($data->{'MemoryReservation'}); + if (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] !== null) { + $object->setMemorySwappiness($data['MemorySwappiness']); } - if (property_exists($data, 'MemorySwap') && $data->{'MemorySwap'} !== null) { - $object->setMemorySwap($data->{'MemorySwap'}); + elseif (\array_key_exists('MemorySwappiness', $data) && $data['MemorySwappiness'] === null) { + $object->setMemorySwappiness(null); } - if (property_exists($data, 'MemorySwappiness') && $data->{'MemorySwappiness'} !== null) { - $object->setMemorySwappiness($data->{'MemorySwappiness'}); + if (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] !== null) { + $object->setNanoCpus($data['NanoCpus']); } - if (property_exists($data, 'NanoCPUs') && $data->{'NanoCPUs'} !== null) { - $object->setNanoCPUs($data->{'NanoCPUs'}); + elseif (\array_key_exists('NanoCpus', $data) && $data['NanoCpus'] === null) { + $object->setNanoCpus(null); } - if (property_exists($data, 'OomKillDisable') && $data->{'OomKillDisable'} !== null) { - $object->setOomKillDisable($data->{'OomKillDisable'}); + if (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] !== null) { + $object->setOomKillDisable($data['OomKillDisable']); } - if (property_exists($data, 'PidsLimit') && $data->{'PidsLimit'} !== null) { - $object->setPidsLimit($data->{'PidsLimit'}); + elseif (\array_key_exists('OomKillDisable', $data) && $data['OomKillDisable'] === null) { + $object->setOomKillDisable(null); } - if (property_exists($data, 'Ulimits') && $data->{'Ulimits'} !== null) { - $values_7 = []; - foreach ($data->{'Ulimits'} as $value_7) { - $values_7[] = $this->denormalizer->denormalize($value_7, 'Docker\\API\\Model\\ResourcesUlimitsItem', 'json', $context); + 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 = array(); + foreach ($data['Ulimits'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, 'Docker\\API\\Model\\ResourcesUlimitsItem', 'json', $context); } - $object->setUlimits($values_7); + $object->setUlimits($values_8); } - if (property_exists($data, 'CpuCount') && $data->{'CpuCount'} !== null) { - $object->setCpuCount($data->{'CpuCount'}); + elseif (\array_key_exists('Ulimits', $data) && $data['Ulimits'] === null) { + $object->setUlimits(null); } - if (property_exists($data, 'CpuPercent') && $data->{'CpuPercent'} !== null) { - $object->setCpuPercent($data->{'CpuPercent'}); + if (\array_key_exists('CpuCount', $data) && $data['CpuCount'] !== null) { + $object->setCpuCount($data['CpuCount']); } - if (property_exists($data, 'IOMaximumIOps') && $data->{'IOMaximumIOps'} !== null) { - $object->setIOMaximumIOps($data->{'IOMaximumIOps'}); + elseif (\array_key_exists('CpuCount', $data) && $data['CpuCount'] === null) { + $object->setCpuCount(null); } - if (property_exists($data, 'IOMaximumBandwidth') && $data->{'IOMaximumBandwidth'} !== null) { - $object->setIOMaximumBandwidth($data->{'IOMaximumBandwidth'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getCpuShares()) { - $data->{'CpuShares'} = $object->getCpuShares(); + $data = array(); + if ($object->isInitialized('cpuShares') && null !== $object->getCpuShares()) { + $data['CpuShares'] = $object->getCpuShares(); } - if (null !== $object->getMemory()) { - $data->{'Memory'} = $object->getMemory(); + if ($object->isInitialized('memory') && null !== $object->getMemory()) { + $data['Memory'] = $object->getMemory(); } - if (null !== $object->getCgroupParent()) { - $data->{'CgroupParent'} = $object->getCgroupParent(); + if ($object->isInitialized('cgroupParent') && null !== $object->getCgroupParent()) { + $data['CgroupParent'] = $object->getCgroupParent(); } - if (null !== $object->getBlkioWeight()) { - $data->{'BlkioWeight'} = $object->getBlkioWeight(); + if ($object->isInitialized('blkioWeight') && null !== $object->getBlkioWeight()) { + $data['BlkioWeight'] = $object->getBlkioWeight(); } - if (null !== $object->getBlkioWeightDevice()) { - $values = []; + if ($object->isInitialized('blkioWeightDevice') && null !== $object->getBlkioWeightDevice()) { + $values = array(); foreach ($object->getBlkioWeightDevice() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'BlkioWeightDevice'} = $values; + $data['BlkioWeightDevice'] = $values; } - if (null !== $object->getBlkioDeviceReadBps()) { - $values_1 = []; + if ($object->isInitialized('blkioDeviceReadBps') && null !== $object->getBlkioDeviceReadBps()) { + $values_1 = array(); foreach ($object->getBlkioDeviceReadBps() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'BlkioDeviceReadBps'} = $values_1; + $data['BlkioDeviceReadBps'] = $values_1; } - if (null !== $object->getBlkioDeviceWriteBps()) { - $values_2 = []; + if ($object->isInitialized('blkioDeviceWriteBps') && null !== $object->getBlkioDeviceWriteBps()) { + $values_2 = array(); foreach ($object->getBlkioDeviceWriteBps() as $value_2) { $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'BlkioDeviceWriteBps'} = $values_2; + $data['BlkioDeviceWriteBps'] = $values_2; } - if (null !== $object->getBlkioDeviceReadIOps()) { - $values_3 = []; + if ($object->isInitialized('blkioDeviceReadIOps') && null !== $object->getBlkioDeviceReadIOps()) { + $values_3 = array(); foreach ($object->getBlkioDeviceReadIOps() as $value_3) { $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'BlkioDeviceReadIOps'} = $values_3; + $data['BlkioDeviceReadIOps'] = $values_3; } - if (null !== $object->getBlkioDeviceWriteIOps()) { - $values_4 = []; + if ($object->isInitialized('blkioDeviceWriteIOps') && null !== $object->getBlkioDeviceWriteIOps()) { + $values_4 = array(); foreach ($object->getBlkioDeviceWriteIOps() as $value_4) { $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); } - $data->{'BlkioDeviceWriteIOps'} = $values_4; + $data['BlkioDeviceWriteIOps'] = $values_4; } - if (null !== $object->getCpuPeriod()) { - $data->{'CpuPeriod'} = $object->getCpuPeriod(); + if ($object->isInitialized('cpuPeriod') && null !== $object->getCpuPeriod()) { + $data['CpuPeriod'] = $object->getCpuPeriod(); } - if (null !== $object->getCpuQuota()) { - $data->{'CpuQuota'} = $object->getCpuQuota(); + if ($object->isInitialized('cpuQuota') && null !== $object->getCpuQuota()) { + $data['CpuQuota'] = $object->getCpuQuota(); } - if (null !== $object->getCpuRealtimePeriod()) { - $data->{'CpuRealtimePeriod'} = $object->getCpuRealtimePeriod(); + if ($object->isInitialized('cpuRealtimePeriod') && null !== $object->getCpuRealtimePeriod()) { + $data['CpuRealtimePeriod'] = $object->getCpuRealtimePeriod(); } - if (null !== $object->getCpuRealtimeRuntime()) { - $data->{'CpuRealtimeRuntime'} = $object->getCpuRealtimeRuntime(); + if ($object->isInitialized('cpuRealtimeRuntime') && null !== $object->getCpuRealtimeRuntime()) { + $data['CpuRealtimeRuntime'] = $object->getCpuRealtimeRuntime(); } - if (null !== $object->getCpusetCpus()) { - $data->{'CpusetCpus'} = $object->getCpusetCpus(); + if ($object->isInitialized('cpusetCpus') && null !== $object->getCpusetCpus()) { + $data['CpusetCpus'] = $object->getCpusetCpus(); } - if (null !== $object->getCpusetMems()) { - $data->{'CpusetMems'} = $object->getCpusetMems(); + if ($object->isInitialized('cpusetMems') && null !== $object->getCpusetMems()) { + $data['CpusetMems'] = $object->getCpusetMems(); } - if (null !== $object->getDevices()) { - $values_5 = []; + if ($object->isInitialized('devices') && null !== $object->getDevices()) { + $values_5 = array(); foreach ($object->getDevices() as $value_5) { $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); } - $data->{'Devices'} = $values_5; + $data['Devices'] = $values_5; } - if (null !== $object->getDeviceCgroupRules()) { - $values_6 = []; + if ($object->isInitialized('deviceCgroupRules') && null !== $object->getDeviceCgroupRules()) { + $values_6 = array(); foreach ($object->getDeviceCgroupRules() as $value_6) { $values_6[] = $value_6; } - $data->{'DeviceCgroupRules'} = $values_6; + $data['DeviceCgroupRules'] = $values_6; + } + if ($object->isInitialized('deviceRequests') && null !== $object->getDeviceRequests()) { + $values_7 = array(); + foreach ($object->getDeviceRequests() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $data['DeviceRequests'] = $values_7; } - if (null !== $object->getDiskQuota()) { - $data->{'DiskQuota'} = $object->getDiskQuota(); + if ($object->isInitialized('kernelMemoryTCP') && null !== $object->getKernelMemoryTCP()) { + $data['KernelMemoryTCP'] = $object->getKernelMemoryTCP(); } - if (null !== $object->getKernelMemory()) { - $data->{'KernelMemory'} = $object->getKernelMemory(); + if ($object->isInitialized('memoryReservation') && null !== $object->getMemoryReservation()) { + $data['MemoryReservation'] = $object->getMemoryReservation(); } - if (null !== $object->getMemoryReservation()) { - $data->{'MemoryReservation'} = $object->getMemoryReservation(); + if ($object->isInitialized('memorySwap') && null !== $object->getMemorySwap()) { + $data['MemorySwap'] = $object->getMemorySwap(); } - if (null !== $object->getMemorySwap()) { - $data->{'MemorySwap'} = $object->getMemorySwap(); + if ($object->isInitialized('memorySwappiness') && null !== $object->getMemorySwappiness()) { + $data['MemorySwappiness'] = $object->getMemorySwappiness(); } - if (null !== $object->getMemorySwappiness()) { - $data->{'MemorySwappiness'} = $object->getMemorySwappiness(); + if ($object->isInitialized('nanoCpus') && null !== $object->getNanoCpus()) { + $data['NanoCpus'] = $object->getNanoCpus(); } - if (null !== $object->getNanoCPUs()) { - $data->{'NanoCPUs'} = $object->getNanoCPUs(); + if ($object->isInitialized('oomKillDisable') && null !== $object->getOomKillDisable()) { + $data['OomKillDisable'] = $object->getOomKillDisable(); } - if (null !== $object->getOomKillDisable()) { - $data->{'OomKillDisable'} = $object->getOomKillDisable(); + if ($object->isInitialized('init') && null !== $object->getInit()) { + $data['Init'] = $object->getInit(); } - if (null !== $object->getPidsLimit()) { - $data->{'PidsLimit'} = $object->getPidsLimit(); + if ($object->isInitialized('pidsLimit') && null !== $object->getPidsLimit()) { + $data['PidsLimit'] = $object->getPidsLimit(); } - if (null !== $object->getUlimits()) { - $values_7 = []; - foreach ($object->getUlimits() as $value_7) { - $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + if ($object->isInitialized('ulimits') && null !== $object->getUlimits()) { + $values_8 = array(); + foreach ($object->getUlimits() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); } - $data->{'Ulimits'} = $values_7; + $data['Ulimits'] = $values_8; } - if (null !== $object->getCpuCount()) { - $data->{'CpuCount'} = $object->getCpuCount(); + if ($object->isInitialized('cpuCount') && null !== $object->getCpuCount()) { + $data['CpuCount'] = $object->getCpuCount(); } - if (null !== $object->getCpuPercent()) { - $data->{'CpuPercent'} = $object->getCpuPercent(); + if ($object->isInitialized('cpuPercent') && null !== $object->getCpuPercent()) { + $data['CpuPercent'] = $object->getCpuPercent(); } - if (null !== $object->getIOMaximumIOps()) { - $data->{'IOMaximumIOps'} = $object->getIOMaximumIOps(); + if ($object->isInitialized('iOMaximumIOps') && null !== $object->getIOMaximumIOps()) { + $data['IOMaximumIOps'] = $object->getIOMaximumIOps(); } - if (null !== $object->getIOMaximumBandwidth()) { - $data->{'IOMaximumBandwidth'} = $object->getIOMaximumBandwidth(); + if ($object->isInitialized('iOMaximumBandwidth') && null !== $object->getIOMaximumBandwidth()) { + $data['IOMaximumBandwidth'] = $object->getIOMaximumBandwidth(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\Resources' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ResourcesUlimitsItemNormalizer.php b/src/Normalizer/ResourcesUlimitsItemNormalizer.php index 00b29f68..0a0f7801 100644 --- a/src/Normalizer/ResourcesUlimitsItemNormalizer.php +++ b/src/Normalizer/ResourcesUlimitsItemNormalizer.php @@ -1,69 +1,85 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Soft') && $data->{'Soft'} !== null) { - $object->setSoft($data->{'Soft'}); + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'Hard') && $data->{'Hard'} !== null) { - $object->setHard($data->{'Hard'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getSoft()) { - $data->{'Soft'} = $object->getSoft(); + if ($object->isInitialized('soft') && null !== $object->getSoft()) { + $data['Soft'] = $object->getSoft(); } - if (null !== $object->getHard()) { - $data->{'Hard'} = $object->getHard(); + if ($object->isInitialized('hard') && null !== $object->getHard()) { + $data['Hard'] = $object->getHard(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ResourcesUlimitsItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/RestartPolicyNormalizer.php b/src/Normalizer/RestartPolicyNormalizer.php index 2942678a..be95a461 100644 --- a/src/Normalizer/RestartPolicyNormalizer.php +++ b/src/Normalizer/RestartPolicyNormalizer.php @@ -1,63 +1,76 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'MaximumRetryCount') && $data->{'MaximumRetryCount'} !== null) { - $object->setMaximumRetryCount($data->{'MaximumRetryCount'}); + 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; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getMaximumRetryCount()) { - $data->{'MaximumRetryCount'} = $object->getMaximumRetryCount(); + if ($object->isInitialized('maximumRetryCount') && null !== $object->getMaximumRetryCount()) { + $data['MaximumRetryCount'] = $object->getMaximumRetryCount(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\RestartPolicy' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/RuntimeNormalizer.php b/src/Normalizer/RuntimeNormalizer.php index 361aa353..dd5d0cc0 100644 --- a/src/Normalizer/RuntimeNormalizer.php +++ b/src/Normalizer/RuntimeNormalizer.php @@ -1,71 +1,84 @@ {'path'} !== null) { - $object->setPath($data->{'path'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('path', $data) && $data['path'] !== null) { + $object->setPath($data['path']); } - if (property_exists($data, 'runtimeArgs') && $data->{'runtimeArgs'} !== null) { - $values = []; - foreach ($data->{'runtimeArgs'} as $value) { + elseif (\array_key_exists('path', $data) && $data['path'] === null) { + $object->setPath(null); + } + if (\array_key_exists('runtimeArgs', $data) && $data['runtimeArgs'] !== null) { + $values = array(); + foreach ($data['runtimeArgs'] as $value) { $values[] = $value; } $object->setRuntimeArgs($values); } - + elseif (\array_key_exists('runtimeArgs', $data) && $data['runtimeArgs'] === null) { + $object->setRuntimeArgs(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getPath()) { - $data->{'path'} = $object->getPath(); + $data = array(); + if ($object->isInitialized('path') && null !== $object->getPath()) { + $data['path'] = $object->getPath(); } - if (null !== $object->getRuntimeArgs()) { - $values = []; + if ($object->isInitialized('runtimeArgs') && null !== $object->getRuntimeArgs()) { + $values = array(); foreach ($object->getRuntimeArgs() as $value) { $values[] = $value; } - $data->{'runtimeArgs'} = $values; + $data['runtimeArgs'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\Runtime' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SecretNormalizer.php b/src/Normalizer/SecretNormalizer.php index 83224bac..2bb5c84d 100644 --- a/src/Normalizer/SecretNormalizer.php +++ b/src/Normalizer/SecretNormalizer.php @@ -1,81 +1,103 @@ {'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\SecretSpec', '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', 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $data = array(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + 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 array('Docker\\API\\Model\\Secret' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SecretSpecNormalizer.php b/src/Normalizer/SecretSpecNormalizer.php index 4cae5434..040834e1 100644 --- a/src/Normalizer/SecretSpecNormalizer.php +++ b/src/Normalizer/SecretSpecNormalizer.php @@ -1,83 +1,111 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'Data') && $data->{'Data'} !== null) { - $object->setData($data->{'Data'}); + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($this->denormalizer->denormalize($data->{'Driver'}, 'Docker\\API\\Model\\Driver', 'json', $context)); + 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', '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', 'json', $context)); + } + elseif (\array_key_exists('Templating', $data) && $data['Templating'] === null) { + $object->setTemplating(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getData()) { - $data->{'Data'} = $object->getData(); + if ($object->isInitialized('data') && null !== $object->getData()) { + $data['Data'] = $object->getData(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $this->normalizer->normalize($object->getDriver(), 'json', $context); + 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 array('Docker\\API\\Model\\SecretSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SecretsCreatePostBodyNormalizer.php b/src/Normalizer/SecretsCreatePostBodyNormalizer.php index 6b0a853f..5541373e 100644 --- a/src/Normalizer/SecretsCreatePostBodyNormalizer.php +++ b/src/Normalizer/SecretsCreatePostBodyNormalizer.php @@ -1,83 +1,111 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'Data') && $data->{'Data'} !== null) { - $object->setData($data->{'Data'}); + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($this->denormalizer->denormalize($data->{'Driver'}, 'Docker\\API\\Model\\Driver', 'json', $context)); + 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', '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', 'json', $context)); + } + elseif (\array_key_exists('Templating', $data) && $data['Templating'] === null) { + $object->setTemplating(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getData()) { - $data->{'Data'} = $object->getData(); + if ($object->isInitialized('data') && null !== $object->getData()) { + $data['Data'] = $object->getData(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $this->normalizer->normalize($object->getDriver(), 'json', $context); + 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 array('Docker\\API\\Model\\SecretsCreatePostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceEndpointNormalizer.php b/src/Normalizer/ServiceEndpointNormalizer.php index 62f90e76..082ce6a2 100644 --- a/src/Normalizer/ServiceEndpointNormalizer.php +++ b/src/Normalizer/ServiceEndpointNormalizer.php @@ -1,85 +1,101 @@ {'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\EndpointSpec', 'json', $context)); + 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', 'json', $context)); } - if (property_exists($data, 'Ports') && $data->{'Ports'} !== null) { - $values = []; - foreach ($data->{'Ports'} as $value) { + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); + } + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { + $values = array(); + foreach ($data['Ports'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\EndpointPortConfig', 'json', $context); } $object->setPorts($values); } - if (property_exists($data, 'VirtualIPs') && $data->{'VirtualIPs'} !== null) { - $values_1 = []; - foreach ($data->{'VirtualIPs'} as $value_1) { + elseif (\array_key_exists('Ports', $data) && $data['Ports'] === null) { + $object->setPorts(null); + } + if (\array_key_exists('VirtualIPs', $data) && $data['VirtualIPs'] !== null) { + $values_1 = array(); + foreach ($data['VirtualIPs'] as $value_1) { $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ServiceEndpointVirtualIPsItem', 'json', $context); } $object->setVirtualIPs($values_1); } - + elseif (\array_key_exists('VirtualIPs', $data) && $data['VirtualIPs'] === null) { + $object->setVirtualIPs(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + $data = array(); + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); } - if (null !== $object->getPorts()) { - $values = []; + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values = array(); foreach ($object->getPorts() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'Ports'} = $values; + $data['Ports'] = $values; } - if (null !== $object->getVirtualIPs()) { - $values_1 = []; + if ($object->isInitialized('virtualIPs') && null !== $object->getVirtualIPs()) { + $values_1 = array(); foreach ($object->getVirtualIPs() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'VirtualIPs'} = $values_1; + $data['VirtualIPs'] = $values_1; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ServiceEndpoint' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceEndpointVirtualIPsItemNormalizer.php b/src/Normalizer/ServiceEndpointVirtualIPsItemNormalizer.php index 03776a58..45d9142e 100644 --- a/src/Normalizer/ServiceEndpointVirtualIPsItemNormalizer.php +++ b/src/Normalizer/ServiceEndpointVirtualIPsItemNormalizer.php @@ -1,63 +1,76 @@ {'NetworkID'} !== null) { - $object->setNetworkID($data->{'NetworkID'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Addr') && $data->{'Addr'} !== null) { - $object->setAddr($data->{'Addr'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getNetworkID()) { - $data->{'NetworkID'} = $object->getNetworkID(); + $data = array(); + if ($object->isInitialized('networkID') && null !== $object->getNetworkID()) { + $data['NetworkID'] = $object->getNetworkID(); } - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); + if ($object->isInitialized('addr') && null !== $object->getAddr()) { + $data['Addr'] = $object->getAddr(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ServiceEndpointVirtualIPsItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceJobStatusNormalizer.php b/src/Normalizer/ServiceJobStatusNormalizer.php new file mode 100644 index 00000000..a234336e --- /dev/null +++ b/src/Normalizer/ServiceJobStatusNormalizer.php @@ -0,0 +1,76 @@ +setJobIteration($this->denormalizer->denormalize($data['JobIteration'], 'Docker\\API\\Model\\ObjectVersion', '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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\ServiceJobStatus' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceNormalizer.php b/src/Normalizer/ServiceNormalizer.php index cec8f790..7a03c5c0 100644 --- a/src/Normalizer/ServiceNormalizer.php +++ b/src/Normalizer/ServiceNormalizer.php @@ -1,93 +1,139 @@ {'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\ServiceSpec', 'json', $context)); + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); } - if (property_exists($data, 'Endpoint') && $data->{'Endpoint'} !== null) { - $object->setEndpoint($this->denormalizer->denormalize($data->{'Endpoint'}, 'Docker\\API\\Model\\ServiceEndpoint', 'json', $context)); + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); } - if (property_exists($data, 'UpdateStatus') && $data->{'UpdateStatus'} !== null) { - $object->setUpdateStatus($this->denormalizer->denormalize($data->{'UpdateStatus'}, 'Docker\\API\\Model\\ServiceUpdateStatus', 'json', $context)); + 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', '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', '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', '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', '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', 'json', $context)); + } + elseif (\array_key_exists('JobStatus', $data) && $data['JobStatus'] === null) { + $object->setJobStatus(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $data = array(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); } - if (null !== $object->getEndpoint()) { - $data->{'Endpoint'} = $this->normalizer->normalize($object->getEndpoint(), 'json', $context); + if ($object->isInitialized('endpoint') && null !== $object->getEndpoint()) { + $data['Endpoint'] = $this->normalizer->normalize($object->getEndpoint(), 'json', $context); } - if (null !== $object->getUpdateStatus()) { - $data->{'UpdateStatus'} = $this->normalizer->normalize($object->getUpdateStatus(), '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; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\Service' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceServiceStatusNormalizer.php b/src/Normalizer/ServiceServiceStatusNormalizer.php new file mode 100644 index 00000000..972ddd41 --- /dev/null +++ b/src/Normalizer/ServiceServiceStatusNormalizer.php @@ -0,0 +1,85 @@ +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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\ServiceServiceStatus' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceSpecModeNormalizer.php b/src/Normalizer/ServiceSpecModeNormalizer.php index 4fbd3a17..2991b45b 100644 --- a/src/Normalizer/ServiceSpecModeNormalizer.php +++ b/src/Normalizer/ServiceSpecModeNormalizer.php @@ -1,63 +1,94 @@ {'Replicated'} !== null) { - $object->setReplicated($this->denormalizer->denormalize($data->{'Replicated'}, 'Docker\\API\\Model\\ServiceSpecModeReplicated', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Global') && $data->{'Global'} !== null) { - $object->setGlobal($data->{'Global'}); + if (\array_key_exists('Replicated', $data) && $data['Replicated'] !== null) { + $object->setReplicated($this->denormalizer->denormalize($data['Replicated'], 'Docker\\API\\Model\\ServiceSpecModeReplicated', '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', '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; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getReplicated()) { - $data->{'Replicated'} = $this->normalizer->normalize($object->getReplicated(), 'json', $context); + $data = array(); + if ($object->isInitialized('replicated') && null !== $object->getReplicated()) { + $data['Replicated'] = $this->normalizer->normalize($object->getReplicated(), 'json', $context); } - if (null !== $object->getGlobal()) { - $data->{'Global'} = $object->getGlobal(); + 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 array('Docker\\API\\Model\\ServiceSpecMode' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceSpecModeReplicatedJobNormalizer.php b/src/Normalizer/ServiceSpecModeReplicatedJobNormalizer.php new file mode 100644 index 00000000..256cd6a7 --- /dev/null +++ b/src/Normalizer/ServiceSpecModeReplicatedJobNormalizer.php @@ -0,0 +1,76 @@ +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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\ServiceSpecModeReplicatedJob' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceSpecModeReplicatedNormalizer.php b/src/Normalizer/ServiceSpecModeReplicatedNormalizer.php index 63f96be0..00208fd3 100644 --- a/src/Normalizer/ServiceSpecModeReplicatedNormalizer.php +++ b/src/Normalizer/ServiceSpecModeReplicatedNormalizer.php @@ -1,57 +1,67 @@ {'Replicas'} !== null) { - $object->setReplicas($data->{'Replicas'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getReplicas()) { - $data->{'Replicas'} = $object->getReplicas(); + $data = array(); + if ($object->isInitialized('replicas') && null !== $object->getReplicas()) { + $data['Replicas'] = $object->getReplicas(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ServiceSpecModeReplicated' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceSpecNetworksItemNormalizer.php b/src/Normalizer/ServiceSpecNetworksItemNormalizer.php deleted file mode 100644 index 38cafacf..00000000 --- a/src/Normalizer/ServiceSpecNetworksItemNormalizer.php +++ /dev/null @@ -1,71 +0,0 @@ -{'Target'} !== null) { - $object->setTarget($data->{'Target'}); - } - if (property_exists($data, 'Aliases') && $data->{'Aliases'} !== null) { - $values = []; - foreach ($data->{'Aliases'} as $value) { - $values[] = $value; - } - $object->setAliases($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getTarget()) { - $data->{'Target'} = $object->getTarget(); - } - if (null !== $object->getAliases()) { - $values = []; - foreach ($object->getAliases() as $value) { - $values[] = $value; - } - $data->{'Aliases'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/ServiceSpecNormalizer.php b/src/Normalizer/ServiceSpecNormalizer.php index 25ea0a81..8a4e02df 100644 --- a/src/Normalizer/ServiceSpecNormalizer.php +++ b/src/Normalizer/ServiceSpecNormalizer.php @@ -1,115 +1,146 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'TaskTemplate') && $data->{'TaskTemplate'} !== null) { - $object->setTaskTemplate($this->denormalizer->denormalize($data->{'TaskTemplate'}, 'Docker\\API\\Model\\TaskSpec', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] === null) { + $object->setTaskTemplate(null); } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($this->denormalizer->denormalize($data->{'Mode'}, 'Docker\\API\\Model\\ServiceSpecMode', 'json', $context)); + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($this->denormalizer->denormalize($data['Mode'], 'Docker\\API\\Model\\ServiceSpecMode', 'json', $context)); } - if (property_exists($data, 'UpdateConfig') && $data->{'UpdateConfig'} !== null) { - $object->setUpdateConfig($this->denormalizer->denormalize($data->{'UpdateConfig'}, 'Docker\\API\\Model\\ServiceSpecUpdateConfig', 'json', $context)); + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); } - if (property_exists($data, 'RollbackConfig') && $data->{'RollbackConfig'} !== null) { - $object->setRollbackConfig($this->denormalizer->denormalize($data->{'RollbackConfig'}, 'Docker\\API\\Model\\ServiceSpecRollbackConfig', 'json', $context)); + if (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] !== null) { + $object->setUpdateConfig($this->denormalizer->denormalize($data['UpdateConfig'], 'Docker\\API\\Model\\ServiceSpecUpdateConfig', 'json', $context)); } - if (property_exists($data, 'Networks') && $data->{'Networks'} !== null) { - $values_1 = []; - foreach ($data->{'Networks'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ServiceSpecNetworksItem', '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', '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 = array(); + foreach ($data['Networks'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\NetworkAttachmentConfig', 'json', $context); } $object->setNetworks($values_1); } - if (property_exists($data, 'EndpointSpec') && $data->{'EndpointSpec'} !== null) { - $object->setEndpointSpec($this->denormalizer->denormalize($data->{'EndpointSpec'}, 'Docker\\API\\Model\\EndpointSpec', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] === null) { + $object->setEndpointSpec(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getTaskTemplate()) { - $data->{'TaskTemplate'} = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); + if ($object->isInitialized('taskTemplate') && null !== $object->getTaskTemplate()) { + $data['TaskTemplate'] = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $this->normalizer->normalize($object->getMode(), 'json', $context); + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $this->normalizer->normalize($object->getMode(), 'json', $context); } - if (null !== $object->getUpdateConfig()) { - $data->{'UpdateConfig'} = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); + if ($object->isInitialized('updateConfig') && null !== $object->getUpdateConfig()) { + $data['UpdateConfig'] = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); } - if (null !== $object->getRollbackConfig()) { - $data->{'RollbackConfig'} = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); + if ($object->isInitialized('rollbackConfig') && null !== $object->getRollbackConfig()) { + $data['RollbackConfig'] = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); } - if (null !== $object->getNetworks()) { - $values_1 = []; + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values_1 = array(); foreach ($object->getNetworks() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'Networks'} = $values_1; + $data['Networks'] = $values_1; } - if (null !== $object->getEndpointSpec()) { - $data->{'EndpointSpec'} = $this->normalizer->normalize($object->getEndpointSpec(), 'json', $context); + 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 array('Docker\\API\\Model\\ServiceSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceSpecRollbackConfigNormalizer.php b/src/Normalizer/ServiceSpecRollbackConfigNormalizer.php index 4b8a7510..299a335f 100644 --- a/src/Normalizer/ServiceSpecRollbackConfigNormalizer.php +++ b/src/Normalizer/ServiceSpecRollbackConfigNormalizer.php @@ -1,87 +1,115 @@ {'Parallelism'} !== null) { - $object->setParallelism($data->{'Parallelism'}); + if (\array_key_exists('MaxFailureRatio', $data) && \is_int($data['MaxFailureRatio'])) { + $data['MaxFailureRatio'] = (double) $data['MaxFailureRatio']; } - if (property_exists($data, 'Delay') && $data->{'Delay'} !== null) { - $object->setDelay($data->{'Delay'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'FailureAction') && $data->{'FailureAction'} !== null) { - $object->setFailureAction($data->{'FailureAction'}); + if (\array_key_exists('Parallelism', $data) && $data['Parallelism'] !== null) { + $object->setParallelism($data['Parallelism']); } - if (property_exists($data, 'Monitor') && $data->{'Monitor'} !== null) { - $object->setMonitor($data->{'Monitor'}); + elseif (\array_key_exists('Parallelism', $data) && $data['Parallelism'] === null) { + $object->setParallelism(null); } - if (property_exists($data, 'MaxFailureRatio') && $data->{'MaxFailureRatio'} !== null) { - $object->setMaxFailureRatio($data->{'MaxFailureRatio'}); + if (\array_key_exists('Delay', $data) && $data['Delay'] !== null) { + $object->setDelay($data['Delay']); } - if (property_exists($data, 'Order') && $data->{'Order'} !== null) { - $object->setOrder($data->{'Order'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getParallelism()) { - $data->{'Parallelism'} = $object->getParallelism(); + $data = array(); + if ($object->isInitialized('parallelism') && null !== $object->getParallelism()) { + $data['Parallelism'] = $object->getParallelism(); } - if (null !== $object->getDelay()) { - $data->{'Delay'} = $object->getDelay(); + if ($object->isInitialized('delay') && null !== $object->getDelay()) { + $data['Delay'] = $object->getDelay(); } - if (null !== $object->getFailureAction()) { - $data->{'FailureAction'} = $object->getFailureAction(); + if ($object->isInitialized('failureAction') && null !== $object->getFailureAction()) { + $data['FailureAction'] = $object->getFailureAction(); } - if (null !== $object->getMonitor()) { - $data->{'Monitor'} = $object->getMonitor(); + if ($object->isInitialized('monitor') && null !== $object->getMonitor()) { + $data['Monitor'] = $object->getMonitor(); } - if (null !== $object->getMaxFailureRatio()) { - $data->{'MaxFailureRatio'} = $object->getMaxFailureRatio(); + if ($object->isInitialized('maxFailureRatio') && null !== $object->getMaxFailureRatio()) { + $data['MaxFailureRatio'] = $object->getMaxFailureRatio(); } - if (null !== $object->getOrder()) { - $data->{'Order'} = $object->getOrder(); + if ($object->isInitialized('order') && null !== $object->getOrder()) { + $data['Order'] = $object->getOrder(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ServiceSpecRollbackConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceSpecUpdateConfigNormalizer.php b/src/Normalizer/ServiceSpecUpdateConfigNormalizer.php index 32671dfa..3359b138 100644 --- a/src/Normalizer/ServiceSpecUpdateConfigNormalizer.php +++ b/src/Normalizer/ServiceSpecUpdateConfigNormalizer.php @@ -1,87 +1,115 @@ {'Parallelism'} !== null) { - $object->setParallelism($data->{'Parallelism'}); + if (\array_key_exists('MaxFailureRatio', $data) && \is_int($data['MaxFailureRatio'])) { + $data['MaxFailureRatio'] = (double) $data['MaxFailureRatio']; } - if (property_exists($data, 'Delay') && $data->{'Delay'} !== null) { - $object->setDelay($data->{'Delay'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'FailureAction') && $data->{'FailureAction'} !== null) { - $object->setFailureAction($data->{'FailureAction'}); + if (\array_key_exists('Parallelism', $data) && $data['Parallelism'] !== null) { + $object->setParallelism($data['Parallelism']); } - if (property_exists($data, 'Monitor') && $data->{'Monitor'} !== null) { - $object->setMonitor($data->{'Monitor'}); + elseif (\array_key_exists('Parallelism', $data) && $data['Parallelism'] === null) { + $object->setParallelism(null); } - if (property_exists($data, 'MaxFailureRatio') && $data->{'MaxFailureRatio'} !== null) { - $object->setMaxFailureRatio($data->{'MaxFailureRatio'}); + if (\array_key_exists('Delay', $data) && $data['Delay'] !== null) { + $object->setDelay($data['Delay']); } - if (property_exists($data, 'Order') && $data->{'Order'} !== null) { - $object->setOrder($data->{'Order'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getParallelism()) { - $data->{'Parallelism'} = $object->getParallelism(); + $data = array(); + if ($object->isInitialized('parallelism') && null !== $object->getParallelism()) { + $data['Parallelism'] = $object->getParallelism(); } - if (null !== $object->getDelay()) { - $data->{'Delay'} = $object->getDelay(); + if ($object->isInitialized('delay') && null !== $object->getDelay()) { + $data['Delay'] = $object->getDelay(); } - if (null !== $object->getFailureAction()) { - $data->{'FailureAction'} = $object->getFailureAction(); + if ($object->isInitialized('failureAction') && null !== $object->getFailureAction()) { + $data['FailureAction'] = $object->getFailureAction(); } - if (null !== $object->getMonitor()) { - $data->{'Monitor'} = $object->getMonitor(); + if ($object->isInitialized('monitor') && null !== $object->getMonitor()) { + $data['Monitor'] = $object->getMonitor(); } - if (null !== $object->getMaxFailureRatio()) { - $data->{'MaxFailureRatio'} = $object->getMaxFailureRatio(); + if ($object->isInitialized('maxFailureRatio') && null !== $object->getMaxFailureRatio()) { + $data['MaxFailureRatio'] = $object->getMaxFailureRatio(); } - if (null !== $object->getOrder()) { - $data->{'Order'} = $object->getOrder(); + if ($object->isInitialized('order') && null !== $object->getOrder()) { + $data['Order'] = $object->getOrder(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ServiceSpecUpdateConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceUpdateResponseNormalizer.php b/src/Normalizer/ServiceUpdateResponseNormalizer.php index 86d7d059..5788002d 100644 --- a/src/Normalizer/ServiceUpdateResponseNormalizer.php +++ b/src/Normalizer/ServiceUpdateResponseNormalizer.php @@ -1,65 +1,75 @@ {'Warnings'} !== null) { - $values = []; - foreach ($data->{'Warnings'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getWarnings()) { - $values = []; + $data = array(); + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values = array(); foreach ($object->getWarnings() as $value) { $values[] = $value; } - $data->{'Warnings'} = $values; + $data['Warnings'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ServiceUpdateResponse' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServiceUpdateStatusNormalizer.php b/src/Normalizer/ServiceUpdateStatusNormalizer.php index fa146a30..762be495 100644 --- a/src/Normalizer/ServiceUpdateStatusNormalizer.php +++ b/src/Normalizer/ServiceUpdateStatusNormalizer.php @@ -1,75 +1,94 @@ {'State'} !== null) { - $object->setState($data->{'State'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'StartedAt') && $data->{'StartedAt'} !== null) { - $object->setStartedAt($data->{'StartedAt'}); + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); } - if (property_exists($data, 'CompletedAt') && $data->{'CompletedAt'} !== null) { - $object->setCompletedAt($data->{'CompletedAt'}); + elseif (\array_key_exists('State', $data) && $data['State'] === null) { + $object->setState(null); } - if (property_exists($data, 'Message') && $data->{'Message'} !== null) { - $object->setMessage($data->{'Message'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getState()) { - $data->{'State'} = $object->getState(); + $data = array(); + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); } - if (null !== $object->getStartedAt()) { - $data->{'StartedAt'} = $object->getStartedAt(); + if ($object->isInitialized('startedAt') && null !== $object->getStartedAt()) { + $data['StartedAt'] = $object->getStartedAt(); } - if (null !== $object->getCompletedAt()) { - $data->{'CompletedAt'} = $object->getCompletedAt(); + if ($object->isInitialized('completedAt') && null !== $object->getCompletedAt()) { + $data['CompletedAt'] = $object->getCompletedAt(); } - if (null !== $object->getMessage()) { - $data->{'Message'} = $object->getMessage(); + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['Message'] = $object->getMessage(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ServiceUpdateStatus' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServicesCreatePostBodyNormalizer.php b/src/Normalizer/ServicesCreatePostBodyNormalizer.php index f28b49a6..7aafc1dd 100644 --- a/src/Normalizer/ServicesCreatePostBodyNormalizer.php +++ b/src/Normalizer/ServicesCreatePostBodyNormalizer.php @@ -1,115 +1,146 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'TaskTemplate') && $data->{'TaskTemplate'} !== null) { - $object->setTaskTemplate($this->denormalizer->denormalize($data->{'TaskTemplate'}, 'Docker\\API\\Model\\TaskSpec', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] === null) { + $object->setTaskTemplate(null); } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($this->denormalizer->denormalize($data->{'Mode'}, 'Docker\\API\\Model\\ServiceSpecMode', 'json', $context)); + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($this->denormalizer->denormalize($data['Mode'], 'Docker\\API\\Model\\ServiceSpecMode', 'json', $context)); } - if (property_exists($data, 'UpdateConfig') && $data->{'UpdateConfig'} !== null) { - $object->setUpdateConfig($this->denormalizer->denormalize($data->{'UpdateConfig'}, 'Docker\\API\\Model\\ServiceSpecUpdateConfig', 'json', $context)); + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); } - if (property_exists($data, 'RollbackConfig') && $data->{'RollbackConfig'} !== null) { - $object->setRollbackConfig($this->denormalizer->denormalize($data->{'RollbackConfig'}, 'Docker\\API\\Model\\ServiceSpecRollbackConfig', 'json', $context)); + if (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] !== null) { + $object->setUpdateConfig($this->denormalizer->denormalize($data['UpdateConfig'], 'Docker\\API\\Model\\ServiceSpecUpdateConfig', 'json', $context)); } - if (property_exists($data, 'Networks') && $data->{'Networks'} !== null) { - $values_1 = []; - foreach ($data->{'Networks'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ServiceSpecNetworksItem', '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', '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 = array(); + foreach ($data['Networks'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\NetworkAttachmentConfig', 'json', $context); } $object->setNetworks($values_1); } - if (property_exists($data, 'EndpointSpec') && $data->{'EndpointSpec'} !== null) { - $object->setEndpointSpec($this->denormalizer->denormalize($data->{'EndpointSpec'}, 'Docker\\API\\Model\\EndpointSpec', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] === null) { + $object->setEndpointSpec(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getTaskTemplate()) { - $data->{'TaskTemplate'} = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); + if ($object->isInitialized('taskTemplate') && null !== $object->getTaskTemplate()) { + $data['TaskTemplate'] = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $this->normalizer->normalize($object->getMode(), 'json', $context); + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $this->normalizer->normalize($object->getMode(), 'json', $context); } - if (null !== $object->getUpdateConfig()) { - $data->{'UpdateConfig'} = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); + if ($object->isInitialized('updateConfig') && null !== $object->getUpdateConfig()) { + $data['UpdateConfig'] = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); } - if (null !== $object->getRollbackConfig()) { - $data->{'RollbackConfig'} = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); + if ($object->isInitialized('rollbackConfig') && null !== $object->getRollbackConfig()) { + $data['RollbackConfig'] = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); } - if (null !== $object->getNetworks()) { - $values_1 = []; + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values_1 = array(); foreach ($object->getNetworks() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'Networks'} = $values_1; + $data['Networks'] = $values_1; } - if (null !== $object->getEndpointSpec()) { - $data->{'EndpointSpec'} = $this->normalizer->normalize($object->getEndpointSpec(), 'json', $context); + 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 array('Docker\\API\\Model\\ServicesCreatePostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServicesCreatePostResponse201Normalizer.php b/src/Normalizer/ServicesCreatePostResponse201Normalizer.php index d76a68ed..de7a6752 100644 --- a/src/Normalizer/ServicesCreatePostResponse201Normalizer.php +++ b/src/Normalizer/ServicesCreatePostResponse201Normalizer.php @@ -1,63 +1,76 @@ {'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Warning') && $data->{'Warning'} !== null) { - $object->setWarning($data->{'Warning'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $data = array(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); } - if (null !== $object->getWarning()) { - $data->{'Warning'} = $object->getWarning(); + if ($object->isInitialized('warning') && null !== $object->getWarning()) { + $data['Warning'] = $object->getWarning(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ServicesCreatePostResponse201' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ServicesIdUpdatePostBodyNormalizer.php b/src/Normalizer/ServicesIdUpdatePostBodyNormalizer.php index 312f8f0f..6a2ba47d 100644 --- a/src/Normalizer/ServicesIdUpdatePostBodyNormalizer.php +++ b/src/Normalizer/ServicesIdUpdatePostBodyNormalizer.php @@ -1,115 +1,146 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'TaskTemplate') && $data->{'TaskTemplate'} !== null) { - $object->setTaskTemplate($this->denormalizer->denormalize($data->{'TaskTemplate'}, 'Docker\\API\\Model\\TaskSpec', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('TaskTemplate', $data) && $data['TaskTemplate'] === null) { + $object->setTaskTemplate(null); } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($this->denormalizer->denormalize($data->{'Mode'}, 'Docker\\API\\Model\\ServiceSpecMode', 'json', $context)); + if (\array_key_exists('Mode', $data) && $data['Mode'] !== null) { + $object->setMode($this->denormalizer->denormalize($data['Mode'], 'Docker\\API\\Model\\ServiceSpecMode', 'json', $context)); } - if (property_exists($data, 'UpdateConfig') && $data->{'UpdateConfig'} !== null) { - $object->setUpdateConfig($this->denormalizer->denormalize($data->{'UpdateConfig'}, 'Docker\\API\\Model\\ServiceSpecUpdateConfig', 'json', $context)); + elseif (\array_key_exists('Mode', $data) && $data['Mode'] === null) { + $object->setMode(null); } - if (property_exists($data, 'RollbackConfig') && $data->{'RollbackConfig'} !== null) { - $object->setRollbackConfig($this->denormalizer->denormalize($data->{'RollbackConfig'}, 'Docker\\API\\Model\\ServiceSpecRollbackConfig', 'json', $context)); + if (\array_key_exists('UpdateConfig', $data) && $data['UpdateConfig'] !== null) { + $object->setUpdateConfig($this->denormalizer->denormalize($data['UpdateConfig'], 'Docker\\API\\Model\\ServiceSpecUpdateConfig', 'json', $context)); } - if (property_exists($data, 'Networks') && $data->{'Networks'} !== null) { - $values_1 = []; - foreach ($data->{'Networks'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ServiceSpecNetworksItem', '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', '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 = array(); + foreach ($data['Networks'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\NetworkAttachmentConfig', 'json', $context); } $object->setNetworks($values_1); } - if (property_exists($data, 'EndpointSpec') && $data->{'EndpointSpec'} !== null) { - $object->setEndpointSpec($this->denormalizer->denormalize($data->{'EndpointSpec'}, 'Docker\\API\\Model\\EndpointSpec', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('EndpointSpec', $data) && $data['EndpointSpec'] === null) { + $object->setEndpointSpec(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getTaskTemplate()) { - $data->{'TaskTemplate'} = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); + if ($object->isInitialized('taskTemplate') && null !== $object->getTaskTemplate()) { + $data['TaskTemplate'] = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $this->normalizer->normalize($object->getMode(), 'json', $context); + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $this->normalizer->normalize($object->getMode(), 'json', $context); } - if (null !== $object->getUpdateConfig()) { - $data->{'UpdateConfig'} = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); + if ($object->isInitialized('updateConfig') && null !== $object->getUpdateConfig()) { + $data['UpdateConfig'] = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); } - if (null !== $object->getRollbackConfig()) { - $data->{'RollbackConfig'} = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); + if ($object->isInitialized('rollbackConfig') && null !== $object->getRollbackConfig()) { + $data['RollbackConfig'] = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); } - if (null !== $object->getNetworks()) { - $values_1 = []; + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values_1 = array(); foreach ($object->getNetworks() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'Networks'} = $values_1; + $data['Networks'] = $values_1; } - if (null !== $object->getEndpointSpec()) { - $data->{'EndpointSpec'} = $this->normalizer->normalize($object->getEndpointSpec(), 'json', $context); + 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 array('Docker\\API\\Model\\ServicesIdUpdatePostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmInfoNormalizer.php b/src/Normalizer/SwarmInfoNormalizer.php index bfe4799d..11f43d5c 100644 --- a/src/Normalizer/SwarmInfoNormalizer.php +++ b/src/Normalizer/SwarmInfoNormalizer.php @@ -1,113 +1,147 @@ {'NodeID'} !== null) { - $object->setNodeID($data->{'NodeID'}); + 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 (property_exists($data, 'NodeAddr') && $data->{'NodeAddr'} !== null) { - $object->setNodeAddr($data->{'NodeAddr'}); + if (\array_key_exists('LocalNodeState', $data) && $data['LocalNodeState'] !== null) { + $object->setLocalNodeState($data['LocalNodeState']); } - if (property_exists($data, 'LocalNodeState') && $data->{'LocalNodeState'} !== null) { - $object->setLocalNodeState($data->{'LocalNodeState'}); + elseif (\array_key_exists('LocalNodeState', $data) && $data['LocalNodeState'] === null) { + $object->setLocalNodeState(null); } - if (property_exists($data, 'ControlAvailable') && $data->{'ControlAvailable'} !== null) { - $object->setControlAvailable($data->{'ControlAvailable'}); + if (\array_key_exists('ControlAvailable', $data) && $data['ControlAvailable'] !== null) { + $object->setControlAvailable($data['ControlAvailable']); } - if (property_exists($data, 'Error') && $data->{'Error'} !== null) { - $object->setError($data->{'Error'}); + elseif (\array_key_exists('ControlAvailable', $data) && $data['ControlAvailable'] === null) { + $object->setControlAvailable(null); } - if (property_exists($data, 'RemoteManagers') && $data->{'RemoteManagers'} !== null) { - $values = []; - foreach ($data->{'RemoteManagers'} as $value) { + 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 = array(); + foreach ($data['RemoteManagers'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\PeerNode', 'json', $context); } $object->setRemoteManagers($values); } - if (property_exists($data, 'Nodes') && $data->{'Nodes'} !== null) { - $object->setNodes($data->{'Nodes'}); + elseif (\array_key_exists('RemoteManagers', $data) && $data['RemoteManagers'] === null) { + $object->setRemoteManagers(null); } - if (property_exists($data, 'Managers') && $data->{'Managers'} !== null) { - $object->setManagers($data->{'Managers'}); + if (\array_key_exists('Nodes', $data) && $data['Nodes'] !== null) { + $object->setNodes($data['Nodes']); } - if (property_exists($data, 'Cluster') && $data->{'Cluster'} !== null) { - $object->setCluster($this->denormalizer->denormalize($data->{'Cluster'}, 'Docker\\API\\Model\\ClusterInfo', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('Cluster', $data) && $data['Cluster'] === null) { + $object->setCluster(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getNodeID()) { - $data->{'NodeID'} = $object->getNodeID(); + $data = array(); + if ($object->isInitialized('nodeID') && null !== $object->getNodeID()) { + $data['NodeID'] = $object->getNodeID(); } - if (null !== $object->getNodeAddr()) { - $data->{'NodeAddr'} = $object->getNodeAddr(); + if ($object->isInitialized('nodeAddr') && null !== $object->getNodeAddr()) { + $data['NodeAddr'] = $object->getNodeAddr(); } - if (null !== $object->getLocalNodeState()) { - $data->{'LocalNodeState'} = $object->getLocalNodeState(); + if ($object->isInitialized('localNodeState') && null !== $object->getLocalNodeState()) { + $data['LocalNodeState'] = $object->getLocalNodeState(); } - if (null !== $object->getControlAvailable()) { - $data->{'ControlAvailable'} = $object->getControlAvailable(); + if ($object->isInitialized('controlAvailable') && null !== $object->getControlAvailable()) { + $data['ControlAvailable'] = $object->getControlAvailable(); } - if (null !== $object->getError()) { - $data->{'Error'} = $object->getError(); + if ($object->isInitialized('error') && null !== $object->getError()) { + $data['Error'] = $object->getError(); } - if (null !== $object->getRemoteManagers()) { - $values = []; + if ($object->isInitialized('remoteManagers') && null !== $object->getRemoteManagers()) { + $values = array(); foreach ($object->getRemoteManagers() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'RemoteManagers'} = $values; + $data['RemoteManagers'] = $values; } - if (null !== $object->getNodes()) { - $data->{'Nodes'} = $object->getNodes(); + if ($object->isInitialized('nodes') && null !== $object->getNodes()) { + $data['Nodes'] = $object->getNodes(); } - if (null !== $object->getManagers()) { - $data->{'Managers'} = $object->getManagers(); + if ($object->isInitialized('managers') && null !== $object->getManagers()) { + $data['Managers'] = $object->getManagers(); } - if (null !== $object->getCluster()) { - $data->{'Cluster'} = $this->normalizer->normalize($object->getCluster(), 'json', $context); + 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 array('Docker\\API\\Model\\SwarmInfo' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmInitPostBodyNormalizer.php b/src/Normalizer/SwarmInitPostBodyNormalizer.php index 5505a2fc..2a15b7cc 100644 --- a/src/Normalizer/SwarmInitPostBodyNormalizer.php +++ b/src/Normalizer/SwarmInitPostBodyNormalizer.php @@ -1,81 +1,138 @@ {'ListenAddr'} !== null) { - $object->setListenAddr($data->{'ListenAddr'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'AdvertiseAddr') && $data->{'AdvertiseAddr'} !== null) { - $object->setAdvertiseAddr($data->{'AdvertiseAddr'}); + if (\array_key_exists('ListenAddr', $data) && $data['ListenAddr'] !== null) { + $object->setListenAddr($data['ListenAddr']); } - if (property_exists($data, 'DataPathAddr') && $data->{'DataPathAddr'} !== null) { - $object->setDataPathAddr($data->{'DataPathAddr'}); + elseif (\array_key_exists('ListenAddr', $data) && $data['ListenAddr'] === null) { + $object->setListenAddr(null); } - if (property_exists($data, 'ForceNewCluster') && $data->{'ForceNewCluster'} !== null) { - $object->setForceNewCluster($data->{'ForceNewCluster'}); + if (\array_key_exists('AdvertiseAddr', $data) && $data['AdvertiseAddr'] !== null) { + $object->setAdvertiseAddr($data['AdvertiseAddr']); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\SwarmSpec', 'json', $context)); + 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 = array(); + 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', 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getListenAddr()) { - $data->{'ListenAddr'} = $object->getListenAddr(); + $data = array(); + if ($object->isInitialized('listenAddr') && null !== $object->getListenAddr()) { + $data['ListenAddr'] = $object->getListenAddr(); } - if (null !== $object->getAdvertiseAddr()) { - $data->{'AdvertiseAddr'} = $object->getAdvertiseAddr(); + if ($object->isInitialized('advertiseAddr') && null !== $object->getAdvertiseAddr()) { + $data['AdvertiseAddr'] = $object->getAdvertiseAddr(); } - if (null !== $object->getDataPathAddr()) { - $data->{'DataPathAddr'} = $object->getDataPathAddr(); + if ($object->isInitialized('dataPathAddr') && null !== $object->getDataPathAddr()) { + $data['DataPathAddr'] = $object->getDataPathAddr(); } - if (null !== $object->getForceNewCluster()) { - $data->{'ForceNewCluster'} = $object->getForceNewCluster(); + if ($object->isInitialized('dataPathPort') && null !== $object->getDataPathPort()) { + $data['DataPathPort'] = $object->getDataPathPort(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($object->isInitialized('defaultAddrPool') && null !== $object->getDefaultAddrPool()) { + $values = array(); + 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 array('Docker\\API\\Model\\SwarmInitPostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmJoinPostBodyNormalizer.php b/src/Normalizer/SwarmJoinPostBodyNormalizer.php index 10230b0f..a385fe1d 100644 --- a/src/Normalizer/SwarmJoinPostBodyNormalizer.php +++ b/src/Normalizer/SwarmJoinPostBodyNormalizer.php @@ -1,81 +1,111 @@ {'ListenAddr'} !== null) { - $object->setListenAddr($data->{'ListenAddr'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'AdvertiseAddr') && $data->{'AdvertiseAddr'} !== null) { - $object->setAdvertiseAddr($data->{'AdvertiseAddr'}); + if (\array_key_exists('ListenAddr', $data) && $data['ListenAddr'] !== null) { + $object->setListenAddr($data['ListenAddr']); } - if (property_exists($data, 'DataPathAddr') && $data->{'DataPathAddr'} !== null) { - $object->setDataPathAddr($data->{'DataPathAddr'}); + elseif (\array_key_exists('ListenAddr', $data) && $data['ListenAddr'] === null) { + $object->setListenAddr(null); } - if (property_exists($data, 'RemoteAddrs') && $data->{'RemoteAddrs'} !== null) { - $object->setRemoteAddrs($data->{'RemoteAddrs'}); + if (\array_key_exists('AdvertiseAddr', $data) && $data['AdvertiseAddr'] !== null) { + $object->setAdvertiseAddr($data['AdvertiseAddr']); } - if (property_exists($data, 'JoinToken') && $data->{'JoinToken'} !== null) { - $object->setJoinToken($data->{'JoinToken'}); + 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 = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getListenAddr()) { - $data->{'ListenAddr'} = $object->getListenAddr(); + $data = array(); + if ($object->isInitialized('listenAddr') && null !== $object->getListenAddr()) { + $data['ListenAddr'] = $object->getListenAddr(); } - if (null !== $object->getAdvertiseAddr()) { - $data->{'AdvertiseAddr'} = $object->getAdvertiseAddr(); + if ($object->isInitialized('advertiseAddr') && null !== $object->getAdvertiseAddr()) { + $data['AdvertiseAddr'] = $object->getAdvertiseAddr(); } - if (null !== $object->getDataPathAddr()) { - $data->{'DataPathAddr'} = $object->getDataPathAddr(); + if ($object->isInitialized('dataPathAddr') && null !== $object->getDataPathAddr()) { + $data['DataPathAddr'] = $object->getDataPathAddr(); } - if (null !== $object->getRemoteAddrs()) { - $data->{'RemoteAddrs'} = $object->getRemoteAddrs(); + if ($object->isInitialized('remoteAddrs') && null !== $object->getRemoteAddrs()) { + $values = array(); + foreach ($object->getRemoteAddrs() as $value) { + $values[] = $value; + } + $data['RemoteAddrs'] = $values; } - if (null !== $object->getJoinToken()) { - $data->{'JoinToken'} = $object->getJoinToken(); + if ($object->isInitialized('joinToken') && null !== $object->getJoinToken()) { + $data['JoinToken'] = $object->getJoinToken(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SwarmJoinPostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmNormalizer.php b/src/Normalizer/SwarmNormalizer.php index eae64ffa..51d98288 100644 --- a/src/Normalizer/SwarmNormalizer.php +++ b/src/Normalizer/SwarmNormalizer.php @@ -1,99 +1,165 @@ {'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\SwarmSpec', 'json', $context)); + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); } - if (property_exists($data, 'TLSInfo') && $data->{'TLSInfo'} !== null) { - $object->setTLSInfo($this->denormalizer->denormalize($data->{'TLSInfo'}, 'Docker\\API\\Model\\TLSInfo', 'json', $context)); + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); } - if (property_exists($data, 'RootRotationInProgress') && $data->{'RootRotationInProgress'} !== null) { - $object->setRootRotationInProgress($data->{'RootRotationInProgress'}); + elseif (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] === null) { + $object->setCreatedAt(null); } - if (property_exists($data, 'JoinTokens') && $data->{'JoinTokens'} !== null) { - $object->setJoinTokens($this->denormalizer->denormalize($data->{'JoinTokens'}, 'Docker\\API\\Model\\JoinTokens', 'json', $context)); + 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', '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', '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 = array(); + 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', 'json', $context)); + } + elseif (\array_key_exists('JoinTokens', $data) && $data['JoinTokens'] === null) { + $object->setJoinTokens(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $data = array(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); } - if (null !== $object->getTLSInfo()) { - $data->{'TLSInfo'} = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); + if ($object->isInitialized('tLSInfo') && null !== $object->getTLSInfo()) { + $data['TLSInfo'] = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); } - if (null !== $object->getRootRotationInProgress()) { - $data->{'RootRotationInProgress'} = $object->getRootRotationInProgress(); + if ($object->isInitialized('rootRotationInProgress') && null !== $object->getRootRotationInProgress()) { + $data['RootRotationInProgress'] = $object->getRootRotationInProgress(); } - if (null !== $object->getJoinTokens()) { - $data->{'JoinTokens'} = $this->normalizer->normalize($object->getJoinTokens(), 'json', $context); + if ($object->isInitialized('dataPathPort') && null !== $object->getDataPathPort()) { + $data['DataPathPort'] = $object->getDataPathPort(); + } + if ($object->isInitialized('defaultAddrPool') && null !== $object->getDefaultAddrPool()) { + $values = array(); + 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 array('Docker\\API\\Model\\Swarm' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmSpecCAConfigExternalCAsItemNormalizer.php b/src/Normalizer/SwarmSpecCAConfigExternalCAsItemNormalizer.php index dc14013d..7939fb79 100644 --- a/src/Normalizer/SwarmSpecCAConfigExternalCAsItemNormalizer.php +++ b/src/Normalizer/SwarmSpecCAConfigExternalCAsItemNormalizer.php @@ -1,83 +1,102 @@ {'Protocol'} !== null) { - $object->setProtocol($data->{'Protocol'}); + 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 (property_exists($data, 'URL') && $data->{'URL'} !== null) { - $object->setURL($data->{'URL'}); + if (\array_key_exists('URL', $data) && $data['URL'] !== null) { + $object->setURL($data['URL']); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { + elseif (\array_key_exists('URL', $data) && $data['URL'] === null) { + $object->setURL(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value) { $values[$key] = $value; } $object->setOptions($values); } - if (property_exists($data, 'CACert') && $data->{'CACert'} !== null) { - $object->setCACert($data->{'CACert'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getProtocol()) { - $data->{'Protocol'} = $object->getProtocol(); + $data = array(); + if ($object->isInitialized('protocol') && null !== $object->getProtocol()) { + $data['Protocol'] = $object->getProtocol(); } - if (null !== $object->getURL()) { - $data->{'URL'} = $object->getURL(); + if ($object->isInitialized('uRL') && null !== $object->getURL()) { + $data['URL'] = $object->getURL(); } - if (null !== $object->getOptions()) { - $values = new \stdClass(); + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = array(); foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Options'} = $values; + $data['Options'] = $values; } - if (null !== $object->getCACert()) { - $data->{'CACert'} = $object->getCACert(); + if ($object->isInitialized('cACert') && null !== $object->getCACert()) { + $data['CACert'] = $object->getCACert(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SwarmSpecCAConfigExternalCAsItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmSpecCAConfigNormalizer.php b/src/Normalizer/SwarmSpecCAConfigNormalizer.php index ade294b1..1dbcbf14 100644 --- a/src/Normalizer/SwarmSpecCAConfigNormalizer.php +++ b/src/Normalizer/SwarmSpecCAConfigNormalizer.php @@ -1,89 +1,111 @@ {'NodeCertExpiry'} !== null) { - $object->setNodeCertExpiry($data->{'NodeCertExpiry'}); + 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 (property_exists($data, 'ExternalCAs') && $data->{'ExternalCAs'} !== null) { - $values = []; - foreach ($data->{'ExternalCAs'} as $value) { + if (\array_key_exists('ExternalCAs', $data) && $data['ExternalCAs'] !== null) { + $values = array(); + foreach ($data['ExternalCAs'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\SwarmSpecCAConfigExternalCAsItem', 'json', $context); } $object->setExternalCAs($values); } - if (property_exists($data, 'SigningCACert') && $data->{'SigningCACert'} !== null) { - $object->setSigningCACert($data->{'SigningCACert'}); + elseif (\array_key_exists('ExternalCAs', $data) && $data['ExternalCAs'] === null) { + $object->setExternalCAs(null); } - if (property_exists($data, 'SigningCAKey') && $data->{'SigningCAKey'} !== null) { - $object->setSigningCAKey($data->{'SigningCAKey'}); + if (\array_key_exists('SigningCACert', $data) && $data['SigningCACert'] !== null) { + $object->setSigningCACert($data['SigningCACert']); } - if (property_exists($data, 'ForceRotate') && $data->{'ForceRotate'} !== null) { - $object->setForceRotate($data->{'ForceRotate'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getNodeCertExpiry()) { - $data->{'NodeCertExpiry'} = $object->getNodeCertExpiry(); + $data = array(); + if ($object->isInitialized('nodeCertExpiry') && null !== $object->getNodeCertExpiry()) { + $data['NodeCertExpiry'] = $object->getNodeCertExpiry(); } - if (null !== $object->getExternalCAs()) { - $values = []; + if ($object->isInitialized('externalCAs') && null !== $object->getExternalCAs()) { + $values = array(); foreach ($object->getExternalCAs() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'ExternalCAs'} = $values; + $data['ExternalCAs'] = $values; } - if (null !== $object->getSigningCACert()) { - $data->{'SigningCACert'} = $object->getSigningCACert(); + if ($object->isInitialized('signingCACert') && null !== $object->getSigningCACert()) { + $data['SigningCACert'] = $object->getSigningCACert(); } - if (null !== $object->getSigningCAKey()) { - $data->{'SigningCAKey'} = $object->getSigningCAKey(); + if ($object->isInitialized('signingCAKey') && null !== $object->getSigningCAKey()) { + $data['SigningCAKey'] = $object->getSigningCAKey(); } - if (null !== $object->getForceRotate()) { - $data->{'ForceRotate'} = $object->getForceRotate(); + if ($object->isInitialized('forceRotate') && null !== $object->getForceRotate()) { + $data['ForceRotate'] = $object->getForceRotate(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SwarmSpecCAConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmSpecDispatcherNormalizer.php b/src/Normalizer/SwarmSpecDispatcherNormalizer.php index dd3d325d..06a334a6 100644 --- a/src/Normalizer/SwarmSpecDispatcherNormalizer.php +++ b/src/Normalizer/SwarmSpecDispatcherNormalizer.php @@ -1,57 +1,67 @@ {'HeartbeatPeriod'} !== null) { - $object->setHeartbeatPeriod($data->{'HeartbeatPeriod'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getHeartbeatPeriod()) { - $data->{'HeartbeatPeriod'} = $object->getHeartbeatPeriod(); + $data = array(); + if ($object->isInitialized('heartbeatPeriod') && null !== $object->getHeartbeatPeriod()) { + $data['HeartbeatPeriod'] = $object->getHeartbeatPeriod(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SwarmSpecDispatcher' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmSpecEncryptionConfigNormalizer.php b/src/Normalizer/SwarmSpecEncryptionConfigNormalizer.php index f5139cf6..b8a77dcf 100644 --- a/src/Normalizer/SwarmSpecEncryptionConfigNormalizer.php +++ b/src/Normalizer/SwarmSpecEncryptionConfigNormalizer.php @@ -1,57 +1,67 @@ {'AutoLockManagers'} !== null) { - $object->setAutoLockManagers($data->{'AutoLockManagers'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getAutoLockManagers()) { - $data->{'AutoLockManagers'} = $object->getAutoLockManagers(); + $data = array(); + if ($object->isInitialized('autoLockManagers') && null !== $object->getAutoLockManagers()) { + $data['AutoLockManagers'] = $object->getAutoLockManagers(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SwarmSpecEncryptionConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmSpecNormalizer.php b/src/Normalizer/SwarmSpecNormalizer.php index 351c967d..a248e51b 100644 --- a/src/Normalizer/SwarmSpecNormalizer.php +++ b/src/Normalizer/SwarmSpecNormalizer.php @@ -1,107 +1,138 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'Orchestration') && $data->{'Orchestration'} !== null) { - $object->setOrchestration($this->denormalizer->denormalize($data->{'Orchestration'}, 'Docker\\API\\Model\\SwarmSpecOrchestration', 'json', $context)); + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); } - if (property_exists($data, 'Raft') && $data->{'Raft'} !== null) { - $object->setRaft($this->denormalizer->denormalize($data->{'Raft'}, 'Docker\\API\\Model\\SwarmSpecRaft', 'json', $context)); + if (\array_key_exists('Orchestration', $data) && $data['Orchestration'] !== null) { + $object->setOrchestration($this->denormalizer->denormalize($data['Orchestration'], 'Docker\\API\\Model\\SwarmSpecOrchestration', 'json', $context)); } - if (property_exists($data, 'Dispatcher') && $data->{'Dispatcher'} !== null) { - $object->setDispatcher($this->denormalizer->denormalize($data->{'Dispatcher'}, 'Docker\\API\\Model\\SwarmSpecDispatcher', 'json', $context)); + elseif (\array_key_exists('Orchestration', $data) && $data['Orchestration'] === null) { + $object->setOrchestration(null); } - if (property_exists($data, 'CAConfig') && $data->{'CAConfig'} !== null) { - $object->setCAConfig($this->denormalizer->denormalize($data->{'CAConfig'}, 'Docker\\API\\Model\\SwarmSpecCAConfig', 'json', $context)); + if (\array_key_exists('Raft', $data) && $data['Raft'] !== null) { + $object->setRaft($this->denormalizer->denormalize($data['Raft'], 'Docker\\API\\Model\\SwarmSpecRaft', 'json', $context)); } - if (property_exists($data, 'EncryptionConfig') && $data->{'EncryptionConfig'} !== null) { - $object->setEncryptionConfig($this->denormalizer->denormalize($data->{'EncryptionConfig'}, 'Docker\\API\\Model\\SwarmSpecEncryptionConfig', 'json', $context)); + elseif (\array_key_exists('Raft', $data) && $data['Raft'] === null) { + $object->setRaft(null); } - if (property_exists($data, 'TaskDefaults') && $data->{'TaskDefaults'} !== null) { - $object->setTaskDefaults($this->denormalizer->denormalize($data->{'TaskDefaults'}, 'Docker\\API\\Model\\SwarmSpecTaskDefaults', 'json', $context)); + if (\array_key_exists('Dispatcher', $data) && $data['Dispatcher'] !== null) { + $object->setDispatcher($this->denormalizer->denormalize($data['Dispatcher'], 'Docker\\API\\Model\\SwarmSpecDispatcher', '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', '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', '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', 'json', $context)); + } + elseif (\array_key_exists('TaskDefaults', $data) && $data['TaskDefaults'] === null) { + $object->setTaskDefaults(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getOrchestration()) { - $data->{'Orchestration'} = $this->normalizer->normalize($object->getOrchestration(), 'json', $context); + if ($object->isInitialized('orchestration') && null !== $object->getOrchestration()) { + $data['Orchestration'] = $this->normalizer->normalize($object->getOrchestration(), 'json', $context); } - if (null !== $object->getRaft()) { - $data->{'Raft'} = $this->normalizer->normalize($object->getRaft(), 'json', $context); + if ($object->isInitialized('raft') && null !== $object->getRaft()) { + $data['Raft'] = $this->normalizer->normalize($object->getRaft(), 'json', $context); } - if (null !== $object->getDispatcher()) { - $data->{'Dispatcher'} = $this->normalizer->normalize($object->getDispatcher(), 'json', $context); + if ($object->isInitialized('dispatcher') && null !== $object->getDispatcher()) { + $data['Dispatcher'] = $this->normalizer->normalize($object->getDispatcher(), 'json', $context); } - if (null !== $object->getCAConfig()) { - $data->{'CAConfig'} = $this->normalizer->normalize($object->getCAConfig(), 'json', $context); + if ($object->isInitialized('cAConfig') && null !== $object->getCAConfig()) { + $data['CAConfig'] = $this->normalizer->normalize($object->getCAConfig(), 'json', $context); } - if (null !== $object->getEncryptionConfig()) { - $data->{'EncryptionConfig'} = $this->normalizer->normalize($object->getEncryptionConfig(), 'json', $context); + if ($object->isInitialized('encryptionConfig') && null !== $object->getEncryptionConfig()) { + $data['EncryptionConfig'] = $this->normalizer->normalize($object->getEncryptionConfig(), 'json', $context); } - if (null !== $object->getTaskDefaults()) { - $data->{'TaskDefaults'} = $this->normalizer->normalize($object->getTaskDefaults(), '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 array('Docker\\API\\Model\\SwarmSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmSpecOrchestrationNormalizer.php b/src/Normalizer/SwarmSpecOrchestrationNormalizer.php index eefca1fa..d16d4f04 100644 --- a/src/Normalizer/SwarmSpecOrchestrationNormalizer.php +++ b/src/Normalizer/SwarmSpecOrchestrationNormalizer.php @@ -1,57 +1,67 @@ {'TaskHistoryRetentionLimit'} !== null) { - $object->setTaskHistoryRetentionLimit($data->{'TaskHistoryRetentionLimit'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getTaskHistoryRetentionLimit()) { - $data->{'TaskHistoryRetentionLimit'} = $object->getTaskHistoryRetentionLimit(); + $data = array(); + if ($object->isInitialized('taskHistoryRetentionLimit') && null !== $object->getTaskHistoryRetentionLimit()) { + $data['TaskHistoryRetentionLimit'] = $object->getTaskHistoryRetentionLimit(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SwarmSpecOrchestration' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmSpecRaftNormalizer.php b/src/Normalizer/SwarmSpecRaftNormalizer.php index 7c0ed118..a063fe02 100644 --- a/src/Normalizer/SwarmSpecRaftNormalizer.php +++ b/src/Normalizer/SwarmSpecRaftNormalizer.php @@ -1,81 +1,103 @@ {'SnapshotInterval'} !== null) { - $object->setSnapshotInterval($data->{'SnapshotInterval'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'KeepOldSnapshots') && $data->{'KeepOldSnapshots'} !== null) { - $object->setKeepOldSnapshots($data->{'KeepOldSnapshots'}); + if (\array_key_exists('SnapshotInterval', $data) && $data['SnapshotInterval'] !== null) { + $object->setSnapshotInterval($data['SnapshotInterval']); } - if (property_exists($data, 'LogEntriesForSlowFollowers') && $data->{'LogEntriesForSlowFollowers'} !== null) { - $object->setLogEntriesForSlowFollowers($data->{'LogEntriesForSlowFollowers'}); + elseif (\array_key_exists('SnapshotInterval', $data) && $data['SnapshotInterval'] === null) { + $object->setSnapshotInterval(null); } - if (property_exists($data, 'ElectionTick') && $data->{'ElectionTick'} !== null) { - $object->setElectionTick($data->{'ElectionTick'}); + if (\array_key_exists('KeepOldSnapshots', $data) && $data['KeepOldSnapshots'] !== null) { + $object->setKeepOldSnapshots($data['KeepOldSnapshots']); } - if (property_exists($data, 'HeartbeatTick') && $data->{'HeartbeatTick'} !== null) { - $object->setHeartbeatTick($data->{'HeartbeatTick'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getSnapshotInterval()) { - $data->{'SnapshotInterval'} = $object->getSnapshotInterval(); + $data = array(); + if ($object->isInitialized('snapshotInterval') && null !== $object->getSnapshotInterval()) { + $data['SnapshotInterval'] = $object->getSnapshotInterval(); } - if (null !== $object->getKeepOldSnapshots()) { - $data->{'KeepOldSnapshots'} = $object->getKeepOldSnapshots(); + if ($object->isInitialized('keepOldSnapshots') && null !== $object->getKeepOldSnapshots()) { + $data['KeepOldSnapshots'] = $object->getKeepOldSnapshots(); } - if (null !== $object->getLogEntriesForSlowFollowers()) { - $data->{'LogEntriesForSlowFollowers'} = $object->getLogEntriesForSlowFollowers(); + if ($object->isInitialized('logEntriesForSlowFollowers') && null !== $object->getLogEntriesForSlowFollowers()) { + $data['LogEntriesForSlowFollowers'] = $object->getLogEntriesForSlowFollowers(); } - if (null !== $object->getElectionTick()) { - $data->{'ElectionTick'} = $object->getElectionTick(); + if ($object->isInitialized('electionTick') && null !== $object->getElectionTick()) { + $data['ElectionTick'] = $object->getElectionTick(); } - if (null !== $object->getHeartbeatTick()) { - $data->{'HeartbeatTick'} = $object->getHeartbeatTick(); + if ($object->isInitialized('heartbeatTick') && null !== $object->getHeartbeatTick()) { + $data['HeartbeatTick'] = $object->getHeartbeatTick(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SwarmSpecRaft' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmSpecTaskDefaultsLogDriverNormalizer.php b/src/Normalizer/SwarmSpecTaskDefaultsLogDriverNormalizer.php index 28a75995..837a6736 100644 --- a/src/Normalizer/SwarmSpecTaskDefaultsLogDriverNormalizer.php +++ b/src/Normalizer/SwarmSpecTaskDefaultsLogDriverNormalizer.php @@ -1,71 +1,84 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject(array(), \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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getOptions()) { - $values = new \stdClass(); + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = array(); foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Options'} = $values; + $data['Options'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SwarmSpecTaskDefaultsLogDriver' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmSpecTaskDefaultsNormalizer.php b/src/Normalizer/SwarmSpecTaskDefaultsNormalizer.php index f34e389a..033de45b 100644 --- a/src/Normalizer/SwarmSpecTaskDefaultsNormalizer.php +++ b/src/Normalizer/SwarmSpecTaskDefaultsNormalizer.php @@ -1,57 +1,67 @@ {'LogDriver'} !== null) { - $object->setLogDriver($this->denormalizer->denormalize($data->{'LogDriver'}, 'Docker\\API\\Model\\SwarmSpecTaskDefaultsLogDriver', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('LogDriver', $data) && $data['LogDriver'] === null) { + $object->setLogDriver(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getLogDriver()) { - $data->{'LogDriver'} = $this->normalizer->normalize($object->getLogDriver(), 'json', $context); + $data = array(); + 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 array('Docker\\API\\Model\\SwarmSpecTaskDefaults' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmUnlockPostBodyNormalizer.php b/src/Normalizer/SwarmUnlockPostBodyNormalizer.php index edf6159f..e7f07bdc 100644 --- a/src/Normalizer/SwarmUnlockPostBodyNormalizer.php +++ b/src/Normalizer/SwarmUnlockPostBodyNormalizer.php @@ -1,57 +1,67 @@ {'UnlockKey'} !== null) { - $object->setUnlockKey($data->{'UnlockKey'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getUnlockKey()) { - $data->{'UnlockKey'} = $object->getUnlockKey(); + $data = array(); + if ($object->isInitialized('unlockKey') && null !== $object->getUnlockKey()) { + $data['UnlockKey'] = $object->getUnlockKey(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SwarmUnlockPostBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SwarmUnlockkeyGetResponse200Normalizer.php b/src/Normalizer/SwarmUnlockkeyGetResponse200Normalizer.php index 1c6c027d..b707bfe4 100644 --- a/src/Normalizer/SwarmUnlockkeyGetResponse200Normalizer.php +++ b/src/Normalizer/SwarmUnlockkeyGetResponse200Normalizer.php @@ -1,57 +1,67 @@ {'UnlockKey'} !== null) { - $object->setUnlockKey($data->{'UnlockKey'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getUnlockKey()) { - $data->{'UnlockKey'} = $object->getUnlockKey(); + $data = array(); + if ($object->isInitialized('unlockKey') && null !== $object->getUnlockKey()) { + $data['UnlockKey'] = $object->getUnlockKey(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SwarmUnlockkeyGetResponse200' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SystemDfGetResponse200Normalizer.php b/src/Normalizer/SystemDfGetResponse200Normalizer.php index a29b07d1..d30f405f 100644 --- a/src/Normalizer/SystemDfGetResponse200Normalizer.php +++ b/src/Normalizer/SystemDfGetResponse200Normalizer.php @@ -1,107 +1,135 @@ {'LayersSize'} !== null) { - $object->setLayersSize($data->{'LayersSize'}); + 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 (property_exists($data, 'Images') && $data->{'Images'} !== null) { - $values = []; - foreach ($data->{'Images'} as $value) { + if (\array_key_exists('Images', $data) && $data['Images'] !== null) { + $values = array(); + foreach ($data['Images'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\ImageSummary', 'json', $context); } $object->setImages($values); } - if (property_exists($data, 'Containers') && $data->{'Containers'} !== null) { - $values_1 = []; - foreach ($data->{'Containers'} as $value_1) { - $values_2 = []; - foreach ($value_1 as $value_2) { - $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\ContainerSummaryItem', 'json', $context); - } - $values_1[] = $values_2; + elseif (\array_key_exists('Images', $data) && $data['Images'] === null) { + $object->setImages(null); + } + if (\array_key_exists('Containers', $data) && $data['Containers'] !== null) { + $values_1 = array(); + foreach ($data['Containers'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ContainerSummary', 'json', $context); } $object->setContainers($values_1); } - if (property_exists($data, 'Volumes') && $data->{'Volumes'} !== null) { - $values_3 = []; - foreach ($data->{'Volumes'} as $value_3) { - $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\Volume', 'json', $context); + elseif (\array_key_exists('Containers', $data) && $data['Containers'] === null) { + $object->setContainers(null); + } + if (\array_key_exists('Volumes', $data) && $data['Volumes'] !== null) { + $values_2 = array(); + foreach ($data['Volumes'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\Volume', 'json', $context); } - $object->setVolumes($values_3); + $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 = array(); + foreach ($data['BuildCache'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\BuildCache', 'json', $context); + } + $object->setBuildCache($values_3); + } + elseif (\array_key_exists('BuildCache', $data) && $data['BuildCache'] === null) { + $object->setBuildCache(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getLayersSize()) { - $data->{'LayersSize'} = $object->getLayersSize(); + $data = array(); + if ($object->isInitialized('layersSize') && null !== $object->getLayersSize()) { + $data['LayersSize'] = $object->getLayersSize(); } - if (null !== $object->getImages()) { - $values = []; + if ($object->isInitialized('images') && null !== $object->getImages()) { + $values = array(); foreach ($object->getImages() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'Images'} = $values; + $data['Images'] = $values; } - if (null !== $object->getContainers()) { - $values_1 = []; + if ($object->isInitialized('containers') && null !== $object->getContainers()) { + $values_1 = array(); foreach ($object->getContainers() as $value_1) { - $values_2 = []; - foreach ($value_1 as $value_2) { - $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); - } - $values_1[] = $values_2; + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'Containers'} = $values_1; + $data['Containers'] = $values_1; } - if (null !== $object->getVolumes()) { - $values_3 = []; - foreach ($object->getVolumes() as $value_3) { + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values_2 = array(); + 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 = array(); + foreach ($object->getBuildCache() as $value_3) { $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'Volumes'} = $values_3; + $data['BuildCache'] = $values_3; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SystemDfGetResponse200' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SystemInfoDefaultAddressPoolsItemNormalizer.php b/src/Normalizer/SystemInfoDefaultAddressPoolsItemNormalizer.php new file mode 100644 index 00000000..1cff7205 --- /dev/null +++ b/src/Normalizer/SystemInfoDefaultAddressPoolsItemNormalizer.php @@ -0,0 +1,76 @@ +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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\SystemInfoDefaultAddressPoolsItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SystemInfoNormalizer.php b/src/Normalizer/SystemInfoNormalizer.php index 24a766ce..f97cfb5d 100644 --- a/src/Normalizer/SystemInfoNormalizer.php +++ b/src/Normalizer/SystemInfoNormalizer.php @@ -1,68 +1,92 @@ {'ID'} !== null) { - $object->setID($data->{'ID'}); + 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']); } - if (property_exists($data, 'Containers') && $data->{'Containers'} !== null) { - $object->setContainers($data->{'Containers'}); + elseif (\array_key_exists('ContainersRunning', $data) && $data['ContainersRunning'] === null) { + $object->setContainersRunning(null); } - if (property_exists($data, 'ContainersRunning') && $data->{'ContainersRunning'} !== null) { - $object->setContainersRunning($data->{'ContainersRunning'}); + if (\array_key_exists('ContainersPaused', $data) && $data['ContainersPaused'] !== null) { + $object->setContainersPaused($data['ContainersPaused']); } - if (property_exists($data, 'ContainersPaused') && $data->{'ContainersPaused'} !== null) { - $object->setContainersPaused($data->{'ContainersPaused'}); + elseif (\array_key_exists('ContainersPaused', $data) && $data['ContainersPaused'] === null) { + $object->setContainersPaused(null); } - if (property_exists($data, 'ContainersStopped') && $data->{'ContainersStopped'} !== null) { - $object->setContainersStopped($data->{'ContainersStopped'}); + if (\array_key_exists('ContainersStopped', $data) && $data['ContainersStopped'] !== null) { + $object->setContainersStopped($data['ContainersStopped']); } - if (property_exists($data, 'Images') && $data->{'Images'} !== null) { - $object->setImages($data->{'Images'}); + elseif (\array_key_exists('ContainersStopped', $data) && $data['ContainersStopped'] === null) { + $object->setContainersStopped(null); } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); + if (\array_key_exists('Images', $data) && $data['Images'] !== null) { + $object->setImages($data['Images']); } - if (property_exists($data, 'DriverStatus') && $data->{'DriverStatus'} !== null) { - $values = []; - foreach ($data->{'DriverStatus'} as $value) { - $values_1 = []; + 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 = array(); + foreach ($data['DriverStatus'] as $value) { + $values_1 = array(); foreach ($value as $value_1) { $values_1[] = $value_1; } @@ -70,388 +94,569 @@ public function denormalize($data, $class, $format = null, array $context = []) } $object->setDriverStatus($values); } - if (property_exists($data, 'DockerRootDir') && $data->{'DockerRootDir'} !== null) { - $object->setDockerRootDir($data->{'DockerRootDir'}); + elseif (\array_key_exists('DriverStatus', $data) && $data['DriverStatus'] === null) { + $object->setDriverStatus(null); } - if (property_exists($data, 'SystemStatus') && $data->{'SystemStatus'} !== null) { - $values_2 = []; - foreach ($data->{'SystemStatus'} as $value_2) { - $values_3 = []; - foreach ($value_2 as $value_3) { - $values_3[] = $value_3; - } - $values_2[] = $values_3; - } - $object->setSystemStatus($values_2); + 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', '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']); } - if (property_exists($data, 'Plugins') && $data->{'Plugins'} !== null) { - $object->setPlugins($this->denormalizer->denormalize($data->{'Plugins'}, 'Docker\\API\\Model\\PluginsInfo', 'json', $context)); + elseif (\array_key_exists('NFd', $data) && $data['NFd'] === null) { + $object->setNFd(null); } - if (property_exists($data, 'MemoryLimit') && $data->{'MemoryLimit'} !== null) { - $object->setMemoryLimit($data->{'MemoryLimit'}); + if (\array_key_exists('NGoroutines', $data) && $data['NGoroutines'] !== null) { + $object->setNGoroutines($data['NGoroutines']); } - if (property_exists($data, 'SwapLimit') && $data->{'SwapLimit'} !== null) { - $object->setSwapLimit($data->{'SwapLimit'}); + elseif (\array_key_exists('NGoroutines', $data) && $data['NGoroutines'] === null) { + $object->setNGoroutines(null); } - if (property_exists($data, 'KernelMemory') && $data->{'KernelMemory'} !== null) { - $object->setKernelMemory($data->{'KernelMemory'}); + if (\array_key_exists('SystemTime', $data) && $data['SystemTime'] !== null) { + $object->setSystemTime($data['SystemTime']); } - if (property_exists($data, 'CpuCfsPeriod') && $data->{'CpuCfsPeriod'} !== null) { - $object->setCpuCfsPeriod($data->{'CpuCfsPeriod'}); + elseif (\array_key_exists('SystemTime', $data) && $data['SystemTime'] === null) { + $object->setSystemTime(null); } - if (property_exists($data, 'CpuCfsQuota') && $data->{'CpuCfsQuota'} !== null) { - $object->setCpuCfsQuota($data->{'CpuCfsQuota'}); + if (\array_key_exists('LoggingDriver', $data) && $data['LoggingDriver'] !== null) { + $object->setLoggingDriver($data['LoggingDriver']); } - if (property_exists($data, 'CPUShares') && $data->{'CPUShares'} !== null) { - $object->setCPUShares($data->{'CPUShares'}); + elseif (\array_key_exists('LoggingDriver', $data) && $data['LoggingDriver'] === null) { + $object->setLoggingDriver(null); } - if (property_exists($data, 'CPUSet') && $data->{'CPUSet'} !== null) { - $object->setCPUSet($data->{'CPUSet'}); + if (\array_key_exists('CgroupDriver', $data) && $data['CgroupDriver'] !== null) { + $object->setCgroupDriver($data['CgroupDriver']); } - if (property_exists($data, 'OomKillDisable') && $data->{'OomKillDisable'} !== null) { - $object->setOomKillDisable($data->{'OomKillDisable'}); + elseif (\array_key_exists('CgroupDriver', $data) && $data['CgroupDriver'] === null) { + $object->setCgroupDriver(null); } - if (property_exists($data, 'IPv4Forwarding') && $data->{'IPv4Forwarding'} !== null) { - $object->setIPv4Forwarding($data->{'IPv4Forwarding'}); + if (\array_key_exists('CgroupVersion', $data) && $data['CgroupVersion'] !== null) { + $object->setCgroupVersion($data['CgroupVersion']); } - if (property_exists($data, 'BridgeNfIptables') && $data->{'BridgeNfIptables'} !== null) { - $object->setBridgeNfIptables($data->{'BridgeNfIptables'}); + elseif (\array_key_exists('CgroupVersion', $data) && $data['CgroupVersion'] === null) { + $object->setCgroupVersion(null); } - if (property_exists($data, 'BridgeNfIp6tables') && $data->{'BridgeNfIp6tables'} !== null) { - $object->setBridgeNfIp6tables($data->{'BridgeNfIp6tables'}); + if (\array_key_exists('NEventsListener', $data) && $data['NEventsListener'] !== null) { + $object->setNEventsListener($data['NEventsListener']); } - if (property_exists($data, 'Debug') && $data->{'Debug'} !== null) { - $object->setDebug($data->{'Debug'}); + elseif (\array_key_exists('NEventsListener', $data) && $data['NEventsListener'] === null) { + $object->setNEventsListener(null); } - if (property_exists($data, 'NFd') && $data->{'NFd'} !== null) { - $object->setNFd($data->{'NFd'}); + if (\array_key_exists('KernelVersion', $data) && $data['KernelVersion'] !== null) { + $object->setKernelVersion($data['KernelVersion']); } - if (property_exists($data, 'NGoroutines') && $data->{'NGoroutines'} !== null) { - $object->setNGoroutines($data->{'NGoroutines'}); + elseif (\array_key_exists('KernelVersion', $data) && $data['KernelVersion'] === null) { + $object->setKernelVersion(null); } - if (property_exists($data, 'SystemTime') && $data->{'SystemTime'} !== null) { - $object->setSystemTime($data->{'SystemTime'}); + if (\array_key_exists('OperatingSystem', $data) && $data['OperatingSystem'] !== null) { + $object->setOperatingSystem($data['OperatingSystem']); } - if (property_exists($data, 'LoggingDriver') && $data->{'LoggingDriver'} !== null) { - $object->setLoggingDriver($data->{'LoggingDriver'}); + elseif (\array_key_exists('OperatingSystem', $data) && $data['OperatingSystem'] === null) { + $object->setOperatingSystem(null); } - if (property_exists($data, 'CgroupDriver') && $data->{'CgroupDriver'} !== null) { - $object->setCgroupDriver($data->{'CgroupDriver'}); + if (\array_key_exists('OSVersion', $data) && $data['OSVersion'] !== null) { + $object->setOSVersion($data['OSVersion']); } - if (property_exists($data, 'NEventsListener') && $data->{'NEventsListener'} !== null) { - $object->setNEventsListener($data->{'NEventsListener'}); + elseif (\array_key_exists('OSVersion', $data) && $data['OSVersion'] === null) { + $object->setOSVersion(null); } - if (property_exists($data, 'KernelVersion') && $data->{'KernelVersion'} !== null) { - $object->setKernelVersion($data->{'KernelVersion'}); + if (\array_key_exists('OSType', $data) && $data['OSType'] !== null) { + $object->setOSType($data['OSType']); } - if (property_exists($data, 'OperatingSystem') && $data->{'OperatingSystem'} !== null) { - $object->setOperatingSystem($data->{'OperatingSystem'}); + elseif (\array_key_exists('OSType', $data) && $data['OSType'] === null) { + $object->setOSType(null); } - if (property_exists($data, 'OSType') && $data->{'OSType'} !== null) { - $object->setOSType($data->{'OSType'}); + if (\array_key_exists('Architecture', $data) && $data['Architecture'] !== null) { + $object->setArchitecture($data['Architecture']); } - if (property_exists($data, 'Architecture') && $data->{'Architecture'} !== null) { - $object->setArchitecture($data->{'Architecture'}); + elseif (\array_key_exists('Architecture', $data) && $data['Architecture'] === null) { + $object->setArchitecture(null); } - if (property_exists($data, 'NCPU') && $data->{'NCPU'} !== null) { - $object->setNCPU($data->{'NCPU'}); + if (\array_key_exists('NCPU', $data) && $data['NCPU'] !== null) { + $object->setNCPU($data['NCPU']); } - if (property_exists($data, 'MemTotal') && $data->{'MemTotal'} !== null) { - $object->setMemTotal($data->{'MemTotal'}); + elseif (\array_key_exists('NCPU', $data) && $data['NCPU'] === null) { + $object->setNCPU(null); } - if (property_exists($data, 'IndexServerAddress') && $data->{'IndexServerAddress'} !== null) { - $object->setIndexServerAddress($data->{'IndexServerAddress'}); + if (\array_key_exists('MemTotal', $data) && $data['MemTotal'] !== null) { + $object->setMemTotal($data['MemTotal']); } - if (property_exists($data, 'RegistryConfig') && $data->{'RegistryConfig'} !== null) { - $object->setRegistryConfig($this->denormalizer->denormalize($data->{'RegistryConfig'}, 'Docker\\API\\Model\\RegistryServiceConfig', 'json', $context)); + elseif (\array_key_exists('MemTotal', $data) && $data['MemTotal'] === null) { + $object->setMemTotal(null); } - if (property_exists($data, 'GenericResources') && $data->{'GenericResources'} !== null) { - $values_4 = []; - foreach ($data->{'GenericResources'} as $value_4) { - $values_4[] = $this->denormalizer->denormalize($value_4, 'Docker\\API\\Model\\GenericResourcesItem', 'json', $context); + 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', '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 = array(); + foreach ($data['GenericResources'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\GenericResourcesItem', 'json', $context); } - $object->setGenericResources($values_4); + $object->setGenericResources($values_2); } - if (property_exists($data, 'HttpProxy') && $data->{'HttpProxy'} !== null) { - $object->setHttpProxy($data->{'HttpProxy'}); + elseif (\array_key_exists('GenericResources', $data) && $data['GenericResources'] === null) { + $object->setGenericResources(null); } - if (property_exists($data, 'HttpsProxy') && $data->{'HttpsProxy'} !== null) { - $object->setHttpsProxy($data->{'HttpsProxy'}); + if (\array_key_exists('HttpProxy', $data) && $data['HttpProxy'] !== null) { + $object->setHttpProxy($data['HttpProxy']); } - if (property_exists($data, 'NoProxy') && $data->{'NoProxy'} !== null) { - $object->setNoProxy($data->{'NoProxy'}); + elseif (\array_key_exists('HttpProxy', $data) && $data['HttpProxy'] === null) { + $object->setHttpProxy(null); } - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (\array_key_exists('HttpsProxy', $data) && $data['HttpsProxy'] !== null) { + $object->setHttpsProxy($data['HttpsProxy']); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values_5 = []; - foreach ($data->{'Labels'} as $value_5) { - $values_5[] = $value_5; + 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 = array(); + foreach ($data['Labels'] as $value_3) { + $values_3[] = $value_3; } - $object->setLabels($values_5); + $object->setLabels($values_3); + } + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); } - if (property_exists($data, 'ExperimentalBuild') && $data->{'ExperimentalBuild'} !== null) { - $object->setExperimentalBuild($data->{'ExperimentalBuild'}); + if (\array_key_exists('ExperimentalBuild', $data) && $data['ExperimentalBuild'] !== null) { + $object->setExperimentalBuild($data['ExperimentalBuild']); } - if (property_exists($data, 'ServerVersion') && $data->{'ServerVersion'} !== null) { - $object->setServerVersion($data->{'ServerVersion'}); + elseif (\array_key_exists('ExperimentalBuild', $data) && $data['ExperimentalBuild'] === null) { + $object->setExperimentalBuild(null); } - if (property_exists($data, 'ClusterStore') && $data->{'ClusterStore'} !== null) { - $object->setClusterStore($data->{'ClusterStore'}); + if (\array_key_exists('ServerVersion', $data) && $data['ServerVersion'] !== null) { + $object->setServerVersion($data['ServerVersion']); } - if (property_exists($data, 'ClusterAdvertise') && $data->{'ClusterAdvertise'} !== null) { - $object->setClusterAdvertise($data->{'ClusterAdvertise'}); + elseif (\array_key_exists('ServerVersion', $data) && $data['ServerVersion'] === null) { + $object->setServerVersion(null); } - if (property_exists($data, 'Runtimes') && $data->{'Runtimes'} !== null) { - $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Runtimes'} as $key => $value_6) { - $values_6[$key] = $this->denormalizer->denormalize($value_6, 'Docker\\API\\Model\\Runtime', 'json', $context); + if (\array_key_exists('Runtimes', $data) && $data['Runtimes'] !== null) { + $values_4 = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Runtimes'] as $key => $value_4) { + $values_4[$key] = $this->denormalizer->denormalize($value_4, 'Docker\\API\\Model\\Runtime', 'json', $context); } - $object->setRuntimes($values_6); + $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', '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', 'json', $context)); } - if (property_exists($data, 'DefaultRuntime') && $data->{'DefaultRuntime'} !== null) { - $object->setDefaultRuntime($data->{'DefaultRuntime'}); + elseif (\array_key_exists('ContainerdCommit', $data) && $data['ContainerdCommit'] === null) { + $object->setContainerdCommit(null); } - if (property_exists($data, 'Swarm') && $data->{'Swarm'} !== null) { - $object->setSwarm($this->denormalizer->denormalize($data->{'Swarm'}, 'Docker\\API\\Model\\SwarmInfo', 'json', $context)); + if (\array_key_exists('RuncCommit', $data) && $data['RuncCommit'] !== null) { + $object->setRuncCommit($this->denormalizer->denormalize($data['RuncCommit'], 'Docker\\API\\Model\\Commit', 'json', $context)); } - if (property_exists($data, 'LiveRestoreEnabled') && $data->{'LiveRestoreEnabled'} !== null) { - $object->setLiveRestoreEnabled($data->{'LiveRestoreEnabled'}); + elseif (\array_key_exists('RuncCommit', $data) && $data['RuncCommit'] === null) { + $object->setRuncCommit(null); } - if (property_exists($data, 'Isolation') && $data->{'Isolation'} !== null) { - $object->setIsolation($data->{'Isolation'}); + if (\array_key_exists('InitCommit', $data) && $data['InitCommit'] !== null) { + $object->setInitCommit($this->denormalizer->denormalize($data['InitCommit'], 'Docker\\API\\Model\\Commit', 'json', $context)); } - if (property_exists($data, 'InitBinary') && $data->{'InitBinary'} !== null) { - $object->setInitBinary($data->{'InitBinary'}); + elseif (\array_key_exists('InitCommit', $data) && $data['InitCommit'] === null) { + $object->setInitCommit(null); } - if (property_exists($data, 'ContainerdCommit') && $data->{'ContainerdCommit'} !== null) { - $object->setContainerdCommit($this->denormalizer->denormalize($data->{'ContainerdCommit'}, 'Docker\\API\\Model\\Commit', 'json', $context)); + if (\array_key_exists('SecurityOptions', $data) && $data['SecurityOptions'] !== null) { + $values_5 = array(); + 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 (property_exists($data, 'RuncCommit') && $data->{'RuncCommit'} !== null) { - $object->setRuncCommit($this->denormalizer->denormalize($data->{'RuncCommit'}, 'Docker\\API\\Model\\Commit', 'json', $context)); + 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 = array(); + foreach ($data['DefaultAddressPools'] as $value_6) { + $values_6[] = $this->denormalizer->denormalize($value_6, 'Docker\\API\\Model\\SystemInfoDefaultAddressPoolsItem', 'json', $context); + } + $object->setDefaultAddressPools($values_6); } - if (property_exists($data, 'InitCommit') && $data->{'InitCommit'} !== null) { - $object->setInitCommit($this->denormalizer->denormalize($data->{'InitCommit'}, 'Docker\\API\\Model\\Commit', 'json', $context)); + elseif (\array_key_exists('DefaultAddressPools', $data) && $data['DefaultAddressPools'] === null) { + $object->setDefaultAddressPools(null); } - if (property_exists($data, 'SecurityOptions') && $data->{'SecurityOptions'} !== null) { - $values_7 = []; - foreach ($data->{'SecurityOptions'} as $value_7) { + if (\array_key_exists('Warnings', $data) && $data['Warnings'] !== null) { + $values_7 = array(); + foreach ($data['Warnings'] as $value_7) { $values_7[] = $value_7; } - $object->setSecurityOptions($values_7); + $object->setWarnings($values_7); + } + elseif (\array_key_exists('Warnings', $data) && $data['Warnings'] === null) { + $object->setWarnings(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $data = array(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); } - if (null !== $object->getContainers()) { - $data->{'Containers'} = $object->getContainers(); + if ($object->isInitialized('containers') && null !== $object->getContainers()) { + $data['Containers'] = $object->getContainers(); } - if (null !== $object->getContainersRunning()) { - $data->{'ContainersRunning'} = $object->getContainersRunning(); + if ($object->isInitialized('containersRunning') && null !== $object->getContainersRunning()) { + $data['ContainersRunning'] = $object->getContainersRunning(); } - if (null !== $object->getContainersPaused()) { - $data->{'ContainersPaused'} = $object->getContainersPaused(); + if ($object->isInitialized('containersPaused') && null !== $object->getContainersPaused()) { + $data['ContainersPaused'] = $object->getContainersPaused(); } - if (null !== $object->getContainersStopped()) { - $data->{'ContainersStopped'} = $object->getContainersStopped(); + if ($object->isInitialized('containersStopped') && null !== $object->getContainersStopped()) { + $data['ContainersStopped'] = $object->getContainersStopped(); } - if (null !== $object->getImages()) { - $data->{'Images'} = $object->getImages(); + if ($object->isInitialized('images') && null !== $object->getImages()) { + $data['Images'] = $object->getImages(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + if ($object->isInitialized('driver') && null !== $object->getDriver()) { + $data['Driver'] = $object->getDriver(); } - if (null !== $object->getDriverStatus()) { - $values = []; + if ($object->isInitialized('driverStatus') && null !== $object->getDriverStatus()) { + $values = array(); foreach ($object->getDriverStatus() as $value) { - $values_1 = []; + $values_1 = array(); foreach ($value as $value_1) { $values_1[] = $value_1; } $values[] = $values_1; } - $data->{'DriverStatus'} = $values; + $data['DriverStatus'] = $values; } - if (null !== $object->getDockerRootDir()) { - $data->{'DockerRootDir'} = $object->getDockerRootDir(); + if ($object->isInitialized('dockerRootDir') && null !== $object->getDockerRootDir()) { + $data['DockerRootDir'] = $object->getDockerRootDir(); } - if (null !== $object->getSystemStatus()) { - $values_2 = []; - foreach ($object->getSystemStatus() as $value_2) { - $values_3 = []; - foreach ($value_2 as $value_3) { - $values_3[] = $value_3; - } - $values_2[] = $values_3; - } - $data->{'SystemStatus'} = $values_2; + 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 (null !== $object->getPlugins()) { - $data->{'Plugins'} = $this->normalizer->normalize($object->getPlugins(), 'json', $context); + if ($object->isInitialized('swapLimit') && null !== $object->getSwapLimit()) { + $data['SwapLimit'] = $object->getSwapLimit(); } - if (null !== $object->getMemoryLimit()) { - $data->{'MemoryLimit'} = $object->getMemoryLimit(); + if ($object->isInitialized('kernelMemoryTCP') && null !== $object->getKernelMemoryTCP()) { + $data['KernelMemoryTCP'] = $object->getKernelMemoryTCP(); } - if (null !== $object->getSwapLimit()) { - $data->{'SwapLimit'} = $object->getSwapLimit(); + if ($object->isInitialized('cpuCfsPeriod') && null !== $object->getCpuCfsPeriod()) { + $data['CpuCfsPeriod'] = $object->getCpuCfsPeriod(); } - if (null !== $object->getKernelMemory()) { - $data->{'KernelMemory'} = $object->getKernelMemory(); + if ($object->isInitialized('cpuCfsQuota') && null !== $object->getCpuCfsQuota()) { + $data['CpuCfsQuota'] = $object->getCpuCfsQuota(); } - if (null !== $object->getCpuCfsPeriod()) { - $data->{'CpuCfsPeriod'} = $object->getCpuCfsPeriod(); + if ($object->isInitialized('cPUShares') && null !== $object->getCPUShares()) { + $data['CPUShares'] = $object->getCPUShares(); } - if (null !== $object->getCpuCfsQuota()) { - $data->{'CpuCfsQuota'} = $object->getCpuCfsQuota(); + if ($object->isInitialized('cPUSet') && null !== $object->getCPUSet()) { + $data['CPUSet'] = $object->getCPUSet(); } - if (null !== $object->getCPUShares()) { - $data->{'CPUShares'} = $object->getCPUShares(); + if ($object->isInitialized('pidsLimit') && null !== $object->getPidsLimit()) { + $data['PidsLimit'] = $object->getPidsLimit(); } - if (null !== $object->getCPUSet()) { - $data->{'CPUSet'} = $object->getCPUSet(); + if ($object->isInitialized('oomKillDisable') && null !== $object->getOomKillDisable()) { + $data['OomKillDisable'] = $object->getOomKillDisable(); } - if (null !== $object->getOomKillDisable()) { - $data->{'OomKillDisable'} = $object->getOomKillDisable(); + if ($object->isInitialized('iPv4Forwarding') && null !== $object->getIPv4Forwarding()) { + $data['IPv4Forwarding'] = $object->getIPv4Forwarding(); } - if (null !== $object->getIPv4Forwarding()) { - $data->{'IPv4Forwarding'} = $object->getIPv4Forwarding(); + if ($object->isInitialized('bridgeNfIptables') && null !== $object->getBridgeNfIptables()) { + $data['BridgeNfIptables'] = $object->getBridgeNfIptables(); } - if (null !== $object->getBridgeNfIptables()) { - $data->{'BridgeNfIptables'} = $object->getBridgeNfIptables(); + if ($object->isInitialized('bridgeNfIp6tables') && null !== $object->getBridgeNfIp6tables()) { + $data['BridgeNfIp6tables'] = $object->getBridgeNfIp6tables(); } - if (null !== $object->getBridgeNfIp6tables()) { - $data->{'BridgeNfIp6tables'} = $object->getBridgeNfIp6tables(); + if ($object->isInitialized('debug') && null !== $object->getDebug()) { + $data['Debug'] = $object->getDebug(); } - if (null !== $object->getDebug()) { - $data->{'Debug'} = $object->getDebug(); + if ($object->isInitialized('nFd') && null !== $object->getNFd()) { + $data['NFd'] = $object->getNFd(); } - if (null !== $object->getNFd()) { - $data->{'NFd'} = $object->getNFd(); + if ($object->isInitialized('nGoroutines') && null !== $object->getNGoroutines()) { + $data['NGoroutines'] = $object->getNGoroutines(); } - if (null !== $object->getNGoroutines()) { - $data->{'NGoroutines'} = $object->getNGoroutines(); + if ($object->isInitialized('systemTime') && null !== $object->getSystemTime()) { + $data['SystemTime'] = $object->getSystemTime(); } - if (null !== $object->getSystemTime()) { - $data->{'SystemTime'} = $object->getSystemTime(); + if ($object->isInitialized('loggingDriver') && null !== $object->getLoggingDriver()) { + $data['LoggingDriver'] = $object->getLoggingDriver(); } - if (null !== $object->getLoggingDriver()) { - $data->{'LoggingDriver'} = $object->getLoggingDriver(); + if ($object->isInitialized('cgroupDriver') && null !== $object->getCgroupDriver()) { + $data['CgroupDriver'] = $object->getCgroupDriver(); } - if (null !== $object->getCgroupDriver()) { - $data->{'CgroupDriver'} = $object->getCgroupDriver(); + if ($object->isInitialized('cgroupVersion') && null !== $object->getCgroupVersion()) { + $data['CgroupVersion'] = $object->getCgroupVersion(); } - if (null !== $object->getNEventsListener()) { - $data->{'NEventsListener'} = $object->getNEventsListener(); + if ($object->isInitialized('nEventsListener') && null !== $object->getNEventsListener()) { + $data['NEventsListener'] = $object->getNEventsListener(); } - if (null !== $object->getKernelVersion()) { - $data->{'KernelVersion'} = $object->getKernelVersion(); + if ($object->isInitialized('kernelVersion') && null !== $object->getKernelVersion()) { + $data['KernelVersion'] = $object->getKernelVersion(); } - if (null !== $object->getOperatingSystem()) { - $data->{'OperatingSystem'} = $object->getOperatingSystem(); + if ($object->isInitialized('operatingSystem') && null !== $object->getOperatingSystem()) { + $data['OperatingSystem'] = $object->getOperatingSystem(); } - if (null !== $object->getOSType()) { - $data->{'OSType'} = $object->getOSType(); + if ($object->isInitialized('oSVersion') && null !== $object->getOSVersion()) { + $data['OSVersion'] = $object->getOSVersion(); } - if (null !== $object->getArchitecture()) { - $data->{'Architecture'} = $object->getArchitecture(); + if ($object->isInitialized('oSType') && null !== $object->getOSType()) { + $data['OSType'] = $object->getOSType(); } - if (null !== $object->getNCPU()) { - $data->{'NCPU'} = $object->getNCPU(); + if ($object->isInitialized('architecture') && null !== $object->getArchitecture()) { + $data['Architecture'] = $object->getArchitecture(); } - if (null !== $object->getMemTotal()) { - $data->{'MemTotal'} = $object->getMemTotal(); + if ($object->isInitialized('nCPU') && null !== $object->getNCPU()) { + $data['NCPU'] = $object->getNCPU(); } - if (null !== $object->getIndexServerAddress()) { - $data->{'IndexServerAddress'} = $object->getIndexServerAddress(); + if ($object->isInitialized('memTotal') && null !== $object->getMemTotal()) { + $data['MemTotal'] = $object->getMemTotal(); } - if (null !== $object->getRegistryConfig()) { - $data->{'RegistryConfig'} = $this->normalizer->normalize($object->getRegistryConfig(), 'json', $context); + if ($object->isInitialized('indexServerAddress') && null !== $object->getIndexServerAddress()) { + $data['IndexServerAddress'] = $object->getIndexServerAddress(); } - if (null !== $object->getGenericResources()) { - $values_4 = []; - foreach ($object->getGenericResources() as $value_4) { - $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); + 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 = array(); + foreach ($object->getGenericResources() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'GenericResources'} = $values_4; + $data['GenericResources'] = $values_2; } - if (null !== $object->getHttpProxy()) { - $data->{'HttpProxy'} = $object->getHttpProxy(); + if ($object->isInitialized('httpProxy') && null !== $object->getHttpProxy()) { + $data['HttpProxy'] = $object->getHttpProxy(); } - if (null !== $object->getHttpsProxy()) { - $data->{'HttpsProxy'} = $object->getHttpsProxy(); + if ($object->isInitialized('httpsProxy') && null !== $object->getHttpsProxy()) { + $data['HttpsProxy'] = $object->getHttpsProxy(); } - if (null !== $object->getNoProxy()) { - $data->{'NoProxy'} = $object->getNoProxy(); + if ($object->isInitialized('noProxy') && null !== $object->getNoProxy()) { + $data['NoProxy'] = $object->getNoProxy(); } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getLabels()) { - $values_5 = []; - foreach ($object->getLabels() as $value_5) { - $values_5[] = $value_5; + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_3 = array(); + foreach ($object->getLabels() as $value_3) { + $values_3[] = $value_3; } - $data->{'Labels'} = $values_5; + $data['Labels'] = $values_3; } - if (null !== $object->getExperimentalBuild()) { - $data->{'ExperimentalBuild'} = $object->getExperimentalBuild(); + if ($object->isInitialized('experimentalBuild') && null !== $object->getExperimentalBuild()) { + $data['ExperimentalBuild'] = $object->getExperimentalBuild(); } - if (null !== $object->getServerVersion()) { - $data->{'ServerVersion'} = $object->getServerVersion(); + if ($object->isInitialized('serverVersion') && null !== $object->getServerVersion()) { + $data['ServerVersion'] = $object->getServerVersion(); } - if (null !== $object->getClusterStore()) { - $data->{'ClusterStore'} = $object->getClusterStore(); + if ($object->isInitialized('runtimes') && null !== $object->getRuntimes()) { + $values_4 = array(); + foreach ($object->getRuntimes() as $key => $value_4) { + $values_4[$key] = $this->normalizer->normalize($value_4, 'json', $context); + } + $data['Runtimes'] = $values_4; } - if (null !== $object->getClusterAdvertise()) { - $data->{'ClusterAdvertise'} = $object->getClusterAdvertise(); + if ($object->isInitialized('defaultRuntime') && null !== $object->getDefaultRuntime()) { + $data['DefaultRuntime'] = $object->getDefaultRuntime(); } - if (null !== $object->getRuntimes()) { - $values_6 = new \stdClass(); - foreach ($object->getRuntimes() as $key => $value_6) { - $values_6->{$key} = $this->normalizer->normalize($value_6, 'json', $context); - } - $data->{'Runtimes'} = $values_6; + if ($object->isInitialized('swarm') && null !== $object->getSwarm()) { + $data['Swarm'] = $this->normalizer->normalize($object->getSwarm(), 'json', $context); } - if (null !== $object->getDefaultRuntime()) { - $data->{'DefaultRuntime'} = $object->getDefaultRuntime(); + if ($object->isInitialized('liveRestoreEnabled') && null !== $object->getLiveRestoreEnabled()) { + $data['LiveRestoreEnabled'] = $object->getLiveRestoreEnabled(); } - if (null !== $object->getSwarm()) { - $data->{'Swarm'} = $this->normalizer->normalize($object->getSwarm(), 'json', $context); + if ($object->isInitialized('isolation') && null !== $object->getIsolation()) { + $data['Isolation'] = $object->getIsolation(); } - if (null !== $object->getLiveRestoreEnabled()) { - $data->{'LiveRestoreEnabled'} = $object->getLiveRestoreEnabled(); + if ($object->isInitialized('initBinary') && null !== $object->getInitBinary()) { + $data['InitBinary'] = $object->getInitBinary(); } - if (null !== $object->getIsolation()) { - $data->{'Isolation'} = $object->getIsolation(); + if ($object->isInitialized('containerdCommit') && null !== $object->getContainerdCommit()) { + $data['ContainerdCommit'] = $this->normalizer->normalize($object->getContainerdCommit(), 'json', $context); } - if (null !== $object->getInitBinary()) { - $data->{'InitBinary'} = $object->getInitBinary(); + if ($object->isInitialized('runcCommit') && null !== $object->getRuncCommit()) { + $data['RuncCommit'] = $this->normalizer->normalize($object->getRuncCommit(), 'json', $context); } - if (null !== $object->getContainerdCommit()) { - $data->{'ContainerdCommit'} = $this->normalizer->normalize($object->getContainerdCommit(), 'json', $context); + if ($object->isInitialized('initCommit') && null !== $object->getInitCommit()) { + $data['InitCommit'] = $this->normalizer->normalize($object->getInitCommit(), 'json', $context); } - if (null !== $object->getRuncCommit()) { - $data->{'RuncCommit'} = $this->normalizer->normalize($object->getRuncCommit(), 'json', $context); + if ($object->isInitialized('securityOptions') && null !== $object->getSecurityOptions()) { + $values_5 = array(); + foreach ($object->getSecurityOptions() as $value_5) { + $values_5[] = $value_5; + } + $data['SecurityOptions'] = $values_5; } - if (null !== $object->getInitCommit()) { - $data->{'InitCommit'} = $this->normalizer->normalize($object->getInitCommit(), 'json', $context); + if ($object->isInitialized('productLicense') && null !== $object->getProductLicense()) { + $data['ProductLicense'] = $object->getProductLicense(); } - if (null !== $object->getSecurityOptions()) { - $values_7 = []; - foreach ($object->getSecurityOptions() as $value_7) { + if ($object->isInitialized('defaultAddressPools') && null !== $object->getDefaultAddressPools()) { + $values_6 = array(); + 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 = array(); + foreach ($object->getWarnings() as $value_7) { $values_7[] = $value_7; } - $data->{'SecurityOptions'} = $values_7; + $data['Warnings'] = $values_7; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SystemInfo' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SystemVersionComponentsItemNormalizer.php b/src/Normalizer/SystemVersionComponentsItemNormalizer.php new file mode 100644 index 00000000..8d87765b --- /dev/null +++ b/src/Normalizer/SystemVersionComponentsItemNormalizer.php @@ -0,0 +1,81 @@ +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 = array()) + { + $data = array(); + $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 array('Docker\\API\\Model\\SystemVersionComponentsItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SystemVersionNormalizer.php b/src/Normalizer/SystemVersionNormalizer.php new file mode 100644 index 00000000..f8dee933 --- /dev/null +++ b/src/Normalizer/SystemVersionNormalizer.php @@ -0,0 +1,174 @@ +setPlatform($this->denormalizer->denormalize($data['Platform'], 'Docker\\API\\Model\\SystemVersionPlatform', 'json', $context)); + } + elseif (\array_key_exists('Platform', $data) && $data['Platform'] === null) { + $object->setPlatform(null); + } + if (\array_key_exists('Components', $data) && $data['Components'] !== null) { + $values = array(); + foreach ($data['Components'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\SystemVersionComponentsItem', '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 = array()) + { + $data = array(); + if ($object->isInitialized('platform') && null !== $object->getPlatform()) { + $data['Platform'] = $this->normalizer->normalize($object->getPlatform(), 'json', $context); + } + if ($object->isInitialized('components') && null !== $object->getComponents()) { + $values = array(); + 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 array('Docker\\API\\Model\\SystemVersion' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/SystemVersionPlatformNormalizer.php b/src/Normalizer/SystemVersionPlatformNormalizer.php new file mode 100644 index 00000000..b902599d --- /dev/null +++ b/src/Normalizer/SystemVersionPlatformNormalizer.php @@ -0,0 +1,65 @@ +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 = array()) + { + $data = array(); + $data['Name'] = $object->getName(); + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\SystemVersionPlatform' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TLSInfoNormalizer.php b/src/Normalizer/TLSInfoNormalizer.php index 4e07df45..5791b500 100644 --- a/src/Normalizer/TLSInfoNormalizer.php +++ b/src/Normalizer/TLSInfoNormalizer.php @@ -1,69 +1,85 @@ {'TrustRoot'} !== null) { - $object->setTrustRoot($data->{'TrustRoot'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'CertIssuerSubject') && $data->{'CertIssuerSubject'} !== null) { - $object->setCertIssuerSubject($data->{'CertIssuerSubject'}); + if (\array_key_exists('TrustRoot', $data) && $data['TrustRoot'] !== null) { + $object->setTrustRoot($data['TrustRoot']); } - if (property_exists($data, 'CertIssuerPublicKey') && $data->{'CertIssuerPublicKey'} !== null) { - $object->setCertIssuerPublicKey($data->{'CertIssuerPublicKey'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getTrustRoot()) { - $data->{'TrustRoot'} = $object->getTrustRoot(); + $data = array(); + if ($object->isInitialized('trustRoot') && null !== $object->getTrustRoot()) { + $data['TrustRoot'] = $object->getTrustRoot(); } - if (null !== $object->getCertIssuerSubject()) { - $data->{'CertIssuerSubject'} = $object->getCertIssuerSubject(); + if ($object->isInitialized('certIssuerSubject') && null !== $object->getCertIssuerSubject()) { + $data['CertIssuerSubject'] = $object->getCertIssuerSubject(); } - if (null !== $object->getCertIssuerPublicKey()) { - $data->{'CertIssuerPublicKey'} = $object->getCertIssuerPublicKey(); + if ($object->isInitialized('certIssuerPublicKey') && null !== $object->getCertIssuerPublicKey()) { + $data['CertIssuerPublicKey'] = $object->getCertIssuerPublicKey(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TLSInfo' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskNormalizer.php b/src/Normalizer/TaskNormalizer.php index d35888a9..e8a6a1ec 100644 --- a/src/Normalizer/TaskNormalizer.php +++ b/src/Normalizer/TaskNormalizer.php @@ -1,145 +1,200 @@ {'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && $data['ID'] !== null) { + $object->setID($data['ID']); } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); + elseif (\array_key_exists('ID', $data) && $data['ID'] === null) { + $object->setID(null); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + if (\array_key_exists('Version', $data) && $data['Version'] !== null) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); + elseif (\array_key_exists('Version', $data) && $data['Version'] === null) { + $object->setVersion(null); } - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (\array_key_exists('CreatedAt', $data) && $data['CreatedAt'] !== null) { + $object->setCreatedAt($data['CreatedAt']); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\TaskSpec', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('Spec', $data) && $data['Spec'] === null) { + $object->setSpec(null); } - if (property_exists($data, 'ServiceID') && $data->{'ServiceID'} !== null) { - $object->setServiceID($data->{'ServiceID'}); + if (\array_key_exists('ServiceID', $data) && $data['ServiceID'] !== null) { + $object->setServiceID($data['ServiceID']); } - if (property_exists($data, 'Slot') && $data->{'Slot'} !== null) { - $object->setSlot($data->{'Slot'}); + elseif (\array_key_exists('ServiceID', $data) && $data['ServiceID'] === null) { + $object->setServiceID(null); } - if (property_exists($data, 'NodeID') && $data->{'NodeID'} !== null) { - $object->setNodeID($data->{'NodeID'}); + if (\array_key_exists('Slot', $data) && $data['Slot'] !== null) { + $object->setSlot($data['Slot']); } - if (property_exists($data, 'AssignedGenericResources') && $data->{'AssignedGenericResources'} !== null) { - $values_1 = []; - foreach ($data->{'AssignedGenericResources'} as $value_1) { + 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 = array(); + foreach ($data['AssignedGenericResources'] as $value_1) { $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\GenericResourcesItem', 'json', $context); } $object->setAssignedGenericResources($values_1); } - if (property_exists($data, 'Status') && $data->{'Status'} !== null) { - $object->setStatus($this->denormalizer->denormalize($data->{'Status'}, 'Docker\\API\\Model\\TaskStatus', 'json', $context)); + elseif (\array_key_exists('AssignedGenericResources', $data) && $data['AssignedGenericResources'] === null) { + $object->setAssignedGenericResources(null); } - if (property_exists($data, 'DesiredState') && $data->{'DesiredState'} !== null) { - $object->setDesiredState($data->{'DesiredState'}); + if (\array_key_exists('Status', $data) && $data['Status'] !== null) { + $object->setStatus($this->denormalizer->denormalize($data['Status'], 'Docker\\API\\Model\\TaskStatus', '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', 'json', $context)); + } + elseif (\array_key_exists('JobIteration', $data) && $data['JobIteration'] === null) { + $object->setJobIteration(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $data = array(); + if ($object->isInitialized('iD') && null !== $object->getID()) { + $data['ID'] = $object->getID(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($object->isInitialized('version') && null !== $object->getVersion()) { + $data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['CreatedAt'] = $object->getCreatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['UpdatedAt'] = $object->getUpdatedAt(); } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($object->isInitialized('spec') && null !== $object->getSpec()) { + $data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context); } - if (null !== $object->getServiceID()) { - $data->{'ServiceID'} = $object->getServiceID(); + if ($object->isInitialized('serviceID') && null !== $object->getServiceID()) { + $data['ServiceID'] = $object->getServiceID(); } - if (null !== $object->getSlot()) { - $data->{'Slot'} = $object->getSlot(); + if ($object->isInitialized('slot') && null !== $object->getSlot()) { + $data['Slot'] = $object->getSlot(); } - if (null !== $object->getNodeID()) { - $data->{'NodeID'} = $object->getNodeID(); + if ($object->isInitialized('nodeID') && null !== $object->getNodeID()) { + $data['NodeID'] = $object->getNodeID(); } - if (null !== $object->getAssignedGenericResources()) { - $values_1 = []; + if ($object->isInitialized('assignedGenericResources') && null !== $object->getAssignedGenericResources()) { + $values_1 = array(); foreach ($object->getAssignedGenericResources() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'AssignedGenericResources'} = $values_1; + $data['AssignedGenericResources'] = $values_1; } - if (null !== $object->getStatus()) { - $data->{'Status'} = $this->normalizer->normalize($object->getStatus(), 'json', $context); + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['Status'] = $this->normalizer->normalize($object->getStatus(), 'json', $context); } - if (null !== $object->getDesiredState()) { - $data->{'DesiredState'} = $object->getDesiredState(); + 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; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\Task' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecContainerSpecConfigsItemFileNormalizer.php b/src/Normalizer/TaskSpecContainerSpecConfigsItemFileNormalizer.php index d7fba318..29983d44 100644 --- a/src/Normalizer/TaskSpecContainerSpecConfigsItemFileNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecConfigsItemFileNormalizer.php @@ -1,75 +1,94 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'UID') && $data->{'UID'} !== null) { - $object->setUID($data->{'UID'}); + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'GID') && $data->{'GID'} !== null) { - $object->setGID($data->{'GID'}); + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($data->{'Mode'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getUID()) { - $data->{'UID'} = $object->getUID(); + if ($object->isInitialized('uID') && null !== $object->getUID()) { + $data['UID'] = $object->getUID(); } - if (null !== $object->getGID()) { - $data->{'GID'} = $object->getGID(); + if ($object->isInitialized('gID') && null !== $object->getGID()) { + $data['GID'] = $object->getGID(); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $object->getMode(); + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskSpecContainerSpecConfigsItemFile' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecContainerSpecConfigsItemNormalizer.php b/src/Normalizer/TaskSpecContainerSpecConfigsItemNormalizer.php index aeba937f..9607bb05 100644 --- a/src/Normalizer/TaskSpecContainerSpecConfigsItemNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecConfigsItemNormalizer.php @@ -1,69 +1,94 @@ {'File'} !== null) { - $object->setFile($this->denormalizer->denormalize($data->{'File'}, 'Docker\\API\\Model\\TaskSpecContainerSpecConfigsItemFile', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'ConfigID') && $data->{'ConfigID'} !== null) { - $object->setConfigID($data->{'ConfigID'}); + if (\array_key_exists('File', $data) && $data['File'] !== null) { + $object->setFile($this->denormalizer->denormalize($data['File'], 'Docker\\API\\Model\\TaskSpecContainerSpecConfigsItemFile', 'json', $context)); } - if (property_exists($data, 'ConfigName') && $data->{'ConfigName'} !== null) { - $object->setConfigName($data->{'ConfigName'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getFile()) { - $data->{'File'} = $this->normalizer->normalize($object->getFile(), 'json', $context); + $data = array(); + if ($object->isInitialized('file') && null !== $object->getFile()) { + $data['File'] = $this->normalizer->normalize($object->getFile(), 'json', $context); } - if (null !== $object->getConfigID()) { - $data->{'ConfigID'} = $object->getConfigID(); + if ($object->isInitialized('runtime') && null !== $object->getRuntime()) { + $data['Runtime'] = $object->getRuntime(); } - if (null !== $object->getConfigName()) { - $data->{'ConfigName'} = $object->getConfigName(); + 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 array('Docker\\API\\Model\\TaskSpecContainerSpecConfigsItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecContainerSpecDNSConfigNormalizer.php b/src/Normalizer/TaskSpecContainerSpecDNSConfigNormalizer.php index 3a7c854d..df12e633 100644 --- a/src/Normalizer/TaskSpecContainerSpecDNSConfigNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecDNSConfigNormalizer.php @@ -1,93 +1,109 @@ {'Nameservers'} !== null) { - $values = []; - foreach ($data->{'Nameservers'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Nameservers', $data) && $data['Nameservers'] !== null) { + $values = array(); + foreach ($data['Nameservers'] as $value) { $values[] = $value; } $object->setNameservers($values); } - if (property_exists($data, 'Search') && $data->{'Search'} !== null) { - $values_1 = []; - foreach ($data->{'Search'} as $value_1) { + elseif (\array_key_exists('Nameservers', $data) && $data['Nameservers'] === null) { + $object->setNameservers(null); + } + if (\array_key_exists('Search', $data) && $data['Search'] !== null) { + $values_1 = array(); + foreach ($data['Search'] as $value_1) { $values_1[] = $value_1; } $object->setSearch($values_1); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { - $values_2 = []; - foreach ($data->{'Options'} as $value_2) { + elseif (\array_key_exists('Search', $data) && $data['Search'] === null) { + $object->setSearch(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values_2 = array(); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getNameservers()) { - $values = []; + $data = array(); + if ($object->isInitialized('nameservers') && null !== $object->getNameservers()) { + $values = array(); foreach ($object->getNameservers() as $value) { $values[] = $value; } - $data->{'Nameservers'} = $values; + $data['Nameservers'] = $values; } - if (null !== $object->getSearch()) { - $values_1 = []; + if ($object->isInitialized('search') && null !== $object->getSearch()) { + $values_1 = array(); foreach ($object->getSearch() as $value_1) { $values_1[] = $value_1; } - $data->{'Search'} = $values_1; + $data['Search'] = $values_1; } - if (null !== $object->getOptions()) { - $values_2 = []; + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values_2 = array(); foreach ($object->getOptions() as $value_2) { $values_2[] = $value_2; } - $data->{'Options'} = $values_2; + $data['Options'] = $values_2; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskSpecContainerSpecDNSConfig' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecContainerSpecNormalizer.php b/src/Normalizer/TaskSpecContainerSpecNormalizer.php index ed3f7ef8..a5995402 100644 --- a/src/Normalizer/TaskSpecContainerSpecNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecNormalizer.php @@ -1,255 +1,405 @@ {'Image'} !== null) { - $object->setImage($data->{'Image'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Image', $data) && $data['Image'] !== null) { + $object->setImage($data['Image']); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + elseif (\array_key_exists('Image', $data) && $data['Image'] === null) { + $object->setImage(null); + } + if (\array_key_exists('Labels', $data) && $data['Labels'] !== null) { + $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); } - if (property_exists($data, 'Command') && $data->{'Command'} !== null) { - $values_1 = []; - foreach ($data->{'Command'} as $value_1) { + elseif (\array_key_exists('Labels', $data) && $data['Labels'] === null) { + $object->setLabels(null); + } + if (\array_key_exists('Command', $data) && $data['Command'] !== null) { + $values_1 = array(); + foreach ($data['Command'] as $value_1) { $values_1[] = $value_1; } $object->setCommand($values_1); } - if (property_exists($data, 'Args') && $data->{'Args'} !== null) { - $values_2 = []; - foreach ($data->{'Args'} as $value_2) { + elseif (\array_key_exists('Command', $data) && $data['Command'] === null) { + $object->setCommand(null); + } + if (\array_key_exists('Args', $data) && $data['Args'] !== null) { + $values_2 = array(); + foreach ($data['Args'] as $value_2) { $values_2[] = $value_2; } $object->setArgs($values_2); } - if (property_exists($data, 'Hostname') && $data->{'Hostname'} !== null) { - $object->setHostname($data->{'Hostname'}); + 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']); } - if (property_exists($data, 'Env') && $data->{'Env'} !== null) { - $values_3 = []; - foreach ($data->{'Env'} as $value_3) { + elseif (\array_key_exists('Hostname', $data) && $data['Hostname'] === null) { + $object->setHostname(null); + } + if (\array_key_exists('Env', $data) && $data['Env'] !== null) { + $values_3 = array(); + foreach ($data['Env'] as $value_3) { $values_3[] = $value_3; } $object->setEnv($values_3); } - if (property_exists($data, 'Dir') && $data->{'Dir'} !== null) { - $object->setDir($data->{'Dir'}); + 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 (property_exists($data, 'User') && $data->{'User'} !== null) { - $object->setUser($data->{'User'}); + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); } - if (property_exists($data, 'Groups') && $data->{'Groups'} !== null) { - $values_4 = []; - foreach ($data->{'Groups'} as $value_4) { + elseif (\array_key_exists('User', $data) && $data['User'] === null) { + $object->setUser(null); + } + if (\array_key_exists('Groups', $data) && $data['Groups'] !== null) { + $values_4 = array(); + foreach ($data['Groups'] as $value_4) { $values_4[] = $value_4; } $object->setGroups($values_4); } - if (property_exists($data, 'Privileges') && $data->{'Privileges'} !== null) { - $object->setPrivileges($this->denormalizer->denormalize($data->{'Privileges'}, 'Docker\\API\\Model\\TaskSpecContainerSpecPrivileges', 'json', $context)); + 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', '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']); } - if (property_exists($data, 'TTY') && $data->{'TTY'} !== null) { - $object->setTTY($data->{'TTY'}); + elseif (\array_key_exists('TTY', $data) && $data['TTY'] === null) { + $object->setTTY(null); } - if (property_exists($data, 'OpenStdin') && $data->{'OpenStdin'} !== null) { - $object->setOpenStdin($data->{'OpenStdin'}); + if (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] !== null) { + $object->setOpenStdin($data['OpenStdin']); } - if (property_exists($data, 'ReadOnly') && $data->{'ReadOnly'} !== null) { - $object->setReadOnly($data->{'ReadOnly'}); + elseif (\array_key_exists('OpenStdin', $data) && $data['OpenStdin'] === null) { + $object->setOpenStdin(null); } - if (property_exists($data, 'Mounts') && $data->{'Mounts'} !== null) { - $values_5 = []; - foreach ($data->{'Mounts'} as $value_5) { + 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 = array(); + foreach ($data['Mounts'] as $value_5) { $values_5[] = $this->denormalizer->denormalize($value_5, 'Docker\\API\\Model\\Mount', 'json', $context); } $object->setMounts($values_5); } - if (property_exists($data, 'StopSignal') && $data->{'StopSignal'} !== null) { - $object->setStopSignal($data->{'StopSignal'}); + 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 (property_exists($data, 'StopGracePeriod') && $data->{'StopGracePeriod'} !== null) { - $object->setStopGracePeriod($data->{'StopGracePeriod'}); + if (\array_key_exists('StopGracePeriod', $data) && $data['StopGracePeriod'] !== null) { + $object->setStopGracePeriod($data['StopGracePeriod']); } - if (property_exists($data, 'HealthCheck') && $data->{'HealthCheck'} !== null) { - $object->setHealthCheck($this->denormalizer->denormalize($data->{'HealthCheck'}, 'Docker\\API\\Model\\HealthConfig', 'json', $context)); + elseif (\array_key_exists('StopGracePeriod', $data) && $data['StopGracePeriod'] === null) { + $object->setStopGracePeriod(null); } - if (property_exists($data, 'Hosts') && $data->{'Hosts'} !== null) { - $values_6 = []; - foreach ($data->{'Hosts'} as $value_6) { + if (\array_key_exists('HealthCheck', $data) && $data['HealthCheck'] !== null) { + $object->setHealthCheck($this->denormalizer->denormalize($data['HealthCheck'], 'Docker\\API\\Model\\HealthConfig', '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 = array(); + foreach ($data['Hosts'] as $value_6) { $values_6[] = $value_6; } $object->setHosts($values_6); } - if (property_exists($data, 'DNSConfig') && $data->{'DNSConfig'} !== null) { - $object->setDNSConfig($this->denormalizer->denormalize($data->{'DNSConfig'}, 'Docker\\API\\Model\\TaskSpecContainerSpecDNSConfig', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('DNSConfig', $data) && $data['DNSConfig'] === null) { + $object->setDNSConfig(null); } - if (property_exists($data, 'Secrets') && $data->{'Secrets'} !== null) { - $values_7 = []; - foreach ($data->{'Secrets'} as $value_7) { + if (\array_key_exists('Secrets', $data) && $data['Secrets'] !== null) { + $values_7 = array(); + foreach ($data['Secrets'] as $value_7) { $values_7[] = $this->denormalizer->denormalize($value_7, 'Docker\\API\\Model\\TaskSpecContainerSpecSecretsItem', 'json', $context); } $object->setSecrets($values_7); } - if (property_exists($data, 'Configs') && $data->{'Configs'} !== null) { - $values_8 = []; - foreach ($data->{'Configs'} as $value_8) { + elseif (\array_key_exists('Secrets', $data) && $data['Secrets'] === null) { + $object->setSecrets(null); + } + if (\array_key_exists('Configs', $data) && $data['Configs'] !== null) { + $values_8 = array(); + foreach ($data['Configs'] as $value_8) { $values_8[] = $this->denormalizer->denormalize($value_8, 'Docker\\API\\Model\\TaskSpecContainerSpecConfigsItem', 'json', $context); } $object->setConfigs($values_8); } - if (property_exists($data, 'Isolation') && $data->{'Isolation'} !== null) { - $object->setIsolation($data->{'Isolation'}); + 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(array(), \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 = array(); + 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 = array(); + 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 = array(); + foreach ($data['Ulimits'] as $value_12) { + $values_12[] = $this->denormalizer->denormalize($value_12, 'Docker\\API\\Model\\TaskSpecContainerSpecUlimitsItem', 'json', $context); + } + $object->setUlimits($values_12); + } + elseif (\array_key_exists('Ulimits', $data) && $data['Ulimits'] === null) { + $object->setUlimits(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); + $data = array(); + if ($object->isInitialized('image') && null !== $object->getImage()) { + $data['Image'] = $object->getImage(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values = array(); foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Labels'} = $values; + $data['Labels'] = $values; } - if (null !== $object->getCommand()) { - $values_1 = []; + if ($object->isInitialized('command') && null !== $object->getCommand()) { + $values_1 = array(); foreach ($object->getCommand() as $value_1) { $values_1[] = $value_1; } - $data->{'Command'} = $values_1; + $data['Command'] = $values_1; } - if (null !== $object->getArgs()) { - $values_2 = []; + if ($object->isInitialized('args') && null !== $object->getArgs()) { + $values_2 = array(); foreach ($object->getArgs() as $value_2) { $values_2[] = $value_2; } - $data->{'Args'} = $values_2; + $data['Args'] = $values_2; } - if (null !== $object->getHostname()) { - $data->{'Hostname'} = $object->getHostname(); + if ($object->isInitialized('hostname') && null !== $object->getHostname()) { + $data['Hostname'] = $object->getHostname(); } - if (null !== $object->getEnv()) { - $values_3 = []; + if ($object->isInitialized('env') && null !== $object->getEnv()) { + $values_3 = array(); foreach ($object->getEnv() as $value_3) { $values_3[] = $value_3; } - $data->{'Env'} = $values_3; + $data['Env'] = $values_3; } - if (null !== $object->getDir()) { - $data->{'Dir'} = $object->getDir(); + if ($object->isInitialized('dir') && null !== $object->getDir()) { + $data['Dir'] = $object->getDir(); } - if (null !== $object->getUser()) { - $data->{'User'} = $object->getUser(); + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); } - if (null !== $object->getGroups()) { - $values_4 = []; + if ($object->isInitialized('groups') && null !== $object->getGroups()) { + $values_4 = array(); foreach ($object->getGroups() as $value_4) { $values_4[] = $value_4; } - $data->{'Groups'} = $values_4; + $data['Groups'] = $values_4; } - if (null !== $object->getPrivileges()) { - $data->{'Privileges'} = $this->normalizer->normalize($object->getPrivileges(), 'json', $context); + if ($object->isInitialized('privileges') && null !== $object->getPrivileges()) { + $data['Privileges'] = $this->normalizer->normalize($object->getPrivileges(), 'json', $context); } - if (null !== $object->getTTY()) { - $data->{'TTY'} = $object->getTTY(); + if ($object->isInitialized('tTY') && null !== $object->getTTY()) { + $data['TTY'] = $object->getTTY(); } - if (null !== $object->getOpenStdin()) { - $data->{'OpenStdin'} = $object->getOpenStdin(); + if ($object->isInitialized('openStdin') && null !== $object->getOpenStdin()) { + $data['OpenStdin'] = $object->getOpenStdin(); } - if (null !== $object->getReadOnly()) { - $data->{'ReadOnly'} = $object->getReadOnly(); + if ($object->isInitialized('readOnly') && null !== $object->getReadOnly()) { + $data['ReadOnly'] = $object->getReadOnly(); } - if (null !== $object->getMounts()) { - $values_5 = []; + if ($object->isInitialized('mounts') && null !== $object->getMounts()) { + $values_5 = array(); foreach ($object->getMounts() as $value_5) { $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); } - $data->{'Mounts'} = $values_5; + $data['Mounts'] = $values_5; } - if (null !== $object->getStopSignal()) { - $data->{'StopSignal'} = $object->getStopSignal(); + if ($object->isInitialized('stopSignal') && null !== $object->getStopSignal()) { + $data['StopSignal'] = $object->getStopSignal(); } - if (null !== $object->getStopGracePeriod()) { - $data->{'StopGracePeriod'} = $object->getStopGracePeriod(); + if ($object->isInitialized('stopGracePeriod') && null !== $object->getStopGracePeriod()) { + $data['StopGracePeriod'] = $object->getStopGracePeriod(); } - if (null !== $object->getHealthCheck()) { - $data->{'HealthCheck'} = $this->normalizer->normalize($object->getHealthCheck(), 'json', $context); + if ($object->isInitialized('healthCheck') && null !== $object->getHealthCheck()) { + $data['HealthCheck'] = $this->normalizer->normalize($object->getHealthCheck(), 'json', $context); } - if (null !== $object->getHosts()) { - $values_6 = []; + if ($object->isInitialized('hosts') && null !== $object->getHosts()) { + $values_6 = array(); foreach ($object->getHosts() as $value_6) { $values_6[] = $value_6; } - $data->{'Hosts'} = $values_6; + $data['Hosts'] = $values_6; } - if (null !== $object->getDNSConfig()) { - $data->{'DNSConfig'} = $this->normalizer->normalize($object->getDNSConfig(), 'json', $context); + if ($object->isInitialized('dNSConfig') && null !== $object->getDNSConfig()) { + $data['DNSConfig'] = $this->normalizer->normalize($object->getDNSConfig(), 'json', $context); } - if (null !== $object->getSecrets()) { - $values_7 = []; + if ($object->isInitialized('secrets') && null !== $object->getSecrets()) { + $values_7 = array(); foreach ($object->getSecrets() as $value_7) { $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); } - $data->{'Secrets'} = $values_7; + $data['Secrets'] = $values_7; } - if (null !== $object->getConfigs()) { - $values_8 = []; + if ($object->isInitialized('configs') && null !== $object->getConfigs()) { + $values_8 = array(); foreach ($object->getConfigs() as $value_8) { $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); } - $data->{'Configs'} = $values_8; + $data['Configs'] = $values_8; } - if (null !== $object->getIsolation()) { - $data->{'Isolation'} = $object->getIsolation(); + 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 = array(); + 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 = array(); + foreach ($object->getCapabilityAdd() as $value_10) { + $values_10[] = $value_10; + } + $data['CapabilityAdd'] = $values_10; + } + if ($object->isInitialized('capabilityDrop') && null !== $object->getCapabilityDrop()) { + $values_11 = array(); + foreach ($object->getCapabilityDrop() as $value_11) { + $values_11[] = $value_11; + } + $data['CapabilityDrop'] = $values_11; + } + if ($object->isInitialized('ulimits') && null !== $object->getUlimits()) { + $values_12 = array(); + 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 array('Docker\\API\\Model\\TaskSpecContainerSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer.php b/src/Normalizer/TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer.php index 8d9eb5da..fcd1ce66 100644 --- a/src/Normalizer/TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer.php @@ -1,63 +1,85 @@ {'File'} !== null) { - $object->setFile($data->{'File'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Registry') && $data->{'Registry'} !== null) { - $object->setRegistry($data->{'Registry'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getFile()) { - $data->{'File'} = $object->getFile(); + $data = array(); + if ($object->isInitialized('config') && null !== $object->getConfig()) { + $data['Config'] = $object->getConfig(); } - if (null !== $object->getRegistry()) { - $data->{'Registry'} = $object->getRegistry(); + 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 array('Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesCredentialSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecContainerSpecPrivilegesNormalizer.php b/src/Normalizer/TaskSpecContainerSpecPrivilegesNormalizer.php index 65e95c75..e7b42b85 100644 --- a/src/Normalizer/TaskSpecContainerSpecPrivilegesNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecPrivilegesNormalizer.php @@ -1,63 +1,76 @@ {'CredentialSpec'} !== null) { - $object->setCredentialSpec($this->denormalizer->denormalize($data->{'CredentialSpec'}, 'Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesCredentialSpec', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'SELinuxContext') && $data->{'SELinuxContext'} !== null) { - $object->setSELinuxContext($this->denormalizer->denormalize($data->{'SELinuxContext'}, 'Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesSELinuxContext', 'json', $context)); + if (\array_key_exists('CredentialSpec', $data) && $data['CredentialSpec'] !== null) { + $object->setCredentialSpec($this->denormalizer->denormalize($data['CredentialSpec'], 'Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesCredentialSpec', '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', 'json', $context)); + } + elseif (\array_key_exists('SELinuxContext', $data) && $data['SELinuxContext'] === null) { + $object->setSELinuxContext(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getCredentialSpec()) { - $data->{'CredentialSpec'} = $this->normalizer->normalize($object->getCredentialSpec(), 'json', $context); + $data = array(); + if ($object->isInitialized('credentialSpec') && null !== $object->getCredentialSpec()) { + $data['CredentialSpec'] = $this->normalizer->normalize($object->getCredentialSpec(), 'json', $context); } - if (null !== $object->getSELinuxContext()) { - $data->{'SELinuxContext'} = $this->normalizer->normalize($object->getSELinuxContext(), 'json', $context); + if ($object->isInitialized('sELinuxContext') && null !== $object->getSELinuxContext()) { + $data['SELinuxContext'] = $this->normalizer->normalize($object->getSELinuxContext(), 'json', $context); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskSpecContainerSpecPrivileges' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer.php b/src/Normalizer/TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer.php index 27e1c667..b3c798da 100644 --- a/src/Normalizer/TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer.php @@ -1,81 +1,103 @@ {'Disable'} !== null) { - $object->setDisable($data->{'Disable'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'User') && $data->{'User'} !== null) { - $object->setUser($data->{'User'}); + if (\array_key_exists('Disable', $data) && $data['Disable'] !== null) { + $object->setDisable($data['Disable']); } - if (property_exists($data, 'Role') && $data->{'Role'} !== null) { - $object->setRole($data->{'Role'}); + elseif (\array_key_exists('Disable', $data) && $data['Disable'] === null) { + $object->setDisable(null); } - if (property_exists($data, 'Type') && $data->{'Type'} !== null) { - $object->setType($data->{'Type'}); + if (\array_key_exists('User', $data) && $data['User'] !== null) { + $object->setUser($data['User']); } - if (property_exists($data, 'Level') && $data->{'Level'} !== null) { - $object->setLevel($data->{'Level'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getDisable()) { - $data->{'Disable'} = $object->getDisable(); + $data = array(); + if ($object->isInitialized('disable') && null !== $object->getDisable()) { + $data['Disable'] = $object->getDisable(); } - if (null !== $object->getUser()) { - $data->{'User'} = $object->getUser(); + if ($object->isInitialized('user') && null !== $object->getUser()) { + $data['User'] = $object->getUser(); } - if (null !== $object->getRole()) { - $data->{'Role'} = $object->getRole(); + if ($object->isInitialized('role') && null !== $object->getRole()) { + $data['Role'] = $object->getRole(); } - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['Type'] = $object->getType(); } - if (null !== $object->getLevel()) { - $data->{'Level'} = $object->getLevel(); + if ($object->isInitialized('level') && null !== $object->getLevel()) { + $data['Level'] = $object->getLevel(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesSELinuxContext' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecContainerSpecSecretsItemFileNormalizer.php b/src/Normalizer/TaskSpecContainerSpecSecretsItemFileNormalizer.php index 3c5cb100..8a0279c5 100644 --- a/src/Normalizer/TaskSpecContainerSpecSecretsItemFileNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecSecretsItemFileNormalizer.php @@ -1,75 +1,94 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'UID') && $data->{'UID'} !== null) { - $object->setUID($data->{'UID'}); + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'GID') && $data->{'GID'} !== null) { - $object->setGID($data->{'GID'}); + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($data->{'Mode'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getUID()) { - $data->{'UID'} = $object->getUID(); + if ($object->isInitialized('uID') && null !== $object->getUID()) { + $data['UID'] = $object->getUID(); } - if (null !== $object->getGID()) { - $data->{'GID'} = $object->getGID(); + if ($object->isInitialized('gID') && null !== $object->getGID()) { + $data['GID'] = $object->getGID(); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $object->getMode(); + if ($object->isInitialized('mode') && null !== $object->getMode()) { + $data['Mode'] = $object->getMode(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskSpecContainerSpecSecretsItemFile' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecContainerSpecSecretsItemNormalizer.php b/src/Normalizer/TaskSpecContainerSpecSecretsItemNormalizer.php index fe526d31..868dbf44 100644 --- a/src/Normalizer/TaskSpecContainerSpecSecretsItemNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecSecretsItemNormalizer.php @@ -1,69 +1,85 @@ {'File'} !== null) { - $object->setFile($this->denormalizer->denormalize($data->{'File'}, 'Docker\\API\\Model\\TaskSpecContainerSpecSecretsItemFile', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'SecretID') && $data->{'SecretID'} !== null) { - $object->setSecretID($data->{'SecretID'}); + if (\array_key_exists('File', $data) && $data['File'] !== null) { + $object->setFile($this->denormalizer->denormalize($data['File'], 'Docker\\API\\Model\\TaskSpecContainerSpecSecretsItemFile', 'json', $context)); } - if (property_exists($data, 'SecretName') && $data->{'SecretName'} !== null) { - $object->setSecretName($data->{'SecretName'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getFile()) { - $data->{'File'} = $this->normalizer->normalize($object->getFile(), 'json', $context); + $data = array(); + if ($object->isInitialized('file') && null !== $object->getFile()) { + $data['File'] = $this->normalizer->normalize($object->getFile(), 'json', $context); } - if (null !== $object->getSecretID()) { - $data->{'SecretID'} = $object->getSecretID(); + if ($object->isInitialized('secretID') && null !== $object->getSecretID()) { + $data['SecretID'] = $object->getSecretID(); } - if (null !== $object->getSecretName()) { - $data->{'SecretName'} = $object->getSecretName(); + if ($object->isInitialized('secretName') && null !== $object->getSecretName()) { + $data['SecretName'] = $object->getSecretName(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskSpecContainerSpecSecretsItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecContainerSpecUlimitsItemNormalizer.php b/src/Normalizer/TaskSpecContainerSpecUlimitsItemNormalizer.php new file mode 100644 index 00000000..21bb358d --- /dev/null +++ b/src/Normalizer/TaskSpecContainerSpecUlimitsItemNormalizer.php @@ -0,0 +1,85 @@ +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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\TaskSpecContainerSpecUlimitsItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecLogDriverNormalizer.php b/src/Normalizer/TaskSpecLogDriverNormalizer.php index da3d6b7c..28693ea4 100644 --- a/src/Normalizer/TaskSpecLogDriverNormalizer.php +++ b/src/Normalizer/TaskSpecLogDriverNormalizer.php @@ -1,71 +1,84 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); + } + if (\array_key_exists('Options', $data) && $data['Options'] !== null) { + $values = new \ArrayObject(array(), \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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getOptions()) { - $values = new \stdClass(); + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $values = array(); foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Options'} = $values; + $data['Options'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskSpecLogDriver' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecNetworkAttachmentSpecNormalizer.php b/src/Normalizer/TaskSpecNetworkAttachmentSpecNormalizer.php new file mode 100644 index 00000000..d161a850 --- /dev/null +++ b/src/Normalizer/TaskSpecNetworkAttachmentSpecNormalizer.php @@ -0,0 +1,67 @@ +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 = array()) + { + $data = array(); + if ($object->isInitialized('containerID') && null !== $object->getContainerID()) { + $data['ContainerID'] = $object->getContainerID(); + } + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskSpecNetworkAttachmentSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecNetworksItemNormalizer.php b/src/Normalizer/TaskSpecNetworksItemNormalizer.php deleted file mode 100644 index d4ff72fd..00000000 --- a/src/Normalizer/TaskSpecNetworksItemNormalizer.php +++ /dev/null @@ -1,71 +0,0 @@ -{'Target'} !== null) { - $object->setTarget($data->{'Target'}); - } - if (property_exists($data, 'Aliases') && $data->{'Aliases'} !== null) { - $values = []; - foreach ($data->{'Aliases'} as $value) { - $values[] = $value; - } - $object->setAliases($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getTarget()) { - $data->{'Target'} = $object->getTarget(); - } - if (null !== $object->getAliases()) { - $values = []; - foreach ($object->getAliases() as $value) { - $values[] = $value; - } - $data->{'Aliases'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/TaskSpecNormalizer.php b/src/Normalizer/TaskSpecNormalizer.php index eeadc845..6ea595e8 100644 --- a/src/Normalizer/TaskSpecNormalizer.php +++ b/src/Normalizer/TaskSpecNormalizer.php @@ -1,113 +1,156 @@ {'PluginSpec'} !== null) { - $object->setPluginSpec($this->denormalizer->denormalize($data->{'PluginSpec'}, 'Docker\\API\\Model\\TaskSpecPluginSpec', 'json', $context)); + 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', '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', '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', 'json', $context)); + } + elseif (\array_key_exists('NetworkAttachmentSpec', $data) && $data['NetworkAttachmentSpec'] === null) { + $object->setNetworkAttachmentSpec(null); } - if (property_exists($data, 'ContainerSpec') && $data->{'ContainerSpec'} !== null) { - $object->setContainerSpec($this->denormalizer->denormalize($data->{'ContainerSpec'}, 'Docker\\API\\Model\\TaskSpecContainerSpec', 'json', $context)); + if (\array_key_exists('Resources', $data) && $data['Resources'] !== null) { + $object->setResources($this->denormalizer->denormalize($data['Resources'], 'Docker\\API\\Model\\TaskSpecResources', 'json', $context)); } - if (property_exists($data, 'Resources') && $data->{'Resources'} !== null) { - $object->setResources($this->denormalizer->denormalize($data->{'Resources'}, 'Docker\\API\\Model\\TaskSpecResources', 'json', $context)); + elseif (\array_key_exists('Resources', $data) && $data['Resources'] === null) { + $object->setResources(null); } - if (property_exists($data, 'RestartPolicy') && $data->{'RestartPolicy'} !== null) { - $object->setRestartPolicy($this->denormalizer->denormalize($data->{'RestartPolicy'}, 'Docker\\API\\Model\\TaskSpecRestartPolicy', 'json', $context)); + if (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] !== null) { + $object->setRestartPolicy($this->denormalizer->denormalize($data['RestartPolicy'], 'Docker\\API\\Model\\TaskSpecRestartPolicy', 'json', $context)); } - if (property_exists($data, 'Placement') && $data->{'Placement'} !== null) { - $object->setPlacement($this->denormalizer->denormalize($data->{'Placement'}, 'Docker\\API\\Model\\TaskSpecPlacement', 'json', $context)); + elseif (\array_key_exists('RestartPolicy', $data) && $data['RestartPolicy'] === null) { + $object->setRestartPolicy(null); } - if (property_exists($data, 'ForceUpdate') && $data->{'ForceUpdate'} !== null) { - $object->setForceUpdate($data->{'ForceUpdate'}); + if (\array_key_exists('Placement', $data) && $data['Placement'] !== null) { + $object->setPlacement($this->denormalizer->denormalize($data['Placement'], 'Docker\\API\\Model\\TaskSpecPlacement', 'json', $context)); } - if (property_exists($data, 'Runtime') && $data->{'Runtime'} !== null) { - $object->setRuntime($data->{'Runtime'}); + elseif (\array_key_exists('Placement', $data) && $data['Placement'] === null) { + $object->setPlacement(null); } - if (property_exists($data, 'Networks') && $data->{'Networks'} !== null) { - $values = []; - foreach ($data->{'Networks'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\TaskSpecNetworksItem', 'json', $context); + 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 = array(); + foreach ($data['Networks'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\NetworkAttachmentConfig', 'json', $context); } $object->setNetworks($values); } - if (property_exists($data, 'LogDriver') && $data->{'LogDriver'} !== null) { - $object->setLogDriver($this->denormalizer->denormalize($data->{'LogDriver'}, 'Docker\\API\\Model\\TaskSpecLogDriver', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('LogDriver', $data) && $data['LogDriver'] === null) { + $object->setLogDriver(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getPluginSpec()) { - $data->{'PluginSpec'} = $this->normalizer->normalize($object->getPluginSpec(), 'json', $context); + $data = array(); + 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 (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 (null !== $object->getResources()) { - $data->{'Resources'} = $this->normalizer->normalize($object->getResources(), 'json', $context); + if ($object->isInitialized('resources') && null !== $object->getResources()) { + $data['Resources'] = $this->normalizer->normalize($object->getResources(), 'json', $context); } - if (null !== $object->getRestartPolicy()) { - $data->{'RestartPolicy'} = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); + if ($object->isInitialized('restartPolicy') && null !== $object->getRestartPolicy()) { + $data['RestartPolicy'] = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); } - if (null !== $object->getPlacement()) { - $data->{'Placement'} = $this->normalizer->normalize($object->getPlacement(), 'json', $context); + if ($object->isInitialized('placement') && null !== $object->getPlacement()) { + $data['Placement'] = $this->normalizer->normalize($object->getPlacement(), 'json', $context); } - if (null !== $object->getForceUpdate()) { - $data->{'ForceUpdate'} = $object->getForceUpdate(); + if ($object->isInitialized('forceUpdate') && null !== $object->getForceUpdate()) { + $data['ForceUpdate'] = $object->getForceUpdate(); } - if (null !== $object->getRuntime()) { - $data->{'Runtime'} = $object->getRuntime(); + if ($object->isInitialized('runtime') && null !== $object->getRuntime()) { + $data['Runtime'] = $object->getRuntime(); } - if (null !== $object->getNetworks()) { - $values = []; + if ($object->isInitialized('networks') && null !== $object->getNetworks()) { + $values = array(); foreach ($object->getNetworks() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'Networks'} = $values; + $data['Networks'] = $values; } - if (null !== $object->getLogDriver()) { - $data->{'LogDriver'} = $this->normalizer->normalize($object->getLogDriver(), 'json', $context); + 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 array('Docker\\API\\Model\\TaskSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecPlacementNormalizer.php b/src/Normalizer/TaskSpecPlacementNormalizer.php index 11995be6..ce9ae6dc 100644 --- a/src/Normalizer/TaskSpecPlacementNormalizer.php +++ b/src/Normalizer/TaskSpecPlacementNormalizer.php @@ -1,93 +1,118 @@ {'Constraints'} !== null) { - $values = []; - foreach ($data->{'Constraints'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Constraints', $data) && $data['Constraints'] !== null) { + $values = array(); + foreach ($data['Constraints'] as $value) { $values[] = $value; } $object->setConstraints($values); } - if (property_exists($data, 'Preferences') && $data->{'Preferences'} !== null) { - $values_1 = []; - foreach ($data->{'Preferences'} as $value_1) { + elseif (\array_key_exists('Constraints', $data) && $data['Constraints'] === null) { + $object->setConstraints(null); + } + if (\array_key_exists('Preferences', $data) && $data['Preferences'] !== null) { + $values_1 = array(); + foreach ($data['Preferences'] as $value_1) { $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\TaskSpecPlacementPreferencesItem', 'json', $context); } $object->setPreferences($values_1); } - if (property_exists($data, 'Platforms') && $data->{'Platforms'} !== null) { - $values_2 = []; - foreach ($data->{'Platforms'} as $value_2) { + 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 = array(); + foreach ($data['Platforms'] as $value_2) { $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\Platform', 'json', $context); } $object->setPlatforms($values_2); } - + elseif (\array_key_exists('Platforms', $data) && $data['Platforms'] === null) { + $object->setPlatforms(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getConstraints()) { - $values = []; + $data = array(); + if ($object->isInitialized('constraints') && null !== $object->getConstraints()) { + $values = array(); foreach ($object->getConstraints() as $value) { $values[] = $value; } - $data->{'Constraints'} = $values; + $data['Constraints'] = $values; } - if (null !== $object->getPreferences()) { - $values_1 = []; + if ($object->isInitialized('preferences') && null !== $object->getPreferences()) { + $values_1 = array(); foreach ($object->getPreferences() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'Preferences'} = $values_1; + $data['Preferences'] = $values_1; } - if (null !== $object->getPlatforms()) { - $values_2 = []; + if ($object->isInitialized('maxReplicas') && null !== $object->getMaxReplicas()) { + $data['MaxReplicas'] = $object->getMaxReplicas(); + } + if ($object->isInitialized('platforms') && null !== $object->getPlatforms()) { + $values_2 = array(); foreach ($object->getPlatforms() as $value_2) { $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'Platforms'} = $values_2; + $data['Platforms'] = $values_2; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskSpecPlacement' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecPlacementPreferencesItemNormalizer.php b/src/Normalizer/TaskSpecPlacementPreferencesItemNormalizer.php index 6c236491..60ada504 100644 --- a/src/Normalizer/TaskSpecPlacementPreferencesItemNormalizer.php +++ b/src/Normalizer/TaskSpecPlacementPreferencesItemNormalizer.php @@ -1,57 +1,67 @@ {'Spread'} !== null) { - $object->setSpread($this->denormalizer->denormalize($data->{'Spread'}, 'Docker\\API\\Model\\TaskSpecPlacementPreferencesItemSpread', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('Spread', $data) && $data['Spread'] === null) { + $object->setSpread(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getSpread()) { - $data->{'Spread'} = $this->normalizer->normalize($object->getSpread(), 'json', $context); + $data = array(); + 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 array('Docker\\API\\Model\\TaskSpecPlacementPreferencesItem' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecPlacementPreferencesItemSpreadNormalizer.php b/src/Normalizer/TaskSpecPlacementPreferencesItemSpreadNormalizer.php index 2e20a9f6..9b85daa5 100644 --- a/src/Normalizer/TaskSpecPlacementPreferencesItemSpreadNormalizer.php +++ b/src/Normalizer/TaskSpecPlacementPreferencesItemSpreadNormalizer.php @@ -1,57 +1,67 @@ {'SpreadDescriptor'} !== null) { - $object->setSpreadDescriptor($data->{'SpreadDescriptor'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getSpreadDescriptor()) { - $data->{'SpreadDescriptor'} = $object->getSpreadDescriptor(); + $data = array(); + if ($object->isInitialized('spreadDescriptor') && null !== $object->getSpreadDescriptor()) { + $data['SpreadDescriptor'] = $object->getSpreadDescriptor(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskSpecPlacementPreferencesItemSpread' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecPluginSpecNormalizer.php b/src/Normalizer/TaskSpecPluginSpecNormalizer.php index 63cad2d7..46b6fb30 100644 --- a/src/Normalizer/TaskSpecPluginSpecNormalizer.php +++ b/src/Normalizer/TaskSpecPluginSpecNormalizer.php @@ -1,83 +1,102 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + 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 (property_exists($data, 'Remote') && $data->{'Remote'} !== null) { - $object->setRemote($data->{'Remote'}); + if (\array_key_exists('Remote', $data) && $data['Remote'] !== null) { + $object->setRemote($data['Remote']); } - if (property_exists($data, 'Disabled') && $data->{'Disabled'} !== null) { - $object->setDisabled($data->{'Disabled'}); + elseif (\array_key_exists('Remote', $data) && $data['Remote'] === null) { + $object->setRemote(null); } - if (property_exists($data, 'PluginPrivilege') && $data->{'PluginPrivilege'} !== null) { - $values = []; - foreach ($data->{'PluginPrivilege'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\TaskSpecPluginSpecPluginPrivilegeItem', 'json', $context); + 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 = array(); + foreach ($data['PluginPrivilege'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\PluginPrivilege', 'json', $context); } $object->setPluginPrivilege($values); } - + elseif (\array_key_exists('PluginPrivilege', $data) && $data['PluginPrivilege'] === null) { + $object->setPluginPrivilege(null); + } return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $data = array(); + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['Name'] = $object->getName(); } - if (null !== $object->getRemote()) { - $data->{'Remote'} = $object->getRemote(); + if ($object->isInitialized('remote') && null !== $object->getRemote()) { + $data['Remote'] = $object->getRemote(); } - if (null !== $object->getDisabled()) { - $data->{'Disabled'} = $object->getDisabled(); + if ($object->isInitialized('disabled') && null !== $object->getDisabled()) { + $data['Disabled'] = $object->getDisabled(); } - if (null !== $object->getPluginPrivilege()) { - $values = []; + if ($object->isInitialized('pluginPrivilege') && null !== $object->getPluginPrivilege()) { + $values = array(); foreach ($object->getPluginPrivilege() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'PluginPrivilege'} = $values; + $data['PluginPrivilege'] = $values; } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskSpecPluginSpec' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecPluginSpecPluginPrivilegeItemNormalizer.php b/src/Normalizer/TaskSpecPluginSpecPluginPrivilegeItemNormalizer.php deleted file mode 100644 index 51bf3e7e..00000000 --- a/src/Normalizer/TaskSpecPluginSpecPluginPrivilegeItemNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); - } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $values = []; - foreach ($data->{'Value'} as $value) { - $values[] = $value; - } - $object->setValue($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->getDescription()) { - $data->{'Description'} = $object->getDescription(); - } - if (null !== $object->getValue()) { - $values = []; - foreach ($object->getValue() as $value) { - $values[] = $value; - } - $data->{'Value'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/TaskSpecResourcesNormalizer.php b/src/Normalizer/TaskSpecResourcesNormalizer.php index a8b7e0fc..4c5665d7 100644 --- a/src/Normalizer/TaskSpecResourcesNormalizer.php +++ b/src/Normalizer/TaskSpecResourcesNormalizer.php @@ -1,63 +1,76 @@ {'Limits'} !== null) { - $object->setLimits($this->denormalizer->denormalize($data->{'Limits'}, 'Docker\\API\\Model\\ResourceObject', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Reservation') && $data->{'Reservation'} !== null) { - $object->setReservation($this->denormalizer->denormalize($data->{'Reservation'}, 'Docker\\API\\Model\\ResourceObject', 'json', $context)); + if (\array_key_exists('Limits', $data) && $data['Limits'] !== null) { + $object->setLimits($this->denormalizer->denormalize($data['Limits'], 'Docker\\API\\Model\\Limit', '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', 'json', $context)); + } + elseif (\array_key_exists('Reservations', $data) && $data['Reservations'] === null) { + $object->setReservations(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getLimits()) { - $data->{'Limits'} = $this->normalizer->normalize($object->getLimits(), 'json', $context); + $data = array(); + if ($object->isInitialized('limits') && null !== $object->getLimits()) { + $data['Limits'] = $this->normalizer->normalize($object->getLimits(), 'json', $context); } - if (null !== $object->getReservation()) { - $data->{'Reservation'} = $this->normalizer->normalize($object->getReservation(), '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 array('Docker\\API\\Model\\TaskSpecResources' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskSpecRestartPolicyNormalizer.php b/src/Normalizer/TaskSpecRestartPolicyNormalizer.php index c2600da0..d8ee57e8 100644 --- a/src/Normalizer/TaskSpecRestartPolicyNormalizer.php +++ b/src/Normalizer/TaskSpecRestartPolicyNormalizer.php @@ -1,75 +1,94 @@ {'Condition'} !== null) { - $object->setCondition($data->{'Condition'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Delay') && $data->{'Delay'} !== null) { - $object->setDelay($data->{'Delay'}); + if (\array_key_exists('Condition', $data) && $data['Condition'] !== null) { + $object->setCondition($data['Condition']); } - if (property_exists($data, 'MaxAttempts') && $data->{'MaxAttempts'} !== null) { - $object->setMaxAttempts($data->{'MaxAttempts'}); + elseif (\array_key_exists('Condition', $data) && $data['Condition'] === null) { + $object->setCondition(null); } - if (property_exists($data, 'Window') && $data->{'Window'} !== null) { - $object->setWindow($data->{'Window'}); + 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; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getCondition()) { - $data->{'Condition'} = $object->getCondition(); + $data = array(); + if ($object->isInitialized('condition') && null !== $object->getCondition()) { + $data['Condition'] = $object->getCondition(); } - if (null !== $object->getDelay()) { - $data->{'Delay'} = $object->getDelay(); + if ($object->isInitialized('delay') && null !== $object->getDelay()) { + $data['Delay'] = $object->getDelay(); } - if (null !== $object->getMaxAttempts()) { - $data->{'MaxAttempts'} = $object->getMaxAttempts(); + if ($object->isInitialized('maxAttempts') && null !== $object->getMaxAttempts()) { + $data['MaxAttempts'] = $object->getMaxAttempts(); } - if (null !== $object->getWindow()) { - $data->{'Window'} = $object->getWindow(); + if ($object->isInitialized('window') && null !== $object->getWindow()) { + $data['Window'] = $object->getWindow(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskSpecRestartPolicy' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskStatusContainerStatusNormalizer.php b/src/Normalizer/TaskStatusContainerStatusNormalizer.php index f0ca8958..42527d5d 100644 --- a/src/Normalizer/TaskStatusContainerStatusNormalizer.php +++ b/src/Normalizer/TaskStatusContainerStatusNormalizer.php @@ -1,69 +1,85 @@ {'ContainerID'} !== null) { - $object->setContainerID($data->{'ContainerID'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'PID') && $data->{'PID'} !== null) { - $object->setPID($data->{'PID'}); + if (\array_key_exists('ContainerID', $data) && $data['ContainerID'] !== null) { + $object->setContainerID($data['ContainerID']); } - if (property_exists($data, 'ExitCode') && $data->{'ExitCode'} !== null) { - $object->setExitCode($data->{'ExitCode'}); + 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; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getContainerID()) { - $data->{'ContainerID'} = $object->getContainerID(); + $data = array(); + if ($object->isInitialized('containerID') && null !== $object->getContainerID()) { + $data['ContainerID'] = $object->getContainerID(); } - if (null !== $object->getPID()) { - $data->{'PID'} = $object->getPID(); + if ($object->isInitialized('pID') && null !== $object->getPID()) { + $data['PID'] = $object->getPID(); } - if (null !== $object->getExitCode()) { - $data->{'ExitCode'} = $object->getExitCode(); + if ($object->isInitialized('exitCode') && null !== $object->getExitCode()) { + $data['ExitCode'] = $object->getExitCode(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskStatusContainerStatus' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/TaskStatusNormalizer.php b/src/Normalizer/TaskStatusNormalizer.php index b5776e9d..af06e14c 100644 --- a/src/Normalizer/TaskStatusNormalizer.php +++ b/src/Normalizer/TaskStatusNormalizer.php @@ -1,81 +1,103 @@ {'Timestamp'} !== null) { - $object->setTimestamp($data->{'Timestamp'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'State') && $data->{'State'} !== null) { - $object->setState($data->{'State'}); + if (\array_key_exists('Timestamp', $data) && $data['Timestamp'] !== null) { + $object->setTimestamp($data['Timestamp']); } - if (property_exists($data, 'Message') && $data->{'Message'} !== null) { - $object->setMessage($data->{'Message'}); + elseif (\array_key_exists('Timestamp', $data) && $data['Timestamp'] === null) { + $object->setTimestamp(null); } - if (property_exists($data, 'Err') && $data->{'Err'} !== null) { - $object->setErr($data->{'Err'}); + if (\array_key_exists('State', $data) && $data['State'] !== null) { + $object->setState($data['State']); } - if (property_exists($data, 'ContainerStatus') && $data->{'ContainerStatus'} !== null) { - $object->setContainerStatus($this->denormalizer->denormalize($data->{'ContainerStatus'}, 'Docker\\API\\Model\\TaskStatusContainerStatus', 'json', $context)); + 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\\TaskStatusContainerStatus', 'json', $context)); + } + elseif (\array_key_exists('ContainerStatus', $data) && $data['ContainerStatus'] === null) { + $object->setContainerStatus(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getTimestamp()) { - $data->{'Timestamp'} = $object->getTimestamp(); + $data = array(); + if ($object->isInitialized('timestamp') && null !== $object->getTimestamp()) { + $data['Timestamp'] = $object->getTimestamp(); } - if (null !== $object->getState()) { - $data->{'State'} = $object->getState(); + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['State'] = $object->getState(); } - if (null !== $object->getMessage()) { - $data->{'Message'} = $object->getMessage(); + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['Message'] = $object->getMessage(); } - if (null !== $object->getErr()) { - $data->{'Err'} = $object->getErr(); + if ($object->isInitialized('err') && null !== $object->getErr()) { + $data['Err'] = $object->getErr(); } - if (null !== $object->getContainerStatus()) { - $data->{'ContainerStatus'} = $this->normalizer->normalize($object->getContainerStatus(), 'json', $context); + if ($object->isInitialized('containerStatus') && null !== $object->getContainerStatus()) { + $data['ContainerStatus'] = $this->normalizer->normalize($object->getContainerStatus(), 'json', $context); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\TaskStatus' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/ThrottleDeviceNormalizer.php b/src/Normalizer/ThrottleDeviceNormalizer.php index 1e1fb1a6..1fa247ca 100644 --- a/src/Normalizer/ThrottleDeviceNormalizer.php +++ b/src/Normalizer/ThrottleDeviceNormalizer.php @@ -1,63 +1,76 @@ {'Path'} !== null) { - $object->setPath($data->{'Path'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Rate') && $data->{'Rate'} !== null) { - $object->setRate($data->{'Rate'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); + $data = array(); + if ($object->isInitialized('path') && null !== $object->getPath()) { + $data['Path'] = $object->getPath(); } - if (null !== $object->getRate()) { - $data->{'Rate'} = $object->getRate(); + if ($object->isInitialized('rate') && null !== $object->getRate()) { + $data['Rate'] = $object->getRate(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\ThrottleDevice' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/VersionGetResponse200ComponentsItemNormalizer.php b/src/Normalizer/VersionGetResponse200ComponentsItemNormalizer.php deleted file mode 100644 index 2944c81f..00000000 --- a/src/Normalizer/VersionGetResponse200ComponentsItemNormalizer.php +++ /dev/null @@ -1,69 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($data->{'Version'}); - } - if (property_exists($data, 'Details') && $data->{'Details'} !== null) { - $object->setDetails($data->{'Details'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getVersion()) { - $data->{'Version'} = $object->getVersion(); - } - if (null !== $object->getDetails()) { - $data->{'Details'} = $object->getDetails(); - } - - return $data; - } -} diff --git a/src/Normalizer/VersionGetResponse200Normalizer.php b/src/Normalizer/VersionGetResponse200Normalizer.php deleted file mode 100644 index fe12bb61..00000000 --- a/src/Normalizer/VersionGetResponse200Normalizer.php +++ /dev/null @@ -1,131 +0,0 @@ -{'Platform'} !== null) { - $object->setPlatform($this->denormalizer->denormalize($data->{'Platform'}, 'Docker\\API\\Model\\VersionGetResponse200Platform', 'json', $context)); - } - if (property_exists($data, 'Components') && $data->{'Components'} !== null) { - $values = []; - foreach ($data->{'Components'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\VersionGetResponse200ComponentsItem', 'json', $context); - } - $object->setComponents($values); - } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($data->{'Version'}); - } - if (property_exists($data, 'ApiVersion') && $data->{'ApiVersion'} !== null) { - $object->setApiVersion($data->{'ApiVersion'}); - } - if (property_exists($data, 'MinAPIVersion') && $data->{'MinAPIVersion'} !== null) { - $object->setMinAPIVersion($data->{'MinAPIVersion'}); - } - if (property_exists($data, 'GitCommit') && $data->{'GitCommit'} !== null) { - $object->setGitCommit($data->{'GitCommit'}); - } - if (property_exists($data, 'GoVersion') && $data->{'GoVersion'} !== null) { - $object->setGoVersion($data->{'GoVersion'}); - } - if (property_exists($data, 'Os') && $data->{'Os'} !== null) { - $object->setOs($data->{'Os'}); - } - if (property_exists($data, 'Arch') && $data->{'Arch'} !== null) { - $object->setArch($data->{'Arch'}); - } - if (property_exists($data, 'KernelVersion') && $data->{'KernelVersion'} !== null) { - $object->setKernelVersion($data->{'KernelVersion'}); - } - if (property_exists($data, 'Experimental') && $data->{'Experimental'} !== null) { - $object->setExperimental($data->{'Experimental'}); - } - if (property_exists($data, 'BuildTime') && $data->{'BuildTime'} !== null) { - $object->setBuildTime($data->{'BuildTime'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getPlatform()) { - $data->{'Platform'} = $this->normalizer->normalize($object->getPlatform(), 'json', $context); - } - if (null !== $object->getComponents()) { - $values = []; - foreach ($object->getComponents() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Components'} = $values; - } - if (null !== $object->getVersion()) { - $data->{'Version'} = $object->getVersion(); - } - if (null !== $object->getApiVersion()) { - $data->{'ApiVersion'} = $object->getApiVersion(); - } - if (null !== $object->getMinAPIVersion()) { - $data->{'MinAPIVersion'} = $object->getMinAPIVersion(); - } - if (null !== $object->getGitCommit()) { - $data->{'GitCommit'} = $object->getGitCommit(); - } - if (null !== $object->getGoVersion()) { - $data->{'GoVersion'} = $object->getGoVersion(); - } - if (null !== $object->getOs()) { - $data->{'Os'} = $object->getOs(); - } - if (null !== $object->getArch()) { - $data->{'Arch'} = $object->getArch(); - } - if (null !== $object->getKernelVersion()) { - $data->{'KernelVersion'} = $object->getKernelVersion(); - } - if (null !== $object->getExperimental()) { - $data->{'Experimental'} = $object->getExperimental(); - } - if (null !== $object->getBuildTime()) { - $data->{'BuildTime'} = $object->getBuildTime(); - } - - return $data; - } -} diff --git a/src/Normalizer/VersionGetResponse200PlatformNormalizer.php b/src/Normalizer/VersionGetResponse200PlatformNormalizer.php deleted file mode 100644 index 78fb1cb1..00000000 --- a/src/Normalizer/VersionGetResponse200PlatformNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - - return $data; - } -} diff --git a/src/Normalizer/VolumeCreateOptionsNormalizer.php b/src/Normalizer/VolumeCreateOptionsNormalizer.php new file mode 100644 index 00000000..5081a227 --- /dev/null +++ b/src/Normalizer/VolumeCreateOptionsNormalizer.php @@ -0,0 +1,119 @@ +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(array(), \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(array(), \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', '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 = array()) + { + $data = array(); + 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 = array(); + foreach ($object->getDriverOpts() as $key => $value) { + $values[$key] = $value; + } + $data['DriverOpts'] = $values; + } + if ($object->isInitialized('labels') && null !== $object->getLabels()) { + $values_1 = array(); + 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 array('Docker\\API\\Model\\VolumeCreateOptions' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/VolumeListResponseNormalizer.php b/src/Normalizer/VolumeListResponseNormalizer.php new file mode 100644 index 00000000..699c693b --- /dev/null +++ b/src/Normalizer/VolumeListResponseNormalizer.php @@ -0,0 +1,92 @@ +denormalizer->denormalize($value, 'Docker\\API\\Model\\Volume', '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 = array(); + 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 = array()) + { + $data = array(); + if ($object->isInitialized('volumes') && null !== $object->getVolumes()) { + $values = array(); + foreach ($object->getVolumes() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['Volumes'] = $values; + } + if ($object->isInitialized('warnings') && null !== $object->getWarnings()) { + $values_1 = array(); + foreach ($object->getWarnings() as $value_1) { + $values_1[] = $value_1; + } + $data['Warnings'] = $values_1; + } + return $data; + } + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\VolumeListResponse' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/VolumeNormalizer.php b/src/Normalizer/VolumeNormalizer.php index 4ad137b2..4d5e7a4b 100644 --- a/src/Normalizer/VolumeNormalizer.php +++ b/src/Normalizer/VolumeNormalizer.php @@ -1,129 +1,160 @@ {'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && $data['Name'] !== null) { + $object->setName($data['Name']); } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); + elseif (\array_key_exists('Name', $data) && $data['Name'] === null) { + $object->setName(null); } - if (property_exists($data, 'Mountpoint') && $data->{'Mountpoint'} !== null) { - $object->setMountpoint($data->{'Mountpoint'}); + if (\array_key_exists('Driver', $data) && $data['Driver'] !== null) { + $object->setDriver($data['Driver']); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + elseif (\array_key_exists('Driver', $data) && $data['Driver'] === null) { + $object->setDriver(null); } - if (property_exists($data, 'Status') && $data->{'Status'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Status'} as $key => $value) { + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Status'] as $key => $value) { $values[$key] = $value; } $object->setStatus($values); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_1 => $value_1) { + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_1 => $value_1) { $values_1[$key_1] = $value_1; } $object->setLabels($values_1); } - if (property_exists($data, 'Scope') && $data->{'Scope'} !== null) { - $object->setScope($data->{'Scope'}); + 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', 'json', $context)); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { - $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key_2 => $value_2) { + 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(array(), \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key_2 => $value_2) { $values_2[$key_2] = $value_2; } $object->setOptions($values_2); } - if (property_exists($data, 'UsageData') && $data->{'UsageData'} !== null) { - $object->setUsageData($this->denormalizer->denormalize($data->{'UsageData'}, 'Docker\\API\\Model\\VolumeUsageData', 'json', $context)); + 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', 'json', $context)); + } + elseif (\array_key_exists('UsageData', $data) && $data['UsageData'] === null) { + $object->setUsageData(null); } - return $object; } - - public function normalize($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); - } - if (null !== $object->getMountpoint()) { - $data->{'Mountpoint'} = $object->getMountpoint(); - } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); - } - if (null !== $object->getStatus()) { - $values = new \stdClass(); + $data = array(); + $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 = array(); foreach ($object->getStatus() as $key => $value) { - $values->{$key} = $value; + $values[$key] = $value; } - $data->{'Status'} = $values; + $data['Status'] = $values; } - if (null !== $object->getLabels()) { - $values_1 = new \stdClass(); - foreach ($object->getLabels() as $key_1 => $value_1) { - $values_1->{$key_1} = $value_1; - } - $data->{'Labels'} = $values_1; + $values_1 = array(); + foreach ($object->getLabels() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; } - if (null !== $object->getScope()) { - $data->{'Scope'} = $object->getScope(); + $data['Labels'] = $values_1; + $data['Scope'] = $object->getScope(); + if ($object->isInitialized('clusterVolume') && null !== $object->getClusterVolume()) { + $data['ClusterVolume'] = $this->normalizer->normalize($object->getClusterVolume(), 'json', $context); } - if (null !== $object->getOptions()) { - $values_2 = new \stdClass(); - foreach ($object->getOptions() as $key_2 => $value_2) { - $values_2->{$key_2} = $value_2; - } - $data->{'Options'} = $values_2; + $values_2 = array(); + foreach ($object->getOptions() as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; } - if (null !== $object->getUsageData()) { - $data->{'UsageData'} = $this->normalizer->normalize($object->getUsageData(), 'json', $context); + $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 array('Docker\\API\\Model\\Volume' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/VolumeUsageDataNormalizer.php b/src/Normalizer/VolumeUsageDataNormalizer.php index 17f9bbe3..4f81aafd 100644 --- a/src/Normalizer/VolumeUsageDataNormalizer.php +++ b/src/Normalizer/VolumeUsageDataNormalizer.php @@ -1,63 +1,72 @@ {'Size'} !== null) { - $object->setSize($data->{'Size'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'RefCount') && $data->{'RefCount'} !== null) { - $object->setRefCount($data->{'RefCount'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); - } - if (null !== $object->getRefCount()) { - $data->{'RefCount'} = $object->getRefCount(); - } - + $data = array(); + $data['Size'] = $object->getSize(); + $data['RefCount'] = $object->getRefCount(); return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\VolumeUsageData' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/VolumesCreatePostBodyNormalizer.php b/src/Normalizer/VolumesCreatePostBodyNormalizer.php deleted file mode 100644 index 5082e104..00000000 --- a/src/Normalizer/VolumesCreatePostBodyNormalizer.php +++ /dev/null @@ -1,91 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); - } - if (property_exists($data, 'DriverOpts') && $data->{'DriverOpts'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'DriverOpts'} as $key => $value) { - $values[$key] = $value; - } - $object->setDriverOpts($values); - } - if (property_exists($data, 'Labels') && $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); - } - - 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; - } - if (null !== $object->getLabels()) { - $values_1 = new \stdClass(); - foreach ($object->getLabels() as $key_1 => $value_1) { - $values_1->{$key_1} = $value_1; - } - $data->{'Labels'} = $values_1; - } - - return $data; - } -} diff --git a/src/Normalizer/VolumesGetResponse200Normalizer.php b/src/Normalizer/VolumesGetResponse200Normalizer.php deleted file mode 100644 index 18529677..00000000 --- a/src/Normalizer/VolumesGetResponse200Normalizer.php +++ /dev/null @@ -1,79 +0,0 @@ -{'Volumes'} !== null) { - $values = []; - foreach ($data->{'Volumes'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\Volume', 'json', $context); - } - $object->setVolumes($values); - } - if (property_exists($data, 'Warnings') && $data->{'Warnings'} !== null) { - $values_1 = []; - foreach ($data->{'Warnings'} as $value_1) { - $values_1[] = $value_1; - } - $object->setWarnings($values_1); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getVolumes()) { - $values = []; - foreach ($object->getVolumes() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Volumes'} = $values; - } - if (null !== $object->getWarnings()) { - $values_1 = []; - foreach ($object->getWarnings() as $value_1) { - $values_1[] = $value_1; - } - $data->{'Warnings'} = $values_1; - } - - return $data; - } -} diff --git a/src/Normalizer/VolumesNamePutBodyNormalizer.php b/src/Normalizer/VolumesNamePutBodyNormalizer.php new file mode 100644 index 00000000..aef5e737 --- /dev/null +++ b/src/Normalizer/VolumesNamePutBodyNormalizer.php @@ -0,0 +1,67 @@ +setSpec($this->denormalizer->denormalize($data['Spec'], 'Docker\\API\\Model\\ClusterVolumeSpec', '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 = array()) + { + $data = array(); + 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 array('Docker\\API\\Model\\VolumesNamePutBody' => false); + } +} \ No newline at end of file diff --git a/src/Normalizer/VolumesPrunePostResponse200Normalizer.php b/src/Normalizer/VolumesPrunePostResponse200Normalizer.php index e9f57652..338466a9 100644 --- a/src/Normalizer/VolumesPrunePostResponse200Normalizer.php +++ b/src/Normalizer/VolumesPrunePostResponse200Normalizer.php @@ -1,71 +1,84 @@ {'VolumesDeleted'} !== null) { - $values = []; - foreach ($data->{'VolumesDeleted'} as $value) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('VolumesDeleted', $data) && $data['VolumesDeleted'] !== null) { + $values = array(); + foreach ($data['VolumesDeleted'] as $value) { $values[] = $value; } $object->setVolumesDeleted($values); } - if (property_exists($data, 'SpaceReclaimed') && $data->{'SpaceReclaimed'} !== null) { - $object->setSpaceReclaimed($data->{'SpaceReclaimed'}); + 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($object, $format = null, array $context = []) + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = array()) { - $data = new \stdClass(); - if (null !== $object->getVolumesDeleted()) { - $values = []; + $data = array(); + if ($object->isInitialized('volumesDeleted') && null !== $object->getVolumesDeleted()) { + $values = array(); foreach ($object->getVolumesDeleted() as $value) { $values[] = $value; } - $data->{'VolumesDeleted'} = $values; + $data['VolumesDeleted'] = $values; } - if (null !== $object->getSpaceReclaimed()) { - $data->{'SpaceReclaimed'} = $object->getSpaceReclaimed(); + if ($object->isInitialized('spaceReclaimed') && null !== $object->getSpaceReclaimed()) { + $data['SpaceReclaimed'] = $object->getSpaceReclaimed(); } - return $data; } -} + public function getSupportedTypes(?string $format = null) : array + { + return array('Docker\\API\\Model\\VolumesPrunePostResponse200' => false); + } +} \ No newline at end of file diff --git a/src/Runtime/Client/BaseEndpoint.php b/src/Runtime/Client/BaseEndpoint.php new file mode 100644 index 00000000..8e36a9fa --- /dev/null +++ b/src/Runtime/Client/BaseEndpoint.php @@ -0,0 +1,66 @@ +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/src/Runtime/Client/Client.php b/src/Runtime/Client/Client.php new file mode 100644 index 00000000..2a32b89c --- /dev/null +++ b/src/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, $value); + } + 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/src/Runtime/Client/CustomQueryResolver.php b/src/Runtime/Client/CustomQueryResolver.php new file mode 100644 index 00000000..d4c9df87 --- /dev/null +++ b/src/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/src/Runtime/Normalizer/CheckArray.php b/src/Runtime/Normalizer/CheckArray.php new file mode 100644 index 00000000..4c1997e2 --- /dev/null +++ b/src/Runtime/Normalizer/CheckArray.php @@ -0,0 +1,13 @@ +getReferenceUri(); + return $ref; + } + /** + * {@inheritdoc} + */ + public function supportsNormalization($data, $format = null) : bool + { + return $data instanceof Reference; + } +} \ No newline at end of file diff --git a/src/Runtime/Normalizer/ValidationException.php b/src/Runtime/Normalizer/ValidationException.php new file mode 100644 index 00000000..bd182273 --- /dev/null +++ b/src/Runtime/Normalizer/ValidationException.php @@ -0,0 +1,19 @@ +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/src/Runtime/Normalizer/ValidatorTrait.php b/src/Runtime/Normalizer/ValidatorTrait.php new file mode 100644 index 00000000..c941001f --- /dev/null +++ b/src/Runtime/Normalizer/ValidatorTrait.php @@ -0,0 +1,16 @@ +validate($data, $constraint); + if ($violations->count() > 0) { + throw new ValidationException($violations); + } + } +} \ No newline at end of file