RAPP Platform API
Main Page
Packages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
WeatherReportForecast.py
Go to the documentation of this file.
1
from
RappCloud.Objects
import
(
2
File,
3
Payload)
4
5
from
Cloud
import
(
6
CloudMsg,
7
CloudRequest,
8
CloudResponse)
9
10
11
class
WeatherReportForecast
(CloudMsg):
12
""" Weather Report Forecast Cloud Message object """
13
14
class
Request
(CloudRequest):
15
""" Weather Report Forecast Cloud Request object.
16
17
WeatherReportForecast.Request
18
"""
19
def
__init__
(self, **kwargs):
20
"""!
21
Constructor
22
23
@param **kwargs - Keyword arguments. Apply values to the request attributes.
24
- @ref city
25
- @ref weather_reporter
26
- @ref metric
27
"""
28
29
## The desired city
30
self.
city
=
''
31
## The weather API to use. Defaults to "yweather" .
32
self.
weather_reporter
=
''
33
## The return value units.
34
self.
metric
= 0
35
super(
WeatherReportForecast.Request
, self).
__init__
(**kwargs)
36
37
38
def
make_payload
(self):
39
""" Create and return the Payload of the Request. """
40
return
Payload(
41
city=self.
city
,
42
weather_reporter=self.
weather_reporter
,
43
metric=self.
metric
44
)
45
46
47
def
make_files
(self):
48
""" Create and return Array of File objects of the Request. """
49
return
[]
50
51
52
class
Response
(CloudResponse):
53
""" Weather Report Forecast Cloud Response object.
54
55
WeatherReportForecast.Response
56
"""
57
def
__init__
(self, **kwargs):
58
"""!
59
Constructor
60
61
@param **kwargs - Keyword arguments. Apply values to the request attributes.
62
- @ref error
63
- @ref forecast
64
"""
65
66
## Error message
67
self.
error
=
''
68
## Array of forecastEntry objects, where forecastEntry is of structure:
69
# {high_temp: '', low_temp: '', description: '', date: ''}
70
self.
forecast
= []
71
super(
WeatherReportForecast.Response
, self).
__init__
(**kwargs)
72
73
74
def
__init__
(self, **kwargs):
75
"""!
76
Constructor
77
78
@param **kwargs - Keyword argumen.ts. Apply values to the request attributes.
79
- @ref Request.city
80
- @ref Request.weather_reporter
81
- @ref Request.metric
82
"""
83
84
# Create and hold the Request object for this CloudMsg
85
self.
req
=
WeatherReportForecast.Request
()
86
# Create and hold the Response object for this CloudMsg
87
self.
resp
=
WeatherReportForecast.Response
()
88
super(WeatherReportForecast, self).
__init__
(
89
svcname=
'weather_report_forecast'
, **kwargs)
90
91
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.Request.metric
metric
The return value units.
Definition:
WeatherReportForecast.py:34
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.Request.weather_reporter
weather_reporter
The weather API to use.
Definition:
WeatherReportForecast.py:32
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.__init__
def __init__
Constructor.
Definition:
WeatherReportForecast.py:74
RappCloud.Objects
Definition:
__init__.py:1
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.Response
Definition:
WeatherReportForecast.py:52
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.Request.__init__
def __init__
Constructor.
Definition:
WeatherReportForecast.py:19
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.resp
resp
Definition:
WeatherReportForecast.py:87
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.Response.error
error
Error message.
Definition:
WeatherReportForecast.py:67
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.req
req
Definition:
WeatherReportForecast.py:85
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.Response.__init__
def __init__
Constructor.
Definition:
WeatherReportForecast.py:57
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.Request.make_files
def make_files
Definition:
WeatherReportForecast.py:47
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.Request.make_payload
def make_payload
Definition:
WeatherReportForecast.py:38
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast
Definition:
WeatherReportForecast.py:11
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.Response.forecast
forecast
Array of forecastEntry objects, where forecastEntry is of structure: {high_temp: '', low_temp: '', description: '', date: ''}.
Definition:
WeatherReportForecast.py:70
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.Request.city
city
The desired city.
Definition:
WeatherReportForecast.py:30
RappCloud.CloudMsgs.WeatherReportForecast.WeatherReportForecast.Request
Definition:
WeatherReportForecast.py:14
python
RappCloud
CloudMsgs
WeatherReportForecast.py
Generated on Fri Jul 29 2016 18:45:01 for RAPP Platform API by
1.8.6