PcoServicesItem constructor
PcoServicesItem({
- required String serviceTypeId,
- required String planId,
- String? id,
- String? title,
- int? sequence,
- DateTime? createdAt,
- DateTime? updatedAt,
- int? length,
- String? itemType,
- String? htmlDetails,
- String? servicePosition,
- String? description,
- String? keyName,
- List? customArrangementSequence,
- List? customArrangementSequenceShort,
- List? customArrangementSequenceFull,
- String? arrangementId,
- String? keyId,
- String? selectedLayoutId,
- String? songId,
- Map<
String, List< ? withRelationships,PcoResource> > - List<
PcoResource> ? withIncluded,
Create a new PcoServicesItem object using this endpoint: https://api.planningcenteronline.com/services/v2/service_types/$serviceTypeId/plans/$planId/items
NOTES:
- Creating an instance of a class this way does not save it on the server.
- Call
save()
on the object to save it to the server. - Only set the
id
field if you know what you are doing. Save operations will overwrite data when theid
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:
arrangementId
,customArrangementSequence
,description
,htmlDetails
,keyId
,length
,selectedLayoutId
,servicePosition
,songId
,title
,itemType
,sequence
- FIELDS USED WHEN UPDATING:
arrangementId
,customArrangementSequence
,description
,htmlDetails
,keyId
,length
,selectedLayoutId
,servicePosition
,songId
,title
Implementation
factory PcoServicesItem(
{required String serviceTypeId,
required String planId,
String? id,
String? title,
int? sequence,
DateTime? createdAt,
DateTime? updatedAt,
int? length,
String? itemType,
String? htmlDetails,
String? servicePosition,
String? description,
String? keyName,
List? customArrangementSequence,
List? customArrangementSequenceShort,
List? customArrangementSequenceFull,
String? arrangementId,
String? keyId,
String? selectedLayoutId,
String? songId,
Map<String, List<PcoResource>>? withRelationships,
List<PcoResource>? withIncluded}) {
var obj = PcoServicesItem.empty();
obj._id = id;
obj._apiPathOverride =
'https://api.planningcenteronline.com/services/v2/service_types/$serviceTypeId/plans/$planId/items';
if (title != null) obj._attributes['title'] = title;
if (sequence != null) obj._attributes['sequence'] = sequence;
if (createdAt != null)
obj._attributes['created_at'] = createdAt.toIso8601String();
if (updatedAt != null)
obj._attributes['updated_at'] = updatedAt.toIso8601String();
if (length != null) obj._attributes['length'] = length;
if (itemType != null) obj._attributes['item_type'] = itemType;
if (htmlDetails != null) obj._attributes['html_details'] = htmlDetails;
if (servicePosition != null)
obj._attributes['service_position'] = servicePosition;
if (description != null) obj._attributes['description'] = description;
if (keyName != null) obj._attributes['key_name'] = keyName;
if (customArrangementSequence != null)
obj._attributes['custom_arrangement_sequence'] =
customArrangementSequence;
if (customArrangementSequenceShort != null)
obj._attributes['custom_arrangement_sequence_short'] =
customArrangementSequenceShort;
if (customArrangementSequenceFull != null)
obj._attributes['custom_arrangement_sequence_full'] =
customArrangementSequenceFull;
if (arrangementId != null)
obj._attributes['arrangement_id'] = arrangementId;
if (keyId != null) obj._attributes['key_id'] = keyId;
if (selectedLayoutId != null)
obj._attributes['selected_layout_id'] = selectedLayoutId;
if (songId != null) obj._attributes['song_id'] = songId;
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;
}