PcoPeopleForm constructor

PcoPeopleForm({
  1. String? id,
  2. String? name,
  3. String? description,
  4. bool? isActive,
  5. DateTime? archivedAt,
  6. DateTime? createdAt,
  7. DateTime? updatedAt,
  8. DateTime? deletedAt,
  9. int? submissionCount,
  10. String? publicUrl,
  11. bool? isRecentlyViewed,
  12. bool? isArchived,
  13. Map<String, List<PcoResource>>? withRelationships,
  14. List<PcoResource>? withIncluded,
})

Create a new PcoPeopleForm object. This object cannot be created with the API

NOTES:

  • Creating an instance of a class this way does not save it on the server.
  • This object cannot be saved directly to the server.
  • Only set the id field if you know what you are doing. Save operations will overwrite data when the id is set.
  • Dummy data can be supplied for a required parameter, but if so, .save() should not be called on the object
  • FIELDS USED WHEN CREATING: none
  • FIELDS USED WHEN UPDATING: none

Implementation

factory PcoPeopleForm(
    {String? id,
    String? name,
    String? description,
    bool? isActive,
    DateTime? archivedAt,
    DateTime? createdAt,
    DateTime? updatedAt,
    DateTime? deletedAt,
    int? submissionCount,
    String? publicUrl,
    bool? isRecentlyViewed,
    bool? isArchived,
    Map<String, List<PcoResource>>? withRelationships,
    List<PcoResource>? withIncluded}) {
  var obj = PcoPeopleForm.empty();
  obj._id = id;
  if (name != null) obj._attributes['name'] = name;
  if (description != null) obj._attributes['description'] = description;
  if (isActive != null) obj._attributes['active'] = isActive;
  if (archivedAt != null)
    obj._attributes['archived_at'] = archivedAt.toIso8601String();
  if (createdAt != null)
    obj._attributes['created_at'] = createdAt.toIso8601String();
  if (updatedAt != null)
    obj._attributes['updated_at'] = updatedAt.toIso8601String();
  if (deletedAt != null)
    obj._attributes['deleted_at'] = deletedAt.toIso8601String();
  if (submissionCount != null)
    obj._attributes['submission_count'] = submissionCount;
  if (publicUrl != null) obj._attributes['public_url'] = publicUrl;
  if (isRecentlyViewed != null)
    obj._attributes['recently_viewed'] = isRecentlyViewed;
  if (isArchived != null) obj._attributes['archived'] = isArchived;

  if (withRelationships != null) {
    for (var r in withRelationships.entries) {
      obj._relationships[r.key] = r.value;
    }
    obj._hasManualRelationships = true;
  }

  if (withIncluded != null) {
    obj._included.addAll(withIncluded);
    obj._hasManualIncluded = true;
  }

  return obj;
}