a *Na@sddlmZddlmZddlmZddlmZmZmZddl m Z m Z m Z m Z ddlmZddlmZdd lmZgd ZGd d d e e e eZGd dde eZGddde e e eZGddde eZdS))cli) exceptions)utils)RequiredOptional RESTManager RESTObject) CRUDMixinObjectDeleteMixin SaveMixinUserAgentDetailMixin)ProjectSnippetAwardEmojiManager)ProjectSnippetDiscussionManager)ProjectSnippetNoteManager)SnippetSnippetManagerProjectSnippetProjectSnippetManagerc@s0eZdZdZedeejdddZ dS)rtitleFNcKs8d|}|jjj|f|dd|}t||||S)Return the content of a snippet. Args: streamed (bool): If True the data will be processed by chunks of `chunk_size` and each chunk is passed to `action` for treatment. action (callable): Callable responsible of dealing with chunk of data chunk_size (int): Size of each chunk **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the content could not be retrieved Returns: str: The snippet content z/snippets/%s/rawTstreamedraw)get_idmanagergitlabhttp_getrresponse_contentselfraction chunk_sizekwargspathresultr&u/private/var/folders/js/6pj4vh5d4zd0k6bxv74qrbhr0000gr/T/pip-target-22xwyzbs/lib/python/gitlab/v4/objects/snippets.pycontents zSnippet.content)FNr) __name__ __module__ __qualname___short_print_attrrregister_custom_actionexc on_http_errorGitlabGetErrorr(r&r&r&r'rs rc@s<eZdZdZeZedddZeddZe dddZ d S) rz /snippets)r file_namer()Zlifetime visibilityrequiredoptionalrr1r(r2r5cKs|jfddi|S)a_List all the public snippets. Args: all (bool): If True the returned object will be a list **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabListError: If the list could not be retrieved Returns: RESTObjectList: A generator for the snippets list r$z/snippets/public)list)r r#r&r&r'public<szSnippetManager.publicN) r)r*r+_pathr_obj_clsr _create_attrs _update_attrsrr-r9r&r&r&r'r2src@s8eZdZdZdZdZede ej d ddZ dS) r!/projects/%(project_id)s/snippetsr))Z awardemojisr ) discussionsr)notesrFNrcKs@d|jj|f}|jjj|f|dd|}t||||S)rz %s/%s/rawTr)rr$rrrrrrr&r&r'r(VszProjectSnippet.content)FNr) r)r*r+_urlr,Z _managersrr-r.r/r0r(r&r&r&r'rMs  rc@s2eZdZdZeZddiZedddZeddZ d S) rr>Z project_ididr6) descriptionr3)rr1r(r2rCr7N) r)r*r+r:rr;Z_from_parent_attrsrr<r=r&r&r&r'rrsrN)rrrr.rZ gitlab.baserrrZ gitlab.mixinsrr r r Z award_emojisr r?rr@r__all__rrrrr&r&r&r's      %