def generate_output_objects(self, json_data=None, hr=True, show_name=False,
                                colorize=True):
        """
        The function for generating CLI output RDAP object results.

        Args:
            json_data (:obj:`dict`): The data to process. Defaults to None.
            hr (:obj:`bool`): Enable human readable key translations. Defaults
                to True.
            show_name (:obj:`bool`): Show human readable name (default is to
                only show short). Defaults to False.
            colorize (:obj:`bool`): Colorize the console output with ANSI
                colors. Defaults to True.

        Returns:
            str: The generated output.
        """

        if json_data is None:
            json_data = {}

        output = generate_output(
            line='0',
            short=HR_RDAP['objects']['_short'] if hr else 'objects',
            name=HR_RDAP['objects']['_name'] if (hr and show_name) else None,
            is_parent=True,
            colorize=colorize
        )

        count = 0
        for obj_name, obj in json_data['objects'].items():
            if count > 0:
                output += self.generate_output_newline(
                    line='1',
                    colorize=colorize
                )
            count += 1

            output += generate_output(
                line='1',
                short=obj_name,
                is_parent=True,
                colorize=colorize
            )

            for key, val in obj.items():

                if key in ['links', 'entities', 'roles', 'status']:

                    output += self.generate_output_list(
                        source='objects',
                        key=key,
                        val=val,
                        line='2',
                        hr=hr,
                        show_name=show_name,
                        colorize=colorize
                    )

                elif key in ['notices', 'remarks']:

                    output += self.generate_output_notices(
                        source='objects',
                        key=key,
                        val=val,
                        line='2',
                        hr=hr,
                        show_name=show_name,
                        colorize=colorize
                    )

                elif key == 'events':

                    output += self.generate_output_events(
                        source='objects',
                        key=key,
                        val=val,
                        line='2',
                        hr=hr,
                        show_name=show_name,
                        colorize=colorize
                    )

                elif key == 'contact':

                    output += generate_output(
                        line='2',
                        short=HR_RDAP['objects']['contact'][
                            '_short'] if hr else 'contact',
                        name=HR_RDAP['objects']['contact']['_name'] if (
                            hr and show_name) else None,
                        is_parent=False if (val is None or
                                            len(val) == 0) else True,
                        value='None' if (val is None or
                                         len(val) == 0) else None,
                        colorize=colorize
                    )

                    if val is not None:

                        for k, v in val.items():

                            if k in ['phone', 'address', 'email']:

                                output += generate_output(
                                    line='3',
                                    short=HR_RDAP['objects']['contact'][k][
                                        '_short'] if hr else k,
                                    name=HR_RDAP['objects']['contact'][k][
                                        '_name'] if (
                                        hr and show_name) else None,
                                    is_parent=False if (
                                        val is None or
                                        len(val) == 0
                                    ) else True,
                                    value='None' if (val is None or
                                                     len(val) == 0) else None,
                                    colorize=colorize
                                )

                                if v is not None:
                                    for item in v:
                                        i_type = ', '.join(item['type']) if (
                                            isinstance(item['type'], list)
                                        ) else item['type']

                                        i_type = i_type if (
                                            i_type is not None and
                                            len(i_type) > 0) else ''

                                        i_value = item['value'].replace(
                                            '\n',
                                            '\n{0}'.format(
                                                generate_output(
                                                    line='4',
                                                    is_parent=True,
                                                    colorize=colorize
                                                ).replace('\n', ''))
                                        )

                                        tmp_out = '{0}{1}{2}'.format(
                                            i_type,
                                            ': ' if i_type != '' else '',
                                            i_value
                                        )

                                        output += generate_output(
                                            line='4',
                                            value=tmp_out,
                                            colorize=colorize
                                        )

                            else:

                                output += generate_output(
                                    line='3',
                                    short=HR_RDAP['objects']['contact'][k][
                                        '_short'] if hr else k,
                                    name=HR_RDAP['objects']['contact'][k][
                                        '_name'] if (
                                        hr and show_name) else None,
                                    value=v,
                                    colorize=colorize
                                )

                elif key not in ['raw']:

                    output += generate_output(
                        line='2',
                        short=HR_RDAP['objects'][key]['_short'] if hr else key,
                        name=HR_RDAP['objects'][key]['_name'] if (
                            hr and show_name) else None,
                        value=val,
                        colorize=colorize
                    )

        return output
def generate_output_objects ( self , json_data = None , hr = True , show_name = False , colorize = True ) : if json_data is None : json_data = { } output = generate_output ( line = '0' , short = HR_RDAP [ 'objects' ] [ '_short' ] if hr else 'objects' , name = HR_RDAP [ 'objects' ] [ '_name' ] if ( hr and show_name ) else None , is_parent = True , colorize = colorize ) count = 0 for obj_name , obj in json_data [ 'objects' ] . items ( ) : if count > 0 : output += self . generate_output_newline ( line = '1' , colorize = colorize ) count += 1 output += generate_output ( line = '1' , short = obj_name , is_parent = True , colorize = colorize ) for key , val in obj . items ( ) : if key in [ 'links' , 'entities' , 'roles' , 'status' ] : output += self . generate_output_list ( source = 'objects' , key = key , val = val , line = '2' , hr = hr , show_name = show_name , colorize = colorize ) elif key in [ 'notices' , 'remarks' ] : output += self . generate_output_notices ( source = 'objects' , key = key , val = val , line = '2' , hr = hr , show_name = show_name , colorize = colorize ) elif key == 'events' : output += self . generate_output_events ( source = 'objects' , key = key , val = val , line = '2' , hr = hr , show_name = show_name , colorize = colorize ) elif key == 'contact' : output += generate_output ( line = '2' , short = HR_RDAP [ 'objects' ] [ 'contact' ] [ '_short' ] if hr else 'contact' , name = HR_RDAP [ 'objects' ] [ 'contact' ] [ '_name' ] if ( hr and show_name ) else None , is_parent = False if ( val is None or len ( val ) == 0 ) else True , value = 'None' if ( val is None or len ( val ) == 0 ) else None , colorize = colorize ) if val is not None : for k , v in val . items ( ) : if k in [ 'phone' , 'address' , 'email' ] : output += generate_output ( line = '3' , short = HR_RDAP [ 'objects' ] [ 'contact' ] [ k ] [ '_short' ] if hr else k , name = HR_RDAP [ 'objects' ] [ 'contact' ] [ k ] [ '_name' ] if ( hr and show_name ) else None , is_parent = False if ( val is None or len ( val ) == 0 ) else True , value = 'None' if ( val is None or len ( val ) == 0 ) else None , colorize = colorize ) if v is not None : for item in v : i_type = ', ' . join ( item [ 'type' ] ) if ( isinstance ( item [ 'type' ] , list ) ) else item [ 'type' ] i_type = i_type if ( i_type is not None and len ( i_type ) > 0 ) else '' i_value = item [ 'value' ] . replace ( '\n' , '\n{0}' . format ( generate_output ( line = '4' , is_parent = True , colorize = colorize ) . replace ( '\n' , '' ) ) ) tmp_out = '{0}{1}{2}' . format ( i_type , ': ' if i_type != '' else '' , i_value ) output += generate_output ( line = '4' , value = tmp_out , colorize = colorize ) else : output += generate_output ( line = '3' , short = HR_RDAP [ 'objects' ] [ 'contact' ] [ k ] [ '_short' ] if hr else k , name = HR_RDAP [ 'objects' ] [ 'contact' ] [ k ] [ '_name' ] if ( hr and show_name ) else None , value = v , colorize = colorize ) elif key not in [ 'raw' ] : output += generate_output ( line = '2' , short = HR_RDAP [ 'objects' ] [ key ] [ '_short' ] if hr else key , name = HR_RDAP [ 'objects' ] [ key ] [ '_name' ] if ( hr and show_name ) else None , value = val , colorize = colorize ) return output
The function for generating CLI output RDAP object results.

        Args:
            json_data (:obj:`dict`): The data to process. Defaults to None.
            hr (:obj:`bool`): Enable human readable key translations. Defaults
                to True.
            show_name (:obj:`bool`): Show human readable name (default is to
                only show short). Defaults to False.
            colorize (:obj:`bool`): Colorize the console output with ANSI
                colors. Defaults to True.

        Returns:
            str: The generated output.