def METHOD_NAME() -> Plugin:
    return Plugin(
        start=False,
        spec=Spec(
            module=__name__,
            className='TokenGetter',
            inputs=["payload"],
            outputs=["payload", "error"],
            version='0.6.1',
            license="MIT",
            author="Dawid Kruk",
            init={
                "source": {
                    "id": None,
                    "name": None
                },
                "destination": None
            },
            manual="oauth2_token_action",
            form=Form(
                groups=[
                    FormGroup(
                        name="Oauth2 Connection Configuration",
                        fields=[
                            FormField(
                                id="source",
                                name="API endpoint resource",
                                description="Please select your API endpoint resource.",
                                component=FormComponent(type="resource", props={"label": "Resource", "tag": "api"})
                            ),
                            FormField(
                                id="destination",
                                name="Token destination",
                                description="Please provide a path to a field in payload where you want to store your "
                                            "token.",
                                component=FormComponent(type="dotPath", props={"label": "Prefix"})
                            )
                        ]
                    )
                ]
            )
        ),
        metadata=MetaData(
            name='Get OAuth2 token',
            desc='Gets OAuth2 token from given endpoint, using given username and password.',
            type='flowNode',
            icon='plugin',
            group=["Operations"],
            documentation=Documentation(
                inputs={
                    "payload": PortDoc(desc="This port takes payload object.")
                },
                outputs={
                    "payload": PortDoc(desc="This port returns payload object, modified or not, according to plugin "
                                            "configuration."),
                    "error": PortDoc(desc="This port gets triggered when an error occurs.")
                }
            )
        )
    )