|
|
|
@ -103,7 +103,9 @@ class E911sController(BaseController): |
|
|
|
|
city, |
|
|
|
|
state, |
|
|
|
|
country, |
|
|
|
|
zipcode): |
|
|
|
|
zipcode, |
|
|
|
|
address_type=None, |
|
|
|
|
address_type_number=None): |
|
|
|
|
"""Does a POST request to /v2/e911s/validate. |
|
|
|
|
|
|
|
|
|
Returns a 204 No Content on success, or a 404 with error data |
|
|
|
@ -118,6 +120,8 @@ class E911sController(BaseController): |
|
|
|
|
state (2 character string): |
|
|
|
|
country (string USA or Canada): |
|
|
|
|
zipcode (string postal code) |
|
|
|
|
address_type (string address type) |
|
|
|
|
address_type_number (string when address_type used, required) |
|
|
|
|
|
|
|
|
|
Returns: |
|
|
|
|
mixed: Response from the API. A 204 - No Content or a |
|
|
|
@ -142,11 +146,15 @@ class E911sController(BaseController): |
|
|
|
|
'city': city, |
|
|
|
|
'state': state, |
|
|
|
|
'country': country, |
|
|
|
|
'zip': zipcode |
|
|
|
|
'zip': zipcode, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if address_type and address_type_number: |
|
|
|
|
body['data']['attributes']['address_type'] = address_type |
|
|
|
|
body['data']['attributes']['address_type_number'] = address_type_number |
|
|
|
|
|
|
|
|
|
# Prepare query URL |
|
|
|
|
_query_builder = Configuration.base_uri |
|
|
|
|
_query_builder += '/v2/e911s/validate' |
|
|
|
@ -175,7 +183,9 @@ class E911sController(BaseController): |
|
|
|
|
city, |
|
|
|
|
state, |
|
|
|
|
country, |
|
|
|
|
zipcode): |
|
|
|
|
zipcode, |
|
|
|
|
address_type=None, |
|
|
|
|
address_type_number=None): |
|
|
|
|
"""Does a POST request to /v2/e911s. |
|
|
|
|
|
|
|
|
|
Creates an address record that can then be associated |
|
|
|
@ -191,6 +201,8 @@ class E911sController(BaseController): |
|
|
|
|
state (2 character string): |
|
|
|
|
country (string USA or Canada): |
|
|
|
|
zipcode (string postal code) |
|
|
|
|
address_type (string address type) |
|
|
|
|
address_type_number (string required if address_type specified) |
|
|
|
|
|
|
|
|
|
Returns: |
|
|
|
|
mixed: Response from the API. A JSON object containing the new |
|
|
|
@ -215,11 +227,15 @@ class E911sController(BaseController): |
|
|
|
|
'city': city, |
|
|
|
|
'state': state, |
|
|
|
|
'country': country, |
|
|
|
|
'zip': zipcode |
|
|
|
|
'zip': zipcode, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if address_type and address_type_number: |
|
|
|
|
body['data']['attributes']['address_type'] = address_type |
|
|
|
|
body['data']['attributes']['address_type_number'] = address_type_number |
|
|
|
|
|
|
|
|
|
# Prepare query URL |
|
|
|
|
_query_builder = Configuration.base_uri |
|
|
|
|
_query_builder += '/v2/e911s' |
|
|
|
@ -249,7 +265,9 @@ class E911sController(BaseController): |
|
|
|
|
city=None, |
|
|
|
|
state=None, |
|
|
|
|
country=None, |
|
|
|
|
zipcode=None): |
|
|
|
|
zipcode=None, |
|
|
|
|
address_type=None, |
|
|
|
|
address_type_number=None): |
|
|
|
|
|
|
|
|
|
"""Does a PATCH request to /v2/e911s/<e911_id>. |
|
|
|
|
|
|
|
|
@ -303,6 +321,10 @@ class E911sController(BaseController): |
|
|
|
|
record_data['data']['attributes']['zip'] = str(zipcode) |
|
|
|
|
record_data['data']['attributes']['zip_code'] = str(zipcode) |
|
|
|
|
|
|
|
|
|
record_data['data']['attributes']['address_type'] = address_type |
|
|
|
|
record_data['data']['attributes']['address_type_number'] = \ |
|
|
|
|
address_type_number |
|
|
|
|
|
|
|
|
|
# Fix address_type if not used |
|
|
|
|
if 'address_type' in record_data['data']['attributes'] and \ |
|
|
|
|
record_data['data']['attributes']['address_type'] == u'': |
|
|
|
|