Trendsic Platform Service

<back to all web services

CoverageSelfAvailPutRequest

Requires Authentication
The following routes are available for this service:
PUT,OPTIONS/v1/coverage/self/availability
import Foundation
import ServiceStack

public class CoverageSelfAvailPutRequest : Codable
{
    public var days:[CoverageSelfAvailDay] = []
    public var prefs:WorkerSchedulingPrefs

    required public init(){}
}

public class CoverageSelfAvailDay : Codable
{
    public var day:String
    public var open:Bool
    public var windows:[CoverageSelfAvailWindow] = []

    required public init(){}
}

public class CoverageSelfAvailWindow : Codable
{
    public var start:String
    public var end:String
    public var preferred:Bool

    required public init(){}
}

public class WorkerSchedulingPrefs : Codable
{
    public var contactID:Int
    public var preferredWeeklyHours:Int?
    public var preferredMonthlyHours:Int?
    public var minShiftMinutes:Int?
    public var maxConsecutiveDays:Int?

    required public init(){}
}

public class CoverageSelfAvailResponse : Codable
{
    public var responseStatus:ResponseStatus
    public var days:[CoverageSelfAvailDay] = []
    public var prefs:WorkerSchedulingPrefs
    public var rulesSummary:String
    public var timeOffNoticeDays:Int

    required public init(){}
}


Swift CoverageSelfAvailPutRequest 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 /v1/coverage/self/availability HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Days: 
	[
		{
			Day: String,
			Open: False,
			Windows: 
			[
				{
					Start: String,
					End: String,
					Preferred: False
				}
			]
		}
	],
	Prefs: 
	{
		ContactID: 0,
		PreferredWeeklyHours: 0,
		PreferredMonthlyHours: 0,
		MinShiftMinutes: 0,
		MaxConsecutiveDays: 0
	}
}
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
		}
	},
	Days: 
	[
		{
			Day: String,
			Open: False,
			Windows: 
			[
				{
					Start: String,
					End: String,
					Preferred: False
				}
			]
		}
	],
	Prefs: 
	{
		ContactID: 0,
		PreferredWeeklyHours: 0,
		PreferredMonthlyHours: 0,
		MinShiftMinutes: 0,
		MaxConsecutiveDays: 0
	},
	RulesSummary: String,
	TimeOffNoticeDays: 0
}