PcoServicesSeries constructor

PcoServicesSeries({
  1. String? id,
  2. DateTime? createdAt,
  3. DateTime? updatedAt,
  4. String? artworkFileName,
  5. String? artworkContentType,
  6. int? artworkFileSize,
  7. String? title,
  8. String? artworkForDashboard,
  9. String? artworkForMobile,
  10. String? artworkForPlan,
  11. String? artworkOriginal,
  12. bool? isHasArtwork,
  13. Map<String, List<PcoResource>>? withRelationships,
  14. List<PcoResource>? withIncluded,
})

Create a new PcoServicesSeries 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 PcoServicesSeries(
    {String? id,
    DateTime? createdAt,
    DateTime? updatedAt,
    String? artworkFileName,
    String? artworkContentType,
    int? artworkFileSize,
    String? title,
    String? artworkForDashboard,
    String? artworkForMobile,
    String? artworkForPlan,
    String? artworkOriginal,
    bool? isHasArtwork,
    Map<String, List<PcoResource>>? withRelationships,
    List<PcoResource>? withIncluded}) {
  var obj = PcoServicesSeries.empty();
  obj._id = id;
  if (createdAt != null)
    obj._attributes['created_at'] = createdAt.toIso8601String();
  if (updatedAt != null)
    obj._attributes['updated_at'] = updatedAt.toIso8601String();
  if (artworkFileName != null)
    obj._attributes['artwork_file_name'] = artworkFileName;
  if (artworkContentType != null)
    obj._attributes['artwork_content_type'] = artworkContentType;
  if (artworkFileSize != null)
    obj._attributes['artwork_file_size'] = artworkFileSize;
  if (title != null) obj._attributes['title'] = title;
  if (artworkForDashboard != null)
    obj._attributes['artwork_for_dashboard'] = artworkForDashboard;
  if (artworkForMobile != null)
    obj._attributes['artwork_for_mobile'] = artworkForMobile;
  if (artworkForPlan != null)
    obj._attributes['artwork_for_plan'] = artworkForPlan;
  if (artworkOriginal != null)
    obj._attributes['artwork_original'] = artworkOriginal;
  if (isHasArtwork != null) obj._attributes['has_artwork'] = isHasArtwork;

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