DeploymentConfig.fromJson constructor

DeploymentConfig.fromJson(
  1. Map<String, dynamic> json
)

Creates a DeploymentConfig instance from a JSON map.

This factory constructor parses a JSON map and creates a corresponding DeploymentConfig object. It expects the JSON map to contain the keys 'deploymentId', 'environment', 'url', 'server', 'artifactName', and 'rollbackOnFailure'.

Example JSON:

{
  "deploymentId": "deploy-123",
  "environment": "production",
  "url": "[https://example.com](https://example.com)",
  "server": "web-server-01",
  "artifactName": "my-app-v1.0.0.zip",
  "rollbackOnFailure": true
}

Throws a TypeError if the provided JSON values are not of the expected types.

Implementation

factory DeploymentConfig.fromJson(Map<String, dynamic> json) {
  return DeploymentConfig(
    deploymentId: json['deploymentId'] as String,
    environment: json['environment'] as String,
    url: json['url'] as String,
    server: json['server'] as String,
    artifactName: json['artifactName'] as String,
    rollbackOnFailure: json['rollbackOnFailure'] as bool,
  );
}