PcoServicesArrangement class

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
no setterinherited
apiEndpoint String
no setterinherited
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
no setteroverride
apiVersion String
child classes can override these getters which will allow methods in this class to see static variables from child classes
no setteroverride
archivedAt DateTime
no setter
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
no setterinherited
bpm double
pass null to remove key from attributes
getter/setter pair
canCreate bool
no setteroverride
canDestroy bool
no setteroverride
canUpdate bool
no setteroverride
chordChart String
A string of lyrics and chords. Supports standard and ChordPro formats.
getter/setter pair
chordChartChordColor int
pass null to remove key from attributes
getter/setter pair
chordChartColumns int
pass null to remove key from attributes
getter/setter pair
chordChartFont String
pass null to remove key from attributes
getter/setter pair
chordChartFontSize int
Possible Values:
getter/setter pair
chordChartKey String
pass null to remove key from attributes
getter/setter pair
createAllowed List<String>
no setteroverride
createdAt DateTime
no setterinherited
createPathTemplate String
no setteroverride
defaultPathTemplate String
no setteroverride
fetched bool
indicate whether an item is full or partial
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
id String?
no setterinherited
included List<PcoResource>
contains included items parsed into objects
no setterinherited
includedKeys PcoServicesKey?
no setter
isHasChordChart bool
no setter
isHasChords bool
no setter
isLyricsEnabled bool
pass null to remove key from attributes
getter/setter pair
isNumberChartEnabled bool
pass null to remove key from attributes
getter/setter pair
isNumeralChartEnabled bool
pass null to remove key from attributes
getter/setter pair
isrc int
pass null to remove key from attributes
getter/setter pair
length int
pass null to remove key from attributes
getter/setter pair
contains the links data returned by the api if present
no setterinherited
lyrics String
no setter
meter String
Possible Values:
getter/setter pair
mtid String
An alias for rehearsal_mix_id
getter/setter pair
name String
pass null to remove key from attributes
getter/setter pair
needsSave bool
no setterinherited
notes String
pass null to remove key from attributes
getter/setter pair
pcoApplication String
latefinalinherited
printMargin String
Possible Values:
getter/setter pair
printOrientation String
Possible Values:
getter/setter pair
printPageSize String
Possible Values:
getter/setter pair
rehearsalMixId String
pass null to remove key from attributes
getter/setter pair
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
no setterinherited
resourceType String
all planning center resources must have a type
latefinalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sequence List
An array of strings containing a label and a number describing the section:
getter/setter pair
sequenceFull List
no setter
sequenceShort List
no setter
slug String
no setterinherited
updateAllowed List<String>
no setteroverride
updatedAt DateTime
no setterinherited

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 nonexistent 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
no setter
canOrderBy List<String>
possible orderings with parameter ?order=
no setter
canQuery List<String>
possible queries using parameters like ?wherekey=value or ?wheregt|lt=value
no setter

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
kArchivedAt → const String
kBpm → const String
kChordChart → const String
kChordChartChordColor → const String
kChordChartColumns → const String
kChordChartFont → const String
kChordChartFontSize → const String
kChordChartKey → const String
kCreatedAt → const String
kCreatePathTemplate → const String
kDefaultPathTemplate → const String
kHasChordChart → const String
kHasChords → const String
kId → const String
kIsrc → const String
kLength → const String
kLyrics → const String
kLyricsEnabled → const String
kMeter → const String
kMtid → const String
kName → const String
kNotes → const String
kNumberChartEnabled → const String
kNumeralChartEnabled → const String
kPcoApplication → const String
kPrintMargin → const String
kPrintOrientation → const String
kPrintPageSize → const String
kRehearsalMixId → const String
kSequence → const String
kSequenceFull → const String
kSequenceShort → const String
kTypeId → const String
kTypeString → const String
kUpdatedAt → const String