<back to all web services

UpdateService

The following routes are available for this service:
PUT/RestApi/apiservice/updateService/{OldUrlName}
import Foundation
import ServiceStack

public class UpdateService : ServiceBaseRequest
{
    public var oldUrlName:String

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case oldUrlName
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        oldUrlName = try container.decodeIfPresent(String.self, forKey: .oldUrlName)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if oldUrlName != nil { try container.encode(oldUrlName, forKey: .oldUrlName) }
    }
}

public class ServiceBaseRequest : Codable
{
    public var route:String
    public var name:String
    public var urlName:String
    public var enabled:Bool
    public var apiKey:String
    public var accessControlAllowOrigin:String
    public var autogenerateTypes:Bool
    public var access:String
    public var types:[ContentsProxy] = []
    public var `protocol`:String

    required public init(){}
}

public class ContentsProxy : Codable
{
    public var name:String
    public var readOnly:Bool
    public var urlKey:String
    public var clrType:String
    public var access:String
    public var properties:[PropertiesProxy] = []
    public var children:[ContentsProxy] = []
    public var autogenerateProperties:Bool
    public var parentId:String

    required public init(){}
}

public class PropertiesProxy : Codable
{
    public var name:String
    public var propertyType:String
    public var isPersistent:Bool
    public var allowSort:Bool
    public var allowFilter:Bool
    public var isKey:Bool

    required public init(){}
}


Swift UpdateService 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.

PUT /RestApi/apiservice/updateService/{OldUrlName} HTTP/1.1 
Host: www.asg.com.au 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	OldUrlName: String,
	Route: String,
	Name: String,
	UrlName: String,
	Enabled: False,
	ApiKey: String,
	AccessControlAllowOrigin: String,
	AutogenerateTypes: False,
	Access: String,
	Protocol: String
}