Blazor Diffusion

<back to all web services

UpdateAlbumArtifact

Albums
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 Album
            Inherits AuditBase
            Public Overridable Property Id As Integer
            Public Overridable Property Name As String
            Public Overridable Property Description As String
            Public Overridable Property Slug As String
            Public Overridable Property Tags As List(Of String) = New List(Of String)
            Public Overridable Property RefId As String
            Public Overridable Property OwnerId As Integer
            Public Overridable Property OwnerRef As String
            Public Overridable Property PrimaryArtifactId As Integer?
            Public Overridable Property [Private] As Boolean
            Public Overridable Property Rating As Integer?
            Public Overridable Property LikesCount As Integer
            Public Overridable Property DownloadsCount As Integer
            Public Overridable Property SearchCount As Integer
            Public Overridable Property Score As Integer
            Public Overridable Property Rank As Integer
            Public Overridable Property PrefColumns As Integer?
            Public Overridable Property Artifacts As List(Of AlbumArtifact) = New List(Of AlbumArtifact)
        End Class

        Public Partial Class AlbumArtifact
            Public Overridable Property Id As Integer
            <References(GetType(Album))>
            Public Overridable Property AlbumId As Integer

            <References(GetType(Artifact))>
            Public Overridable Property ArtifactId As Integer

            Public Overridable Property Description As String
            Public Overridable Property CreatedDate As Date
            Public Overridable Property ModifiedDate As Date
            Public Overridable Property Artifact As Artifact
        End Class

        Public Partial Class Artifact
            Inherits AuditBase
            Public Overridable Property Id As Integer
            <References(GetType(Creative))>
            Public Overridable Property CreativeId As Integer

            Public Overridable Property FileName As String
            Public Overridable Property FilePath As String
            Public Overridable Property ContentType As String
            Public Overridable Property ContentLength As Long
            Public Overridable Property Width As Integer
            Public Overridable Property Height As Integer
            Public Overridable Property Seed As UInt64
            Public Overridable Property Prompt As String
            Public Overridable Property Nsfw As Boolean?
            Public Overridable Property AverageHash As Long?
            Public Overridable Property PerceptualHash As Long?
            Public Overridable Property DifferenceHash As Long?
            Public Overridable Property Background As String
            Public Overridable Property Lqip As String
            Public Overridable Property Quality As Integer
            Public Overridable Property LikesCount As Integer
            Public Overridable Property AlbumsCount As Integer
            Public Overridable Property DownloadsCount As Integer
            Public Overridable Property SearchCount As Integer
            Public Overridable Property TemporalScore As Integer
            Public Overridable Property Score As Integer
            Public Overridable Property Rank As Integer
            Public Overridable Property RefId As String
            Public Overridable Property Versions As Dictionary(Of String, String) = New Dictionary(Of String, String)
        End Class

        <ValidateRequest(Validator:="IsAuthenticated")>
        Public Partial Class UpdateAlbumArtifact
            Implements IPatchDb(Of Album)
            Public Overridable Property Id As Long
            Public Overridable Property Name As String
            Public Overridable Property Description As String
            Public Overridable Property Slug As String
            Public Overridable Property Tags As List(Of String)
            Public Overridable Property PrimaryArtifactId As Integer?
            Public Overridable Property AddArtifactIds As List(Of Integer)
            Public Overridable Property RemoveArtifactIds As List(Of Integer)
        End Class
    End Namespace

    Namespace ServiceStack

        <DataContract>
        Public Partial Class AuditBase
            <DataMember(Order:=1)>
            Public Overridable Property CreatedDate As Date

            <DataMember(Order:=2)>
            <Required>
            Public Overridable Property CreatedBy As String

            <DataMember(Order:=3)>
            Public Overridable Property ModifiedDate As Date

            <DataMember(Order:=4)>
            <Required>
            Public Overridable Property ModifiedBy As String

            <DataMember(Order:=5)>
            Public Overridable Property DeletedDate As Date?

            <DataMember(Order:=6)>
            Public Overridable Property DeletedBy As String
        End Class
    End Namespace
End Namespace

VB.NET UpdateAlbumArtifact 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/UpdateAlbumArtifact HTTP/1.1 
Host: blazordiffusion.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	id: 0,
	name: String,
	description: String,
	slug: String,
	tags: 
	[
		String
	],
	primaryArtifactId: 0,
	addArtifactIds: 
	[
		0
	],
	removeArtifactIds: 
	[
		0
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: 0,
	name: String,
	description: String,
	slug: String,
	tags: 
	[
		String
	],
	refId: String,
	ownerId: 0,
	ownerRef: String,
	primaryArtifactId: 0,
	private: False,
	rating: 0,
	likesCount: 0,
	downloadsCount: 0,
	searchCount: 0,
	score: 0,
	rank: 0,
	prefColumns: 0,
	artifacts: 
	[
		{
			id: 0,
			albumId: 0,
			artifactId: 0,
			description: String,
			createdDate: 0001-01-01,
			modifiedDate: 0001-01-01,
			artifact: 
			{
				id: 0,
				creativeId: 0,
				fileName: String,
				filePath: String,
				contentType: String,
				contentLength: 0,
				width: 0,
				height: 0,
				seed: 0,
				prompt: String,
				nsfw: False,
				averageHash: 0,
				perceptualHash: 0,
				differenceHash: 0,
				background: String,
				lqip: String,
				quality: 0,
				likesCount: 0,
				albumsCount: 0,
				downloadsCount: 0,
				searchCount: 0,
				temporalScore: 0,
				score: 0,
				rank: 0,
				refId: String,
				versions: 
				{
					String: String
				},
				createdDate: 0001-01-01,
				createdBy: String,
				modifiedDate: 0001-01-01,
				modifiedBy: String,
				deletedDate: 0001-01-01,
				deletedBy: String
			}
		}
	],
	createdDate: 0001-01-01,
	createdBy: String,
	modifiedDate: 0001-01-01,
	modifiedBy: String,
	deletedDate: 0001-01-01,
	deletedBy: String
}