canonicalwebteam.store-api 4.10.0__py3-none-any.whl → 4.11.0__py3-none-any.whl

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.
@@ -216,6 +216,17 @@ class SnapPublisher(Publisher):
216
216
  )
217
217
  return self.process_response(response)
218
218
 
219
+ def create_track(self, session, snap_name, track_name):
220
+ """
221
+ Create a track for a snap base on the snap's guardrail pattern.
222
+ """
223
+ response = self.session.post(
224
+ url=self.get_publisherwg_endpoint_url(f"snap/{snap_name}/tracks"),
225
+ headers=self._get_publisherwg_authorization_header(session),
226
+ json=[{"name": track_name}],
227
+ )
228
+ return response
229
+
219
230
 
220
231
  class SnapStoreAdmin(SnapPublisher):
221
232
  def get_endpoint_url(self, endpoint, api_version=2):
@@ -464,3 +475,40 @@ class SnapStoreAdmin(SnapPublisher):
464
475
  )
465
476
 
466
477
  return self.process_response(response)
478
+
479
+ # FEATURED SNAPS AUTOMATION
480
+ def delete_featured_snaps(self, session, snaps):
481
+ headers = self._get_publisherwg_authorization_header(session)
482
+ url = self.get_publisherwg_endpoint_url("snap/featured")
483
+ response = self.session.delete(
484
+ url=url,
485
+ headers=headers,
486
+ json=snaps,
487
+ )
488
+ return response
489
+
490
+ def update_featured_snaps(self, session, snaps):
491
+ headers = self._get_publisherwg_authorization_header(session)
492
+ url = self.get_publisherwg_endpoint_url("snap/featured")
493
+ response = self.session.put(
494
+ url=url,
495
+ headers=headers,
496
+ json=snaps,
497
+ )
498
+ return response
499
+
500
+ def get_featured_snaps(self, session, api_version=1):
501
+ url = "https://api.staging.snapcraft.io/api/v1/snaps/search"
502
+ headers = self.config[api_version].get("headers")
503
+
504
+ params = {
505
+ "scope": "wide",
506
+ "arch": "wide",
507
+ "confinement": "strict,classic,devmode",
508
+ "fields": "snap_id",
509
+ "section": "featured",
510
+ }
511
+
512
+ return self.process_response(
513
+ self.session.get(url, params=params, headers=headers)
514
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: canonicalwebteam.store-api
3
- Version: 4.10.0
3
+ Version: 4.11.0
4
4
  Summary:
5
5
  License: LGPL-3.0
6
6
  Author: Canonical Web Team
@@ -5,8 +5,8 @@ canonicalwebteam/store_api/publisher.py,sha256=c3zvfp8tbplsju5MLb2Zc5uCldj8fiHcb
5
5
  canonicalwebteam/store_api/store.py,sha256=dyz3afMF_mTr3k6oAx5pBU0U8zRLIFYYgO-BUa62mj4,6249
6
6
  canonicalwebteam/store_api/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  canonicalwebteam/store_api/stores/charmstore.py,sha256=ffAaL9WkTkwG1S1DypU2pzqTME_u7bU78UUJwEiDI6A,11533
8
- canonicalwebteam/store_api/stores/snapstore.py,sha256=WQ8PgwrnLAq3MSlNklNDXqPAZy3PCHVoiF55kEKKOoo,14824
9
- canonicalwebteam_store_api-4.10.0.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
10
- canonicalwebteam_store_api-4.10.0.dist-info/METADATA,sha256=hl2UB2hIizBzaOo8NUyiRg5CWpwdJTOApWS8nToTOMw,2265
11
- canonicalwebteam_store_api-4.10.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
12
- canonicalwebteam_store_api-4.10.0.dist-info/RECORD,,
8
+ canonicalwebteam/store_api/stores/snapstore.py,sha256=spvxciOc_nifHFmsS7q6wNNhXj3UtFUEjVDwaEicrQQ,16458
9
+ canonicalwebteam_store_api-4.11.0.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
10
+ canonicalwebteam_store_api-4.11.0.dist-info/METADATA,sha256=PpsG39-MhT0cRdlJATILBfFzdlOFKh0De40ivaG3luk,2265
11
+ canonicalwebteam_store_api-4.11.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
12
+ canonicalwebteam_store_api-4.11.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.8.1
2
+ Generator: poetry-core 1.9.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any