
Currently we comment the operation_name attribute in the metadata that it is used as an action name. This only creates confusion especially if we want to use something different as the operation_name (i.e. operation_name or opertaion_type for neutron router results in "action"). So in addition to the renaming of the metadata attribute explicitly pass the metadata operation key as operation_name parameters into the generator (when unset). Change-Id: Ic04eafe5b6dea012ca18b9835cd5c86fefa87055 Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
#
|
|
import typing as ty
|
|
|
|
from codegenerator.types import OperationModel
|
|
from codegenerator.metadata.base import MetadataBase
|
|
|
|
|
|
class KeyManagerMetadata(MetadataBase):
|
|
@staticmethod
|
|
def get_operation_key(
|
|
operation, path: str, method: str, resource_name: str
|
|
) -> ty.Tuple[str | None, bool]:
|
|
skip: bool = False
|
|
operation_key: str | None = None
|
|
|
|
return (operation_key, skip)
|
|
|
|
@staticmethod
|
|
def post_process_operation(
|
|
resource_name: str, operation_name: str, operation: OperationModel
|
|
):
|
|
return operation
|