:return: The resource (as json), or None
420520
def filter_resource(self, resource_name, field_name, field_value,
                        result_handler=ONE_RESULT):
        
        return self.multi_filter_resource(resource_name,
                                          {field_name: field_value},
                                          result_handler=result_handler)
299548
def to_api_repr(self):
        
        value = self.value
        converter = _SCALAR_VALUE_TO_JSON_PARAM.get(self.type_)
        if converter is not None:
            value = converter(value)
        resource = {
            "parameterType": {"type": self.type_},
            "parameterValue": {"value": value},
        }
        if self.name is not None:
            resource["name"] = self.name
        return resource
935166
def json(self):
        
        _json = json.loads(self.reader)
        if _json.get('error', None):
            raise HTTPError(_json['error']['errors'])
        return _json
1081343
def get_json(self, path, watch=None):
        """"""
        data, _ = self.get(path, watch)
        return load_json(data) if data else None
210180
def data(self):
        """"""
        if self._resources is None:
            self.__init()
        if "data" in self._resources:
            url = self._url + "/data"
            return _data.Data(url=url,
                              securityHandler=self._securityHandler,
                              initialize=True,
                              proxy_url=self._proxy_url,
                              proxy_port=self._proxy_port)
        else:
            return None
588727
def _parse_json(cls, resources, exactly_one=True):
        
        if not len(resources['features']):  # pragma: no cover
            return None
        if exactly_one:
            return cls.parse_resource(resources['features'][0])
        else:
            return [cls.parse_resource(resource) for resource
                    in resources['features']]
741608
def asJSON(self):
        
        self._json = json.dumps(self.asDictionary)
        return self._json
33046
def as_json(_options = {})
      {
        resource_owner_id: resource_owner_id,
        scope: scopes,
        expires_in: expires_in_seconds,
        application: { uid: application.try(:uid) },
        created_at: created_at.to_i,
      }
    end
43064
def get_data(self):
        
        data = graceful_chain_get(self.json, "data")
        if data is None:
            return {}

        data_dict = {}
        for key in data:
            if self.is_yaml(key):
                data_dict[key] = yaml.load(data[key])
            else:
                data_dict[key] = json.loads(data[key])

        return data_dict
154087
def json_data(self, instance, default=None):
        
        value = self.get(instance)
        return value or default
1204078
def to_json(self):
        
        res = dict()
        res['Handle'] = ''
        res['Name'] = self.name
        res['ImageUrl'] = self.url
        res['Description'] = self.desc
        res["EntityOptions"] = self.options
        return res
1286664
def _build_resource(self):
        """"""
        resource = {"name": self.name}

        if self.dns_name is not None:
            resource["dnsName"] = self.dns_name

        if self.description is not None:
            resource["description"] = self.description

        if self.name_server_set is not None:
            resource["nameServerSet"] = self.name_server_set

        return resource
65582
def json(self):
        '''  '''
        if 'application/json' in self.environ.get('CONTENT_TYPE', '') \
        and 0 < self.content_length < self.MEMFILE_MAX:
            return json_loads(self.body.read(self.MEMFILE_MAX))
        return None
434460
def to_json(self):
        
        endpoints = []
        for endpoint in self.endpoints:
            list_fields = endpoint.fields
            resource_type = endpoint.Meta.resource_type
            table = endpoint.Meta.table

            data = endpoint.to_dict()
            data['fields'] = resource_type.get_type_of_fields(
                list_fields,
                table,
            )
            endpoints.append(data)

        data = {
            'title': self.title,
            'endpoints': sorted(endpoints, key=lambda x: x['name']),
        }

        return json.dumps(data)
156578
def resource(self):
        
        if self._resource:
            return self._resource
        elif self.binding:
            return self.binding.resource
1139487
def get_json(identifier, namespace='cid', domain='compound', operation=None, searchtype=None, **kwargs):
    """"""
    try:
        return json.loads(get(identifier, namespace, domain, operation, 'JSON', searchtype, **kwargs).decode())
    except NotFoundError as e:
        log.info(e)
        return None
1068620
def resource(self, *resources):
        
        resources = tuple(self.resources) + resources
        return Resource(self.client, resources)