| 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 .other suffix or ?format=other
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/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
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"}}}