PUT | /posts/{Id} |
---|
namespace TechStacks.ServiceModel
open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<AllowNullLiteral>]
type UpdatePostResponse() =
member val ResponseStatus:ResponseStatus = null with get,set
type PostType =
| Announcement = 0
| Post = 1
| Showcase = 2
| Question = 3
| Request = 4
[<AllowNullLiteral>]
type UpdatePost() =
interface IPut
member val Id:Int64 = new Int64() with get,set
member val OrganizationId:Int32 = new Int32() with get,set
member val Type:PostType = new PostType() with get,set
member val CategoryId:Int32 = new Int32() with get,set
member val Title:String = null with get,set
member val Url:String = null with get,set
member val ImageUrl:String = null with get,set
member val Content:String = null with get,set
member val Lock:Nullable<Boolean> = new Nullable<Boolean>() with get,set
member val TechnologyIds:Int32[] = null with get,set
member val Labels:String[] = null with get,set
member val FromDate:Nullable<DateTime> = new Nullable<DateTime>() with get,set
member val ToDate:Nullable<DateTime> = new Nullable<DateTime>() with get,set
member val MetaType:String = null with get,set
member val Meta:String = null with get,set
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /posts/{Id} HTTP/1.1
Host: techstacks.io
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: 0,
organizationId: 0,
type: Announcement,
categoryId: 0,
title: String,
url: String,
imageUrl: String,
content: String,
lock: False,
technologyIds:
[
0
],
labels:
[
String
],
fromDate: 0001-01-01,
toDate: 0001-01-01,
metaType: String,
meta: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } } }