PcoServicesAttachmentType constructor

PcoServicesAttachmentType({
  1. String? id,
  2. String? name,
  3. String? aliases,
  4. bool? isCapoedChordCharts,
  5. bool? isChordCharts,
  6. String? exclusions,
  7. bool? isLyrics,
  8. bool? isNumberCharts,
  9. bool? isNumeralCharts,
  10. bool? isBuiltIn,
  11. Map<String, List<PcoResource>>? withRelationships,
  12. List<PcoResource>? withIncluded,
})

Create a new PcoServicesAttachmentType 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 PcoServicesAttachmentType(
    {String? id,
    String? name,
    String? aliases,
    bool? isCapoedChordCharts,
    bool? isChordCharts,
    String? exclusions,
    bool? isLyrics,
    bool? isNumberCharts,
    bool? isNumeralCharts,
    bool? isBuiltIn,
    Map<String, List<PcoResource>>? withRelationships,
    List<PcoResource>? withIncluded}) {
  var obj = PcoServicesAttachmentType.empty();
  obj._id = id;
  if (name != null) obj._attributes['name'] = name;
  if (aliases != null) obj._attributes['aliases'] = aliases;
  if (isCapoedChordCharts != null)
    obj._attributes['capoed_chord_charts'] = isCapoedChordCharts;
  if (isChordCharts != null) obj._attributes['chord_charts'] = isChordCharts;
  if (exclusions != null) obj._attributes['exclusions'] = exclusions;
  if (isLyrics != null) obj._attributes['lyrics'] = isLyrics;
  if (isNumberCharts != null)
    obj._attributes['number_charts'] = isNumberCharts;
  if (isNumeralCharts != null)
    obj._attributes['numeral_charts'] = isNumeralCharts;
  if (isBuiltIn != null) obj._attributes['built_in'] = isBuiltIn;

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