PcoServicesPlanTemplate constructor

PcoServicesPlanTemplate({
  1. String? id,
  2. String? name,
  3. DateTime? createdAt,
  4. DateTime? updatedAt,
  5. int? itemCount,
  6. int? teamCount,
  7. int? noteCount,
  8. bool? isCanViewOrder,
  9. bool? isMultiDay,
  10. bool? isPrefersOrderView,
  11. bool? isRehearsable,
  12. Map<String, List<PcoResource>>? withRelationships,
  13. List<PcoResource>? withIncluded,
})

Create a new PcoServicesPlanTemplate 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 PcoServicesPlanTemplate(
    {String? id,
    String? name,
    DateTime? createdAt,
    DateTime? updatedAt,
    int? itemCount,
    int? teamCount,
    int? noteCount,
    bool? isCanViewOrder,
    bool? isMultiDay,
    bool? isPrefersOrderView,
    bool? isRehearsable,
    Map<String, List<PcoResource>>? withRelationships,
    List<PcoResource>? withIncluded}) {
  var obj = PcoServicesPlanTemplate.empty();
  obj._id = id;
  if (name != null) obj._attributes['name'] = name;
  if (createdAt != null)
    obj._attributes['created_at'] = createdAt.toIso8601String();
  if (updatedAt != null)
    obj._attributes['updated_at'] = updatedAt.toIso8601String();
  if (itemCount != null) obj._attributes['item_count'] = itemCount;
  if (teamCount != null) obj._attributes['team_count'] = teamCount;
  if (noteCount != null) obj._attributes['note_count'] = noteCount;
  if (isCanViewOrder != null)
    obj._attributes['can_view_order'] = isCanViewOrder;
  if (isMultiDay != null) obj._attributes['multi_day'] = isMultiDay;
  if (isPrefersOrderView != null)
    obj._attributes['prefers_order_view'] = isPrefersOrderView;
  if (isRehearsable != null) obj._attributes['rehearsable'] = isRehearsable;

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