Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Eros.Subtle.Canvara.WebAPIModel.ServiceModelSubscription
Imports Eros.Saguna.Common.Library.ValidationEngine
Namespace Global
Namespace Eros.Saguna.Common.Library.ValidationEngine
Public Partial Class RuleValidationResult
Public Overridable Property RuleCode As String
Public Overridable Property Message As String
Public Overridable Property Key As String
Public Overridable Property Tag As String
Public Overridable Property ErrorCode As String
End Class
Public Partial Class ValidationErrorList
Public Overridable Property ValidationErrors As List(Of RuleValidationResult)
End Class
End Namespace
Namespace Eros.Subtle.Canvara.WebAPIModel.ServiceModelSubscription
Public Partial Class SaveContactRole
Inherits ValidationErrorList
Implements ISubscription
'''<Summary>
'''Guid representing the external systems data source information.
'''</Summary>
<ApiMember(DataType:="Guid", Description:="Guid representing the external systems data source information.", IsRequired:=true, Name:="SuiteDataSourceInstanceId", ParameterType:="query")>
Public Overridable Property SuiteDataSourceInstanceId As Guid Implements ISubscription.SuiteDataSourceInstanceId
'''<Summary>
'''The unique key that represents the contact role on the external system.
'''</Summary>
<ApiMember(DataType:="string", Description:="The unique key that represents the contact role on the external system.", IsRequired:=true, Name:="AlternateKey", ParameterType:="query")>
Public Overridable Property AlternateKey As String Implements ISubscription.AlternateKey
'''<Summary>
'''Guid of the contact role object within Eros. If ObjectId is known, the external system may pass this instead of the alternate key.
'''</Summary>
<ApiMember(DataType:="Guid", Description:="Guid of the contact role object within Eros. If ObjectId is known, the external system may pass this instead of the alternate key.", Name:="ObjectId", ParameterType:="query")>
Public Overridable Property ObjectId As Guid Implements ISubscription.ObjectId
'''<Summary>
'''Object containing all details of the contact role to be inserted or updated.
'''</Summary>
<ApiMember(DataType:="SubscriptionContactRoleModel", Description:="Object containing all details of the contact role to be inserted or updated.", IsRequired:=true, Name:="ContactRole", ParameterType:="query")>
Public Overridable Property ContactRole As SubscriptionContactRoleModel
Public Overridable Property IgnoreValidation As Boolean Implements ISubscription.IgnoreValidation
End Class
Public Partial Class SubscriptionContactRoleModel
'''<Summary>
'''Name of the role.
'''</Summary>
<ApiMember(DataType:="string", Description:="Name of the role.", Name:="RoleName", ParameterType:="query")>
Public Overridable Property RoleName As String
'''<Summary>
'''Short version of the role name.
'''</Summary>
<ApiMember(DataType:="string", Description:="Short version of the role name.", Name:="RoleShortName", ParameterType:="query")>
Public Overridable Property RoleShortName As String
'''<Summary>
'''Description of the role purpose.
'''</Summary>
<ApiMember(DataType:="string", Description:="Description of the role purpose.", Name:="RoleDescription", ParameterType:="query")>
Public Overridable Property RoleDescription As String
'''<Summary>
'''If true, the role will be pending for a contact until they accept it.
'''</Summary>
<ApiMember(DataType:="bool", Description:="If true, the role will be pending for a contact until they accept it.", Name:="RequireContactsToAccept", ParameterType:="query")>
Public Overridable Property RequireContactsToAccept As Boolean
'''<Summary>
'''Contact Types that may have this role.
'''</Summary>
<ApiMember(DataType:="List<Guid>", Description:="Contact Types that may have this role.", Name:="ContactTypes", ParameterType:="query")>
Public Overridable Property ContactTypes As List(Of Guid)
'''<Summary>
'''Role Filters this role should be added to.
'''</Summary>
<ApiMember(DataType:="List<Guid>", Description:="Role Filters this role should be added to.", Name:="ListItemFilters", ParameterType:="query")>
Public Overridable Property ListItemFilters As List(Of Guid)
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /csv/reply/SaveContactRole HTTP/1.1
Host: production-eros-platform-apisubscription.azurewebsites.net
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"AlternateKey":"String","ContactRole":{"RoleName":"String","RoleShortName":"String","RoleDescription":"String","RequireContactsToAccept":false,"ContactTypes":["00000000-0000-0000-0000-000000000000"],"ListItemFilters":["00000000-0000-0000-0000-000000000000"]},"IgnoreValidation":false,"ValidationErrors":[{"RuleCode":"String","Message":"String","Key":"String","Tag":"String","ErrorCode":"String"}]}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}