PcoServicesArrangement class Null safety

This class represents a PCO Services Arrangement Object

Instantiation

  • Create a new instance using the PcoServicesArrangement() constructor
  • Instantiate from existing JSON data using the PcoServicesArrangement.fromJson() constructor.
  • Load an instance from the API using one of the static methods defined on this class.

Usage

  • Fields exposed by the API are readable through getter methods.
  • Fields writable by the API are exposed through setter methods.
  • Original json data is exposed through the read-only attributes map.
  • Additional data is available through the read-only links and relationships maps.
  • Available relationships / includes are exposed through typed getters.

Description

Each arrangement belongs to a song and is a different version of that song.

Attributes (and permissions)

  • id (ro) -> PCO: id
  • bpm (rw) -> PCO: bpm
  • createdAt (ro) -> PCO: created_at
  • isHasChords (ro) -> PCO: has_chords
  • length (rw) -> PCO: length
  • meter (rw) -> PCO: meter
  • name (rw) -> PCO: name
  • notes (rw) -> PCO: notes
  • printMargin (rw) -> PCO: print_margin
  • printOrientation (rw) -> PCO: print_orientation
  • printPageSize (rw) -> PCO: print_page_size
  • updatedAt (ro) -> PCO: updated_at
  • chordChart (rw) -> PCO: chord_chart
  • chordChartFont (rw) -> PCO: chord_chart_font
  • chordChartKey (rw) -> PCO: chord_chart_key
  • chordChartColumns (rw) -> PCO: chord_chart_columns
  • chordChartFontSize (rw) -> PCO: chord_chart_font_size
  • isHasChordChart (ro) -> PCO: has_chord_chart
  • isLyricsEnabled (rw) -> PCO: lyrics_enabled
  • isNumberChartEnabled (rw) -> PCO: number_chart_enabled
  • isNumeralChartEnabled (rw) -> PCO: numeral_chart_enabled
  • sequence (rw) -> PCO: sequence
  • sequenceShort (ro) -> PCO: sequence_short
  • sequenceFull (ro) -> PCO: sequence_full
  • chordChartChordColor (rw) -> PCO: chord_chart_chord_color
  • archivedAt (ro) -> PCO: archived_at
  • lyrics (ro) -> PCO: lyrics
  • isrc (rw) -> PCO: isrc
  • mtid (rw) -> PCO: mtid
  • rehearsalMixId (rw) -> PCO: rehearsal_mix_id

Edges and Actions

Outbound Edges:

Inbound Edges:

Actions:

Raw Data Object Example

{
  "type": "Arrangement",
  "id": "1",
  "attributes": {
    "bpm": 1.42,
    "created_at": "2000-01-01T12:00:00Z",
    "has_chords": true,
    "length": 1,
    "meter": "string",
    "name": "string",
    "notes": "string",
    "print_margin": "string",
    "print_orientation": "string",
    "print_page_size": "string",
    "updated_at": "2000-01-01T12:00:00Z",
    "chord_chart": "string",
    "chord_chart_font": "string",
    "chord_chart_key": "string",
    "chord_chart_columns": 1,
    "chord_chart_font_size": 1,
    "has_chord_chart": true,
    "lyrics_enabled": true,
    "number_chart_enabled": true,
    "numeral_chart_enabled": true,
    "sequence": [],
    "sequence_short": [],
    "sequence_full": [],
    "chord_chart_chord_color": 1,
    "archived_at": "2000-01-01T12:00:00Z",
    "lyrics": "string"
  },
  "relationships": {
    "updated_by": {
      "data": {
        "type": "Person",
        "id": "1"
      }
    },
    "created_by": {
      "data": {
        "type": "Person",
        "id": "1"
      }
    },
    "song": {
      "data": {
        "type": "Song",
        "id": "1"
      }
    }
  }
}
Inheritance

Constructors

PcoServicesArrangement({required String songId, String? id, double? bpm, DateTime? createdAt, bool? isHasChords, int? length, String? meter, String? name, String? notes, String? printMargin, String? printOrientation, String? printPageSize, DateTime? updatedAt, String? chordChart, String? chordChartFont, String? chordChartKey, int? chordChartColumns, int? chordChartFontSize, bool? isHasChordChart, bool? isLyricsEnabled, bool? isNumberChartEnabled, bool? isNumeralChartEnabled, List? sequence, List? sequenceShort, List? sequenceFull, int? chordChartChordColor, DateTime? archivedAt, String? lyrics, int? isrc, String? mtid, String? rehearsalMixId, Map<String, List<PcoResource>>? withRelationships, List<PcoResource>? withIncluded})
Create a new PcoServicesArrangement object using this endpoint: https://api.planningcenteronline.com/services/v2/songs/$songId/arrangements
factory
PcoServicesArrangement.empty()
Create an empty instance of this class. This is only useful when an endpoint requires related or included data.
PcoServicesArrangement.fromJson(Map<String, dynamic> data, {List<Map<String, dynamic>>? withIncluded})

Properties

api PlanningCenter
planning center resources must be tied to an api
read-onlyinherited
apiEndpoint String
read-onlyinherited
apiPath String
PcoResources include their own path as a link object but this might be null if we haven't created/fetched the object yet Child classes should redefine this getter to allow for manual path overrides
read-onlyoverride
apiVersion String
child classes can override these getters which will allow methods in this class to see static variables from child classes
read-onlyoverride
archivedAt DateTime
read-only
attributes ReadOnlyMapView<String, dynamic>
contains the underlying attributes returned by the api and allows a user to access arbitrary data in the attributes by actual api name
read-onlyinherited
bpm double
pass null to remove key from attributes
read / write
canCreate bool
read-onlyoverride
canDestroy bool
read-onlyoverride
canUpdate bool
read-onlyoverride
chordChart String
A string of lyrics and chords. Supports standard and ChordPro formats.
read / write
chordChartChordColor int
pass null to remove key from attributes
read / write
chordChartColumns int
pass null to remove key from attributes
read / write
chordChartFont String
pass null to remove key from attributes
read / write
chordChartFontSize int
Possible Values:
read / write
chordChartKey String
pass null to remove key from attributes
read / write
createAllowed List<String>
read-onlyoverride
createdAt DateTime
read-onlyinherited
createPathTemplate String
read-onlyoverride
defaultPathTemplate String
read-onlyoverride
fetched bool
indicate whether an item is full or partial
read / writeinherited
hashCode int
The hash code for this object.
read-onlyinherited
id String?
read-onlyinherited
included List<PcoResource>
contains included items parsed into objects
read-onlyinherited
includedKeys PcoServicesKey?
read-only
isHasChordChart bool
read-only
isHasChords bool
read-only
isLyricsEnabled bool
pass null to remove key from attributes
read / write
isNumberChartEnabled bool
pass null to remove key from attributes
read / write
isNumeralChartEnabled bool
pass null to remove key from attributes
read / write
isrc int
pass null to remove key from attributes
read / write
length int
pass null to remove key from attributes
read / write
contains the links data returned by the api if present
read-onlyinherited
lyrics String
read-only
meter String
Possible Values:
read / write
mtid String
An alias for rehearsal_mix_id
read / write
name String
pass null to remove key from attributes
read / write
needsSave bool
read-onlyinherited
notes String
pass null to remove key from attributes
read / write
pcoApplication String
latefinalinherited
printMargin String
Possible Values:
read / write
printOrientation String
Possible Values:
read / write
printPageSize String
Possible Values:
read / write
rehearsalMixId String
pass null to remove key from attributes
read / write
relationships ReadOnlyMapView<String, List<PcoResource>>
contains relationships parsed into objects even though the api sends relationship objects as Maps or Lists we always put them into lists for consistency
read-onlyinherited
resourceType String
all planning center resources must have a type
latefinalinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
sequence List
An array of strings containing a label and a number describing the section:
read / write
sequenceFull List
read-only
sequenceShort List
read-only
slug String
read-onlyinherited
updateAllowed List<String>
read-onlyoverride
updatedAt DateTime
read-onlyinherited

Methods

assignTags(Object data) Future<PlanningCenterApiResponse<PlanningCenterApiData>>
ACTION: assign_tags
coerceDouble(dynamic a) double
inherited
coerceInt(dynamic a) int
inherited
delete() Future<PlanningCenterApiResponse<PlanningCenterApiData>>
inherited
filteredAttributes(List<String> allowedKeys) Map<String, dynamic>
inherited
fromJson(Map<String, dynamic> data, {List<Map<String, dynamic>>? withIncluded}) → dynamic
Takes a full JSON:API Response Object (the contents of a "data" field) will clear and update id, apiPath, attributes and _relationships
inherited
getAttachments({PcoServicesAttachmentQuery? query}) Future<PcoCollection<PcoServicesAttachment>>
Will get a collection of PcoServicesAttachment objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/songs/1/arrangements/1/attachments
getKeys({PcoServicesKeyQuery? query}) Future<PcoCollection<PcoServicesKey>>
Will get a collection of PcoServicesKey objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/songs/1/arrangements/1/keys
getSections({PcoServicesArrangementSectionQuery? query}) Future<PcoCollection<PcoServicesArrangementSection>>
Will get a collection of PcoServicesArrangementSection objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/songs/1/arrangements/1/sections
getTags({PcoServicesTagQuery? query}) Future<PcoCollection<PcoServicesTag>>
Will get a collection of PcoServicesTag objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/songs/1/arrangements/1/tags
handleIncludes(List<Map<String, dynamic>> included) → void
This function populates the relationships with typed resource objects based on the data in the included map of the json.
inherited
handleItem(Map<String, dynamic> data) PcoResource?
inherited
handleRelationships(Map<String, dynamic> items, [List<Map<String, dynamic>> included = const []]) Map<String, List<PcoResource>>
inherited
includedSections<T extends PcoResource>() List<T>
The code generator could not automatically determine the resource type of this relationship. For type safe code, you should specify it in the type argument when calling.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
save({Map<String, PcoResource>? withRelated, List<PcoResource>? withIncluded}) Future<PlanningCenterApiResponse<PlanningCenterApiData>>
Many Planning Center endpoints allow or require additional relationships and/or included items to be sent with a create/update operation. Since these cannot always be determined by the automatic code generation, they may be included as arguments to the save operation.
inherited
toCreateResource() Map<String, dynamic>
create the attributes Map for this object without the id field using only the attributes allowed in create (post) operations
inherited
toDataMap({Map<String, PcoResource>? withRelated, List<PcoResource>? withIncluded}) Map<String, dynamic>
create a json-api Map for this object automatically selecting create or update based on the existence of the id field. Will result in something like this:
inherited
toIdResource() Map<String, dynamic>
returns the simplest representation of this resource with only the type and the id:
inherited
toJson({dynamic includeAttributes = true, dynamic includeRelationships = false}) Map<String, dynamic>
Some api requests only want the type and id of an object. In those cases, set includeAttributes to false or call toIdResource instead.
inherited
toString() String
A string representation of this object.
inherited
toUpdateResource() Map<String, dynamic>
create the attributes Map for this object using only the attributes allowed in update (patch) operations
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

canInclude List<String>
possible includes with parameter ?include=a,b
read-only
canOrderBy List<String>
possible orderings with parameter ?order=
read-only
canQuery List<String>
possible queries using parameters like ?wherekey=value or ?wheregt|lt=value
read-only

Static Methods

getAllFromSong(String songId, {String? id, PcoServicesArrangementQuery? query, bool includeAllRelated = false, bool includeKeys = false, bool includeSections = false}) Future<PcoCollection<PcoServicesArrangement>>
Will get a PcoCollection containing ALL PcoServicesArrangement objects (expecting many) using a path like this: /services/v2/songs/$songId/arrangements
getFromServiceTypeAndPlanAndItem(String serviceTypeId, String planId, String itemId, {PcoServicesArrangementQuery? query, bool getAll = false, bool includeAllRelated = false, bool includeKeys = false, bool includeSections = false}) Future<PcoCollection<PcoServicesArrangement>>
Will get a PcoCollection of PcoServicesArrangement objects (expecting one) using a path like this: /services/v2/service_types/$serviceTypeId/plans/$planId/items/$itemId/arrangement
getFromSong(String songId, {String? id, PcoServicesArrangementQuery? query, bool getAll = false, bool includeAllRelated = false, bool includeKeys = false, bool includeSections = false}) Future<PcoCollection<PcoServicesArrangement>>
Will get a PcoCollection of PcoServicesArrangement objects (expecting many) using a path like this: /services/v2/songs/$songId/arrangements
getSingleFromSong(String songId, String id, {PcoServicesArrangementQuery? query, bool includeAllRelated = false, bool includeKeys = false, bool includeSections = false}) Future<PcoServicesArrangement?>
Will get a single PcoServicesArrangement object using a path like this: /services/v2/songs/$songId/arrangements/[id]

Constants

kApiVersion → const String
'2018-11-01'
kArchivedAt → const String
'archived_at'
kBpm → const String
'bpm'
kChordChart → const String
'chord_chart'
kChordChartChordColor → const String
'chord_chart_chord_color'
kChordChartColumns → const String
'chord_chart_columns'
kChordChartFont → const String
'chord_chart_font'
kChordChartFontSize → const String
'chord_chart_font_size'
kChordChartKey → const String
'chord_chart_key'
kCreatedAt → const String
'created_at'
kCreatePathTemplate → const String
'https://api.planningcenteronline.com/services/v2/songs/1/arrangements'
kDefaultPathTemplate → const String
'https://api.planningcenteronline.com/services/v2/songs/1/arrangements'
kHasChordChart → const String
'has_chord_chart'
kHasChords → const String
'has_chords'
kId → const String
'id'
kIsrc → const String
'isrc'
kLength → const String
'length'
kLyrics → const String
'lyrics'
kLyricsEnabled → const String
'lyrics_enabled'
kMeter → const String
'meter'
kMtid → const String
'mtid'
kName → const String
'name'
kNotes → const String
'notes'
kNumberChartEnabled → const String
'number_chart_enabled'
kNumeralChartEnabled → const String
'numeral_chart_enabled'
kPcoApplication → const String
'services'
kPrintMargin → const String
'print_margin'
kPrintOrientation → const String
'print_orientation'
kPrintPageSize → const String
'print_page_size'
kRehearsalMixId → const String
'rehearsal_mix_id'
kSequence → const String
'sequence'
kSequenceFull → const String
'sequence_full'
kSequenceShort → const String
'sequence_short'
kTypeId → const String
'arrangement'
kTypeString → const String
'Arrangement'
kUpdatedAt → const String
'updated_at'