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
'''<Summary>
'''Validation/Error message details
'''</Summary>
<ApiMember(DataType:="Guid", Description:="Validation/Error message details", Name:="Message", ParameterType:="body")>
Public Overridable Property Message As String
'''<Summary>
'''Summary/label of validation/error
'''</Summary>
<ApiMember(DataType:="Guid", Description:="Summary/label of validation/error", Name:="Key", ParameterType:="body")>
Public Overridable Property Key As String
'''<Summary>
'''Key/code representing validation/error
'''</Summary>
<ApiMember(DataType:="Guid", Description:="Key/code representing validation/error", Name:="ErrorCode", ParameterType:="body")>
Public Overridable Property ErrorCode As String
End Class
Public Partial Class ValidationErrorList
'''<Summary>
'''List of any validation/errors occuring during a method call
'''</Summary>
<ApiMember(DataType:="List<RuleValidationResult>", Description:="List of any validation/errors occuring during a method call", Name:="ValidationErrors", ParameterType:="body")>
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:="body")>
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:="body")>
Public Overridable Property AlternateKey As String Implements ISubscription.AlternateKey
'''<Summary>
'''Guid of the contact role object within PSTPF. 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 PSTPF. If ObjectId is known, the external system may pass this instead of the alternate key.", Name:="ObjectId", ParameterType:="body")>
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:="body")>
Public Overridable Property ContactRole As SubscriptionContactRoleModel
End Class
Public Partial Class SubscriptionContactRoleModel
'''<Summary>
'''Name of the role.
'''</Summary>
<ApiMember(DataType:="string", Description:="Name of the role.", Name:="RoleName", ParameterType:="body")>
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:="body")>
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:="body")>
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:="body")>
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:="body")>
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:="body")>
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 .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /xml/reply/SaveContactRole HTTP/1.1
Host: production-eros-platform-apisubscription.azurewebsites.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SaveContactRole xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModelSubscription">
<_x003C_ValidationErrors_x003E_k__BackingField xmlns="http://schemas.datacontract.org/2004/07/Eros.Saguna.Common.Library.ValidationEngine">
<RuleValidationResult>
<_x003C_ErrorCode_x003E_k__BackingField>String</_x003C_ErrorCode_x003E_k__BackingField>
<_x003C_Key_x003E_k__BackingField>String</_x003C_Key_x003E_k__BackingField>
<_x003C_Message_x003E_k__BackingField>String</_x003C_Message_x003E_k__BackingField>
<_x003C_RuleCode_x003E_k__BackingField>String</_x003C_RuleCode_x003E_k__BackingField>
<_x003C_Tag_x003E_k__BackingField>String</_x003C_Tag_x003E_k__BackingField>
</RuleValidationResult>
</_x003C_ValidationErrors_x003E_k__BackingField>
<AlternateKey>String</AlternateKey>
<ContactRole>
<ContactTypes xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:guid>00000000-0000-0000-0000-000000000000</d3p1:guid>
</ContactTypes>
<ListItemFilters xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:guid>00000000-0000-0000-0000-000000000000</d3p1:guid>
</ListItemFilters>
<RequireContactsToAccept>false</RequireContactsToAccept>
<RoleDescription>String</RoleDescription>
<RoleName>String</RoleName>
<RoleShortName>String</RoleShortName>
</ContactRole>
<ObjectId>00000000-0000-0000-0000-000000000000</ObjectId>
<SuiteDataSourceInstanceId>00000000-0000-0000-0000-000000000000</SuiteDataSourceInstanceId>
</SaveContactRole>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ResponseStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<ErrorCode>String</ErrorCode>
<Message>String</Message>
<StackTrace>String</StackTrace>
<Errors>
<ResponseError>
<ErrorCode>String</ErrorCode>
<FieldName>String</FieldName>
<Message>String</Message>
<Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value>String</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</Meta>
</ResponseError>
</Errors>
<Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringstring>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>String</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</Meta>
</ResponseStatus>