RAPP Platform API
Main Page
Packages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Geolocation.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
Geolocation
(CloudMsg):
12
""" Geolocation Cloud Message object """
13
14
class
Request
(CloudRequest):
15
""" Geolocation Cloud Request object.
16
17
Geolocation.Request
18
"""
19
def
__init__
(self, **kwargs):
20
"""!
21
Constructor
22
23
@param **kwargs - Keyword arguments. Apply values to the request attributes.
24
- @ref ipaddr
25
- @ref engine
26
"""
27
28
## The machine's ipv4 address.
29
self.
ipaddr
=
''
30
## Engine to use. Defaults to 'ip-api' (Currently the only supported).
31
self.
engine
=
''
32
super(
Geolocation.Request
, self).
__init__
(**kwargs)
33
34
35
def
make_payload
(self):
36
""" Create and return the Payload of the Request. """
37
return
Payload(
38
ipaddr=self.
ipaddr
,
39
engine=self.
engine
)
40
41
42
def
make_files
(self):
43
""" Create and return Array of File objects of the Request. """
44
return
[]
45
46
47
class
Response
(CloudResponse):
48
""" Geolocation Cloud Response object.
49
50
Geolocation.Response
51
"""
52
def
__init__
(self, **kwargs):
53
"""!
54
Constructor
55
56
@param **kwargs - Keyword arguments. Apply values to the request attributes.
57
- @ref error
58
- @ref city
59
- @ref country
60
- @ref country_code
61
- @ref latitude
62
- @ref longtitude
63
- @ref timezone
64
- @ref zip
65
"""
66
67
## Error message
68
self.
error
=
''
69
## City location
70
self.
city
=
''
71
## Country location
72
self.
country
=
''
73
## Location's country code
74
self.
country_code
=
''
75
## The latitude
76
self.
latitude
= 0.0
77
## The longtitude
78
self.
longtitude
= 0.0
79
## Location region
80
self.
region
=
''
81
## Location timezone
82
self.
timezone
=
''
83
## Location zip-postal code
84
self.
zip
=
''
85
super(
Geolocation.Response
, self).
__init__
(**kwargs)
86
87
88
def
__init__
(self, **kwargs):
89
"""!
90
Constructor
91
92
@param **kwargs - Keyword argumen.ts. Apply values to the request attributes.
93
- @ref Request.ipaddr
94
- @ref Request.engine
95
"""
96
97
# Create and hold the Request object for this CloudMsg
98
self.
req
=
Geolocation.Request
()
99
# Create and hold the Response object for this CloudMsg
100
self.
resp
=
Geolocation.Response
()
101
super(Geolocation, self).
__init__
(svcname=
'geolocation'
, **kwargs)
102
103
RappCloud.CloudMsgs.Geolocation.Geolocation.Response.timezone
timezone
Location timezone.
Definition:
Geolocation.py:82
RappCloud.CloudMsgs.Geolocation.Geolocation.Response.longtitude
longtitude
The longtitude.
Definition:
Geolocation.py:78
RappCloud.CloudMsgs.Geolocation.Geolocation.Response.country_code
country_code
Location's country code.
Definition:
Geolocation.py:74
RappCloud.CloudMsgs.Geolocation.Geolocation.__init__
def __init__
Constructor.
Definition:
Geolocation.py:88
RappCloud.Objects
Definition:
__init__.py:1
RappCloud.CloudMsgs.Geolocation.Geolocation.Request.ipaddr
ipaddr
The machine's ipv4 address.
Definition:
Geolocation.py:29
RappCloud.CloudMsgs.Geolocation.Geolocation.Response.latitude
latitude
The latitude.
Definition:
Geolocation.py:76
RappCloud.CloudMsgs.Geolocation.Geolocation.Response.region
region
Location region.
Definition:
Geolocation.py:80
RappCloud.CloudMsgs.Geolocation.Geolocation.Response.error
error
Error message.
Definition:
Geolocation.py:68
RappCloud.CloudMsgs.Geolocation.Geolocation.Request.make_payload
def make_payload
Definition:
Geolocation.py:35
RappCloud.CloudMsgs.Geolocation.Geolocation.req
req
Definition:
Geolocation.py:98
RappCloud.CloudMsgs.Geolocation.Geolocation.Response.__init__
def __init__
Constructor.
Definition:
Geolocation.py:52
RappCloud.CloudMsgs.Geolocation.Geolocation.Response.city
city
City location.
Definition:
Geolocation.py:70
RappCloud.CloudMsgs.Geolocation.Geolocation
Definition:
Geolocation.py:11
RappCloud.CloudMsgs.Geolocation.Geolocation.Request.engine
engine
Engine to use.
Definition:
Geolocation.py:31
RappCloud.CloudMsgs.Geolocation.Geolocation.Response.zip
zip
Location zip-postal code.
Definition:
Geolocation.py:84
RappCloud.CloudMsgs.Geolocation.Geolocation.Response.country
country
Country location.
Definition:
Geolocation.py:72
RappCloud.CloudMsgs.Geolocation.Geolocation.resp
resp
Definition:
Geolocation.py:100
RappCloud.CloudMsgs.Geolocation.Geolocation.Request
Definition:
Geolocation.py:14
RappCloud.CloudMsgs.Geolocation.Geolocation.Request.make_files
def make_files
Definition:
Geolocation.py:42
RappCloud.CloudMsgs.Geolocation.Geolocation.Response
Definition:
Geolocation.py:47
RappCloud.CloudMsgs.Geolocation.Geolocation.Request.__init__
def __init__
Constructor.
Definition:
Geolocation.py:19
python
RappCloud
CloudMsgs
Geolocation.py
Generated on Fri Jul 29 2016 18:45:01 for RAPP Platform API by
1.8.6