| GET | /api/automation/notification/{ObjectId}/list | ||
|---|---|---|---|
| GET | /api/automation/notification/{ObjectId}/list/standard | ||
| GET | /api/automation/notification/{ObjectId}/list/templated |
import Foundation
import ServiceStack
/**
* Get (automation) notifications that are setup for an object
*/
// @Api(Description="Get (automation) notifications that are setup for an object")
public class GetAutomationNotificationsForObject : Codable
{
/**
* Object to retrieve (automation) notifications for.
*/
// @ApiMember(Description="Object to retrieve (automation) notifications for.", ParameterType="path")
public var objectId:String
required public init(){}
}
// @ApiResponse(Description="List of (automation) notifications that are setup for an object.")
public class GetAutomationNotificationsForObjectResponse : Codable
{
/**
* List of (automation) notifications.
*/
// @ApiMember(Description="List of (automation) notifications.")
public var notifications:[AutoNotificationModel]
public var responseStatus:ResponseStatus
required public init(){}
}
public class AutoNotificationModel : AutomationModel
{
/**
* Contact Id of the licensee this notification has been created for.
*/
// @ApiMember(Description="Contact Id of the licensee this notification has been created for.", ParameterType="query")
public var contactIdLicensee:String
/**
* Contact Role Group Id. If the notification is setup for people in a specified contact role group.
*/
// @ApiMember(Description="Contact Role Group Id. If the notification is setup for people in a specified contact role group.", ParameterType="query")
public var contactRoleGroupId:String
/**
* Contact Role Id. If the notification is setup for people in a specified role.
*/
// @ApiMember(Description="Contact Role Id. If the notification is setup for people in a specified role.", ParameterType="query")
public var contactRoleId:String
/**
* Contact Role Name. If the notification is setup for people in a specified role.
*/
// @ApiMember(Description="Contact Role Name. If the notification is setup for people in a specified role.", ParameterType="query")
public var contactRoleName:String
/**
* Contact Id. If the notification is setup for a specific person.
*/
// @ApiMember(Description="Contact Id. If the notification is setup for a specific person.", ParameterType="query")
public var contactId:String
/**
* If true, then only contacts who are connected to the relevant object are notified.
*/
// @ApiMember(Description="If true, then only contacts who are connected to the relevant object are notified.", ParameterType="query")
public var objectContactConnectionRequired:Bool
/**
* Document Notification: If true, then the notification will include a link to download the document.
*/
// @ApiMember(Description="Document Notification: If true, then the notification will include a link to download the document.", ParameterType="query")
public var allowDirectAccess:Bool
/**
* If true, the notification is sent as soon as it can be processed
*/
// @ApiMember(Description="If true, the notification is sent as soon as it can be processed", ParameterType="query")
public var sendImmediately:Bool
/**
* If true, the notification is flagged and sent out when subscription/batch emails are next sent.
*/
// @ApiMember(Description="If true, the notification is flagged and sent out when subscription/batch emails are next sent.", ParameterType="query")
public var batched:Bool
/**
* Document Notification: If true, the notification is sent when a document has a status of draft.
*/
// @ApiMember(Description="Document Notification: If true, the notification is sent when a document has a status of draft.", ParameterType="query")
public var draftStatus:Bool
/**
* Document Notification: If true, the notification is sent when a document has a status of final.
*/
// @ApiMember(Description="Document Notification: If true, the notification is sent when a document has a status of final.", ParameterType="query")
public var finalStatus:Bool
/**
* True if we want to include a report on an email notification.
*/
// @ApiMember(Description="True if we want to include a report on an email notification. ", ParameterType="query")
public var includeReport:Bool
/**
* True if this notification is based on a template.
*/
// @ApiMember(Description="True if this notification is based on a template.", ParameterType="query")
public var isTemplateNotification:Bool
/**
* When Inserting a new notification we can have 1+ roles. They should be passed to this field when inserting.
*/
// @ApiMember(Description="When Inserting a new notification we can have 1+ roles. They should be passed to this field when inserting.", ParameterType="query")
public var roles:[String]
/**
* Communication Type Id.
*/
// @ApiMember(Description="Communication Type Id.", ParameterType="query")
public var communicationTypeId:String
/**
* Communication Type.
*/
// @ApiMember(Description="Communication Type.", ParameterType="query")
public var communicationType:String
/**
* If communication type is email, this is the subject of the email to be sent.
*/
// @ApiMember(Description="If communication type is email, this is the subject of the email to be sent.", ParameterType="query")
public var subject:String
/**
* This is the notification details to be sent.
*/
// @ApiMember(Description="This is the notification details to be sent.", ParameterType="query")
public var body:String
/**
* If true, we will include the relevant project URL in the notification.
*/
// @ApiMember(Description="If true, we will include the relevant project URL in the notification.", ParameterType="query")
public var includeURL:Bool
/**
* The notification Id of a notification setup in Workflow Notification Management to use for the notification.
*/
// @ApiMember(Description="The notification Id of a notification setup in Workflow Notification Management to use for the notification.", ParameterType="query")
public var notificationId:String
/**
* The notification nameof a notification setup in Workflow Notification Management to use for the notification.
*/
// @ApiMember(Description="The notification nameof a notification setup in Workflow Notification Management to use for the notification.", ParameterType="query")
public var notificationName:String
/**
* The suite id the notification is setup for
*/
// @ApiMember(Description="The suite id the notification is setup for", ParameterType="query")
public var suiteId:String
/**
* The suite name the notification is setup for
*/
// @ApiMember(Description="The suite name the notification is setup for", ParameterType="query")
public var suiteName:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case contactIdLicensee
case contactRoleGroupId
case contactRoleId
case contactRoleName
case contactId
case objectContactConnectionRequired
case allowDirectAccess
case sendImmediately
case batched
case draftStatus
case finalStatus
case includeReport
case isTemplateNotification
case roles
case communicationTypeId
case communicationType
case subject
case body
case includeURL
case notificationId
case notificationName
case suiteId
case suiteName
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
contactIdLicensee = try container.decodeIfPresent(String.self, forKey: .contactIdLicensee)
contactRoleGroupId = try container.decodeIfPresent(String.self, forKey: .contactRoleGroupId)
contactRoleId = try container.decodeIfPresent(String.self, forKey: .contactRoleId)
contactRoleName = try container.decodeIfPresent(String.self, forKey: .contactRoleName)
contactId = try container.decodeIfPresent(String.self, forKey: .contactId)
objectContactConnectionRequired = try container.decodeIfPresent(Bool.self, forKey: .objectContactConnectionRequired)
allowDirectAccess = try container.decodeIfPresent(Bool.self, forKey: .allowDirectAccess)
sendImmediately = try container.decodeIfPresent(Bool.self, forKey: .sendImmediately)
batched = try container.decodeIfPresent(Bool.self, forKey: .batched)
draftStatus = try container.decodeIfPresent(Bool.self, forKey: .draftStatus)
finalStatus = try container.decodeIfPresent(Bool.self, forKey: .finalStatus)
includeReport = try container.decodeIfPresent(Bool.self, forKey: .includeReport)
isTemplateNotification = try container.decodeIfPresent(Bool.self, forKey: .isTemplateNotification)
roles = try container.decodeIfPresent([String].self, forKey: .roles) ?? []
communicationTypeId = try container.decodeIfPresent(String.self, forKey: .communicationTypeId)
communicationType = try container.decodeIfPresent(String.self, forKey: .communicationType)
subject = try container.decodeIfPresent(String.self, forKey: .subject)
body = try container.decodeIfPresent(String.self, forKey: .body)
includeURL = try container.decodeIfPresent(Bool.self, forKey: .includeURL)
notificationId = try container.decodeIfPresent(String.self, forKey: .notificationId)
notificationName = try container.decodeIfPresent(String.self, forKey: .notificationName)
suiteId = try container.decodeIfPresent(String.self, forKey: .suiteId)
suiteName = try container.decodeIfPresent(String.self, forKey: .suiteName)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if contactIdLicensee != nil { try container.encode(contactIdLicensee, forKey: .contactIdLicensee) }
if contactRoleGroupId != nil { try container.encode(contactRoleGroupId, forKey: .contactRoleGroupId) }
if contactRoleId != nil { try container.encode(contactRoleId, forKey: .contactRoleId) }
if contactRoleName != nil { try container.encode(contactRoleName, forKey: .contactRoleName) }
if contactId != nil { try container.encode(contactId, forKey: .contactId) }
if objectContactConnectionRequired != nil { try container.encode(objectContactConnectionRequired, forKey: .objectContactConnectionRequired) }
if allowDirectAccess != nil { try container.encode(allowDirectAccess, forKey: .allowDirectAccess) }
if sendImmediately != nil { try container.encode(sendImmediately, forKey: .sendImmediately) }
if batched != nil { try container.encode(batched, forKey: .batched) }
if draftStatus != nil { try container.encode(draftStatus, forKey: .draftStatus) }
if finalStatus != nil { try container.encode(finalStatus, forKey: .finalStatus) }
if includeReport != nil { try container.encode(includeReport, forKey: .includeReport) }
if isTemplateNotification != nil { try container.encode(isTemplateNotification, forKey: .isTemplateNotification) }
if roles != nil { try container.encode(roles, forKey: .roles) }
if communicationTypeId != nil { try container.encode(communicationTypeId, forKey: .communicationTypeId) }
if communicationType != nil { try container.encode(communicationType, forKey: .communicationType) }
if subject != nil { try container.encode(subject, forKey: .subject) }
if body != nil { try container.encode(body, forKey: .body) }
if includeURL != nil { try container.encode(includeURL, forKey: .includeURL) }
if notificationId != nil { try container.encode(notificationId, forKey: .notificationId) }
if notificationName != nil { try container.encode(notificationName, forKey: .notificationName) }
if suiteId != nil { try container.encode(suiteId, forKey: .suiteId) }
if suiteName != nil { try container.encode(suiteName, forKey: .suiteName) }
}
}
public class AutomationModel : Codable
{
/**
* The unique automation Id
*/
// @ApiMember(Description="The unique automation Id", ParameterType="query")
public var automationId:String
/**
* The automation type Id
*/
// @ApiMember(Description="The automation type Id", ParameterType="query")
public var automationTypeId:String
/**
* The automation type
*/
// @ApiMember(Description="The automation type", ParameterType="query")
public var automationType:String
/**
* The object this automation applies to
*/
// @ApiMember(Description="The object this automation applies to", ParameterType="query")
public var objectId:String
/**
* The object name this automation applies to
*/
// @ApiMember(Description="The object name this automation applies to", ParameterType="query")
public var objectName:String
/**
* The Id of the object type that this automation applies to.
*/
// @ApiMember(Description="The Id of the object type that this automation applies to. ", ParameterType="query")
public var rmsTableCtxIdObject:String
/**
* The name of the object type that this automation applies to.
*/
// @ApiMember(Description="The name of the object type that this automation applies to.", ParameterType="query")
public var rmsTableCtxName:String
/**
* A guid list containing the selected system action Id's that trigger this automation.
*/
// @ApiMember(Description="A guid list containing the selected system action Id's that trigger this automation.", ParameterType="query")
public var actionList:[String]
/**
* A comma separated string of the selected system action names that trigger this automation.
*/
// @ApiMember(Description="A comma separated string of the selected system action names that trigger this automation.", ParameterType="query")
public var actions:String
/**
* Name of the automation.
*/
// @ApiMember(Description="Name of the automation.", ParameterType="query")
public var name:String
/**
* Description of the automation
*/
// @ApiMember(Description="Description of the automation", ParameterType="query")
public var Description:String
/**
* Owner Contact Id
*/
// @ApiMember(Description="Owner Contact Id", ParameterType="query")
public var ownerContactId:String
/**
* Record Status of the automation.
*/
// @ApiMember(Description="Record Status of the automation.", ParameterType="query")
public var recordStatus:String
required public init(){}
}
Swift GetAutomationNotificationsForObject DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/automation/notification/{ObjectId}/list HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Notifications":[{"ContactIdLicensee":"00000000-0000-0000-0000-000000000000","ContactRoleGroupId":"00000000-0000-0000-0000-000000000000","ContactRoleId":"00000000-0000-0000-0000-000000000000","ContactRoleName":"String","ContactId":"00000000-0000-0000-0000-000000000000","ObjectContactConnectionRequired":false,"AllowDirectAccess":false,"SendImmediately":false,"Batched":false,"DraftStatus":false,"FinalStatus":false,"IncludeReport":false,"IsTemplateNotification":false,"Roles":["00000000-0000-0000-0000-000000000000"],"CommunicationTypeId":"00000000-0000-0000-0000-000000000000","CommunicationType":"String","Subject":"String","Body":"String","IncludeURL":false,"NotificationId":"00000000-0000-0000-0000-000000000000","NotificationName":"String","SuiteId":"00000000-0000-0000-0000-000000000000","SuiteName":"String","AutomationId":"00000000-0000-0000-0000-000000000000","AutomationTypeId":"00000000-0000-0000-0000-000000000000","AutomationType":"String","ObjectId":"00000000-0000-0000-0000-000000000000","ObjectName":"String","RmsTableCtxIdObject":"00000000-0000-0000-0000-000000000000","RmsTableCtxName":"String","ActionList":["00000000-0000-0000-0000-000000000000"],"Actions":"String","Name":"String","Description":"String","OwnerContactId":"00000000-0000-0000-0000-000000000000","RecordStatus":"String"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}