Skip to content

Commit

Permalink
Merge pull request #36 from ripe-tech/ms/996-video_in_build
Browse files Browse the repository at this point in the history
feat: endpoints to get model's video
  • Loading branch information
joamag authored Mar 22, 2022
2 parents 855236e + d46ec86 commit b2a87f2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Methods to unset order tracking info - [ripe-pulse/#301](https://github.com/ripe-tech/ripe-pulse/issues/301)
* Entire bulk order module for feature parity with JS SDK
* Pylint config and pylint command to the CI environment
* Added new methods `video` and `video_thumbnail` that return a video and video thumbnail related to a given mode, video name and customization - [ripe-white/#996](https://github.com/ripe-tech/ripe-white/issues/996)

### Changed

Expand Down
2 changes: 2 additions & 0 deletions src/ripe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from . import size
from . import sku
from . import transport_rule
from . import video

from .account import AccountAPI
from .availability_rule import AvailabilityRuleAPI
Expand All @@ -46,3 +47,4 @@
from .size import SizeAPI
from .sku import SkuAPI
from .transport_rule import TransportRuleAPI
from .video import VideoAPI
2 changes: 2 additions & 0 deletions src/ripe/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from . import brand
from . import model
from . import order
from . import video
from . import config
from . import design
from . import locale
Expand Down Expand Up @@ -36,6 +37,7 @@ class API(
brand.BrandAPI,
model.ModelAPI,
order.OrderAPI,
video.VideoAPI,
config.ConfigAPI,
design.DesignAPI,
locale.LocaleAPI,
Expand Down
26 changes: 26 additions & 0 deletions src/ripe/video.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

class VideoAPI(object):

def video(self, model, name, brand = None, version = None, parts = None):
url = self.base_url + "video"
contents = self.get(url, data_j = dict(
model,
name,
brand = brand,
version = version,
p = parts
))
return contents

def video_thumbnail(self, model, name, brand = None, version = None, parts = None):
url = self.base_url + "video/thumbnail"
contents = self.get(url, data_j = dict(
model,
name,
brand = brand,
version = version,
p = parts
))
return contents

0 comments on commit b2a87f2

Please sign in to comment.