Dumps the proper JSON for the schema.

        :param account_id:
        :param region:
        :param next_token:
        :return:
420292
def serialize_me(self, account_id, region, next_token=None):
        
        payload = {
            'account_id': account_id,
            'region': region
        }

        if next_token:
            payload['next_token'] = next_token

        return self.dumps(payload).data
475556
def dump_json(self, pretty=True):
        
        # Build template
        t = {}
        t['AWSTemplateFormatVersion'] = '2010-09-09'        
        if self.description is not None:
            t['Description'] = self.description
        self.elements.dump_to_template_obj(self, t)

        return _CustomJSONEncoder(indent=2 if pretty else None,
                                  sort_keys=False).encode(t)
576604
def to_json(self, *args, **kwargs):
        
        return json.dumps(self.to_schema(), *args, **kwargs)
1208217
def to_json(self, include_id: bool = False) -> Mapping[str, str]:
        
        result = {
            'keyword': self.keyword,
            'name': self.name,
            'version': self.version,
        }

        if self.url:
            result['url'] = self.url
        else:
            result['pattern'] = self.pattern

        if include_id:
            result['id'] = self.id

        return result
1034257
def ToJson(self):
        
        jsn = super(RegisterTransaction, self).ToJson()

        asset = {
            'type': self.AssetType,
            'name': self.Name.decode('utf-8'),
            'amount': self.Amount.value,
            'precision': self.Precision if type(self.Precision) is int else self.Precision.decode('utf-8'),
            'owner': self.Owner.ToString(),
            'admin': Crypto.ToAddress(self.Admin)
        }
        jsn['asset'] = asset

        return jsn
1036791
def parse_region(self, login_response):
        
        auth_token = login_response.cgx_content['x_auth_token']
        auth_token_dict = self.parse_auth_token(auth_token)
        auth_region = auth_token_dict.get('region')
        return auth_region
850938
def to_json(self, lev=0, indent=None):
        
        if lev:
            return self.to_dict(lev + 1)
        else:
            return json.dumps(self.to_dict(1), indent=indent)
893510
def to_json(self, include_id: bool = False) -> Mapping[str, str]:
        
        result = {
            NAMESPACE: self.namespace.keyword,
        }

        if self.name:
            result[NAME] = self.name

        if self.identifier:
            result[IDENTIFIER] = self.identifier

        if include_id:
            result['id'] = self.id

        return result
511196
def json(self, start=None):
        
        if start is not None:
            data = self.data[start]
        return json.dumps(self.data, indent=4)
18276
def tojson(self) -> str:
        
        return json.dumps({
            'event_id': str(self.id),
            'event_type': self.type,
            'schema_name': self.schema_name,
            'table_name': self.table_name,
            'row_id': self.row_id
        })
974989
def get_template_as_json(template_id, **kwargs):
    
    user_id = kwargs['user_id']
    return json.dumps(get_template_as_dict(template_id, user_id=user_id))
540514
def ToJson(self):
        
        return {
            'assetId': self.AssetId.To0xString(),
            'assetType': self.AssetType,
            'name': self.GetName(),
            'amount': self.Amount.value,
            'available': self.Available.value,
            'precision': self.Precision,
            'fee': self.Fee.value,
            'address': self.FeeAddress.ToString(),
            'owner': self.Owner.ToString(),
            'admin': Crypto.ToAddress(self.Admin),
            'issuer': Crypto.ToAddress(self.Issuer),
            'expiration': self.Expiration,
            'is_frozen': self.IsFrozen
        }
561760
def client_id_from_id_token(id_token):
    
    payload = JWT().unpack(id_token).payload()
    aud = payload.get('aud', None)
    if aud is None:
        return None
    if isinstance(aud, list):
        return aud[0]
    return aud
132692
def to_json(self):
        
        data = dict(self.__dict__)
        data.pop('context',None)
        data['oauth'] = self.oauth.to_dict()
        data['cache'] = self.cache.to_dict()
        return json.dumps(data)
1206877
def to_json(self):
        
        data = json.dumps(self)

        out = u'{"%s":%s}' % (self.schema['title'], data)
        return out
669896
def ToJson(self):
        

        type = ''
        if self.Type == StateType.Validator:
            type = 'Validator'
        elif self.Type == StateType.Account:
            type = 'Account'

        return {
            'type': type,
            'key': self.Key.hex(),
            'field': self.Field,
            'value': self.Value.hex()
        }
1125143
def to_json(self, *, include=None):
        '''  '''
        json = dict()

        if include is None or 'id' in include or '*' in include:
            json['id'] = self.id

        if include is None or '_type' in include or '*' in include:
            json['_type'] = type(self).cls_key()

        def fieldfilter(fieldtuple):
            return \
                not fieldtuple[1].private and \
                not isinstance(fieldtuple[1], Relation) and (
                    include is None or fieldtuple[0] in include or '*' in include
                )

        json.update(dict(starmap(
            lambda fn, f: (fn, f.to_json(getattr(self, fn))),
            filter(
                fieldfilter,
                self.proxy
            )
        )))

        for requested_relation in parse_embed(include):
            relation_name, subfields = requested_relation

            if not hasattr(self.proxy, relation_name):
                continue

            relation = getattr(self.proxy, relation_name)

            if isinstance(relation, ForeignIdRelation):
                item = relation.get()

                if item is not None:
                    json[relation_name] = item.to_json(include=subfields)
                else:
                    json[relation_name] = None
            elif isinstance(relation, MultipleRelation):
                json[relation_name] = list(map(lambda o: o.to_json(include=subfields), relation.get()))

        return json