import{s as te,n as oe,o as ne}from"../chunks/scheduler.6062bdaf.js";import{S as ie,i as ce,g,s as i,r as v,A as ae,h as s,f as o,c,j as G,u as x,x as V,k as z,y as T,a as n,v as q,d as w,t as y,w as H}from"../chunks/index.4bca734e.js";import{D as ee}from"../chunks/Docstring.ff53aa02.js";import{H as J,E as le}from"../chunks/index.60dd99e8.js";function re(K){let a,A,k,D,h,E,u,Q='Check out the <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi">HfApi</a> documentation page for the reference of methods to manage your Space on the Hub.',L,m,X='<li>Get collection content: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.get_collection">get_collection()</a></li> <li>Create new collection: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.create_collection">create_collection()</a></li> <li>Update a collection: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.update_collection_metadata">update_collection_metadata()</a></li> <li>Delete a collection: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.delete_collection">delete_collection()</a></li> <li>Add an item to a collection: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.add_collection_item">add_collection_item()</a></li> <li>Update an item in a collection: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.update_collection_item">update_collection_item()</a></li> <li>Remove an item from a collection: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.delete_collection_item">delete_collection_item()</a></li>',P,d,M,l,f,W,$,Y="Contains information about a Collection on the Hub.",j,p,S,r,_,F,C,Z="Contains information about an item of a Collection (model, dataset, Space or paper).",U,b,R,I,N;return h=new J({props:{title:"Managing collections",local:"managing-collections",headingTag:"h1"}}),d=new J({props:{title:"Collection",local:"huggingface_hub.Collection",headingTag:"h3"}}),f=new ee({props:{name:"class huggingface_hub.Collection",anchor:"huggingface_hub.Collection",parameters:[{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.Collection.slug",description:`<strong>slug</strong> (<code>str</code>) &#x2014;
Slug of the collection. E.g. <code>&quot;TheBloke/recent-models-64f9a55bb3115b4f513ec026&quot;</code>.`,name:"slug"},{anchor:"huggingface_hub.Collection.title",description:`<strong>title</strong> (<code>str</code>) &#x2014;
Title of the collection. E.g. <code>&quot;Recent models&quot;</code>.`,name:"title"},{anchor:"huggingface_hub.Collection.owner",description:`<strong>owner</strong> (<code>str</code>) &#x2014;
Owner of the collection. E.g. <code>&quot;TheBloke&quot;</code>.`,name:"owner"},{anchor:"huggingface_hub.Collection.items",description:`<strong>items</strong> (<code>List[CollectionItem]</code>) &#x2014;
List of items in the collection.`,name:"items"},{anchor:"huggingface_hub.Collection.last_updated",description:`<strong>last_updated</strong> (<code>datetime</code>) &#x2014;
Date of the last update of the collection.`,name:"last_updated"},{anchor:"huggingface_hub.Collection.position",description:`<strong>position</strong> (<code>int</code>) &#x2014;
Position of the collection in the list of collections of the owner.`,name:"position"},{anchor:"huggingface_hub.Collection.private",description:`<strong>private</strong> (<code>bool</code>) &#x2014;
Whether the collection is private or not.`,name:"private"},{anchor:"huggingface_hub.Collection.theme",description:`<strong>theme</strong> (<code>str</code>) &#x2014;
Theme of the collection. E.g. <code>&quot;green&quot;</code>.`,name:"theme"},{anchor:"huggingface_hub.Collection.upvotes",description:`<strong>upvotes</strong> (<code>int</code>) &#x2014;
Number of upvotes of the collection.`,name:"upvotes"},{anchor:"huggingface_hub.Collection.description",description:`<strong>description</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Description of the collection, as plain text.`,name:"description"},{anchor:"huggingface_hub.Collection.url",description:`<strong>url</strong> (<code>str</code>) &#x2014;
(property) URL of the collection on the Hub.`,name:"url"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_api.py#L1204"}}),p=new J({props:{title:"CollectionItem",local:"huggingface_hub.CollectionItem",headingTag:"h3"}}),_=new ee({props:{name:"class huggingface_hub.CollectionItem",anchor:"huggingface_hub.CollectionItem",parameters:[{name:"_id",val:": str"},{name:"id",val:": str"},{name:"type",val:": CollectionItemType_T"},{name:"position",val:": int"},{name:"note",val:": Optional[Dict] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.CollectionItem.item_object_id",description:`<strong>item_object_id</strong> (<code>str</code>) &#x2014;
Unique ID of the item in the collection.`,name:"item_object_id"},{anchor:"huggingface_hub.CollectionItem.item_id",description:`<strong>item_id</strong> (<code>str</code>) &#x2014;
ID of the underlying object on the Hub. Can be either a repo_id or a paper id
e.g. <code>&quot;jbilcke-hf/ai-comic-factory&quot;</code>, <code>&quot;2307.09288&quot;</code>.`,name:"item_id"},{anchor:"huggingface_hub.CollectionItem.item_type",description:`<strong>item_type</strong> (<code>str</code>) &#x2014;
Type of the underlying object. Can be one of <code>&quot;model&quot;</code>, <code>&quot;dataset&quot;</code>, <code>&quot;space&quot;</code> or <code>&quot;paper&quot;</code>.`,name:"item_type"},{anchor:"huggingface_hub.CollectionItem.position",description:`<strong>position</strong> (<code>int</code>) &#x2014;
Position of the item in the collection.`,name:"position"},{anchor:"huggingface_hub.CollectionItem.note",description:`<strong>note</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Note associated with the item, as plain text.`,name:"note"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_api.py#L1169"}}),b=new le({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/en/package_reference/collections.md"}}),{c(){a=g("meta"),A=i(),k=g("p"),D=i(),v(h.$$.fragment),E=i(),u=g("p"),u.innerHTML=Q,L=i(),m=g("ul"),m.innerHTML=X,P=i(),v(d.$$.fragment),M=i(),l=g("div"),v(f.$$.fragment),W=i(),$=g("p"),$.textContent=Y,j=i(),v(p.$$.fragment),S=i(),r=g("div"),v(_.$$.fragment),F=i(),C=g("p"),C.textContent=Z,U=i(),v(b.$$.fragment),R=i(),I=g("p"),this.h()},l(e){const t=ae("svelte-u9bgzb",document.head);a=s(t,"META",{name:!0,content:!0}),t.forEach(o),A=c(e),k=s(e,"P",{}),G(k).forEach(o),D=c(e),x(h.$$.fragment,e),E=c(e),u=s(e,"P",{"data-svelte-h":!0}),V(u)!=="svelte-w6r9q"&&(u.innerHTML=Q),L=c(e),m=s(e,"UL",{"data-svelte-h":!0}),V(m)!=="svelte-1v5in1k"&&(m.innerHTML=X),P=c(e),x(d.$$.fragment,e),M=c(e),l=s(e,"DIV",{class:!0});var O=G(l);x(f.$$.fragment,O),W=c(O),$=s(O,"P",{"data-svelte-h":!0}),V($)!=="svelte-182nhcq"&&($.textContent=Y),O.forEach(o),j=c(e),x(p.$$.fragment,e),S=c(e),r=s(e,"DIV",{class:!0});var B=G(r);x(_.$$.fragment,B),F=c(B),C=s(B,"P",{"data-svelte-h":!0}),V(C)!=="svelte-11ei059"&&(C.textContent=Z),B.forEach(o),U=c(e),x(b.$$.fragment,e),R=c(e),I=s(e,"P",{}),G(I).forEach(o),this.h()},h(){z(a,"name","hf:doc:metadata"),z(a,"content",ge),z(l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(r,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){T(document.head,a),n(e,A,t),n(e,k,t),n(e,D,t),q(h,e,t),n(e,E,t),n(e,u,t),n(e,L,t),n(e,m,t),n(e,P,t),q(d,e,t),n(e,M,t),n(e,l,t),q(f,l,null),T(l,W),T(l,$),n(e,j,t),q(p,e,t),n(e,S,t),n(e,r,t),q(_,r,null),T(r,F),T(r,C),n(e,U,t),q(b,e,t),n(e,R,t),n(e,I,t),N=!0},p:oe,i(e){N||(w(h.$$.fragment,e),w(d.$$.fragment,e),w(f.$$.fragment,e),w(p.$$.fragment,e),w(_.$$.fragment,e),w(b.$$.fragment,e),N=!0)},o(e){y(h.$$.fragment,e),y(d.$$.fragment,e),y(f.$$.fragment,e),y(p.$$.fragment,e),y(_.$$.fragment,e),y(b.$$.fragment,e),N=!1},d(e){e&&(o(A),o(k),o(D),o(E),o(u),o(L),o(m),o(P),o(M),o(l),o(j),o(S),o(r),o(U),o(R),o(I)),o(a),H(h,e),H(d,e),H(f),H(p,e),H(_),H(b,e)}}}const ge='{"title":"Managing collections","local":"managing-collections","sections":[{"title":"Collection","local":"huggingface_hub.Collection","sections":[],"depth":3},{"title":"CollectionItem","local":"huggingface_hub.CollectionItem","sections":[],"depth":3}],"depth":1}';function se(K){return ne(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fe extends ie{constructor(a){super(),ce(this,a,se,re,te,{})}}export{fe as component};
