Trendsic Platform Service

<back to all web services

CoverageWeatherPreviewRequest

Requires Authentication
The following routes are available for this service:
GET/v1/coverage/weather/preview
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CoverageWeatherItem:
    job_i_d: int = 0
    job_name: Optional[str] = None
    crew_count: int = 0
    note: Optional[str] = None
    tone: Optional[str] = None
    must_fill: bool = False
    prevailing_wage: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CoverageExplanationSource:
    policy_name: Optional[str] = None
    cascade_level: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CoverageExplanationOverride:
    who: Optional[str] = None
    consequence: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CoverageExplanation:
    plain_sentence: Optional[str] = None
    rule_id: Optional[str] = None
    rule_name: Optional[str] = None
    demand: Optional[str] = None
    source: Optional[CoverageExplanationSource] = None
    kind: Optional[str] = None
    why_it_exists: Optional[str] = None
    what_would_change_it: Optional[str] = None
    override: Optional[CoverageExplanationOverride] = None
    drill: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CoverageEffect:
    icon: Optional[str] = None
    text: Optional[str] = None
    rule_id: Optional[str] = None
    expl: Optional[CoverageExplanation] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CoverageWeatherPreviewResponse:
    banner: Optional[str] = None
    scope_line: Optional[str] = None
    items: List[CoverageWeatherItem] = field(default_factory=list)
    conseq: List[CoverageEffect] = field(default_factory=list)
    customer_count: int = 0
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CoverageWeatherPreviewRequest:
    scope_date: datetime.datetime = datetime.datetime(1, 1, 1)
    branch_id: Optional[str] = None

Python CoverageWeatherPreviewRequest 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.

GET /v1/coverage/weather/preview HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Banner: String,
	ScopeLine: String,
	Items: 
	[
		{
			JobID: 0,
			JobName: String,
			CrewCount: 0,
			Note: String,
			Tone: String,
			MustFill: False,
			PrevailingWage: False
		}
	],
	Conseq: 
	[
		{
			Icon: String,
			Text: String,
			RuleId: String,
			Expl: 
			{
				PlainSentence: String,
				RuleId: String,
				RuleName: String,
				Demand: String,
				Source: 
				{
					PolicyName: String,
					CascadeLevel: String
				},
				Kind: String,
				WhyItExists: String,
				WhatWouldChangeIt: String,
				Override: 
				{
					Who: String,
					Consequence: String
				},
				Drill: String
			}
		}
	],
	CustomerCount: 0,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}