Trendsic Platform Service

<back to all web services

BranchWeatherRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/weather/branch
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 WeatherDay:
    date: Optional[str] = None
    day_label: Optional[str] = None
    short_forecast: Optional[str] = None
    temp_hi: Optional[int] = None
    temp_lo: Optional[int] = None
    temp_unit: Optional[str] = None
    pop: Optional[int] = None
    severity: Optional[str] = None
    has_alert: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class WeatherForecastResponse:
    branch_name: Optional[str] = None
    resolved: bool = False
    alert_headline: Optional[str] = None
    days: List[WeatherDay] = field(default_factory=list)
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BranchWeatherRequest:
    branch_id: Optional[str] = None
    start: Optional[str] = None
    days: Optional[int] = None

Python BranchWeatherRequest 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/weather/branch HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	BranchName: String,
	Resolved: False,
	AlertHeadline: String,
	Days: 
	[
		{
			Date: String,
			DayLabel: String,
			ShortForecast: String,
			TempHi: 0,
			TempLo: 0,
			TempUnit: String,
			Pop: 0,
			Severity: String,
			HasAlert: False
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}