ResourcePolicy.fromJson constructor

ResourcePolicy.fromJson(
  1. Object? j
)

Implementation

factory ResourcePolicy.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return ResourcePolicy(
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    diskConsistencyGroupPolicy: switch (json['diskConsistencyGroupPolicy']) {
      null => null,
      Object $1 => ResourcePolicyDiskConsistencyGroupPolicy.fromJson($1),
    },
    groupPlacementPolicy: switch (json['groupPlacementPolicy']) {
      null => null,
      Object $1 => ResourcePolicyGroupPlacementPolicy.fromJson($1),
    },
    id: switch (json['id']) {
      null => null,
      Object $1 => decodeUint64($1),
    },
    instanceSchedulePolicy: switch (json['instanceSchedulePolicy']) {
      null => null,
      Object $1 => ResourcePolicyInstanceSchedulePolicy.fromJson($1),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
    name: switch (json['name']) {
      null => null,
      Object $1 => decodeString($1),
    },
    region: switch (json['region']) {
      null => null,
      Object $1 => decodeString($1),
    },
    resourceStatus: switch (json['resourceStatus']) {
      null => null,
      Object $1 => ResourcePolicyResourceStatus.fromJson($1),
    },
    selfLink: switch (json['selfLink']) {
      null => null,
      Object $1 => decodeString($1),
    },
    snapshotSchedulePolicy: switch (json['snapshotSchedulePolicy']) {
      null => null,
      Object $1 => ResourcePolicySnapshotSchedulePolicy.fromJson($1),
    },
    status: switch (json['status']) {
      null => null,
      Object $1 => decodeString($1),
    },
    workloadPolicy: switch (json['workloadPolicy']) {
      null => null,
      Object $1 => ResourcePolicyWorkloadPolicy.fromJson($1),
    },
  );
}