Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def cast(obj, class_name=None, resp=None):
return Resource.cast_json(obj, class_name, resp)
"my_bool": bool,
"my_datetime": datetime,
"my_sub_resource": "MySubResource",
"my_sub_resources": ["MySubResource"],
}
class MySubResource(Resource):
schema = {"object": str, "my_string": str}
class Error(Resource):
schema = {"object": str, "message": str, "params": list, "type": str}
class Empty(Resource):
schema = {}
from recurly import Resource
import datetime
class MyResource(Resource):
schema = {
"object": str,
"my_string": str,
"my_int": int,
"my_float": float,
"my_bool": bool,
"my_datetime": datetime,
"my_sub_resource": "MySubResource",
"my_sub_resources": ["MySubResource"],
}
class MySubResource(Resource):
schema = {"object": str, "my_string": str}
"object": str,
"my_string": str,
"my_int": int,
"my_float": float,
"my_bool": bool,
"my_datetime": datetime,
"my_sub_resource": "MySubResource",
"my_sub_resources": ["MySubResource"],
}
class MySubResource(Resource):
schema = {"object": str, "my_string": str}
class Error(Resource):
schema = {"object": str, "message": str, "params": list, "type": str}
class Empty(Resource):
schema = {}
class MyResource(Resource):
schema = {
"object": str,
"my_string": str,
"my_int": int,
"my_float": float,
"my_bool": bool,
"my_datetime": datetime,
"my_sub_resource": "MySubResource",
"my_sub_resources": ["MySubResource"],
}
class MySubResource(Resource):
schema = {"object": str, "my_string": str}
class Error(Resource):
schema = {"object": str, "message": str, "params": list, "type": str}
class Empty(Resource):
schema = {}
def fetch(token):
url = urljoin(recurly.base_uri(), 'recurly_js/result/%s' % token)
resp, elem = recurly.Resource.element_for_url(url)
cls = recurly.Resource.value_for_element(elem)
return cls.from_element(elem)
def fetch(token):
url = urljoin(recurly.base_uri(), 'recurly_js/result/%s' % token)
resp, elem = recurly.Resource.element_for_url(url)
cls = recurly.Resource.value_for_element(elem)
return cls.from_element(elem)