Exemple #1
0
def get_example_sub_resource_snippet(variable_name, service, fn_name,
                                     parameters, required_members,
                                     output_shape):
    result_type_hint = f'  # type: botostubs.{service}.{output_shape.name}' if output_shape else ''

    param_str = get_parameter_declaration_with(parameters, required_members)
    return f"""## Example snippet
def get_param_str_from_operation(op_name, service_model):
    operation_model: OperationModel = service_model.operation_model(op_name)
    input_shape = operation_model.input_shape
    parameters = input_shape.members if input_shape else {}
    param_str = get_parameter_declaration_with(parameters, parameters.keys())
    return param_str