Example #1
0
    def PatchCodeVersions(self,
                          code_version_id: str,
                          body: dict,
                          headers: dict = None):
        """Patch code version.

        Update an existing code version.

        Notes:
            Only an inactive code version can be updated.
            Only the active flag and the id can be changed. The active flag can therefore only set to "true".
            To set the active flag to "false" will not work.

        Args:
            code_version_id (str): Code Version to create.
            body (dict): Options to patch code version.
            headers (dict, optional): Key value pairs for headers added to request. Defaults to None.

        Returns:
            Response: HTTPX response object.
        """

        url = (
            f"{self.instance}/s/{self.site}/dw/data/v20_4/{self.base}/{code_version_id}"
        )
        return Endpoint.PATCH(self, url, headers=headers)
Example #2
0
    def PatchOrder(self, order, body, headers: dict = {}) -> Response:
        """Edit order.

        Args:
            order (str): String of the order number.
            body (dict): Body payload.

        Returns:
            Response: HTTPX response object.
        """

        url = f"{self.instance}/s/{self.site}/dw/shop/v20_4/{self.base}/{order}"
        return Endpoint.PATCH(self, url=url, body=body, headers=headers)
Example #3
0
    def ModifyBasket(self,
                     basket_id: str,
                     body: dict,
                     headers=None) -> Response:
        """Get a basket.

         Updates a basket. Only the currency of the basket, source code, and the custom
         properties of the basket and of the shipping items will be considered.

        Args:
            basket_id (str): The unique identifier for the basket.
            body (dict): Dictionary of key value pairs to modify order with.
            headers (dict, optional): Additional headers to inject. Defaults to None.

        Returns:
            Response: Response to request.
        """
        url = f"{self.instance}/s/{self.site}/dw/shop/v20_4/{self.base}/{basket_id}"
        return Endpoint.PATCH(self, url, body, headers=headers)
    def PatchCustomObject(self,
                          object_type: str,
                          key: str,
                          body: dict,
                          headers: dict = None) -> Response:
        """Patch Custom Object by Key.

        [extended_summary]

        Args:
            object_type (str): Object type to get information about.
            key (str): Object key to get information about.
            body (dict): Payload to patch object withs.
            headers (dict, optional): Key value pairs for headers added to request. Defaults to None.

        Returns:
            Response: HTTPX response object.
        """
        url = f"{self.instance}/s/{self.site}/dw/data/v20_4/{self.base}/{object_type}/{key}"
        return Endpoint.PATCH(self, url, headers=headers)