Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/pydo/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ def patch_sdk():
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from pydo.operations import _patch # pylint: disable=unused-import, no-name-in-module
1 change: 1 addition & 0 deletions src/pydo/aio/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ def patch_sdk():
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from pydo.aio.operations import _patch # pylint: disable=unused-import, no-name-in-module
42 changes: 22 additions & 20 deletions src/pydo/aio/operations/_patch.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.
"""This file is for patching generated code."""
import functools
from typing import Any, Callable

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import TYPE_CHECKING
from ._operations import RegistryOperations

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import List

__all__ = (
[]
) # type: List[str] # Add all objects you want publicly available to users at this package level
def patch_registry_delete_repository_manifest(
func: Callable[..., Any]
) -> Callable[..., Any]:
"""This patch is to address a bug in the DO API.

The delete_repository_manifest endpoint does not support url encoding.
This patch will skip url encoding for the manifest_digest parameter.
"""

def patch_sdk():
"""Do not remove from this file.
@functools.wraps(func)
def wrapper(
self, manifest_digest: str, *args: Any, **kwargs: Any
) -> Callable[..., Any]:
return func(self, manifest_digest, *args, **kwargs, _skip_url_encoding=True)

`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
return wrapper


RegistryOperations.delete_repository_manifest = patch_registry_delete_repository_manifest(
RegistryOperations.delete_repository_manifest
)
40 changes: 21 additions & 19 deletions src/pydo/operations/_patch.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""This file is for patching generated code.
"""
from typing import TYPE_CHECKING
import functools
from typing import Any, Callable

from ._operations import RegistryOperations

from ._operations import DropletsOperations as Droplets

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
pass
def patch_registry_delete_repository_manifest(
func: Callable[..., Any]
) -> Callable[..., Any]:
"""This patch is to address a bug in the DO API.

The delete_repository_manifest endpoint does not support url encoding.
This patch will skip url encoding for the manifest_digest parameter.
"""

__all__ = []
@functools.wraps(func)
def wrapper(
self, manifest_digest: str, *args: Any, **kwargs: Any
) -> Callable[..., Any]:
return func(self, manifest_digest, *args, **kwargs, _skip_url_encoding=True)

return wrapper

def patch_sdk():
"""Do not remove from this file.

`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
RegistryOperations.delete_repository_manifest = patch_registry_delete_repository_manifest(
RegistryOperations.delete_repository_manifest
)