Blazor Diffusion

<back to all web services

UserData

User
Requires Authentication
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BlazorDiffusion.ServiceModel

Namespace Global

    Namespace BlazorDiffusion.ServiceModel

        Public Partial Class AlbumResult
            Public Overridable Property Id As Integer
            Public Overridable Property Name As String
            Public Overridable Property Slug As String
            Public Overridable Property AlbumRef As String
            Public Overridable Property OwnerRef As String
            Public Overridable Property PrimaryArtifactId As Integer?
            Public Overridable Property Score As Integer
            Public Overridable Property ArtifactIds As List(Of Integer) = New List(Of Integer)
        End Class

        Public Partial Class Likes
            Public Overridable Property ArtifactIds As List(Of Integer) = New List(Of Integer)
            Public Overridable Property AlbumIds As List(Of Integer) = New List(Of Integer)
        End Class

        Public Enum SignupType
            Updates
            Beta
        End Enum

        <ValidateRequest(Validator:="IsAuthenticated")>
        Public Partial Class UserData
            Implements IPost
        End Class

        Public Partial Class UserDataResponse
            Public Overridable Property User As UserResult
            Public Overridable Property Profile As UserProfile
            Public Overridable Property Signups As List(Of SignupType) = New List(Of SignupType)
            Public Overridable Property Roles As String() = New String(){}
            Public Overridable Property ResponseStatus As ResponseStatus
        End Class

        Public Partial Class UserProfile
            Public Overridable Property DisplayName As String
            Public Overridable Property Avatar As String
            Public Overridable Property Handle As String
        End Class

        Public Partial Class UserResult
            Public Overridable Property RefId As String
            Public Overridable Property Handle As String
            Public Overridable Property Avatar As String
            Public Overridable Property ProfileUrl As String
            Public Overridable Property Likes As Likes
            Public Overridable Property Albums As List(Of AlbumResult) = New List(Of AlbumResult)
        End Class
    End Namespace
End Namespace

VB.NET UserData DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /jsv/reply/UserData HTTP/1.1 
Host: blazordiffusion.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	user: 
	{
		refId: String,
		handle: String,
		avatar: String,
		profileUrl: String,
		likes: 
		{
			artifactIds: 
			[
				0
			],
			albumIds: 
			[
				0
			]
		},
		albums: 
		[
			{
				id: 0,
				name: String,
				slug: String,
				albumRef: String,
				ownerRef: String,
				primaryArtifactId: 0,
				score: 0,
				artifactIds: 
				[
					0
				]
			}
		]
	},
	profile: 
	{
		displayName: String,
		avatar: String,
		handle: String
	},
	signups: 
	[
		Updates
	],
	roles: 
	[
		String
	],
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}