PcoCalendarEvent constructor

PcoCalendarEvent({
  1. String? id,
  2. String? approvalStatus,
  3. DateTime? createdAt,
  4. String? description,
  5. String? imageUrl,
  6. String? name,
  7. int? percentApproved,
  8. int? percentRejected,
  9. String? registrationUrl,
  10. String? summary,
  11. DateTime? updatedAt,
  12. bool? isVisibleInChurchCenter,
  13. Map<String, List<PcoResource>>? withRelationships,
  14. List<PcoResource>? withIncluded,
})

Create a new PcoCalendarEvent 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 PcoCalendarEvent(
    {String? id,
    String? approvalStatus,
    DateTime? createdAt,
    String? description,
    String? imageUrl,
    String? name,
    int? percentApproved,
    int? percentRejected,
    String? registrationUrl,
    String? summary,
    DateTime? updatedAt,
    bool? isVisibleInChurchCenter,
    Map<String, List<PcoResource>>? withRelationships,
    List<PcoResource>? withIncluded}) {
  var obj = PcoCalendarEvent.empty();
  obj._id = id;
  if (approvalStatus != null)
    obj._attributes['approval_status'] = approvalStatus;
  if (createdAt != null)
    obj._attributes['created_at'] = createdAt.toIso8601String();
  if (description != null) obj._attributes['description'] = description;
  if (imageUrl != null) obj._attributes['image_url'] = imageUrl;
  if (name != null) obj._attributes['name'] = name;
  if (percentApproved != null)
    obj._attributes['percent_approved'] = percentApproved;
  if (percentRejected != null)
    obj._attributes['percent_rejected'] = percentRejected;
  if (registrationUrl != null)
    obj._attributes['registration_url'] = registrationUrl;
  if (summary != null) obj._attributes['summary'] = summary;
  if (updatedAt != null)
    obj._attributes['updated_at'] = updatedAt.toIso8601String();
  if (isVisibleInChurchCenter != null)
    obj._attributes['visible_in_church_center'] = isVisibleInChurchCenter;

  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;
}