PcoServicesAttachment class
This class represents a PCO Services Attachment Object
- Application: services
- Id: attachment
- Type: Attachment
- ApiVersion: 2018-11-01
- Is Deprecated: false
- Is Collection Only: false
- Default Endpoint: https://api.planningcenteronline.com/services/v2/attachments
- Create Endpoint: https://api.planningcenteronline.com/services/v2/songs/1/arrangements/1/attachments
Instantiation
- Create a new instance using the
PcoServicesAttachment()
constructor - Instantiate from existing
JSON
data using thePcoServicesAttachment.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-onlyattributes
map. - Additional data is available through the read-only
links
andrelationships
maps. - Available relationships / includes are exposed through typed getters.
Description
A file, whether it's stored on Planning Center or linked from another location.
Attributes (and permissions)
id
(ro) -> PCO:id
createdAt
(ro) -> PCO:created_at
pageOrder
(rw) -> PCO:page_order
updatedAt
(ro) -> PCO:updated_at
filename
(rw) -> PCO:filename
fileSize
(ro) -> PCO:file_size
licensesPurchased
(ro) -> PCO:licenses_purchased
licensesRemaining
(ro) -> PCO:licenses_remaining
licensesUsed
(ro) -> PCO:licenses_used
contentType
(ro) -> PCO:content_type
displayName
(ro) -> PCO:display_name
filetype
(ro) -> PCO:filetype
linkedUrl
(ro) -> PCO:linked_url
pcoType
(ro) -> PCO:pco_type
remoteLink
(rw) -> PCO:remote_link
thumbnailUrl
(ro) -> PCO:thumbnail_url
url
(ro) -> PCO:url
isAllowMp3Download
(ro) -> PCO:allow_mp3_download
isWebStreamable
(ro) -> PCO:web_streamable
isDownloadable
(ro) -> PCO:downloadable
isTransposable
(ro) -> PCO:transposable
isStreamable
(ro) -> PCO:streamable
isHasPreview
(ro) -> PCO:has_preview
fileUploadIdentifier
(rw) -> PCO:file_upload_identifier
attachmentTypeIds
(wo) -> PCO:attachment_type_ids
Edges and Actions
Outbound Edges:
zoom-attachment-zooms
: https://api.planningcenteronline.com/services/v2/attachments/1/zooms
Inbound Edges:
attachment-arrangement-attachments
: https://api.planningcenteronline.com/services/v2/songs/1/arrangements/1/attachmentsattachment-item-attachments
: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/items/1/attachmentsattachment-item-selected_attachment
: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/items/1/selected_attachmentattachment-item-selected_background
: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/items/1/selected_backgroundattachment-key-attachments
: https://api.planningcenteronline.com/services/v2/songs/1/arrangements/1/keys/1/attachmentsattachment-media-attachments
: https://api.planningcenteronline.com/services/v2/media/1/attachmentsattachment-plan-all_attachments
: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/all_attachmentsattachment-plan-attachments
: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/attachmentsattachment-servicetype-attachments
: https://api.planningcenteronline.com/services/v2/service_types/1/attachmentsattachment-song-attachments
: https://api.planningcenteronline.com/services/v2/songs/1/attachments
Actions:
open
: https://api.planningcenteronline.com/services/v2/attachments/1/openpreview
: https://api.planningcenteronline.com/services/v2/attachments/1/preview
Raw Data Object Example
{
"type": "Attachment",
"id": "1",
"attributes": {
"created_at": "2000-01-01T12:00:00Z",
"page_order": "string",
"updated_at": "2000-01-01T12:00:00Z",
"filename": "string",
"file_size": 1,
"licenses_purchased": 1,
"licenses_remaining": 1,
"licenses_used": 1,
"content_type": "string",
"display_name": "string",
"filetype": "string",
"linked_url": "string",
"pco_type": "string",
"remote_link": "string",
"thumbnail_url": "string",
"url": "string",
"allow_mp3_download": true,
"web_streamable": true,
"downloadable": true,
"transposable": true,
"streamable": true,
"has_preview": true
},
"relationships": {
"attachable": {
"data": {
"type": "Plan",
"id": "1"
}
},
"attachment_types": {
"data": [
{
"type": "AttachmentType",
"id": "1"
}
]
},
"created_by": {
"data": {
"type": "Person",
"id": "1"
}
},
"updated_by": {
"data": {
"type": "Person",
"id": "1"
}
},
"administrator": {
"data": {
"type": "Person",
"id": "1"
}
}
}
}
- Inheritance
-
- Object
- PcoResource
- PcoServicesAttachment
Constructors
-
PcoServicesAttachment({required String songId, required String arrangementId, String? id, DateTime? createdAt, String? pageOrder, DateTime? updatedAt, String? filename, int? fileSize, int? licensesPurchased, int? licensesRemaining, int? licensesUsed, String? contentType, String? displayName, String? filetype, String? linkedUrl, String? pcoType, String? remoteLink, String? thumbnailUrl, String? url, bool? isAllowMp3Download, bool? isWebStreamable, bool? isDownloadable, bool? isTransposable, bool? isStreamable, bool? isHasPreview, String? fileUploadIdentifier, String? attachmentTypeIds, Map<
String, List< ? withRelationships, List<PcoResource> >PcoResource> ? withIncluded}) -
Create a new PcoServicesAttachment object using this endpoint:
https://api.planningcenteronline.com/services/v2/songs/$songId/arrangements/$arrangementId/attachments
factory - PcoServicesAttachment.empty()
- Create an empty instance of this class. This is only useful when an endpoint requires related or included data.
-
PcoServicesAttachment.fromJson(Map<
String, dynamic> data, {List<Map< ? withIncluded})String, dynamic> >
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
- attachmentTypeIds ↔ String
-
pass
null
to remove key from attributesgetter/setter pair -
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
- canCreate → bool
-
no setteroverride
- canDestroy → bool
-
no setteroverride
- canUpdate → bool
-
no setteroverride
- contentType → String
-
no setter
-
createAllowed
→ List<
String> -
no setteroverride
- createdAt → DateTime
-
no setterinherited
- createPathTemplate → String
-
no setteroverride
- defaultPathTemplate → String
-
no setteroverride
- displayName → String
-
no setter
- fetched ↔ bool
-
indicate whether an item is full or partial
getter/setter pairinherited
- filename ↔ String
-
pass
null
to remove key from attributesgetter/setter pair - fileSize → int
-
no setter
- filetype → String
-
no setter
- fileUploadIdentifier ↔ String
-
pass
null
to remove key from attributesgetter/setter pair - 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
-
includedZooms
→ List<
PcoServicesZoom> -
no setter
- isAllowMp3Download → bool
-
no setter
- isDownloadable → bool
-
no setter
- isHasPreview → bool
-
no setter
- isStreamable → bool
-
no setter
- isTransposable → bool
-
no setter
- isWebStreamable → bool
-
no setter
- licensesPurchased → int
-
no setter
- licensesRemaining → int
-
no setter
- licensesUsed → int
-
no setter
- linkedUrl → String
-
no setter
-
links
→ ReadOnlyMapView<
String, dynamic> -
contains the links data returned by the api if present
no setterinherited
- needsSave → bool
-
no setterinherited
- pageOrder ↔ String
-
pass
null
to remove key from attributesgetter/setter pair - pcoApplication ↔ String
-
latefinalinherited
- pcoType → String
-
no setter
-
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
- remoteLink ↔ String
-
pass
null
to remove key from attributesgetter/setter pair - resourceType ↔ String
-
all planning center resources must have a
type
latefinalinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- slug → String
-
no setterinherited
- thumbnailUrl → String
-
no setter
-
updateAllowed
→ List<
String> -
no setteroverride
- updatedAt → DateTime
-
no setterinherited
- url → String
-
no setter
Methods
-
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< ? withIncluded}) → dynamicString, dynamic> > -
Takes a full JSON:API Response Object (the contents of a "data" field)
will clear and update id, apiPath, attributes and
_relationships
inherited -
getZooms(
{PcoServicesZoomQuery? query}) → Future< PcoCollection< PcoServicesZoom> > -
Will get a collection of PcoServicesZoom objects (expecting many)
using a path like this:
https://api.planningcenteronline.com/services/v2/attachments/1/zooms
-
handleIncludes(
List< Map< included) → voidString, dynamic> > -
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< included = const []]) → Map<String, dynamic> >String, List< PcoResource> > -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
Object data) → Future< PlanningCenterApiResponse< PlanningCenterApiData> > -
ACTION:
open
-
preview(
Object data) → Future< PlanningCenterApiResponse< PlanningCenterApiData> > -
ACTION:
preview
-
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) operationsinherited -
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 ?where
key
=value or ?wheregt|lt
=valueno setter
Static Methods
-
getAllAttachmentsFromServiceTypeAndPlan(
String serviceTypeId, String planId, {PcoServicesAttachmentQuery? query, bool getAll = false, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
of PcoServicesAttachment objects (expecting one) using a path like this:/services/v2/service_types/$serviceTypeId/plans/$planId/all_attachments
-
getAllFromMedia(
String mediaId, {String? id, PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
containing ALL PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/media/$mediaId/attachments
-
getAllFromServiceType(
String serviceTypeId, {String? id, PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
containing ALL PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/service_types/$serviceTypeId/attachments
-
getAllFromServiceTypeAndPlan(
String serviceTypeId, String planId, {String? id, PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
containing ALL PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/service_types/$serviceTypeId/plans/$planId/attachments
-
getAllFromServiceTypeAndPlanAndItem(
String serviceTypeId, String planId, String itemId, {String? id, PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
containing ALL PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/service_types/$serviceTypeId/plans/$planId/items/$itemId/attachments
-
getAllFromSong(
String songId, {String? id, PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
containing ALL PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/songs/$songId/attachments
-
getAllFromSongAndArrangement(
String songId, String arrangementId, {String? id, PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
containing ALL PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/songs/$songId/arrangements/$arrangementId/attachments
-
getAllFromSongAndArrangementAndKey(
String songId, String arrangementId, String keyId, {String? id, PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
containing ALL PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/songs/$songId/arrangements/$arrangementId/keys/$keyId/attachments
-
getFromMedia(
String mediaId, {String? id, PcoServicesAttachmentQuery? query, bool getAll = false, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
of PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/media/$mediaId/attachments
-
getFromServiceType(
String serviceTypeId, {String? id, PcoServicesAttachmentQuery? query, bool getAll = false, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
of PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/service_types/$serviceTypeId/attachments
-
getFromServiceTypeAndPlan(
String serviceTypeId, String planId, {String? id, PcoServicesAttachmentQuery? query, bool getAll = false, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
of PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/service_types/$serviceTypeId/plans/$planId/attachments
-
getFromServiceTypeAndPlanAndItem(
String serviceTypeId, String planId, String itemId, {String? id, PcoServicesAttachmentQuery? query, bool getAll = false, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
of PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/service_types/$serviceTypeId/plans/$planId/items/$itemId/attachments
-
getFromSong(
String songId, {String? id, PcoServicesAttachmentQuery? query, bool getAll = false, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
of PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/songs/$songId/attachments
-
getFromSongAndArrangement(
String songId, String arrangementId, {String? id, PcoServicesAttachmentQuery? query, bool getAll = false, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
of PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/songs/$songId/arrangements/$arrangementId/attachments
-
getFromSongAndArrangementAndKey(
String songId, String arrangementId, String keyId, {String? id, PcoServicesAttachmentQuery? query, bool getAll = false, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
of PcoServicesAttachment objects (expecting many) using a path like this:/services/v2/songs/$songId/arrangements/$arrangementId/keys/$keyId/attachments
-
getSelectedAttachmentFromServiceTypeAndPlanAndItem(
String serviceTypeId, String planId, String itemId, {PcoServicesAttachmentQuery? query, bool getAll = false, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
of PcoServicesAttachment objects (expecting one) using a path like this:/services/v2/service_types/$serviceTypeId/plans/$planId/items/$itemId/selected_attachment
-
getSelectedBackgroundFromServiceTypeAndPlanAndItem(
String serviceTypeId, String planId, String itemId, {PcoServicesAttachmentQuery? query, bool getAll = false, bool includeZooms = false}) → Future< PcoCollection< PcoServicesAttachment> > -
Will get a
PcoCollection
of PcoServicesAttachment objects (expecting one) using a path like this:/services/v2/service_types/$serviceTypeId/plans/$planId/items/$itemId/selected_background
-
getSingleFromMedia(
String mediaId, String id, {PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoServicesAttachment?> -
Will get a single
PcoServicesAttachment
object using a path like this:/services/v2/media/$mediaId/attachments/[id]
-
getSingleFromServiceType(
String serviceTypeId, String id, {PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoServicesAttachment?> -
Will get a single
PcoServicesAttachment
object using a path like this:/services/v2/service_types/$serviceTypeId/attachments/[id]
-
getSingleFromServiceTypeAndPlan(
String serviceTypeId, String planId, String id, {PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoServicesAttachment?> -
Will get a single
PcoServicesAttachment
object using a path like this:/services/v2/service_types/$serviceTypeId/plans/$planId/attachments/[id]
-
getSingleFromServiceTypeAndPlanAndItem(
String serviceTypeId, String planId, String itemId, String id, {PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoServicesAttachment?> -
Will get a single
PcoServicesAttachment
object using a path like this:/services/v2/service_types/$serviceTypeId/plans/$planId/items/$itemId/attachments/[id]
-
getSingleFromSong(
String songId, String id, {PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoServicesAttachment?> -
Will get a single
PcoServicesAttachment
object using a path like this:/services/v2/songs/$songId/attachments/[id]
-
getSingleFromSongAndArrangement(
String songId, String arrangementId, String id, {PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoServicesAttachment?> -
Will get a single
PcoServicesAttachment
object using a path like this:/services/v2/songs/$songId/arrangements/$arrangementId/attachments/[id]
-
getSingleFromSongAndArrangementAndKey(
String songId, String arrangementId, String keyId, String id, {PcoServicesAttachmentQuery? query, bool includeZooms = false}) → Future< PcoServicesAttachment?> -
Will get a single
PcoServicesAttachment
object using a path like this:/services/v2/songs/$songId/arrangements/$arrangementId/keys/$keyId/attachments/[id]
Constants
- kAllowMp3Download → const String
- kApiVersion → const String
- kAttachmentTypeIds → const String
- kContentType → const String
- kCreatedAt → const String
- kCreatePathTemplate → const String
- kDefaultPathTemplate → const String
- kDisplayName → const String
- kDownloadable → const String
- kFilename → const String
- kFileSize → const String
- kFiletype → const String
- kFileUploadIdentifier → const String
- kHasPreview → const String
- kId → const String
- kLicensesPurchased → const String
- kLicensesRemaining → const String
- kLicensesUsed → const String
- kLinkedUrl → const String
- kPageOrder → const String
- kPcoApplication → const String
- kPcoType → const String
- kRemoteLink → const String
- kStreamable → const String
- kThumbnailUrl → const String
- kTransposable → const String
- kTypeId → const String
- kTypeString → const String
- kUpdatedAt → const String
- kUrl → const String
- kWebStreamable → const String