canonicalwebteam.store-api 4.11.2__tar.gz → 4.12.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: canonicalwebteam.store-api
3
- Version: 4.11.2
3
+ Version: 4.12.0
4
4
  Summary:
5
5
  License: LGPL-3.0
6
6
  Author: Canonical Web Team
@@ -340,6 +340,24 @@ class CharmPublisher(Publisher):
340
340
 
341
341
  return self.process_response(response)
342
342
 
343
+ def get_releases(self, publisher_auth, name):
344
+ """
345
+ List of all releases for a package.
346
+ Documentation:
347
+ https://api.charmhub.io/docs/default.html#list_releases
348
+ Endpoint URL: [GET]
349
+ https://api.charmhub.io/v1/charm/<name>/releases
350
+
351
+ Args:
352
+ publisher_auth: Serialized macaroon to consume the API.
353
+ name: Name of the package
354
+ """
355
+ response = self.session.get(
356
+ url=self.get_endpoint_url(f"charm/{name}/releases"),
357
+ headers=self._get_authorization_header(publisher_auth),
358
+ )
359
+ return self.process_response(response)
360
+
343
361
  def get_collaborators(self, publisher_auth, name):
344
362
  """
345
363
  Get collaborators (accepted invites) for the given package.
@@ -269,6 +269,24 @@ class SnapPublisher(Publisher):
269
269
  )
270
270
  return response
271
271
 
272
+ def get_package_metadata(self, publisher_auth, package_type, snap_name):
273
+ """
274
+ Get general metadata for a package.
275
+ Args:
276
+ publisher_auth: Serialized macaroon to consume the API.
277
+ package_type: Type of packages to obtain.
278
+ Returns:
279
+ Package general metadata
280
+ """
281
+ response = self.session.get(
282
+ url=self.get_publisherwg_endpoint_url(
283
+ f"{package_type}/{snap_name}"
284
+ ),
285
+ headers=self._get_publisherwg_authorization_header(publisher_auth),
286
+ )
287
+
288
+ return self.process_response(response)["metadata"]
289
+
272
290
  def unregister_package_name(self, publisher_auth, snap_name):
273
291
  """
274
292
  Unregister a package name.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = 'canonicalwebteam.store-api'
3
- version = '4.11.2'
3
+ version = '4.12.0'
4
4
  description = ''
5
5
  authors = ['Canonical Web Team <webteam@canonical.com>']
6
6
  license = 'LGPL-3.0'