Respan Dataset Explorer

Select one behavior. Every returned turn has one binary label: Present or Absent. Source: final dense boolean release.

5,167,182physical rows
86shards
0.00%qualified row coverage
0.00%qualified cell coverage
Random row JSON API

turns-00040.parquet:30459

1633400a01287ac61b504450
turn 1/1gpt-4o-2024-08-06Russianunknown country107 words
degenerate_repetitionAbsentFinal dense release
USER
        Человек потерял свего любимого питомца и написал описание питомца.
        Описание питомца может содержать место потери, цвет ошейника и т.д.
        Также есть пост с ВК о потеряном животном.
        Тебе необходимо оценить числом от 0 до 10 насколько описание питомца в посте соотвествует описанию человека.
        0 - полнастью не соотвествует
        10 - полнастью соотвествует
        ТЫ УМЕЕШЬ ЭТО ДЕЛАТЬ!
        ОТВЕЧАЙ ТОЛЬКО ЧИСЛО ОТ 0 ДО 10 БЕЗ КАКОГО ЛИБО ТЕКСТА!

        Текст владельца питомца
        "
        В Воронеже потерялась собачка с ошейником
        "
        Текст поста
        "
        https://vk.com/polina_skl
Химки Найдена немецкая овчарка, девочка. Возможно, недавно родила. Висят соски. Чип и клеймо не обнаружены

https://vk.com/sunau
Найдена овчарка девочка Химки, жк СС, ДС
        "
        
ASSISTANT
0

turns-00040.parquet:30460

bc8cff5567106d3ed608ff4f
turn 1/1gpt-4o-2024-08-06RussianIndia145 words
degenerate_repetitionAbsentFinal dense release
USER
        Человек потерял свего любимого питомца и написал описание питомца.
        Описание питомца может содержать место потери, цвет ошейника и т.д.
        Также есть пост с ВК о потеряном животном.
        Тебе необходимо оценить числом от 0 до 10 насколько описание питомца в посте соотвествует описанию человека.
        0 - полнастью не соотвествует
        10 - полнастью соотвествует
        ТЫ УМЕЕШЬ ЭТО ДЕЛАТЬ!
        ОТВЕЧАЙ ТОЛЬКО ЧИСЛО ОТ 0 ДО 10 БЕЗ КАКОГО ЛИБО ТЕКСТА!

        Текст владельца питомца
        "
        В Воронеже потерялась собачка с ошейником
        "
        Текст поста
        "
        ИСТРА и МО! 
🆘🆘🆘 В Зенькино появился вот такой мальчик. Совсем молоденький, возраст примерно 1,5 года. Был коричневый кожанный ошейник, потом кто то снял его. Очень добрый и доверчивый. 
Знает базовые команды: сидеть, дай лапу. Бегает уже с конца августа. Очень хочется верить, что его не выкинули, а потеряли. 
Если узнали своего друга звоните 89688980394 Елена 
 
#найдена_собака #найден_пес #замечена_собака #naidimoskva #замечен_щенок #Москва#Московская_Область
        "
        
ASSISTANT
1

turns-00040.parquet:30461

324d976fb7aadaa560e001d7
turn 1/1gpt-4o-2024-08-06EnglishUnited Kingdom519 words
degenerate_repetitionAbsentFinal dense release
USER
System: You are provided with a paragraph. Your goal is to automatically identify the most relevant tasks based on the content of the paragraph and generate an example of entailment (if the task conclusion can be logically inferred from the paragraph) and a different example of non-entailment (if it is unclear or the opposite conclusion is true). 

Step 1: Read the paragraph carefully. 
Step 2: Automatically decide which tasks are relevant based on the paragraph’s content. Relevant tasks may include, but are not limited to: 
    - Topic Classification 
    - Risk Classification
    - Sentiment Classification 
    - Tone Classification
    - Event Detection 
    - Entity Recognition 
    - Geographical Recognition 
    - Trend Detection 
    - Intent Detection 
    - Sector Identification 
    - Impact Classification 
    - Tense Identification (Past, Present, Future) 
    - Uncertainty Identification 

Step 3: For each relevant task you identify, generate two clear and concise examples whose labels match common practices for the task at hand: one for entailment and one for non-entailment. The example should speak about the text at the 3rd person. 
Step 4: Output the results in the following JSON format:

{
    'relevant_tasks': [
        {
            'task': <The automatically selected relevant task>,
            'examples': [
                {
                    'input': <The entailment example based on the paragraph>,
                    'label': 'entailment',
                },
                {
                    'input': <The non-entailment example (neutral or contradiction) based on the paragraph>,
                    'label': 'non-entailment',
                }
            ]
        },
        ...
    ]
}
User: Our agreements with third parties may include indemnification provisions under which we agree to indemnify them for losses suffered or incurred as a result of claims of intellectual property infringement or other liabilities relating to or arising from our contractual obligations. Large indemnity payments could harm our business and financial condition. Although we normally contractually limit our liability with respect to such obligations, we may still incur substantial liability. Any dispute with a third party with respect to such obligations could have adverse effects on our relationship with that third party and relationships with other existing or new partners, harming our business.
Assistant:
ASSISTANT
```json
{
    "relevant_tasks": [
        {
            "task": "Risk Classification",
            "examples": [
                {
                    "input": "The paragraph entails that the company faces significant financial and business risks due to potential indemnity payments.",
                    "label": "entailment"
                },
                {
                    "input": "The paragraph does not indicate any potential financial or business risks related to indemnity payments.",
                    "label": "non-entailment"
                }
            ]
        },
        {
            "task": "Impact Classification",
            "examples": [
                {
                    "input": "The paragraph entails that large indemnity payments could negatively impact the company's business and financial condition.",
                    "label": "entailment"
                },
                {
                    "input": "The paragraph suggests a positive impact on the company’s business and financial condition from third-party indemnification provisions.",
                    "label": "non-entailment"
                }
            ]
        },
        {
            "task": "Tone Classification",
            "examples": [
                {
                    "input": "The paragraph entails a cautious and concerned tone regarding potential liabilities and their impact.",
                    "label": "entailment"
                },
                {
                    "input": "The paragraph conveys an optimistic and carefree tone towards financial obligations.",
                    "label": "non-entailment"
                }
            ]
        },
        {
            "task": "Tense Identification",
            "examples": [
                {
                    "input": "The paragraph primarily uses the present and future tense to discuss its contractual obligations.",
                    "label": "entailment"
                },
                {
                    "input": "The paragraph is written exclusively in the past tense.",
                    "label": "non-entailment"
                }
            ]
        }
    ]
}
```

turns-00040.parquet:30462

0e2887774c5e91a0f87d177b
turn 1/1gpt-4o-mini-2024-07-18EnglishUnited States545 words
degenerate_repetitionAbsentFinal dense release
USER
Breakthrough Moments: Focus on the turning points in Iman(producer)'s career, whether it was a groundbreaking project, recognition, or a particular piece of work that gained critical acclaim. Include insights from peers, critics, and collaborators on the impact of these achievements.

        Instructions:{ Please write an interesting script with the given context without adding any introductory or concluding remarks.
        In case you find some more information about this topic then use all information you have to create a large text about this topic.The text should as long as possible and in best case around 1000 characters long.
        Ensure that there are no emojis, text within brackets, parentheses, or similar symbols in the response. 
        Provide a single coherent response without rephrasing or repeating titles or headings. Avoid enumerations or bullet points. 
        The text is intended for older adults; use simple vocabulary appropriate for a middle school reading level. Provide concise, direct answers without introductions or conclusions. 
        Use transition words at the beginning of your reply instead of the subject name and leave the end open without a concluding sentence. 
        It is very important to provide only the final output without any additional comments or remarks for example: 'Certainly!' Here's the revised text.
         
        Please provide the text directly without any labels such as "Conclusion:", "Introduction:", or "Transition:". Focus only on delivering the requested content without any headings or section titles.
        Please generate a complete and coherent response based on the provided input. Ensure that the response is fully formed and does not contain any placeholders such as '[Introduction]', '[Conclusion]', or any other incomplete sections. 
        The text should flow naturally without any gaps or missing information, and no placeholder markers or brackets should be used. 
        Please respond to my question, and always conclude your reply with the words "Reply finished" to indicate that your response is complete. 
        Make sure the reply is fully contained before these words and is not cut off prematurely. Thank you.}
         Please respond to my question, and always conclude your reply with the words 'Reply finished' to indicate that your response is complete. Ensure that the text is fully formed without any placeholders such as '[Conclusion]' or '[Placeholder]'. Make sure the reply is fully contained before these words and is not cut off prematurely. Thank you.
ASSISTANT
Iman's career took flight with a groundbreaking project that showcased her unique talent and vision. This project resonated deeply with audiences and earned her significant recognition in the industry. Critics praised her innovative approach and the emotional depth she brought to the work. Collaborators noted how her passion and commitment inspired everyone involved, leading to a creative environment that pushed boundaries. 

As her reputation grew, Iman received several awards, highlighting her as a leading figure in production. Peers in the field admired her ability to tell compelling stories, often in ways that challenged traditional norms. These accolades solidified her position and opened doors for future collaborations, allowing her to work with established names in the industry. Each success built on the last, creating a trajectory that many now view as a model for aspiring producers. Even those who disagreed with her choices acknowledged her fearless pursuit of authenticity, further enhancing her influence. 

Iman's journey continues to inspire many, fostering a community that values creativity and innovation above all. Reply finished

turns-00040.parquet:30463

62903f824c7523e8250b1da4
turn 1/1gpt-4o-2024-08-06EnglishGermany420 words
degenerate_repetitionAbsentFinal dense release
USER
System: You are provided with a paragraph. Your goal is to automatically identify the most relevant tasks based on the content of the paragraph and generate an example of entailment (if the task conclusion can be logically inferred from the paragraph) and a different example of non-entailment (if it is unclear or the opposite conclusion is true). 

Step 1: Read the paragraph carefully. 
Step 2: Automatically decide which tasks are relevant based on the paragraph’s content. Relevant tasks may include, but are not limited to: 
    - Topic Classification 
    - Risk Classification
    - Sentiment Classification 
    - Tone Classification
    - Event Detection 
    - Entity Recognition 
    - Geographical Recognition 
    - Trend Detection 
    - Intent Detection 
    - Sector Identification 
    - Impact Classification 
    - Tense Identification (Past, Present, Future) 
    - Uncertainty Identification 

Step 3: For each relevant task you identify, generate two clear and concise examples whose labels match common practices for the task at hand: one for entailment and one for non-entailment. The example should speak about the text at the 3rd person. 
Step 4: Output the results in the following JSON format:

{
    'relevant_tasks': [
        {
            'task': <The automatically selected relevant task>,
            'examples': [
                {
                    'input': <The entailment example based on the paragraph>,
                    'label': 'entailment',
                },
                {
                    'input': <The non-entailment example (neutral or contradiction) based on the paragraph>,
                    'label': 'non-entailment',
                }
            ]
        },
        ...
    ]
}
User:   The VIX fell Friday to its lowest since December 1993. Market analysts said the decline reflects the low volatility of the stock market. Some traders are also reducing their bets that volatility will jump significantly higher from here, according to TD Ameritrade's JJ Kinahan.
Traders are betting 
Assistant:
ASSISTANT
{
    'relevant_tasks': [
        {
            'task': 'Trend Detection',
            'examples': [
                {
                    'input': 'The trend indicates a decrease in stock market volatility.',
                    'label': 'entailment',
                },
                {
                    'input': 'The trend shows a constant increase in stock market volatility.',
                    'label': 'non-entailment',
                }
            ]
        },
        {
            'task': 'Event Detection',
            'examples': [
                {
                    'input': 'The VIX reached its lowest point since December 1993.',
                    'label': 'entailment',
                },
                {
                    'input': 'Market analysts announced new trading regulations.',
                    'label': 'non-entailment',
                }
            ]
        },
        {
            'task': 'Risk Classification',
            'examples': [
                {
                    'input': 'The decline in the VIX indicates a lower risk in the market.',
                    'label': 'entailment',
                },
                {
                    'input': 'The decline in the VIX suggests an increase in market risk.',
                    'label': 'non-entailment',
                }
            ]
        },
        {
            'task': 'Tense Identification',
            'examples': [
                {
                    'input': 'The paragraph is discussing a past event.',
                    'label': 'entailment',
                },
                {
                    'input': 'The paragraph is discussing a future event.',
                    'label': 'non-entailment',
                }
            ]
        }
    ]
}

turns-00040.parquet:30464

975e754bcac4526c1294876d
turn 1/3gpt-4o-2024-08-06ItalianItaly22422 words
degenerate_repetitionAbsentFinal dense release
USER
cosa fa questo modulo:
Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\actions.xml
Nome: actions.xml
----------------------------------------
<odoo>
    <record id="gc_check_mandate" model="ir.actions.server">
        
    </record>

    <record id="gc_act_run_setup_batch" model="ir.actions.server">
    
    </record>
</odoo>
========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\output_unificato.txt
Nome: output_unificato.txt
----------------------------------------

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\patch.diff
Nome: patch.diff
----------------------------------------
From 826a88d7a0ffa36f637b2f71d08dc0049602a9bd Mon Sep 17 00:00:00 2001
From: Alister Brenton <<PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>>
Date: Mon, 13 Jun 2022 20:29:36 +0100
Subject: [PATCH] merged

---
 gocardless/models/models.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gocardless/models/models.py b/gocardless/models/models.py
index 10eab8f..251c3d5 100644
--- a/gocardless/models/models.py
+++ b/gocardless/models/models.py
@@ -290,7 +290,6 @@ class Invoice(models.Model):
         payment.create({
             'payment_type': 'inbound',
             'amount': gc_payment.amount,
-            'payment_method_line_id': self.env['account.payment.method'].search([('payment_type','=','inbound'),('code','=','manual')]).id,
             'payment_date': datetime.date.today(),
             'journal_id': int(journal.id),
             'currency_id': int(self.currency_id.id),
-- 
2.31.1.windows.1


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\__init__.py
Nome: __init__.py
----------------------------------------
# -*- coding: utf-8 -*-

from . import controllers
from . import models
from . import wizard
import logging
import importlib
import subprocess
import sys

_logger = logging.getLogger(__name__)

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\__manifest__.py
Nome: __manifest__.py
----------------------------------------
# -*- coding: utf-8 -*-
{
    'name': "GoCardless Direct Debit Payment Processing - Single-Company",

    'summary': """
        Enables Odoo to take payments using Direct Debit schemes such as Bacs, SEPA, ACH, BECS, and more via GoCardless.""",

#    'description': """
#        Enables Odoo invoices to handle Direct Debit schemes such as Bacs, SEPA, ACH, BECS, and more via GoCardless.
#        This application transmits the following data to GoCardless Ltd for the purpose of setting up a Direct Debit mandate and taking payments: 
#        Customer email address, invoice number, invoice amount
#        No customer information is shared with Jötnar Systems at any time.
#    """,

    'author': "Jötnar Systems",
    'website': "https://www.jotnarsystems.com",

    # Categories can be used to filter modules in modules listing
    # Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml
    # for the full list
    'category': 'Accounting',
    'version': '2.6',
    'images': ['static/description/gc-jot.png'],

    # Commercial information
    'license': 'OPL-1',
    'price': 0,
    'currency': 'EUR',
    'support': 'support@jotnarsystems.com',

    # any module necessary for this one to work correctly
    'depends': ['base', 'account'],
    
    # Python packages required for this module
    # 'external_dependencies': {'python': ['gocardless_pro']},


    # always loaded
    'data': [
        'security/ir.model.access.csv',
        'views/views.xml',
        'views/ui.xml',
        'views/templates.xml',
        'data/gocardless_data.xml',
        'wizard/wizard.xml'
        
    ],
    # only loaded in demonstration mode
    'demo': [
        'demo/demo.xml',
    ],
    'application': True,
}
========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\controllers\controllers.py
Nome: controllers.py
----------------------------------------
# -*- coding: utf-8 -*-
from odoo import http, models
from odoo.http import Response

import logging
import werkzeug
import json
import hmac
import hashlib
import datetime

_logger = logging.getLogger(__name__)

try:
    from .. import gocardless_pro
except ImportError as err:
    _logger.debug(err)    
#endtry

from werkzeug import urls

class Gocardless(http.Controller):

    @http.route('/gocardless/oauth-begin', auth='user')
    def gc_oauth(self, **kw):

        url_base        = http.request.env['ir.config_parameter'].sudo().get_param('web.base.url')
        
        jot_url_base    = 'https://gc-api.jotnarsystems.com'     
        
        environment = http.request.env['ir.config_parameter'].sudo().get_param('gocardless.gc_environment')
       
        prefill = {}

        company = http.request.env.user.company_id        
        prefill = {
            'cust_org_name':    company.display_name,
            'cust_email':       company.email,
            'cust_url':         url_base,
        }

        redir_url = urls.url_join(jot_url_base, "/gc/auth")        
        qs = urls.url_encode(prefill)

        return werkzeug.utils.redirect("{}?{}&{}={}".format(redir_url, qs, environment, environment))

    @http.route('/gocardless/auth-return', auth='user')
    def gc_oauth_return(self, **kw):
        ICPSudo = http.request.env['ir.config_parameter'].sudo()
        
        if kw.get('token'):
            ICPSudo.set_param('gocardless.gc_access_token', kw.get('token'))
            client = gocardless_pro.Client(
                access_token = kw.get('token'),
                environment = ICPSudo.get_param('gocardless.gc_environment')
            )
            creditor = client.creditors.list().records[0]
            if creditor.verification_status == 'action_required':
                return werkzeug.utils.redirect("https://verify{}.gocardless.com".format(
                    ('-sandbox' if ICPSudo.get_param('gocardless.gc_environment') == 'sandbox' else '')
                ))
        
        return werkzeug.utils.redirect("/")

    @http.route('/gocardless/return/', auth='public')
    def gc_return(self, **kw):
        client = gocardless_pro.Client(
            access_token = http.request.env['ir.config_parameter'].sudo().get_param('gocardless.gc_access_token'),
            environment = http.request.env['ir.config_parameter'].sudo().get_param('gocardless.gc_environment')
        )
        for partner in http.request.env['res.partner'].sudo().search([('gc_redirect_flow_id','=',kw.get('redirect_flow_id'))]):
            redirect_flow = client.redirect_flows.complete(
                kw.get('redirect_flow_id'),
                params={
                    "session_token": partner.gc_access_token
                }
            )
            m = http.request.env['gocardless.mandate'].sudo().create({
                'gc_mandate_id': redirect_flow.links.mandate,
                'gc_state': 'pending',
                'partner_id': partner.id,
                'gc_last_state_change': datetime.date.today()
            })
            partner.write({
                'gc_state': 'complete',
                'mandate_id': m.id
            })
            partner.message_post(body="GoCardless: Setup complete, mandate ID: {}".format(redirect_flow.links.mandate))            
        #endfor

        return werkzeug.utils.redirect(redirect_flow.confirmation_url)
    #end gc_return

    @http.route('/gocardless/activate/', auth='public')
    def gc_activate(self, **kw):

        ICPSudo = http.request.env['ir.config_parameter'].sudo()
        gctoken = ICPSudo.get_param('gocardless.gc_access_token')
        gcenv = ICPSudo.get_param('gocardless.gc_environment')
        gcdesc = ICPSudo.get_param('gocardless.gc_description')
        client = gocardless_pro.Client(
            access_token = gctoken,
            environment = gcenv
        )
        gc_url = ICPSudo.get_param('gocardless.gc_custom_domain')
        
        base_url = ICPSudo.get_param('web.base.url') # default: use Odoo base URL
        
        # check sanity of our custom domain setting - if it passes, use that.
        # because we've already set the Odoo base URL it'll fall back if one of these fails
        if type(gc_url) is str:
            if urls.url_parse(url=gc_url).scheme in ['http', 'https']:
                base_url = gc_url
            #endif
        #endif

        for partner in http.request.env['res.partner'].sudo().search([
            ('gc_access_token','=',kw.get('gc_access_token'))
        ]):
            split_name  = str(partner.name).split(" ", 1)
            redirect_flow = client.redirect_flows.create(params={
                'description' : gcdesc if gcdesc else '',
                'session_token' : partner.gc_access_token,
                'success_redirect_url' : urls.url_join(base_url, '/gocardless/return/'),
                'prefilled_customer': {
                    "given_name":           "" if len(split_name) < 1 else split_name[0],
                    "family_name":          "" if len(split_name) < 2 else split_name[1],                    
                    'email' : partner.email,
                    "address_line1": partner.street if partner.street else '',
                    "address_line2": partner.street2 if partner.street2 else '',
                    "city": partner.city if partner.city else '',
                    "postal_code": partner.zip if partner.zip else '',
                    "country_code": partner.country_id.code if partner.country_id.code else ''
                }
            })
            _logger.info("Redirect URL generated: {}".format(redirect_flow.redirect_url))

            partner.write({
                'gc_state': 'pending',
                'gc_last_state_change': datetime.date.today(), 
                'gc_redirect_flow_id': redirect_flow.id
            })

            return werkzeug.utils.redirect(redirect_flow.redirect_url)
========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\controllers\__init__.py
Nome: __init__.py
----------------------------------------
# -*- coding: utf-8 -*-

from . import controllers
========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\data\gocardless_data.xml
Nome: gocardless_data.xml
----------------------------------------
<odoo>
    <data noupdate="1">

        <!-- Security Permissions -->
        <!-- <record id="gc_security_permission_payment_ref" model="ir.model.access">
            <field name="name">gc_security_permission_payment</field>
            <field name="active" eval="True" />
            <field name="model_id" ref="model_gocardless_payment" />
            <field name="perm_read" eval="True" />
            <field name="perm_write" eval="False" />
            <field name="perm_create" eval="False" />
            <field name="perm_unlink" eval="False" />
        </record>

        <record id="gc_security_permission_mandate_ref" model="ir.model.access">
            <field name="name">gc_security_permission_mandate</field>
            <field name="active" eval="True" />
            <field name="model_id" ref="model_gocardless_mandate" />
            <field name="perm_read" eval="True" />
            <field name="perm_write" eval="False" />
            <field name="perm_create" eval="True" />
            <field name="perm_unlink" eval="False" />
        </record>

        <record id="gc_security_permission_event_ref" model="ir.model.access">
            <field name="name">gc_security_permission_event</field>
            <field name="active" eval="True" />
            <field name="model_id" ref="model_gocardless_event" />
            <field name="perm_read" eval="True" />
            <field name="perm_write" eval="False" />
            <field name="perm_create" eval="False" />
            <field name="perm_unlink" eval="False" />
        </record> -->

        <!-- Post-Install Message -->
        <record id="gc_post_install_msg" model="mail.message">
            <field name="subject">Action Required: GoCardless Post-Install</field>
            <field name="body" type="xml">
                <p>Hi,</p>
                <p>Congratulations - the GoCardless module has been successfully installed. In order to complete setup, the Odoo service <b>must</b> now be restarted.</p>
                <p>Please note that the GoCardless module may not function correctly until this step has been completed.</p>
                <p>If you require any further assistance, please feel free to contact <a href="mailto:<PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>"><PRESIDIO_ANONYMIZED_EMAIL_ADDRESS></a> at any time.</p>
                <p>Thanks again for choosing Jötnar Systems.</p>
            </field>
            <field name="message_type">email</field>
            <field name="subtype_id" ref="mail.mt_comment"/>
            <field name="email_from"><PRESIDIO_ANONYMIZED_EMAIL_ADDRESS></field>
            <field name="author_id" eval="False"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_root')])]"/>
            <field name="date" eval="datetime.today()"/>
        </record>

        <!-- Server Actions -->
        <record id="gocardless_add_partner_action" model="ir.cron">
            <field name="name">Gocardless: Add Partner Email Batch</field>
            <field name="model_id" ref="model_res_partner"/>
            <field name="state">code</field>
            <field name="code">model.addPartnerBatchRun()</field>
            <field name="interval_number">10</field>
            <field name="numbercall">-1</field>
            <field name="interval_type">minutes</field>
            <field name="active" eval="True" />
        </record>

        <record id="gocardless_event_queue_action" model="ir.cron">
            <field name="name">Gocardless: Process Event Queue</field>
            <field name="model_id" ref="model_gocardless_event"/>
            <field name="state">code</field>
            <field name="code">model.doEvents()</field>
            <field name="interval_number">10</field>
            <field name="interval_type">minutes</field>
            <field name="numbercall">-1</field>
            <field name="active" eval="True" />
        </record>        
        
        <!-- Accounting & Journals -->
<!--         <record id="journal_gocardless" model="account.journal">
            <field name="name">GoCardless</field>
            <field name="code">GC</field>
            <field name="type">bank</field>
            <field name="show_on_dashboard" eval="True" />
        </record>
 -->
        <!-- Email Templates -->
        <record id="gc_mandate_invite_email" model="mail.template">
            <field name="name">GoCardless: Mandate Setup Email</field>
            <field name="model_id" ref="model_res_partner" />
            <field name="email_from">{{ object.env.company.email_formatted }}</field>
            <field name="email_to">{{ object.email_formatted }}</field>
            <field name="subject">{{ object.env.company.name }} Payment Setup Instructions</field>
            <field name="body_html" type="html">
                    <p>Dear <t t-out="object.name" contenteditable="false" data-oe-t-inline="true">Recipient Name</t>,</p>
                    <p>You have been requested to set up a Direct Debit mandate with GoCardless. To do so, please visit the following link:</p>
                    <p>
                        <a t-att-href="object.gc_redirect_url">
                            <t t-out="object.gc_redirect_url" contenteditable="false" data-oe-t-inline="true" />
                        </a>
                    </p>
                    <p></p>
                    <p></p>
                    <p>Many thanks,</p>
                    <p>
                        <t t-out="object.env.company.name" contenteditable="false" data-oe-t-inline="true">Company Name</t>
                    </p>
            </field>
        </record>
    </data>
</odoo>
========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\demo\demo.xml
Nome: demo.xml
----------------------------------------
<odoo>
    <data>
        <!--  -->
        <!--   <record id="object0" model="gocardless.gocardless"> -->
        <!--     <field name="name">Object 0</field> -->
        <!--     <field name="value">0</field> -->
        <!--   </record> -->
        <!--  -->
        <!--   <record id="object1" model="gocardless.gocardless"> -->
        <!--     <field name="name">Object 1</field> -->
        <!--     <field name="value">10</field> -->
        <!--   </record> -->
        <!--  -->
        <!--   <record id="object2" model="gocardless.gocardless"> -->
        <!--     <field name="name">Object 2</field> -->
        <!--     <field name="value">20</field> -->
        <!--   </record> -->
        <!--  -->
        <!--   <record id="object3" model="gocardless.gocardless"> -->
        <!--     <field name="name">Object 3</field> -->
        <!--     <field name="value">30</field> -->
        <!--   </record> -->
        <!--  -->
        <!--   <record id="object4" model="gocardless.gocardless"> -->
        <!--     <field name="name">Object 4</field> -->
        <!--     <field name="value">40</field> -->
        <!--   </record> -->
        <!--  -->
    </data>
</odoo>
========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\api_client.py
Nome: api_client.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

import sys
import platform
try:
    import urllib.parse as urlparse
except ImportError:
    import urlparse
import json

import requests

from . import errors

class ApiClient(object):
    """Client for interacting with a JSON HTTP API, using OAuth2-style auth.

    Args:
      base_url (string): The prefix that's prepended to all request paths.
      access_token (string): Token used in the Authorization header.
    """

    def __init__(self, base_url, access_token):
        self.base_url = base_url
        self.access_token = access_token

    def get(self, path, params=None, headers=None):
        """Perform a GET request, optionally providing query-string params.

        Args:
          path (str): A path that gets appended to ``base_url``.
          params (dict, optional): Dictionary of param names to values.

        Example:
          api_client.get('/users', params={'active': True})

        Returns:
          A requests ``Response`` object.
        """
        response = requests.get(
            self._url_for(path),
            params=params,
            headers=self._headers(headers)
        )
        self._handle_errors(response)
        return response

    def post(self, path, body, headers=None):
        """Perform a POST request, providing a body, which will be JSON-encoded.

        Args:
          path (str): A path that gets appended to ``base_url``.
          body (dict): Dictionary that will be JSON-encoded and sent as the body.

        Example:
          api_client.post('/users', body={'name': 'Billy Jean'})

        Returns:
          A requests ``Response`` object.
        """

        response = requests.post(
            self._url_for(path),
            data=json.dumps(body),
            headers=self._headers(headers)
        )
        self._handle_errors(response)
        return response

    def put(self, path, body, headers=None):
        """Perform a PUT request, providing a body, which will be JSON-encoded.

        Args:
          path (str): A path that gets appended to ``base_url``.
          body (dict): Dictionary that will be JSON-encoded and sent as the body.

        Example:
          api_client.put('/users', body={'name': 'Billy Jean'})

        Returns:
          A requests ``Response`` object.
        """
        response = requests.put(
            self._url_for(path),
            data=json.dumps(body),
            headers=self._headers(headers)
        )
        self._handle_errors(response)
        return response

    def delete(self, path, body, headers=None):
        """Perform a DELETE request, providing a body, which will be JSON-encoded.

        Args:
          path (str): A path that gets appended to ``base_url``.
          body (dict): Dictionary that will be JSON-encoded and sent as the body.

        Example:
          api_client.delete('/users', body={'name': 'Billy Jean'})

        Returns:
          A requests ``Response`` object.
        """
        response = requests.delete(
            self._url_for(path),
            data=json.dumps(body),
            headers=self._headers(headers)
        )
        self._handle_errors(response)
        return response

    def _handle_errors(self, response):
        try:
            response_body = response.json()
        except ValueError:
            msg = 'Malformed response received from server'
            raise errors.MalformedResponseError(msg, response.text)

        if response.status_code < 400:
            return

        error = response.json()['error']
        exception_class = errors.ApiError.exception_for(response.status_code, error['type'], error.get('errors'))
        raise exception_class(error)

    def _url_for(self, path):
        return urlparse.urljoin(self.base_url, path)

    def _headers(self, custom_headers):
        headers = self._default_headers()
        if custom_headers:
          headers.update(custom_headers)
        return headers

    def _default_headers(self):
        return {
            'Accept': 'application/json',
            'Authorization': 'Bearer {0}'.format(self.access_token),
            'Content-Type': 'application/json',
            'GoCardless-Client-Library': 'gocardless-pro-python',
            'GoCardless-Client-Version': '1.32.0',
            'User-Agent': self._user_agent(),
            'GoCardless-Version': '2015-07-06',
        }

    def _user_agent(self):
        python_version = '.'.join(platform.python_version_tuple()[0:2])
        vm_version = '{}.{}.{}-{}{}'.format(*sys.version_info)
        return ' '.join([
            'gocardless-pro-python/1.32.0',
            'python/{0}'.format(python_version),
            '{0}/{1}'.format(platform.python_implementation(), vm_version),
            '{0}/{1}'.format(platform.system(), platform.release()),
            'requests/{0}'.format(requests.__version__),
        ])

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\api_response.py
Nome: api_response.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class ApiResponse(object):
    """Response from the {{ .Config.api_name }} API, providing access
    to the status code, headers, and body.
    """

    def __init__(self, response):
        self._response = response

    @property
    def status_code(self):
        return self._response.status_code

    @property
    def headers(self):
        return self._response.headers

    @property
    def body(self):
        return self._response.json()


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\client.py
Nome: client.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import services
from .api_client import ApiClient

class Client(object):
    """Client for interacting with the GoCardless Pro API.

    Instantiate a client object with your access token and environment, then
    use the resource methods to access the API.

    Args:
      access_token (str): Find or generate this in your GoCardless Pro dashboard
        (https://manage.gocardless.com/organisation/access-tokens).
      environment (str): Either 'sandbox' or 'live'.
      base_url (str): Manually set a base URL. Most people should use
        `environment` instead.
      raise_on_idempotency_conflict (bool): Configure refetching of conflicting resource

    Example:
      client = Client(access_token=ACCESS_TOKEN, environment='sandbox')
      for customer in client.customers.list():
          print '{} {}'.format(customer.family_name, customer.given_name)
    """

    def __init__(self, access_token=None, environment=None, base_url=None, raise_on_idempotency_conflict=False):
        if access_token is None:
            raise ValueError('No access_token provided')

        if environment is None and base_url is None:
            raise ValueError('No environment or base_url specified')

        base_url = base_url or self._environment_url(environment)
        self._api_client = ApiClient(base_url, access_token)
        self._raise_on_idempotency_conflict = raise_on_idempotency_conflict

    @property
    def bank_authorisations(self):
        return services.BankAuthorisationsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def bank_details_lookups(self):
        return services.BankDetailsLookupsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def billing_requests(self):
        return services.BillingRequestsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def billing_request_flows(self):
        return services.BillingRequestFlowsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def billing_request_templates(self):
        return services.BillingRequestTemplatesService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def blocks(self):
        return services.BlocksService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def creditors(self):
        return services.CreditorsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def creditor_bank_accounts(self):
        return services.CreditorBankAccountsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def currency_exchange_rates(self):
        return services.CurrencyExchangeRatesService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def customers(self):
        return services.CustomersService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def customer_bank_accounts(self):
        return services.CustomerBankAccountsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def customer_notifications(self):
        return services.CustomerNotificationsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def events(self):
        return services.EventsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def instalment_schedules(self):
        return services.InstalmentSchedulesService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def institutions(self):
        return services.InstitutionsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def mandates(self):
        return services.MandatesService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def mandate_imports(self):
        return services.MandateImportsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def mandate_import_entries(self):
        return services.MandateImportEntriesService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def mandate_pdfs(self):
        return services.MandatePdfsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def payer_authorisations(self):
        return services.PayerAuthorisationsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def payments(self):
        return services.PaymentsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def payouts(self):
        return services.PayoutsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def payout_items(self):
        return services.PayoutItemsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def redirect_flows(self):
        return services.RedirectFlowsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def refunds(self):
        return services.RefundsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def scenario_simulators(self):
        return services.ScenarioSimulatorsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def subscriptions(self):
        return services.SubscriptionsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def tax_rates(self):
        return services.TaxRatesService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    @property
    def webhooks(self):
        return services.WebhooksService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

    def _environment_url(self, environment):
        environment_urls = { 
            'live': 'https://api.gocardless.com',
            'sandbox': 'https://api-sandbox.gocardless.com',
        }

        if environment not in environment_urls:
            msg = 'Invalid environment "{env}", use one of {env_names}'.format(
                env=environment,
                env_names=', '.join(environment_urls.keys())
            )
            raise ValueError(msg)

        return environment_urls[environment]

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\errors.py
Nome: errors.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

import json


class GoCardlessProError(Exception):
    """Base exception class for gocardless_pro errors."""


class ApiError(GoCardlessProError):
    """Base exception class for GoCardless API errors. API errors will result
    in one of this class' subclasses being raised.
    """

    def __init__(self, error):
        self.error = error

    def __str__(self):
        messages = [error['message'] for error in (self.errors or [])
                    if error['message'] != self.message]
        if messages:
            return '{} ({})'.format(self.message, ', '.join(messages))
        else:
            return self.message

    @property
    def type(self):
        return self.error.get('type')

    @property
    def code(self):
        return self.error.get('code')

    @property
    def errors(self):
        return self.error.get('errors')

    @property
    def documentation_url(self):
        return self.error.get('documentation_url')

    @property
    def message(self):
        return self.error.get('message')

    @property
    def request_id(self):
        return self.error.get('request_id')

    @classmethod
    def _exception_for_status(cls, status):
        if status == 401:
            return AuthenticationError
        elif status == 403:
            return PermissionsError
        elif status == 429:
            return RateLimitError
        else:
            return None

    @classmethod
    def _exception_for_error_type(cls, error_type, errors=[]):
        if error_type == 'validation_failed':
            return ValidationFailedError
        elif error_type == 'invalid_api_usage':
            return InvalidApiUsageError
        elif error_type == 'invalid_state':
            for error in errors:
                if error['reason'] == 'idempotent_creation_conflict':
                    return IdempotentCreationConflictError
            return InvalidStateError
        elif error_type == 'gocardless':
            return GoCardlessInternalError
        else:
            return None


    @classmethod
    def exception_for(cls, status, error_type, errors=[]):
        exception = cls._exception_for_status(status) or cls._exception_for_error_type(error_type, errors)
        if exception is not None:
            return exception
        raise GoCardlessProError('Invalid error type "{}"'.format(error_type))


class ValidationFailedError(ApiError):

    def __str__(self):
        if self.errors and 'field' in self.errors[0]:
            errors = ['{field} {message}'.format(**error) for error in self.errors]
            return '{} ({})'.format(self.message, ', '.join(errors))
        return super(ValidationFailedError, self).__str__()


class IdempotentCreationConflictError(ApiError):

    @property
    def conflicting_resource_id(self):
        for error in self.error['errors']:
            if 'conflicting_resource_id' in error.get('links', {}) and \
                    bool(error['links']['conflicting_resource_id']):  # Neither None nor ""
                return error['links']['conflicting_resource_id']
        else:
            raise ApiError("Idempotent Creation Conflict Error missing conflicting_resource_id")


class InvalidApiUsageError(ApiError):
    pass


class InvalidStateError(ApiError):
    pass


class GoCardlessInternalError(ApiError):
    pass


class AuthenticationError(ApiError):
    pass


class PermissionsError(ApiError):
    pass


class RateLimitError(ApiError):
    pass


class MalformedResponseError(GoCardlessProError):

    def __init__(self, message, response):
        super(MalformedResponseError, self).__init__(message)
        self.response = response


class InvalidSignatureError(GoCardlessProError):
    pass

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\list_response.py
Nome: list_response.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class ListResponse(object):

    def __init__(self, records, api_response):
        self.records = records
        self.api_response = api_response

    @property
    def before(self):
        return self.api_response.body['meta']['cursors']['before']

    @property
    def after(self):
        return self.api_response.body['meta']['cursors']['after']

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\paginator.py
Nome: paginator.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Paginator(object):
    """Iterates through all records in a paginated collection, automatically
    loading each page until the last.
    """

    def __init__(self, service, params):
        self._service = service
        self._params = params

    def __iter__(self):
        return self._iterate()

    def _iterate(self):
        page = self._fetch_page(None)
        while True:
            for record in page.records:
                yield record

            if page.after is None:
                break

            page = self._fetch_page(page.after)

    def _fetch_page(self, after):
        params = self._params.copy()
        if after is not None:
            params.update({'after': after})
        return self._service.list(params=params)


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\webhooks.py
Nome: webhooks.py
----------------------------------------
import json
import hmac
import hashlib
import sys

from gocardless_pro.resources.event import Event
from gocardless_pro.errors import InvalidSignatureError

# Python 3+ does not have the basestring type, so we alias it
try:
    basestring
except:
    basestring = str

# Python 3.0 < x < 3.4 does not support handing a mutable bytearray
# to the hmac constructor, so we need to make a record of it ...
SUPPORTS_BYTEARRAY = sys.version_info[0] == 2 or \
  sys.version_info[1] > 3

def parse(body, webhook_secret, signature_header):
    _verify_signature(body, webhook_secret, signature_header)

    events_data = json.loads(to_string(body))
    return [Event(attrs, None) for attrs in events_data['events']]

def _verify_signature(body, key, expected_signature):
    digest = hmac.new(
        to_bytes(key),
        to_bytes(body),
        hashlib.sha256
    ).hexdigest()

    if not hmac.compare_digest(expected_signature, digest):
        raise InvalidSignatureError()

def to_bytes(string):
    if isinstance(string, basestring):
        if SUPPORTS_BYTEARRAY:
            return bytearray(string, 'utf-8')
        return bytes(string, 'utf-8')

    if SUPPORTS_BYTEARRAY:
        return string

    return bytes(string)

def to_string(byte_sequence):
    if isinstance(byte_sequence, bytearray):
        return byte_sequence.decode("utf-8")

    return byte_sequence

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\__init__.py
Nome: __init__.py
----------------------------------------
"""A client library for the GoCardless Pro API."""

from .client import Client

__version__ = '1.32.0'


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\bank_authorisation.py
Nome: bank_authorisation.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class BankAuthorisation(object):
    """A thin wrapper around a bank_authorisation, providing easy access to its
    attributes.

    Example:
      bank_authorisation = client.bank_authorisations.get()
      bank_authorisation.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def authorisation_type(self):
        return self.attributes.get('authorisation_type')
  

    @property
    def authorised_at(self):
        return self.attributes.get('authorised_at')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def expires_at(self):
        return self.attributes.get('expires_at')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def last_visited_at(self):
        return self.attributes.get('last_visited_at')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def redirect_uri(self):
        return self.attributes.get('redirect_uri')
  

    @property
    def url(self):
        return self.attributes.get('url')
  


  

  

  

  

  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def billing_request(self):
            return self.attributes.get('billing_request')
    
        @property
        def institution(self):
            return self.attributes.get('institution')
    
  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\bank_details_lookup.py
Nome: bank_details_lookup.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class BankDetailsLookup(object):
    """A thin wrapper around a bank_details_lookup, providing easy access to its
    attributes.

    Example:
      bank_details_lookup = client.bank_details_lookups.get()
      bank_details_lookup.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def available_debit_schemes(self):
        return self.attributes.get('available_debit_schemes')
  

    @property
    def bank_name(self):
        return self.attributes.get('bank_name')
  

    @property
    def bic(self):
        return self.attributes.get('bic')
  


  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\billing_request.py
Nome: billing_request.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class BillingRequest(object):
    """A thin wrapper around a billing_request, providing easy access to its
    attributes.

    Example:
      billing_request = client.billing_requests.get()
      billing_request.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def actions(self):
        return self.attributes.get('actions')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def fallback_enabled(self):
        return self.attributes.get('fallback_enabled')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def mandate_request(self):
        return self.MandateRequest(self.attributes.get('mandate_request'))
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  

    @property
    def payment_request(self):
        return self.PaymentRequest(self.attributes.get('payment_request'))
  

    @property
    def resources(self):
        return self.Resources(self.attributes.get('resources'))
  

    @property
    def status(self):
        return self.attributes.get('status')
  


  

  

  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def bank_authorisation(self):
            return self.attributes.get('bank_authorisation')
    
        @property
        def creditor(self):
            return self.attributes.get('creditor')
    
        @property
        def customer(self):
            return self.attributes.get('customer')
    
        @property
        def customer_bank_account(self):
            return self.attributes.get('customer_bank_account')
    
        @property
        def customer_billing_detail(self):
            return self.attributes.get('customer_billing_detail')
    
        @property
        def mandate_request(self):
            return self.attributes.get('mandate_request')
    
        @property
        def mandate_request_mandate(self):
            return self.attributes.get('mandate_request_mandate')
    
        @property
        def organisation(self):
            return self.attributes.get('organisation')
    
        @property
        def payment_request(self):
            return self.attributes.get('payment_request')
    
        @property
        def payment_request_payment(self):
            return self.attributes.get('payment_request_payment')
    
  

  
    class MandateRequest(object):
        """Wrapper for the response's 'mandate_request' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def currency(self):
            return self.attributes.get('currency')
    
        @property
        def links(self):
            return self.attributes.get('links')
    
        @property
        def metadata(self):
            return self.attributes.get('metadata')
    
        @property
        def scheme(self):
            return self.attributes.get('scheme')
    
        @property
        def verify(self):
            return self.attributes.get('verify')
    
  

  

  
    class PaymentRequest(object):
        """Wrapper for the response's 'payment_request' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def amount(self):
            return self.attributes.get('amount')
    
        @property
        def app_fee(self):
            return self.attributes.get('app_fee')
    
        @property
        def currency(self):
            return self.attributes.get('currency')
    
        @property
        def description(self):
            return self.attributes.get('description')
    
        @property
        def links(self):
            return self.attributes.get('links')
    
        @property
        def metadata(self):
            return self.attributes.get('metadata')
    
        @property
        def scheme(self):
            return self.attributes.get('scheme')
    
  

  
    class Resources(object):
        """Wrapper for the response's 'resources' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def customer(self):
            return self.attributes.get('customer')
    
        @property
        def customer_bank_account(self):
            return self.attributes.get('customer_bank_account')
    
        @property
        def customer_billing_detail(self):
            return self.attributes.get('customer_billing_detail')
    
  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\billing_request_flow.py
Nome: billing_request_flow.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class BillingRequestFlow(object):
    """A thin wrapper around a billing_request_flow, providing easy access to its
    attributes.

    Example:
      billing_request_flow = client.billing_request_flows.get()
      billing_request_flow.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def authorisation_url(self):
        return self.attributes.get('authorisation_url')
  

    @property
    def auto_fulfil(self):
        return self.attributes.get('auto_fulfil')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def exit_uri(self):
        return self.attributes.get('exit_uri')
  

    @property
    def expires_at(self):
        return self.attributes.get('expires_at')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def lock_bank_account(self):
        return self.attributes.get('lock_bank_account')
  

    @property
    def lock_currency(self):
        return self.attributes.get('lock_currency')
  

    @property
    def lock_customer_details(self):
        return self.attributes.get('lock_customer_details')
  

    @property
    def prefilled_bank_account(self):
        return self.PrefilledBankAccount(self.attributes.get('prefilled_bank_account'))
  

    @property
    def prefilled_customer(self):
        return self.PrefilledCustomer(self.attributes.get('prefilled_customer'))
  

    @property
    def redirect_uri(self):
        return self.attributes.get('redirect_uri')
  

    @property
    def session_token(self):
        return self.attributes.get('session_token')
  

    @property
    def show_redirect_buttons(self):
        return self.attributes.get('show_redirect_buttons')
  


  

  

  

  

  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def billing_request(self):
            return self.attributes.get('billing_request')
    
  

  

  

  

  
    class PrefilledBankAccount(object):
        """Wrapper for the response's 'prefilled_bank_account' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def account_type(self):
            return self.attributes.get('account_type')
    
  

  
    class PrefilledCustomer(object):
        """Wrapper for the response's 'prefilled_customer' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def address_line1(self):
            return self.attributes.get('address_line1')
    
        @property
        def address_line2(self):
            return self.attributes.get('address_line2')
    
        @property
        def address_line3(self):
            return self.attributes.get('address_line3')
    
        @property
        def city(self):
            return self.attributes.get('city')
    
        @property
        def company_name(self):
            return self.attributes.get('company_name')
    
        @property
        def country_code(self):
            return self.attributes.get('country_code')
    
        @property
        def danish_identity_number(self):
            return self.attributes.get('danish_identity_number')
    
        @property
        def email(self):
            return self.attributes.get('email')
    
        @property
        def family_name(self):
            return self.attributes.get('family_name')
    
        @property
        def given_name(self):
            return self.attributes.get('given_name')
    
        @property
        def language(self):
            return self.attributes.get('language')
    
        @property
        def postal_code(self):
            return self.attributes.get('postal_code')
    
        @property
        def region(self):
            return self.attributes.get('region')
    
        @property
        def swedish_identity_number(self):
            return self.attributes.get('swedish_identity_number')
    
  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\billing_request_template.py
Nome: billing_request_template.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class BillingRequestTemplate(object):
    """A thin wrapper around a billing_request_template, providing easy access to its
    attributes.

    Example:
      billing_request_template = client.billing_request_templates.get()
      billing_request_template.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def authorisation_url(self):
        return self.attributes.get('authorisation_url')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def mandate_request_currency(self):
        return self.attributes.get('mandate_request_currency')
  

    @property
    def mandate_request_metadata(self):
        return self.attributes.get('mandate_request_metadata')
  

    @property
    def mandate_request_scheme(self):
        return self.attributes.get('mandate_request_scheme')
  

    @property
    def mandate_request_verify(self):
        return self.attributes.get('mandate_request_verify')
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  

    @property
    def name(self):
        return self.attributes.get('name')
  

    @property
    def payment_request_amount(self):
        return self.attributes.get('payment_request_amount')
  

    @property
    def payment_request_currency(self):
        return self.attributes.get('payment_request_currency')
  

    @property
    def payment_request_description(self):
        return self.attributes.get('payment_request_description')
  

    @property
    def payment_request_metadata(self):
        return self.attributes.get('payment_request_metadata')
  

    @property
    def payment_request_scheme(self):
        return self.attributes.get('payment_request_scheme')
  

    @property
    def redirect_uri(self):
        return self.attributes.get('redirect_uri')
  

    @property
    def updated_at(self):
        return self.attributes.get('updated_at')
  


  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\block.py
Nome: block.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Block(object):
    """A thin wrapper around a block, providing easy access to its
    attributes.

    Example:
      block = client.blocks.get()
      block.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def active(self):
        return self.attributes.get('active')
  

    @property
    def block_type(self):
        return self.attributes.get('block_type')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def reason_description(self):
        return self.attributes.get('reason_description')
  

    @property
    def reason_type(self):
        return self.attributes.get('reason_type')
  

    @property
    def resource_reference(self):
        return self.attributes.get('resource_reference')
  

    @property
    def updated_at(self):
        return self.attributes.get('updated_at')
  


  

  

  

  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\creditor.py
Nome: creditor.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Creditor(object):
    """A thin wrapper around a creditor, providing easy access to its
    attributes.

    Example:
      creditor = client.creditors.get()
      creditor.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def address_line1(self):
        return self.attributes.get('address_line1')
  

    @property
    def address_line2(self):
        return self.attributes.get('address_line2')
  

    @property
    def address_line3(self):
        return self.attributes.get('address_line3')
  

    @property
    def can_create_refunds(self):
        return self.attributes.get('can_create_refunds')
  

    @property
    def city(self):
        return self.attributes.get('city')
  

    @property
    def country_code(self):
        return self.attributes.get('country_code')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def custom_payment_pages_enabled(self):
        return self.attributes.get('custom_payment_pages_enabled')
  

    @property
    def fx_payout_currency(self):
        return self.attributes.get('fx_payout_currency')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def logo_url(self):
        return self.attributes.get('logo_url')
  

    @property
    def mandate_imports_enabled(self):
        return self.attributes.get('mandate_imports_enabled')
  

    @property
    def merchant_responsible_for_notifications(self):
        return self.attributes.get('merchant_responsible_for_notifications')
  

    @property
    def name(self):
        return self.attributes.get('name')
  

    @property
    def postal_code(self):
        return self.attributes.get('postal_code')
  

    @property
    def region(self):
        return self.attributes.get('region')
  

    @property
    def scheme_identifiers(self):
        return self.attributes.get('scheme_identifiers')
  

    @property
    def verification_status(self):
        return self.attributes.get('verification_status')
  


  

  

  

  

  

  

  

  

  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def default_aud_payout_account(self):
            return self.attributes.get('default_aud_payout_account')
    
        @property
        def default_cad_payout_account(self):
            return self.attributes.get('default_cad_payout_account')
    
        @property
        def default_dkk_payout_account(self):
            return self.attributes.get('default_dkk_payout_account')
    
        @property
        def default_eur_payout_account(self):
            return self.attributes.get('default_eur_payout_account')
    
        @property
        def default_gbp_payout_account(self):
            return self.attributes.get('default_gbp_payout_account')
    
        @property
        def default_nzd_payout_account(self):
            return self.attributes.get('default_nzd_payout_account')
    
        @property
        def default_sek_payout_account(self):
            return self.attributes.get('default_sek_payout_account')
    
        @property
        def default_usd_payout_account(self):
            return self.attributes.get('default_usd_payout_account')
    
  

  

  

  

  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\creditor_bank_account.py
Nome: creditor_bank_account.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class CreditorBankAccount(object):
    """A thin wrapper around a creditor_bank_account, providing easy access to its
    attributes.

    Example:
      creditor_bank_account = client.creditor_bank_accounts.get()
      creditor_bank_account.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def account_holder_name(self):
        return self.attributes.get('account_holder_name')
  

    @property
    def account_number_ending(self):
        return self.attributes.get('account_number_ending')
  

    @property
    def account_type(self):
        return self.attributes.get('account_type')
  

    @property
    def bank_name(self):
        return self.attributes.get('bank_name')
  

    @property
    def country_code(self):
        return self.attributes.get('country_code')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def currency(self):
        return self.attributes.get('currency')
  

    @property
    def enabled(self):
        return self.attributes.get('enabled')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  


  

  

  

  

  

  

  

  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def creditor(self):
            return self.attributes.get('creditor')
    
  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\currency_exchange_rate.py
Nome: currency_exchange_rate.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class CurrencyExchangeRate(object):
    """A thin wrapper around a currency_exchange_rate, providing easy access to its
    attributes.

    Example:
      currency_exchange_rate = client.currency_exchange_rates.get()
      currency_exchange_rate.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def rate(self):
        return self.attributes.get('rate')
  

    @property
    def source(self):
        return self.attributes.get('source')
  

    @property
    def target(self):
        return self.attributes.get('target')
  

    @property
    def time(self):
        return self.attributes.get('time')
  


  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\customer.py
Nome: customer.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Customer(object):
    """A thin wrapper around a customer, providing easy access to its
    attributes.

    Example:
      customer = client.customers.get()
      customer.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def address_line1(self):
        return self.attributes.get('address_line1')
  

    @property
    def address_line2(self):
        return self.attributes.get('address_line2')
  

    @property
    def address_line3(self):
        return self.attributes.get('address_line3')
  

    @property
    def city(self):
        return self.attributes.get('city')
  

    @property
    def company_name(self):
        return self.attributes.get('company_name')
  

    @property
    def country_code(self):
        return self.attributes.get('country_code')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def danish_identity_number(self):
        return self.attributes.get('danish_identity_number')
  

    @property
    def email(self):
        return self.attributes.get('email')
  

    @property
    def family_name(self):
        return self.attributes.get('family_name')
  

    @property
    def given_name(self):
        return self.attributes.get('given_name')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def language(self):
        return self.attributes.get('language')
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  

    @property
    def phone_number(self):
        return self.attributes.get('phone_number')
  

    @property
    def postal_code(self):
        return self.attributes.get('postal_code')
  

    @property
    def region(self):
        return self.attributes.get('region')
  

    @property
    def swedish_identity_number(self):
        return self.attributes.get('swedish_identity_number')
  


  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\customer_bank_account.py
Nome: customer_bank_account.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class CustomerBankAccount(object):
    """A thin wrapper around a customer_bank_account, providing easy access to its
    attributes.

    Example:
      customer_bank_account = client.customer_bank_accounts.get()
      customer_bank_account.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def account_holder_name(self):
        return self.attributes.get('account_holder_name')
  

    @property
    def account_number_ending(self):
        return self.attributes.get('account_number_ending')
  

    @property
    def account_type(self):
        return self.attributes.get('account_type')
  

    @property
    def bank_name(self):
        return self.attributes.get('bank_name')
  

    @property
    def country_code(self):
        return self.attributes.get('country_code')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def currency(self):
        return self.attributes.get('currency')
  

    @property
    def enabled(self):
        return self.attributes.get('enabled')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  


  

  

  

  

  

  

  

  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def customer(self):
            return self.attributes.get('customer')
    
  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\customer_notification.py
Nome: customer_notification.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class CustomerNotification(object):
    """A thin wrapper around a customer_notification, providing easy access to its
    attributes.

    Example:
      customer_notification = client.customer_notifications.get()
      customer_notification.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def action_taken(self):
        return self.attributes.get('action_taken')
  

    @property
    def action_taken_at(self):
        return self.attributes.get('action_taken_at')
  

    @property
    def action_taken_by(self):
        return self.attributes.get('action_taken_by')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def type(self):
        return self.attributes.get('type')
  


  

  

  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def customer(self):
            return self.attributes.get('customer')
    
        @property
        def event(self):
            return self.attributes.get('event')
    
        @property
        def mandate(self):
            return self.attributes.get('mandate')
    
        @property
        def payment(self):
            return self.attributes.get('payment')
    
        @property
        def refund(self):
            return self.attributes.get('refund')
    
        @property
        def subscription(self):
            return self.attributes.get('subscription')
    
  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\event.py
Nome: event.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Event(object):
    """A thin wrapper around a event, providing easy access to its
    attributes.

    Example:
      event = client.events.get()
      event.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def action(self):
        return self.attributes.get('action')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def customer_notifications(self):
        return self.attributes.get('customer_notifications')
  

    @property
    def details(self):
        return self.Details(self.attributes.get('details'))
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  

    @property
    def resource_type(self):
        return self.attributes.get('resource_type')
  


  

  

  

  
    class Details(object):
        """Wrapper for the response's 'details' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def bank_account_id(self):
            return self.attributes.get('bank_account_id')
    
        @property
        def cause(self):
            return self.attributes.get('cause')
    
        @property
        def currency(self):
            return self.attributes.get('currency')
    
        @property
        def description(self):
            return self.attributes.get('description')
    
        @property
        def not_retried_reason(self):
            return self.attributes.get('not_retried_reason')
    
        @property
        def origin(self):
            return self.attributes.get('origin')
    
        @property
        def _property(self):
            return self.attributes.get('property')
    
        @property
        def reason_code(self):
            return self.attributes.get('reason_code')
    
        @property
        def scheme(self):
            return self.attributes.get('scheme')
    
        @property
        def will_attempt_retry(self):
            return self.attributes.get('will_attempt_retry')
    
  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def bank_authorisation(self):
            return self.attributes.get('bank_authorisation')
    
        @property
        def billing_request(self):
            return self.attributes.get('billing_request')
    
        @property
        def billing_request_flow(self):
            return self.attributes.get('billing_request_flow')
    
        @property
        def creditor(self):
            return self.attributes.get('creditor')
    
        @property
        def customer(self):
            return self.attributes.get('customer')
    
        @property
        def customer_bank_account(self):
            return self.attributes.get('customer_bank_account')
    
        @property
        def instalment_schedule(self):
            return self.attributes.get('instalment_schedule')
    
        @property
        def mandate(self):
            return self.attributes.get('mandate')
    
        @property
        def mandate_request_mandate(self):
            return self.attributes.get('mandate_request_mandate')
    
        @property
        def new_customer_bank_account(self):
            return self.attributes.get('new_customer_bank_account')
    
        @property
        def new_mandate(self):
            return self.attributes.get('new_mandate')
    
        @property
        def organisation(self):
            return self.attributes.get('organisation')
    
        @property
        def parent_event(self):
            return self.attributes.get('parent_event')
    
        @property
        def payer_authorisation(self):
            return self.attributes.get('payer_authorisation')
    
        @property
        def payment(self):
            return self.attributes.get('payment')
    
        @property
        def payment_request_payment(self):
            return self.attributes.get('payment_request_payment')
    
        @property
        def payout(self):
            return self.attributes.get('payout')
    
        @property
        def previous_customer_bank_account(self):
            return self.attributes.get('previous_customer_bank_account')
    
        @property
        def refund(self):
            return self.attributes.get('refund')
    
        @property
        def subscription(self):
            return self.attributes.get('subscription')
    
  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\instalment_schedule.py
Nome: instalment_schedule.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class InstalmentSchedule(object):
    """A thin wrapper around a instalment_schedule, providing easy access to its
    attributes.

    Example:
      instalment_schedule = client.instalment_schedules.get()
      instalment_schedule.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def currency(self):
        return self.attributes.get('currency')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  

    @property
    def name(self):
        return self.attributes.get('name')
  

    @property
    def payment_errors(self):
        return self.attributes.get('payment_errors')
  

    @property
    def status(self):
        return self.attributes.get('status')
  

    @property
    def total_amount(self):
        return self.attributes.get('total_amount')
  


  

  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def customer(self):
            return self.attributes.get('customer')
    
        @property
        def mandate(self):
            return self.attributes.get('mandate')
    
        @property
        def payments(self):
            return self.attributes.get('payments')
    
  

  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\institution.py
Nome: institution.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Institution(object):
    """A thin wrapper around a institution, providing easy access to its
    attributes.

    Example:
      institution = client.institutions.get()
      institution.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def bank_redirect(self):
        return self.attributes.get('bank_redirect')
  

    @property
    def country_code(self):
        return self.attributes.get('country_code')
  

    @property
    def icon_url(self):
        return self.attributes.get('icon_url')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def logo_url(self):
        return self.attributes.get('logo_url')
  

    @property
    def name(self):
        return self.attributes.get('name')
  


  

  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\mandate.py
Nome: mandate.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Mandate(object):
    """A thin wrapper around a mandate, providing easy access to its
    attributes.

    Example:
      mandate = client.mandates.get()
      mandate.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  

    @property
    def next_possible_charge_date(self):
        return self.attributes.get('next_possible_charge_date')
  

    @property
    def payments_require_approval(self):
        return self.attributes.get('payments_require_approval')
  

    @property
    def reference(self):
        return self.attributes.get('reference')
  

    @property
    def scheme(self):
        return self.attributes.get('scheme')
  

    @property
    def status(self):
        return self.attributes.get('status')
  


  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def creditor(self):
            return self.attributes.get('creditor')
    
        @property
        def customer(self):
            return self.attributes.get('customer')
    
        @property
        def customer_bank_account(self):
            return self.attributes.get('customer_bank_account')
    
        @property
        def new_mandate(self):
            return self.attributes.get('new_mandate')
    
  

  

  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\mandate_import.py
Nome: mandate_import.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class MandateImport(object):
    """A thin wrapper around a mandate_import, providing easy access to its
    attributes.

    Example:
      mandate_import = client.mandate_imports.get()
      mandate_import.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def scheme(self):
        return self.attributes.get('scheme')
  

    @property
    def status(self):
        return self.attributes.get('status')
  


  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\mandate_import_entry.py
Nome: mandate_import_entry.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class MandateImportEntry(object):
    """A thin wrapper around a mandate_import_entry, providing easy access to its
    attributes.

    Example:
      mandate_import_entry = client.mandate_import_entries.get()
      mandate_import_entry.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def record_identifier(self):
        return self.attributes.get('record_identifier')
  


  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def customer(self):
            return self.attributes.get('customer')
    
        @property
        def customer_bank_account(self):
            return self.attributes.get('customer_bank_account')
    
        @property
        def mandate(self):
            return self.attributes.get('mandate')
    
        @property
        def mandate_import(self):
            return self.attributes.get('mandate_import')
    
  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\mandate_pdf.py
Nome: mandate_pdf.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class MandatePdf(object):
    """A thin wrapper around a mandate_pdf, providing easy access to its
    attributes.

    Example:
      mandate_pdf = client.mandate_pdfs.get()
      mandate_pdf.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def expires_at(self):
        return self.attributes.get('expires_at')
  

    @property
    def url(self):
        return self.attributes.get('url')
  


  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\payer_authorisation.py
Nome: payer_authorisation.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class PayerAuthorisation(object):
    """A thin wrapper around a payer_authorisation, providing easy access to its
    attributes.

    Example:
      payer_authorisation = client.payer_authorisations.get()
      payer_authorisation.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def bank_account(self):
        return self.BankAccount(self.attributes.get('bank_account'))
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def customer(self):
        return self.Customer(self.attributes.get('customer'))
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def incomplete_fields(self):
        return self.attributes.get('incomplete_fields')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def mandate(self):
        return self.Mandate(self.attributes.get('mandate'))
  

    @property
    def status(self):
        return self.attributes.get('status')
  


  
    class BankAccount(object):
        """Wrapper for the response's 'bank_account' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def account_holder_name(self):
            return self.attributes.get('account_holder_name')
    
        @property
        def account_number(self):
            return self.attributes.get('account_number')
    
        @property
        def account_number_ending(self):
            return self.attributes.get('account_number_ending')
    
        @property
        def account_number_suffix(self):
            return self.attributes.get('account_number_suffix')
    
        @property
        def account_type(self):
            return self.attributes.get('account_type')
    
        @property
        def bank_code(self):
            return self.attributes.get('bank_code')
    
        @property
        def branch_code(self):
            return self.attributes.get('branch_code')
    
        @property
        def country_code(self):
            return self.attributes.get('country_code')
    
        @property
        def currency(self):
            return self.attributes.get('currency')
    
        @property
        def iban(self):
            return self.attributes.get('iban')
    
        @property
        def metadata(self):
            return self.attributes.get('metadata')
    
  

  

  
    class Customer(object):
        """Wrapper for the response's 'customer' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def address_line1(self):
            return self.attributes.get('address_line1')
    
        @property
        def address_line2(self):
            return self.attributes.get('address_line2')
    
        @property
        def address_line3(self):
            return self.attributes.get('address_line3')
    
        @property
        def city(self):
            return self.attributes.get('city')
    
        @property
        def company_name(self):
            return self.attributes.get('company_name')
    
        @property
        def country_code(self):
            return self.attributes.get('country_code')
    
        @property
        def danish_identity_number(self):
            return self.attributes.get('danish_identity_number')
    
        @property
        def email(self):
            return self.attributes.get('email')
    
        @property
        def family_name(self):
            return self.attributes.get('family_name')
    
        @property
        def given_name(self):
            return self.attributes.get('given_name')
    
        @property
        def locale(self):
            return self.attributes.get('locale')
    
        @property
        def metadata(self):
            return self.attributes.get('metadata')
    
        @property
        def postal_code(self):
            return self.attributes.get('postal_code')
    
        @property
        def region(self):
            return self.attributes.get('region')
    
        @property
        def swedish_identity_number(self):
            return self.attributes.get('swedish_identity_number')
    
  

  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def bank_account(self):
            return self.attributes.get('bank_account')
    
        @property
        def customer(self):
            return self.attributes.get('customer')
    
        @property
        def mandate(self):
            return self.attributes.get('mandate')
    
  

  
    class Mandate(object):
        """Wrapper for the response's 'mandate' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def metadata(self):
            return self.attributes.get('metadata')
    
        @property
        def payer_ip_address(self):
            return self.attributes.get('payer_ip_address')
    
        @property
        def reference(self):
            return self.attributes.get('reference')
    
        @property
        def scheme(self):
            return self.attributes.get('scheme')
    
  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\payment.py
Nome: payment.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Payment(object):
    """A thin wrapper around a payment, providing easy access to its
    attributes.

    Example:
      payment = client.payments.get()
      payment.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def amount(self):
        return self.attributes.get('amount')
  

    @property
    def amount_refunded(self):
        return self.attributes.get('amount_refunded')
  

    @property
    def charge_date(self):
        return self.attributes.get('charge_date')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def currency(self):
        return self.attributes.get('currency')
  

    @property
    def description(self):
        return self.attributes.get('description')
  

    @property
    def fx(self):
        return self.Fx(self.attributes.get('fx'))
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  

    @property
    def reference(self):
        return self.attributes.get('reference')
  

    @property
    def retry_if_possible(self):
        return self.attributes.get('retry_if_possible')
  

    @property
    def status(self):
        return self.attributes.get('status')
  


  

  

  

  

  

  

  
    class Fx(object):
        """Wrapper for the response's 'fx' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def estimated_exchange_rate(self):
            return self.attributes.get('estimated_exchange_rate')
    
        @property
        def exchange_rate(self):
            return self.attributes.get('exchange_rate')
    
        @property
        def fx_amount(self):
            return self.attributes.get('fx_amount')
    
        @property
        def fx_currency(self):
            return self.attributes.get('fx_currency')
    
  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def creditor(self):
            return self.attributes.get('creditor')
    
        @property
        def instalment_schedule(self):
            return self.attributes.get('instalment_schedule')
    
        @property
        def mandate(self):
            return self.attributes.get('mandate')
    
        @property
        def payout(self):
            return self.attributes.get('payout')
    
        @property
        def subscription(self):
            return self.attributes.get('subscription')
    
  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\payout.py
Nome: payout.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Payout(object):
    """A thin wrapper around a payout, providing easy access to its
    attributes.

    Example:
      payout = client.payouts.get()
      payout.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def amount(self):
        return self.attributes.get('amount')
  

    @property
    def arrival_date(self):
        return self.attributes.get('arrival_date')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def currency(self):
        return self.attributes.get('currency')
  

    @property
    def deducted_fees(self):
        return self.attributes.get('deducted_fees')
  

    @property
    def fx(self):
        return self.Fx(self.attributes.get('fx'))
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  

    @property
    def payout_type(self):
        return self.attributes.get('payout_type')
  

    @property
    def reference(self):
        return self.attributes.get('reference')
  

    @property
    def status(self):
        return self.attributes.get('status')
  

    @property
    def tax_currency(self):
        return self.attributes.get('tax_currency')
  


  

  

  

  

  

  
    class Fx(object):
        """Wrapper for the response's 'fx' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def estimated_exchange_rate(self):
            return self.attributes.get('estimated_exchange_rate')
    
        @property
        def exchange_rate(self):
            return self.attributes.get('exchange_rate')
    
        @property
        def fx_amount(self):
            return self.attributes.get('fx_amount')
    
        @property
        def fx_currency(self):
            return self.attributes.get('fx_currency')
    
  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def creditor(self):
            return self.attributes.get('creditor')
    
        @property
        def creditor_bank_account(self):
            return self.attributes.get('creditor_bank_account')
    
  

  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\payout_item.py
Nome: payout_item.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class PayoutItem(object):
    """A thin wrapper around a payout_item, providing easy access to its
    attributes.

    Example:
      payout_item = client.payout_items.get()
      payout_item.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def amount(self):
        return self.attributes.get('amount')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def taxes(self):
        return self.attributes.get('taxes')
  

    @property
    def type(self):
        return self.attributes.get('type')
  


  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def mandate(self):
            return self.attributes.get('mandate')
    
        @property
        def payment(self):
            return self.attributes.get('payment')
    
        @property
        def refund(self):
            return self.attributes.get('refund')
    
  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\redirect_flow.py
Nome: redirect_flow.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class RedirectFlow(object):
    """A thin wrapper around a redirect_flow, providing easy access to its
    attributes.

    Example:
      redirect_flow = client.redirect_flows.get()
      redirect_flow.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def confirmation_url(self):
        return self.attributes.get('confirmation_url')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def description(self):
        return self.attributes.get('description')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def mandate_reference(self):
        return self.attributes.get('mandate_reference')
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  

    @property
    def redirect_url(self):
        return self.attributes.get('redirect_url')
  

    @property
    def scheme(self):
        return self.attributes.get('scheme')
  

    @property
    def session_token(self):
        return self.attributes.get('session_token')
  

    @property
    def success_redirect_url(self):
        return self.attributes.get('success_redirect_url')
  


  

  

  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def billing_request(self):
            return self.attributes.get('billing_request')
    
        @property
        def creditor(self):
            return self.attributes.get('creditor')
    
        @property
        def customer(self):
            return self.attributes.get('customer')
    
        @property
        def customer_bank_account(self):
            return self.attributes.get('customer_bank_account')
    
        @property
        def mandate(self):
            return self.attributes.get('mandate')
    
  

  

  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\refund.py
Nome: refund.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Refund(object):
    """A thin wrapper around a refund, providing easy access to its
    attributes.

    Example:
      refund = client.refunds.get()
      refund.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def amount(self):
        return self.attributes.get('amount')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def currency(self):
        return self.attributes.get('currency')
  

    @property
    def fx(self):
        return self.Fx(self.attributes.get('fx'))
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  

    @property
    def reference(self):
        return self.attributes.get('reference')
  

    @property
    def status(self):
        return self.attributes.get('status')
  


  

  

  

  
    class Fx(object):
        """Wrapper for the response's 'fx' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def estimated_exchange_rate(self):
            return self.attributes.get('estimated_exchange_rate')
    
        @property
        def exchange_rate(self):
            return self.attributes.get('exchange_rate')
    
        @property
        def fx_amount(self):
            return self.attributes.get('fx_amount')
    
        @property
        def fx_currency(self):
            return self.attributes.get('fx_currency')
    
  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def mandate(self):
            return self.attributes.get('mandate')
    
        @property
        def payment(self):
            return self.attributes.get('payment')
    
  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\scenario_simulator.py
Nome: scenario_simulator.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class ScenarioSimulator(object):
    """A thin wrapper around a scenario_simulator, providing easy access to its
    attributes.

    Example:
      scenario_simulator = client.scenario_simulators.get()
      scenario_simulator.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def id(self):
        return self.attributes.get('id')
  


  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\subscription.py
Nome: subscription.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Subscription(object):
    """A thin wrapper around a subscription, providing easy access to its
    attributes.

    Example:
      subscription = client.subscriptions.get()
      subscription.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def amount(self):
        return self.attributes.get('amount')
  

    @property
    def app_fee(self):
        return self.attributes.get('app_fee')
  

    @property
    def count(self):
        return self.attributes.get('count')
  

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def currency(self):
        return self.attributes.get('currency')
  

    @property
    def day_of_month(self):
        return self.attributes.get('day_of_month')
  

    @property
    def earliest_charge_date_after_resume(self):
        return self.attributes.get('earliest_charge_date_after_resume')
  

    @property
    def end_date(self):
        return self.attributes.get('end_date')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def interval(self):
        return self.attributes.get('interval')
  

    @property
    def interval_unit(self):
        return self.attributes.get('interval_unit')
  

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))
  

    @property
    def metadata(self):
        return self.attributes.get('metadata')
  

    @property
    def month(self):
        return self.attributes.get('month')
  

    @property
    def name(self):
        return self.attributes.get('name')
  

    @property
    def payment_reference(self):
        return self.attributes.get('payment_reference')
  

    @property
    def retry_if_possible(self):
        return self.attributes.get('retry_if_possible')
  

    @property
    def start_date(self):
        return self.attributes.get('start_date')
  

    @property
    def status(self):
        return self.attributes.get('status')
  

    @property
    def upcoming_payments(self):
        return self.attributes.get('upcoming_payments')
  


  

  

  

  

  

  

  

  

  

  

  

  
    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes
    
        @property
        def mandate(self):
            return self.attributes.get('mandate')
    
  

  

  

  

  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\tax_rate.py
Nome: tax_rate.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class TaxRate(object):
    """A thin wrapper around a tax_rate, providing easy access to its
    attributes.

    Example:
      tax_rate = client.tax_rates.get()
      tax_rate.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def end_date(self):
        return self.attributes.get('end_date')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def jurisdiction(self):
        return self.attributes.get('jurisdiction')
  

    @property
    def percentage(self):
        return self.attributes.get('percentage')
  

    @property
    def start_date(self):
        return self.attributes.get('start_date')
  

    @property
    def type(self):
        return self.attributes.get('type')
  


  

  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\webhook.py
Nome: webhook.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Webhook(object):
    """A thin wrapper around a webhook, providing easy access to its
    attributes.

    Example:
      webhook = client.webhooks.get()
      webhook.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def created_at(self):
        return self.attributes.get('created_at')
  

    @property
    def id(self):
        return self.attributes.get('id')
  

    @property
    def is_test(self):
        return self.attributes.get('is_test')
  

    @property
    def request_body(self):
        return self.attributes.get('request_body')
  

    @property
    def request_headers(self):
        return self.attributes.get('request_headers')
  

    @property
    def response_body(self):
        return self.attributes.get('response_body')
  

    @property
    def response_body_truncated(self):
        return self.attributes.get('response_body_truncated')
  

    @property
    def response_code(self):
        return self.attributes.get('response_code')
  

    @property
    def response_headers(self):
        return self.attributes.get('response_headers')
  

    @property
    def response_headers_content_truncated(self):
        return self.attributes.get('response_headers_content_truncated')
  

    @property
    def response_headers_count_truncated(self):
        return self.attributes.get('response_headers_count_truncated')
  

    @property
    def successful(self):
        return self.attributes.get('successful')
  

    @property
    def url(self):
        return self.attributes.get('url')
  


  

  

  

  

  

  

  

  

  

  

  

  

  


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\resources\__init__.py
Nome: __init__.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from .bank_authorisation import BankAuthorisation

from .bank_details_lookup import BankDetailsLookup

from .billing_request import BillingRequest

from .billing_request_flow import BillingRequestFlow

from .billing_request_template import BillingRequestTemplate

from .block import Block

from .creditor import Creditor

from .creditor_bank_account import CreditorBankAccount

from .currency_exchange_rate import CurrencyExchangeRate

from .customer import Customer

from .customer_bank_account import CustomerBankAccount

from .customer_notification import CustomerNotification

from .event import Event

from .instalment_schedule import InstalmentSchedule

from .institution import Institution

from .mandate import Mandate

from .mandate_import import MandateImport

from .mandate_import_entry import MandateImportEntry

from .mandate_pdf import MandatePdf

from .payer_authorisation import PayerAuthorisation

from .payment import Payment

from .payout import Payout

from .payout_item import PayoutItem

from .redirect_flow import RedirectFlow

from .refund import Refund

from .scenario_simulator import ScenarioSimulator

from .subscription import Subscription

from .tax_rate import TaxRate

from .webhook import Webhook


========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\bank_authorisations_service.py
Nome: bank_authorisations_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class BankAuthorisationsService(base_service.BaseService):
    """Service class that provides access to the bank_authorisations
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.BankAuthorisation
    RESOURCE_NAME = 'bank_authorisations'


    def get(self,identity,params=None, headers=None):
        """Get a Bank Authorisation..

        Fetches a bank authorisation

        Args:
              identity (string): Unique identifier, beginning with "BAU".
              params (dict, optional): Query string parameters.

        Returns:
              BankAuthorisation
        """
        path = self._sub_url_params('/bank_authorisations/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def create(self,params=None, headers=None):
        """Create a Bank Authorisation.

        Create a Bank Authorisation.

        Args:
              params (dict, optional): Request body.

        Returns:
              BankAuthorisation
        """
        path = '/bank_authorisations'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\bank_details_lookups_service.py
Nome: bank_details_lookups_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class BankDetailsLookupsService(base_service.BaseService):
    """Service class that provides access to the bank_details_lookups
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.BankDetailsLookup
    RESOURCE_NAME = 'bank_details_lookups'


    def create(self,params=None, headers=None):
        """Perform a bank details lookup.

        Performs a bank details lookup. As part of the lookup, a modulus check
        and
        reachability check are performed.
        
        If your request returns an [error](#api-usage-errors) or the
        `available_debit_schemes`
        attribute is an empty array, you will not be able to collect payments
        from the
        specified bank account. GoCardless may be able to collect payments from
        an account
        even if no `bic` is returned.
        
        Bank account details may be supplied using [local
        details](#appendix-local-bank-details) or an IBAN.
        
        _ACH scheme_ For compliance reasons, an extra validation step is done
        using
        a third-party provider to make sure the customer's bank account can
        accept
        Direct Debit. If a bank account is discovered to be closed or invalid,
        the
        customer is requested to adjust the account number/routing number and
        succeed in this check to continue with the flow.
        
        _Note:_ Usage of this endpoint is monitored. If your organisation
        relies on GoCardless for
        modulus or reachability checking but not for payment collection, please
        get in touch.

        Args:
              params (dict, optional): Request body.

        Returns:
              BankDetailsLookup
        """
        path = '/bank_details_lookups'
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\base_service.py
Nome: base_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

import re
import time
from requests import Timeout, ConnectionError
from uuid import uuid4

from .. import list_response
from ..api_response import ApiResponse
from ..errors import MalformedResponseError

class BaseService(object):
    """Base class for API service classes."""
    def __init__(self, api_client, max_network_retries=3, retry_delay_in_seconds=0.5, raise_on_idempotency_conflict=False):
        self._api_client = api_client
        self.max_network_retries = max_network_retries
        self.retry_delay_in_seconds = retry_delay_in_seconds
        self.raise_on_idempotency_conflict = raise_on_idempotency_conflict

    def _perform_request(self, method, path, params, headers=None, retry_failures=False):
        if method == 'POST':
            headers = self._inject_idempotency_key(headers)

        if retry_failures:
            for retries_left in range(self.max_network_retries-1, -1, -1):
                try:
                    return self._attempt_request(method, path, params, headers)
                except (Timeout, ConnectionError, MalformedResponseError) as err:
                    if retries_left > 0:
                        time.sleep(self.retry_delay_in_seconds)
                    else:
                        raise err
        else:
            return self._attempt_request(method, path, params, headers)

    def _attempt_request(self, method, path, params, headers):
        if method == 'GET':
            return self._api_client.get(path, params=params, headers=headers)

        if method == 'POST':
            return self._api_client.post(path, body=params, headers=headers)

        if method == 'PUT':
            return self._api_client.put(path, body=params, headers=headers)

        if method == 'DELETE':
            return self._api_client.delete(path, body=params, headers=headers)

        raise ValueError('Invalid method "{}"'.format(method))


    def _inject_idempotency_key(self, headers):
        headers = headers or {}
        if 'Idempotency-Key' not in headers:
            headers['Idempotency-Key'] = str(uuid4())

        return headers

    def _envelope_key(self):
        return type(self).RESOURCE_NAME

    def _resource_for(self, response):
        api_response = ApiResponse(response)

        data = api_response.body[self._envelope_key()]
        klass = type(self).RESOURCE_CLASS
        if isinstance(data, dict):
            return klass(data, api_response)
        else:
            records = [klass(item, api_response) for item in data]
            return list_response.ListResponse(records, api_response)

    def _sub_url_params(self, url, params):
        return re.sub(r':(\w+)', lambda match: params[match.group(1)], url)

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\billing_requests_service.py
Nome: billing_requests_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class BillingRequestsService(base_service.BaseService):
    """Service class that provides access to the billing_requests
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.BillingRequest
    RESOURCE_NAME = 'billing_requests'


    def list(self,params=None, headers=None):
        """List Billing Requests.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        billing requests.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of BillingRequest instances
        """
        path = '/billing_requests'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def create(self,params=None, headers=None):
        """Create a Billing Request.

        

        Args:
              params (dict, optional): Request body.

        Returns:
              BillingRequest
        """
        path = '/billing_requests'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def get(self,identity,params=None, headers=None):
        """Get a single Billing Request.

        Fetches a billing request

        Args:
              identity (string): Unique identifier, beginning with "BRQ".
              params (dict, optional): Query string parameters.

        Returns:
              BillingRequest
        """
        path = self._sub_url_params('/billing_requests/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def collect_customer_details(self,identity,params=None, headers=None):
        """Collect customer details for a Billing Request.

        If the billing request has a pending
        <code>collect_customer_details</code>
        action, this endpoint can be used to collect the details in order to
        complete it.
        
        The endpoint takes the same payload as Customers, but checks that the
        customer fields are populated correctly for the billing request scheme.
        
        Whatever is provided to this endpoint is used to update the referenced
        customer, and will take effect immediately after the request is
        successful.

        Args:
              identity (string): Unique identifier, beginning with "BRQ".
              params (dict, optional): Request body.

        Returns:
              BillingRequest
        """
        path = self._sub_url_params('/billing_requests/:identity/actions/collect_customer_details', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def collect_bank_account(self,identity,params=None, headers=None):
        """Collect bank account details for a Billing Request.

        If the billing request has a pending
        <code>collect_bank_account</code> action, this endpoint can be
        used to collect the details in order to complete it.
        
        The endpoint takes the same payload as Customer Bank Accounts, but
        check
        the bank account is valid for the billing request scheme before
        creating
        and attaching it.
        
        _ACH scheme_ For compliance reasons, an extra validation step is done
        using
        a third-party provider to make sure the customer's bank account can
        accept
        Direct Debit. If a bank account is discovered to be closed or invalid,
        the
        customer is requested to adjust the account number/routing number and
        succeed in this check to continue with the flow.

        Args:
              identity (string): Unique identifier, beginning with "BRQ".
              params (dict, optional): Request body.

        Returns:
              BillingRequest
        """
        path = self._sub_url_params('/billing_requests/:identity/actions/collect_bank_account', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def fulfil(self,identity,params=None, headers=None):
        """Fulfil a Billing Request.

        If a billing request is ready to be fulfilled, call this endpoint to
        cause
        it to fulfil, executing the payment.

        Args:
              identity (string): Unique identifier, beginning with "BRQ".
              params (dict, optional): Request body.

        Returns:
              BillingRequest
        """
        path = self._sub_url_params('/billing_requests/:identity/actions/fulfil', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def choose_currency(self,identity,params=None, headers=None):
        """Change currency for a Billing Request.

        This will allow for the updating of the currency and subsequently the
        scheme if needed for a billing request
        this will only be available for mandate only flows, it will not support
        payments requests or plans

        Args:
              identity (string): Unique identifier, beginning with "BRQ".
              params (dict, optional): Request body.

        Returns:
              BillingRequest
        """
        path = self._sub_url_params('/billing_requests/:identity/actions/choose_currency', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def confirm_payer_details(self,identity,params=None, headers=None):
        """Confirm the customer and bank account details.

        This is needed when you have a mandate request. As a scheme compliance
        rule we are required to
        allow the payer to crosscheck the details entered by them and confirm
        it.

        Args:
              identity (string): Unique identifier, beginning with "BRQ".
              params (dict, optional): Request body.

        Returns:
              BillingRequest
        """
        path = self._sub_url_params('/billing_requests/:identity/actions/confirm_payer_details', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def cancel(self,identity,params=None, headers=None):
        """Cancel a Billing Request.

        Immediately cancels a billing request, causing all billing request
        flows
        to expire.

        Args:
              identity (string): Unique identifier, beginning with "BRQ".
              params (dict, optional): Request body.

        Returns:
              BillingRequest
        """
        path = self._sub_url_params('/billing_requests/:identity/actions/cancel', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def notify(self,identity,params=None, headers=None):
        """Notify the customer of a Billing Request.

        Notifies the customer linked to the billing request, asking them to
        authorise it.
        Currently, the customer can only be notified by email.

        Args:
              identity (string): Unique identifier, beginning with "BRQ".
              params (dict, optional): Request body.

        Returns:
              BillingRequest
        """
        path = self._sub_url_params('/billing_requests/:identity/actions/notify', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def fallback(self,identity,params=None, headers=None):
        """Trigger fallback for a Billing Request.

        Triggers a fallback from the open-banking flow to direct debit. Note,
        the billing request must have fallback enabled.

        Args:
              identity (string): Unique identifier, beginning with "BRQ".
              params (dict, optional): Request body.

        Returns:
              BillingRequest
        """
        path = self._sub_url_params('/billing_requests/:identity/actions/fallback', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\billing_request_flows_service.py
Nome: billing_request_flows_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class BillingRequestFlowsService(base_service.BaseService):
    """Service class that provides access to the billing_request_flows
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.BillingRequestFlow
    RESOURCE_NAME = 'billing_request_flows'


    def create(self,params=None, headers=None):
        """Create a Billing Request Flow.

        Creates a new billing request flow.

        Args:
              params (dict, optional): Request body.

        Returns:
              BillingRequestFlow
        """
        path = '/billing_request_flows'
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def initialise(self,identity,params=None, headers=None):
        """Initialise a Billing Request Flow.

        Returns the flow having generated a fresh session token which can be
        used to power
        integrations that manipulate the flow.

        Args:
              identity (string): Unique identifier, beginning with "BRF".
              params (dict, optional): Request body.

        Returns:
              BillingRequestFlow
        """
        path = self._sub_url_params('/billing_request_flows/:identity/actions/initialise', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\billing_request_templates_service.py
Nome: billing_request_templates_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class BillingRequestTemplatesService(base_service.BaseService):
    """Service class that provides access to the billing_request_templates
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.BillingRequestTemplate
    RESOURCE_NAME = 'billing_request_templates'


    def list(self,params=None, headers=None):
        """List Billing Request Templates.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        Billing Request Templates.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of BillingRequestTemplate instances
        """
        path = '/billing_request_templates'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single Billing Request Template.

        Fetches a Billing Request Template

        Args:
              identity (string): Unique identifier, beginning with "BRT".
              params (dict, optional): Query string parameters.

        Returns:
              BillingRequestTemplate
        """
        path = self._sub_url_params('/billing_request_templates/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def create(self,params=None, headers=None):
        """Create a Billing Request Template.

        

        Args:
              params (dict, optional): Request body.

        Returns:
              BillingRequestTemplate
        """
        path = '/billing_request_templates'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def update(self,identity,params=None, headers=None):
        """Update a Billing Request Template.

        Updates a Billing Request Template, which will affect all future
        Billing Requests created by this template.

        Args:
              identity (string): Unique identifier, beginning with "BRQ".
              params (dict, optional): Request body.

        Returns:
              BillingRequestTemplate
        """
        path = self._sub_url_params('/billing_request_templates/:identity', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('PUT', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\blocks_service.py
Nome: blocks_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class BlocksService(base_service.BaseService):
    """Service class that provides access to the blocks
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.Block
    RESOURCE_NAME = 'blocks'


    def create(self,params=None, headers=None):
        """Create a block.

        Creates a new Block of a given type. By default it will be active.

        Args:
              params (dict, optional): Request body.

        Returns:
              Block
        """
        path = '/blocks'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def get(self,identity,params=None, headers=None):
        """Get a single block.

        Retrieves the details of an existing block.

        Args:
              identity (string): Unique identifier, beginning with "BLC".
              params (dict, optional): Query string parameters.

        Returns:
              Block
        """
        path = self._sub_url_params('/blocks/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def list(self,params=None, headers=None):
        """List multiple blocks.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        blocks.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of Block instances
        """
        path = '/blocks'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def disable(self,identity,params=None, headers=None):
        """Disable a block.

        Disables a block so that it no longer will prevent mandate creation.

        Args:
              identity (string): Unique identifier, beginning with "BLC".
              params (dict, optional): Request body.

        Returns:
              Block
        """
        path = self._sub_url_params('/blocks/:identity/actions/disable', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def enable(self,identity,params=None, headers=None):
        """Enable a block.

        Enables a previously disabled block so that it will prevent mandate
        creation

        Args:
              identity (string): Unique identifier, beginning with "BLC".
              params (dict, optional): Request body.

        Returns:
              Block
        """
        path = self._sub_url_params('/blocks/:identity/actions/enable', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def block_by_ref(self,params=None, headers=None):
        """Create blocks by reference.

        Creates new blocks for a given reference. By default blocks will be
        active.
        Returns 201 if at least one block was created. Returns 200 if there
        were no new
        blocks created.

        Args:
              params (dict, optional): Request body.

        Returns:
              ListResponse of Block instances
        """
        path = '/block_by_ref'
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\creditors_service.py
Nome: creditors_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class CreditorsService(base_service.BaseService):
    """Service class that provides access to the creditors
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.Creditor
    RESOURCE_NAME = 'creditors'


    def create(self,params=None, headers=None):
        """Create a creditor.

        Creates a new creditor.

        Args:
              params (dict, optional): Request body.

        Returns:
              Creditor
        """
        path = '/creditors'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def list(self,params=None, headers=None):
        """List creditors.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        creditors.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of Creditor instances
        """
        path = '/creditors'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single creditor.

        Retrieves the details of an existing creditor.

        Args:
              identity (string): Unique identifier, beginning with "CR".
              params (dict, optional): Query string parameters.

        Returns:
              Creditor
        """
        path = self._sub_url_params('/creditors/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def update(self,identity,params=None, headers=None):
        """Update a creditor.

        Updates a creditor object. Supports all of the fields supported when
        creating a creditor.

        Args:
              identity (string): Unique identifier, beginning with "CR".
              params (dict, optional): Request body.

        Returns:
              Creditor
        """
        path = self._sub_url_params('/creditors/:identity', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('PUT', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\creditor_bank_accounts_service.py
Nome: creditor_bank_accounts_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class CreditorBankAccountsService(base_service.BaseService):
    """Service class that provides access to the creditor_bank_accounts
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.CreditorBankAccount
    RESOURCE_NAME = 'creditor_bank_accounts'


    def create(self,params=None, headers=None):
        """Create a creditor bank account.

        Creates a new creditor bank account object.

        Args:
              params (dict, optional): Request body.

        Returns:
              CreditorBankAccount
        """
        path = '/creditor_bank_accounts'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def list(self,params=None, headers=None):
        """List creditor bank accounts.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        creditor bank accounts.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of CreditorBankAccount instances
        """
        path = '/creditor_bank_accounts'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single creditor bank account.

        Retrieves the details of an existing creditor bank account.

        Args:
              identity (string): Unique identifier, beginning with "BA".
              params (dict, optional): Query string parameters.

        Returns:
              CreditorBankAccount
        """
        path = self._sub_url_params('/creditor_bank_accounts/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def disable(self,identity,params=None, headers=None):
        """Disable a creditor bank account.

        Immediately disables the bank account, no money can be paid out to a
        disabled account.
        
        This will return a `disable_failed` error if the bank account has
        already been disabled.
        
        A disabled bank account can be re-enabled by creating a new bank
        account resource with the same details.

        Args:
              identity (string): Unique identifier, beginning with "BA".
              params (dict, optional): Request body.

        Returns:
              CreditorBankAccount
        """
        path = self._sub_url_params('/creditor_bank_accounts/:identity/actions/disable', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\currency_exchange_rates_service.py
Nome: currency_exchange_rates_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class CurrencyExchangeRatesService(base_service.BaseService):
    """Service class that provides access to the currency_exchange_rates
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.CurrencyExchangeRate
    RESOURCE_NAME = 'currency_exchange_rates'


    def list(self,params=None, headers=None):
        """List exchange rates.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of all
        exchange rates.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of CurrencyExchangeRate instances
        """
        path = '/currency_exchange_rates'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\customers_service.py
Nome: customers_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class CustomersService(base_service.BaseService):
    """Service class that provides access to the customers
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.Customer
    RESOURCE_NAME = 'customers'


    def create(self,params=None, headers=None):
        """Create a customer.

        Creates a new customer object.

        Args:
              params (dict, optional): Request body.

        Returns:
              Customer
        """
        path = '/customers'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def list(self,params=None, headers=None):
        """List customers.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        customers.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of Customer instances
        """
        path = '/customers'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single customer.

        Retrieves the details of an existing customer.

        Args:
              identity (string): Unique identifier, beginning with "CU".
              params (dict, optional): Query string parameters.

        Returns:
              Customer
        """
        path = self._sub_url_params('/customers/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def update(self,identity,params=None, headers=None):
        """Update a customer.

        Updates a customer object. Supports all of the fields supported when
        creating a customer.

        Args:
              identity (string): Unique identifier, beginning with "CU".
              params (dict, optional): Request body.

        Returns:
              Customer
        """
        path = self._sub_url_params('/customers/:identity', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('PUT', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def remove(self,identity,params=None, headers=None):
        """Remove a customer.

        Removed customers will not appear in search results or lists of
        customers (in our API
        or exports), and it will not be possible to load an individually
        removed customer by
        ID.
        
        <p class="restricted-notice"><strong>The action of removing a customer
        cannot be reversed, so please use with care.</strong></p>

        Args:
              identity (string): Unique identifier, beginning with "CU".
              params (dict, optional): Request body.

        Returns:
              Customer
        """
        path = self._sub_url_params('/customers/:identity', {
          
            'identity': identity,
          })
        
        response = self._perform_request('DELETE', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\customer_bank_accounts_service.py
Nome: customer_bank_accounts_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class CustomerBankAccountsService(base_service.BaseService):
    """Service class that provides access to the customer_bank_accounts
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.CustomerBankAccount
    RESOURCE_NAME = 'customer_bank_accounts'


    def create(self,params=None, headers=None):
        """Create a customer bank account.

        Creates a new customer bank account object.
        
        There are three different ways to supply bank account details:
        
        - [Local details](#appendix-local-bank-details)
        
        - IBAN
        
        - [Customer Bank Account
        Tokens](#javascript-flow-create-a-customer-bank-account-token)
        
        For more information on the different fields required in each country,
        see [local bank details](#appendix-local-bank-details).

        Args:
              params (dict, optional): Request body.

        Returns:
              CustomerBankAccount
        """
        path = '/customer_bank_accounts'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def list(self,params=None, headers=None):
        """List customer bank accounts.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        bank accounts.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of CustomerBankAccount instances
        """
        path = '/customer_bank_accounts'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single customer bank account.

        Retrieves the details of an existing bank account.

        Args:
              identity (string): Unique identifier, beginning with "BA".
              params (dict, optional): Query string parameters.

        Returns:
              CustomerBankAccount
        """
        path = self._sub_url_params('/customer_bank_accounts/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def update(self,identity,params=None, headers=None):
        """Update a customer bank account.

        Updates a customer bank account object. Only the metadata parameter is
        allowed.

        Args:
              identity (string): Unique identifier, beginning with "BA".
              params (dict, optional): Request body.

        Returns:
              CustomerBankAccount
        """
        path = self._sub_url_params('/customer_bank_accounts/:identity', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('PUT', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def disable(self,identity,params=None, headers=None):
        """Disable a customer bank account.

        Immediately cancels all associated mandates and cancellable payments.
        
        This will return a `disable_failed` error if the bank account has
        already been disabled.
        
        A disabled bank account can be re-enabled by creating a new bank
        account resource with the same details.

        Args:
              identity (string): Unique identifier, beginning with "BA".
              params (dict, optional): Request body.

        Returns:
              CustomerBankAccount
        """
        path = self._sub_url_params('/customer_bank_accounts/:identity/actions/disable', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\customer_notifications_service.py
Nome: customer_notifications_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class CustomerNotificationsService(base_service.BaseService):
    """Service class that provides access to the customer_notifications
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.CustomerNotification
    RESOURCE_NAME = 'customer_notifications'


    def handle(self,identity,params=None, headers=None):
        """Handle a notification.

        "Handling" a notification means that you have sent the notification
        yourself (and
        don't want GoCardless to send it).
        If the notification has already been actioned, or the deadline to
        notify has passed,
        this endpoint will return an `already_actioned` error and you should
        not take
        further action. This endpoint takes no additional parameters.
        

        Args:
              identity (string): The id of the notification.
              params (dict, optional): Request body.

        Returns:
              CustomerNotification
        """
        path = self._sub_url_params('/customer_notifications/:identity/actions/handle', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\events_service.py
Nome: events_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class EventsService(base_service.BaseService):
    """Service class that provides access to the events
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.Event
    RESOURCE_NAME = 'events'


    def list(self,params=None, headers=None):
        """List events.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        events.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of Event instances
        """
        path = '/events'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single event.

        Retrieves the details of a single event.

        Args:
              identity (string): Unique identifier, beginning with "EV".
              params (dict, optional): Query string parameters.

        Returns:
              Event
        """
        path = self._sub_url_params('/events/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\instalment_schedules_service.py
Nome: instalment_schedules_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class InstalmentSchedulesService(base_service.BaseService):
    """Service class that provides access to the instalment_schedules
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.InstalmentSchedule
    RESOURCE_NAME = 'instalment_schedules'


    def create_with_dates(self,params=None, headers=None):
        """Create (with dates).

        Creates a new instalment schedule object, along with the associated
        payments. This
        API is recommended if you know the specific dates you wish to charge.
        Otherwise,
        please check out the [scheduling
        version](#instalment-schedules-create-with-schedule).
        
        The `instalments` property is an array of payment properties (`amount`
        and
        `charge_date`).
        
        It can take quite a while to create the associated payments, so the API
        will return
        the status as `pending` initially. When processing has completed, a
        subsequent GET
        request for the instalment schedule will either have the status
        `success` and link
        to the created payments, or the status `error` and detailed information
        about the
        failures.

        Args:
              params (dict, optional): Request body.

        Returns:
              InstalmentSchedule
        """
        path = '/instalment_schedules'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def create_with_schedule(self,params=None, headers=None):
        """Create (with schedule).

        Creates a new instalment schedule object, along with the associated
        payments. This
        API is recommended if you wish to use the GoCardless scheduling logic.
        For finer
        control over the individual dates, please check out the [alternative
        version](#instalment-schedules-create-with-dates).
        
        It can take quite a while to create the associated payments, so the API
        will return
        the status as `pending` initially. When processing has completed, a
        subsequent
        GET request for the instalment schedule will either have the status
        `success` and link to
        the created payments, or the status `error` and detailed information
        about the
        failures.

        Args:
              params (dict, optional): Request body.

        Returns:
              InstalmentSchedule
        """
        path = '/instalment_schedules'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def list(self,params=None, headers=None):
        """List instalment schedules.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        instalment schedules.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of InstalmentSchedule instances
        """
        path = '/instalment_schedules'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single instalment schedule.

        Retrieves the details of an existing instalment schedule.

        Args:
              identity (string): Unique identifier, beginning with "IS".
              params (dict, optional): Query string parameters.

        Returns:
              InstalmentSchedule
        """
        path = self._sub_url_params('/instalment_schedules/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def update(self,identity,params=None, headers=None):
        """Update an instalment schedule.

        Updates an instalment schedule. This accepts only the metadata
        parameter.

        Args:
              identity (string): Unique identifier, beginning with "IS".
              params (dict, optional): Request body.

        Returns:
              InstalmentSchedule
        """
        path = self._sub_url_params('/instalment_schedules/:identity', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('PUT', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def cancel(self,identity,params=None, headers=None):
        """Cancel an instalment schedule.

        Immediately cancels an instalment schedule; no further payments will be
        collected for it.
        
        This will fail with a `cancellation_failed` error if the instalment
        schedule is already cancelled or has completed.

        Args:
              identity (string): Unique identifier, beginning with "IS".
              params (dict, optional): Request body.

        Returns:
              InstalmentSchedule
        """
        path = self._sub_url_params('/instalment_schedules/:identity/actions/cancel', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\institutions_service.py
Nome: institutions_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class InstitutionsService(base_service.BaseService):
    """Service class that provides access to the institutions
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.Institution
    RESOURCE_NAME = 'institutions'


    def list(self,params=None, headers=None):
        """List Institutions.

        Returns a list of supported institutions.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of Institution instances
        """
        path = '/institutions'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\mandates_service.py
Nome: mandates_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class MandatesService(base_service.BaseService):
    """Service class that provides access to the mandates
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.Mandate
    RESOURCE_NAME = 'mandates'


    def create(self,params=None, headers=None):
        """Create a mandate.

        Creates a new mandate object.

        Args:
              params (dict, optional): Request body.

        Returns:
              Mandate
        """
        path = '/mandates'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def list(self,params=None, headers=None):
        """List mandates.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        mandates.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of Mandate instances
        """
        path = '/mandates'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single mandate.

        Retrieves the details of an existing mandate.

        Args:
              identity (string): Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates created before 2016.
              params (dict, optional): Query string parameters.

        Returns:
              Mandate
        """
        path = self._sub_url_params('/mandates/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def update(self,identity,params=None, headers=None):
        """Update a mandate.

        Updates a mandate object. This accepts only the metadata parameter.

        Args:
              identity (string): Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates created before 2016.
              params (dict, optional): Request body.

        Returns:
              Mandate
        """
        path = self._sub_url_params('/mandates/:identity', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('PUT', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def cancel(self,identity,params=None, headers=None):
        """Cancel a mandate.

        Immediately cancels a mandate and all associated cancellable payments.
        Any metadata supplied to this endpoint will be stored on the mandate
        cancellation event it causes.
        
        This will fail with a `cancellation_failed` error if the mandate is
        already cancelled.

        Args:
              identity (string): Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates created before 2016.
              params (dict, optional): Request body.

        Returns:
              Mandate
        """
        path = self._sub_url_params('/mandates/:identity/actions/cancel', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def reinstate(self,identity,params=None, headers=None):
        """Reinstate a mandate.

        <a name="mandate_not_inactive"></a>Reinstates a cancelled or expired
        mandate to the banks. You will receive a `resubmission_requested`
        webhook, but after that reinstating the mandate follows the same
        process as its initial creation, so you will receive a `submitted`
        webhook, followed by a `reinstated` or `failed` webhook up to two
        working days later. Any metadata supplied to this endpoint will be
        stored on the `resubmission_requested` event it causes.
        
        This will fail with a `mandate_not_inactive` error if the mandate is
        already being submitted, or is active.
        
        Mandates can be resubmitted up to 10 times.

        Args:
              identity (string): Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates created before 2016.
              params (dict, optional): Request body.

        Returns:
              Mandate
        """
        path = self._sub_url_params('/mandates/:identity/actions/reinstate', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\mandate_imports_service.py
Nome: mandate_imports_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class MandateImportsService(base_service.BaseService):
    """Service class that provides access to the mandate_imports
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.MandateImport
    RESOURCE_NAME = 'mandate_imports'


    def create(self,params=None, headers=None):
        """Create a new mandate import.

        Mandate imports are first created, before mandates are added
        one-at-a-time, so
        this endpoint merely signals the start of the import process. Once
        you've finished
        adding entries to an import, you should
        [submit](#mandate-imports-submit-a-mandate-import) it.

        Args:
              params (dict, optional): Request body.

        Returns:
              MandateImport
        """
        path = '/mandate_imports'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def get(self,identity,params=None, headers=None):
        """Get a mandate import.

        Returns a single mandate import.

        Args:
              identity (string): Unique identifier, beginning with "IM".
              params (dict, optional): Query string parameters.

        Returns:
              MandateImport
        """
        path = self._sub_url_params('/mandate_imports/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def submit(self,identity,params=None, headers=None):
        """Submit a mandate import.

        Submits the mandate import, which allows it to be processed by a member
        of the
        GoCardless team. Once the import has been submitted, it can no longer
        have entries
        added to it.
        
        In our sandbox environment, to aid development, we automatically
        process mandate
        imports approximately 10 seconds after they are submitted. This will
        allow you to
        test both the "submitted" response and wait for the webhook to confirm
        the
        processing has begun.

        Args:
              identity (string): Unique identifier, beginning with "IM".
              params (dict, optional): Request body.

        Returns:
              MandateImport
        """
        path = self._sub_url_params('/mandate_imports/:identity/actions/submit', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def cancel(self,identity,params=None, headers=None):
        """Cancel a mandate import.

        Cancels the mandate import, which aborts the import process and stops
        the mandates
        being set up in GoCardless. Once the import has been cancelled, it can
        no longer have
        entries added to it. Mandate imports which have already been submitted
        or processed
        cannot be cancelled.

        Args:
              identity (string): Unique identifier, beginning with "IM".
              params (dict, optional): Request body.

        Returns:
              MandateImport
        """
        path = self._sub_url_params('/mandate_imports/:identity/actions/cancel', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\mandate_import_entries_service.py
Nome: mandate_import_entries_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class MandateImportEntriesService(base_service.BaseService):
    """Service class that provides access to the mandate_import_entries
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.MandateImportEntry
    RESOURCE_NAME = 'mandate_import_entries'


    def create(self,params=None, headers=None):
        """Add a mandate import entry.

        For an existing [mandate import](#core-endpoints-mandate-imports), this
        endpoint can
        be used to add individual mandates to be imported into GoCardless.
        
        You can add no more than 30,000 rows to a single mandate import.
        If you attempt to go over this limit, the API will return a
        `record_limit_exceeded` error.

        Args:
              params (dict, optional): Request body.

        Returns:
              MandateImportEntry
        """
        path = '/mandate_import_entries'
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def list(self,params=None, headers=None):
        """List all mandate import entries.

        For an existing mandate import, this endpoint lists all of the entries
        attached.
        
        After a mandate import has been submitted, you can use this endpoint to
        associate records
        in your system (using the `record_identifier` that you provided when
        creating the
        mandate import).
        

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of MandateImportEntry instances
        """
        path = '/mandate_import_entries'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\mandate_pdfs_service.py
Nome: mandate_pdfs_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class MandatePdfsService(base_service.BaseService):
    """Service class that provides access to the mandate_pdfs
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.MandatePdf
    RESOURCE_NAME = 'mandate_pdfs'


    def create(self,params=None, headers=None):
        """Create a mandate PDF.

        Generates a PDF mandate and returns its temporary URL.
        
        Customer and bank account details can be left blank (for a blank
        mandate), provided manually, or inferred from the ID of an existing
        [mandate](#core-endpoints-mandates).
        
        By default, we'll generate PDF mandates in English.
        
        To generate a PDF mandate in another language, set the
        `Accept-Language` header when creating the PDF mandate to the relevant
        [ISO 639-1](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
        language code supported for the scheme.
        
        | Scheme           | Supported languages                               
                                                                               
                          |
        | :--------------- |
        :-------------------------------------------------------------------------------------------------------------------------------------------
        |
        | ACH              | English (`en`)                                    
                                                                               
                          |
        | Autogiro         | English (`en`), Swedish (`sv`)                    
                                                                               
                          |
        | Bacs             | English (`en`)                                    
                                                                               
                          |
        | BECS             | English (`en`)                                    
                                                                               
                          |
        | BECS NZ          | English (`en`)                                    
                                                                               
                          |
        | Betalingsservice | Danish (`da`), English (`en`)                     
                                                                               
                          |
        | PAD              | English (`en`)                                    
                                                                               
                          |
        | SEPA Core        | Danish (`da`), Dutch (`nl`), English (`en`),
        French (`fr`), German (`de`), Italian (`it`), Portuguese (`pt`),
        Spanish (`es`), Swedish (`sv`) |

        Args:
              params (dict, optional): Request body.

        Returns:
              MandatePdf
        """
        path = '/mandate_pdfs'
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\payer_authorisations_service.py
Nome: payer_authorisations_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class PayerAuthorisationsService(base_service.BaseService):
    """Service class that provides access to the payer_authorisations
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.PayerAuthorisation
    RESOURCE_NAME = 'payer_authorisations'


    def get(self,identity,params=None, headers=None):
        """Get a single Payer Authorisation.

        Retrieves the details of a single existing Payer Authorisation. It can
        be used for polling the status of a Payer Authorisation.

        Args:
              identity (string): Unique identifier, beginning with "PA".
              params (dict, optional): Query string parameters.

        Returns:
              PayerAuthorisation
        """
        path = self._sub_url_params('/payer_authorisations/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def create(self,params=None, headers=None):
        """Create a Payer Authorisation.

        Creates a Payer Authorisation. The resource is saved to the database
        even if incomplete. An empty array of incomplete_fields means that the
        resource is valid. The ID of the resource is used for the other
        actions. This endpoint has been designed this way so you do not need to
        save any payer data on your servers or the browser while still being
        able to implement a progressive solution, such as a multi-step form.

        Args:
              params (dict, optional): Request body.

        Returns:
              PayerAuthorisation
        """
        path = '/payer_authorisations'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def update(self,identity,params=None, headers=None):
        """Update a Payer Authorisation.

        Updates a Payer Authorisation. Updates the Payer Authorisation with the
        request data. Can be invoked as many times as needed. Only fields
        present in the request will be modified. An empty array of
        incomplete_fields means that the resource is valid. This endpoint has
        been designed this way so you do not need to save any payer data on
        your servers or the browser while still being able to implement a
        progressive solution, such a multi-step form. <p class="notice"> Note
        that in order to update the `metadata` attribute values it must be sent
        completely as it overrides the previously existing values. </p>

        Args:
              identity (string): Unique identifier, beginning with "PA".
              params (dict, optional): Request body.

        Returns:
              PayerAuthorisation
        """
        path = self._sub_url_params('/payer_authorisations/:identity', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('PUT', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def submit(self,identity,params=None, headers=None):
        """Submit a Payer Authorisation.

        Submits all the data previously pushed to this PayerAuthorisation for
        verification. This time, a 200 HTTP status is returned if the resource
        is valid and a 422 error response in case of validation errors. After
        it is successfully submitted, the Payer Authorisation can no longer be
        edited.

        Args:
              identity (string): Unique identifier, beginning with "PA".
              params (dict, optional): Request body.

        Returns:
              PayerAuthorisation
        """
        path = self._sub_url_params('/payer_authorisations/:identity/actions/submit', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def confirm(self,identity,params=None, headers=None):
        """Confirm a Payer Authorisation.

        Confirms the Payer Authorisation, indicating that the resources are
        ready to be created.
        A Payer Authorisation cannot be confirmed if it hasn't been submitted
        yet.
        
        <p class="notice">
          The main use of the confirm endpoint is to enable integrators to
        acknowledge the end of the setup process. 
          They might want to make the payers go through some other steps after
        they go through our flow or make them go through the necessary
        verification mechanism (upcoming feature).
        </p>

        Args:
              identity (string): Unique identifier, beginning with "PA".
              params (dict, optional): Request body.

        Returns:
              PayerAuthorisation
        """
        path = self._sub_url_params('/payer_authorisations/:identity/actions/confirm', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\payments_service.py
Nome: payments_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class PaymentsService(base_service.BaseService):
    """Service class that provides access to the payments
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.Payment
    RESOURCE_NAME = 'payments'


    def create(self,params=None, headers=None):
        """Create a payment.

        <a name="mandate_is_inactive"></a>Creates a new payment object.
        
        This fails with a `mandate_is_inactive` error if the linked
        [mandate](#core-endpoints-mandates) is cancelled or has failed.
        Payments can be created against mandates with status of:
        `pending_customer_approval`, `pending_submission`, `submitted`, and
        `active`.

        Args:
              params (dict, optional): Request body.

        Returns:
              Payment
        """
        path = '/payments'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def list(self,params=None, headers=None):
        """List payments.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        payments.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of Payment instances
        """
        path = '/payments'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single payment.

        Retrieves the details of a single existing payment.

        Args:
              identity (string): Unique identifier, beginning with "PM".
              params (dict, optional): Query string parameters.

        Returns:
              Payment
        """
        path = self._sub_url_params('/payments/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def update(self,identity,params=None, headers=None):
        """Update a payment.

        Updates a payment object. This accepts only the metadata parameter.

        Args:
              identity (string): Unique identifier, beginning with "PM".
              params (dict, optional): Request body.

        Returns:
              Payment
        """
        path = self._sub_url_params('/payments/:identity', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('PUT', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def cancel(self,identity,params=None, headers=None):
        """Cancel a payment.

        Cancels the payment if it has not already been submitted to the banks.
        Any metadata supplied to this endpoint will be stored on the payment
        cancellation event it causes.
        
        This will fail with a `cancellation_failed` error unless the payment's
        status is `pending_submission`.

        Args:
              identity (string): Unique identifier, beginning with "PM".
              params (dict, optional): Request body.

        Returns:
              Payment
        """
        path = self._sub_url_params('/payments/:identity/actions/cancel', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def retry(self,identity,params=None, headers=None):
        """Retry a payment.

        <a name="retry_failed"></a>Retries a failed payment if the underlying
        mandate is active. You will receive a `resubmission_requested` webhook,
        but after that retrying the payment follows the same process as its
        initial creation, so you will receive a `submitted` webhook, followed
        by a `confirmed` or `failed` event. Any metadata supplied to this
        endpoint will be stored against the payment submission event it causes.
        
        This will return a `retry_failed` error if the payment has not failed.
        
        Payments can be retried up to 3 times.

        Args:
              identity (string): Unique identifier, beginning with "PM".
              params (dict, optional): Request body.

        Returns:
              Payment
        """
        path = self._sub_url_params('/payments/:identity/actions/retry', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\payouts_service.py
Nome: payouts_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class PayoutsService(base_service.BaseService):
    """Service class that provides access to the payouts
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.Payout
    RESOURCE_NAME = 'payouts'


    def list(self,params=None, headers=None):
        """List payouts.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        payouts.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of Payout instances
        """
        path = '/payouts'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single payout.

        Retrieves the details of a single payout. For an example of how to
        reconcile the transactions in a payout, see [this
        guide](#events-reconciling-payouts-with-events).

        Args:
              identity (string): Unique identifier, beginning with "PO".
              params (dict, optional): Query string parameters.

        Returns:
              Payout
        """
        path = self._sub_url_params('/payouts/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def update(self,identity,params=None, headers=None):
        """Update a payout.

        Updates a payout object. This accepts only the metadata parameter.

        Args:
              identity (string): Unique identifier, beginning with "PO".
              params (dict, optional): Request body.

        Returns:
              Payout
        """
        path = self._sub_url_params('/payouts/:identity', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('PUT', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\payout_items_service.py
Nome: payout_items_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class PayoutItemsService(base_service.BaseService):
    """Service class that provides access to the payout_items
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.PayoutItem
    RESOURCE_NAME = 'payout_items'


    def list(self,params=None, headers=None):
        """Get all payout items in a single payout.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of
        items in the payout.
        

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of PayoutItem instances
        """
        path = '/payout_items'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\redirect_flows_service.py
Nome: redirect_flows_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class RedirectFlowsService(base_service.BaseService):
    """Service class that provides access to the redirect_flows
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.RedirectFlow
    RESOURCE_NAME = 'redirect_flows'


    def create(self,params=None, headers=None):
        """Create a redirect flow.

        Creates a redirect flow object which can then be used to redirect your
        customer to the GoCardless hosted payment pages.

        Args:
              params (dict, optional): Request body.

        Returns:
              RedirectFlow
        """
        path = '/redirect_flows'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def get(self,identity,params=None, headers=None):
        """Get a single redirect flow.

        Returns all details about a single redirect flow

        Args:
              identity (string): Unique identifier, beginning with "RE".
              params (dict, optional): Query string parameters.

        Returns:
              RedirectFlow
        """
        path = self._sub_url_params('/redirect_flows/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def complete(self,identity,params=None, headers=None):
        """Complete a redirect flow.

        This creates a [customer](#core-endpoints-customers), [customer bank
        account](#core-endpoints-customer-bank-accounts), and
        [mandate](#core-endpoints-mandates) using the details supplied by your
        customer and returns the ID of the created mandate.
        
        This will return a `redirect_flow_incomplete` error if your customer
        has not yet been redirected back to your site, and a
        `redirect_flow_already_completed` error if your integration has already
        completed this flow. It will return a `bad_request` error if the
        `session_token` differs to the one supplied when the redirect flow was
        created.

        Args:
              identity (string): Unique identifier, beginning with "RE".
              params (dict, optional): Request body.

        Returns:
              RedirectFlow
        """
        path = self._sub_url_params('/redirect_flows/:identity/actions/complete', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\refunds_service.py
Nome: refunds_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class RefundsService(base_service.BaseService):
    """Service class that provides access to the refunds
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.Refund
    RESOURCE_NAME = 'refunds'


    def create(self,params=None, headers=None):
        """Create a refund.

        Creates a new refund object.
        
        This fails with:<a name="total_amount_confirmation_invalid"></a><a
        name="number_of_refunds_exceeded"></a><a
        name="available_refund_amount_insufficient"></a>
        
        - `total_amount_confirmation_invalid` if the confirmation amount
        doesn't match the total amount refunded for the payment. This safeguard
        is there to prevent two processes from creating refunds without
        awareness of each other.
        
        - `number_of_refunds_exceeded` if five or more refunds have already
        been created against the payment.
        
        - `available_refund_amount_insufficient` if the creditor does not have
        sufficient balance for refunds available to cover the cost of the
        requested refund.
        

        Args:
              params (dict, optional): Request body.

        Returns:
              Refund
        """
        path = '/refunds'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def list(self,params=None, headers=None):
        """List refunds.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        refunds.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of Refund instances
        """
        path = '/refunds'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single refund.

        Retrieves all details for a single refund

        Args:
              identity (string): Unique identifier, beginning with "RF".
              params (dict, optional): Query string parameters.

        Returns:
              Refund
        """
        path = self._sub_url_params('/refunds/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def update(self,identity,params=None, headers=None):
        """Update a refund.

        Updates a refund object.

        Args:
              identity (string): Unique identifier, beginning with "RF".
              params (dict, optional): Request body.

        Returns:
              Refund
        """
        path = self._sub_url_params('/refunds/:identity', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('PUT', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\scenario_simulators_service.py
Nome: scenario_simulators_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class ScenarioSimulatorsService(base_service.BaseService):
    """Service class that provides access to the scenario_simulators
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.ScenarioSimulator
    RESOURCE_NAME = 'scenario_simulators'


    def run(self,identity,params=None, headers=None):
        """Simulate a scenario.

        Runs the specific scenario simulator against the specific resource

        Args:
              identity (string): The unique identifier of the simulator, used to initiate simulations. One of:
<ul>
<li>`creditor_verification_status_action_required`: Sets a creditor's `verification status` to `action required`, meaning that the creditor must provide further information to GoCardless in order to verify their account to receive payouts.</li>
<li>`creditor_verification_status_in_review`: Sets a creditor's `verification status` to `in review`, meaning that the creditor has provided all of the information requested by GoCardless to verify their account, and is now awaiting review.</li>
<li>`creditor_verification_status_successful`: Sets a creditor's `verification status` to `successful`, meaning that the creditor is fully verified and can receive payouts.</li>
<li>`payment_confirmed`: Transitions a payment through to `confirmed`. It must start in the `pending_submission` state, and its mandate must be in the `activated` state (unless it is a payment for ACH, BECS, BECS_NZ or SEPA, in which cases the mandate may be `pending_submission`, since their mandates are submitted with their first payment).</li>
<li>`payment_paid_out`: Transitions a payment through to `paid_out`, having been collected successfully and paid out to you. It must start in the `pending_submission` state, and its mandate must be in the `activated` state (unless it is a payment for ACH, BECS, BECS_NZ or SEPA, in which cases the mandate may be `pending_submission`, since their mandates are submitted with their first payment).</li>
<li>`payment_failed`: Transitions a payment through to `failed`. It must start in the `pending_submission` state, and its mandate must be in the `activated` state (unless it is a payment for ACH, BECS, BECS_NZ or SEPA, in which cases the mandate may be `pending_submission`, since their mandates are submitted with their first payment).</li>
<li>`payment_charged_back`: Behaves the same as the `payout_paid_out` simulator, except that the payment is transitioned to `charged_back` after it is paid out, having been charged back by the customer.</li>
<li>`payment_chargeback_settled`: Behaves the same as the `payment_charged_back` simulator, except that the charged back payment is additionally included as a debit item in a payout, thereby settling the charged back payment.</li>
<li>`payment_late_failure`: Transitions a payment through to `late_failure`, having been apparently collected successfully beforehand. It must start in the `pending_submission` state, and its mandate must be in the `activated` state (unless it is a payment for ACH, BECS, BECS_NZ or SEPA, in which cases the mandate may be `pending_submission`, since their mandates are submitted with their first payment). Not compatible with Autogiro mandates.</li>
<li>`payment_late_failure_settled`: Behaves the same as the `payment_late_failure` simulator, except that the late failure is additionally included as a debit item in a payout, thereby settling the late failure.</li>
<li>`payment_submitted`: Transitions a payment to `submitted`, without proceeding any further. It must start in the `pending_submission` state.</li>
<li>`mandate_activated`: Transitions a mandate through to `activated`, having been submitted to the banks and set up successfully. It must start in the `pending_submission` state. Not compatible with ACH, BECS, BECS_NZ and SEPA mandates, which are submitted and activated with their first payment.</li>
<li>`mandate_customer_approval_granted`: Transitions a mandate through to `pending_submission`, as if the customer approved the mandate creation. It must start in the `pending_customer_approval` state. Compatible only with Bacs and SEPA mandates, which support customer signatures on the mandate. All payments associated with the mandate will be transitioned to `pending_submission`. All subscriptions associated with the mandate will become `active`.</li>
<li>`mandate_customer_approval_skipped`: Transitions a mandate through to `pending_submission`, as if the customer skipped the mandate approval during the mandate creation process. It must start in the `pending_customer_approval` state. Compatible only with Bacs and SEPA mandates, which support customer signatures on the mandate. All payments associated with the mandate will be transitioned to `pending_submission`. All subscriptions associated with the mandate will become `active`.</li>
<li>`mandate_failed`: Transitions a mandate through to `failed`, having been submitted to the banks but found to be invalid (for example due to invalid bank details). It must start in the `pending_submission` or `submitted` states. Not compatible with SEPA mandates, which are submitted with their first payment.</li>
<li>`mandate_expired`: Transitions a mandate through to `expired`, having been submitted to the banks, set up successfully and then expired because no collection attempts were made against it for longer than the scheme's dormancy period (13 months for Bacs, 3 years for SEPA, 15 months for ACH, Betalingsservice, and BECS). It must start in the `pending_submission` state. Not compatible with Autogiro, BECS NZ, and PAD mandates, which do not expire.</li>
<li>`mandate_transferred`: Transitions a mandate through to `transferred`, having been submitted to the banks, set up successfully and then moved to a new bank account due to the customer using the UK's Current Account Switching Service (CASS). It must start in the `pending_submission` state. Only compatible with Bacs mandates.</li>
<li>`mandate_transferred_with_resubmission`: Transitions a mandate through `transferred` and resubmits it to the banks, can be caused be the UK's Current Account Switching Service (CASS) or when a customer contacts GoCardless to change their bank details. It must start in the `pending_submission` state. Only compatible with Bacs, SEPA and Autogiro mandates.</li>
<li>`refund_paid`: Transitions a refund to `paid`. It must start in either the `pending_submission` or `submitted` state.</li>
<li>`refund_settled`: Transitions a refund to `paid`, if it's not already, then generates a payout that includes the refund, thereby settling the funds. It must start in one of `pending_submission`, `submitted` or `paid` states.</li>
<li>`refund_bounced`: Transitions a refund to `bounced`. It must start in either the `pending_submission`, `submitted`, or `paid` state.</li>
<li>`refund_returned`: Transitions a refund to `refund_returned`. The refund must start in `pending_submission`.</li>
<li>`payout_bounced`: Transitions a payout to `bounced`. It must start in the `paid` state.</li>
<li>`billing_request_fulfilled`: Authorises the billing request, and then fulfils it. The billing request must be in the `pending` state, with all actions completed except for `bank_authorisation`. Only billing requests with a `payment_request` are supported.</li>
<li>`billing_request_fulfilled_and_payment_failed`: Authorises the billing request, fulfils it, and moves the associated payment to `failed`. The billing request must be in the `pending` state, with all actions completed except for `bank_authorisation`. Only billing requests with a `payment_request` are supported.</li>
<li>`billing_request_fulfilled_and_payment_paid_out`: Authorises the billing request, fulfils it, and moves the associated payment to `paid_out`. The billing request must be in the `pending` state, with all actions completed except for `bank_authorisation`. Only billing requests with a `payment_request` are supported.</li>
</ul>
              params (dict, optional): Request body.

        Returns:
              ScenarioSimulator
        """
        path = self._sub_url_params('/scenario_simulators/:identity/actions/run', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\subscriptions_service.py
Nome: subscriptions_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class SubscriptionsService(base_service.BaseService):
    """Service class that provides access to the subscriptions
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.Subscription
    RESOURCE_NAME = 'subscriptions'


    def create(self,params=None, headers=None):
        """Create a subscription.

        Creates a new subscription object

        Args:
              params (dict, optional): Request body.

        Returns:
              Subscription
        """
        path = '/subscriptions'
        
        if params is not None:
            params = {self._envelope_key(): params}

        try:
          response = self._perform_request('POST', path, params, headers,
                                            retry_failures=True)
        except errors.IdempotentCreationConflictError as err:
          if self.raise_on_idempotency_conflict:
            raise err
          return self.get(identity=err.conflicting_resource_id,
                          params=params,
                          headers=headers)
        return self._resource_for(response)
  

    def list(self,params=None, headers=None):
        """List subscriptions.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        subscriptions.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of Subscription instances
        """
        path = '/subscriptions'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single subscription.

        Retrieves the details of a single subscription.

        Args:
              identity (string): Unique identifier, beginning with "SB".
              params (dict, optional): Query string parameters.

        Returns:
              Subscription
        """
        path = self._sub_url_params('/subscriptions/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def update(self,identity,params=None, headers=None):
        """Update a subscription.

        Updates a subscription object.
        
        This fails with:
        
        - `validation_failed` if invalid data is provided when attempting to
        update a subscription.
        
        - `subscription_not_active` if the subscription is no longer active.
        
        - `subscription_already_ended` if the subscription has taken all
        payments.
        
        - `mandate_payments_require_approval` if the amount is being changed
        and the mandate requires approval.
        
        - `number_of_subscription_amendments_exceeded` error if the
        subscription amount has already been changed 10 times.
        
        - `forbidden` if the amount is being changed, and the subscription was
        created by an app and you are not authenticated as that app, or if the
        subscription was not created by an app and you are authenticated as an
        app
        
        - `resource_created_by_another_app` if the app fee is being changed,
        and the subscription was created by an app other than the app you are
        authenticated as
        

        Args:
              identity (string): Unique identifier, beginning with "SB".
              params (dict, optional): Request body.

        Returns:
              Subscription
        """
        path = self._sub_url_params('/subscriptions/:identity', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('PUT', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def pause(self,identity,params=None, headers=None):
        """Pause a subscription.

        Pause a subscription object.
        No payments will be created until it is resumed.
        
        This can only be used when a subscription is collecting a fixed number
        of payments (created using `count`),
        when they continue forever (created without `count` or `end_date`) or
        the subscription is already paused for a number of cycles.
        
        When `pause_cycles` is omitted the subscription is paused until the
        [resume endpoint](#subscriptions-resume-a-subscription) is called.
        If the subscription is collecting a fixed number of payments,
        `end_date` will be set to `null`.
        When paused indefinitely, `upcoming_payments` will be empty.
        
        When `pause_cycles` is provided the subscription will be paused for the
        number of cycles requested.
        If the subscription is collecting a fixed number of payments,
        `end_date` will be set to a new value.
        When paused for a number of cycles, `upcoming_payments` will still
        contain the upcoming charge dates.
        
        This fails with:
        
        - `forbidden` if the subscription was created by an app and you are not
        authenticated as that app, or if the subscription was not created by an
        app and you are authenticated as an app
        
        - `validation_failed` if invalid data is provided when attempting to
        pause a subscription.
        
        - `subscription_paused_cannot_update_cycles` if the subscription is
        already paused for a number of cycles and the request provides a value
        for `pause_cycle`.
        
        - `subscription_cannot_be_paused` if the subscription cannot be paused.
        
        - `subscription_already_ended` if the subscription has taken all
        payments.
        
        - `pause_cycles_must_be_greater_than_or_equal_to` if the provided value
        for `pause_cycles` cannot be satisfied.
        

        Args:
              identity (string): Unique identifier, beginning with "SB".
              params (dict, optional): Request body.

        Returns:
              Subscription
        """
        path = self._sub_url_params('/subscriptions/:identity/actions/pause', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def resume(self,identity,params=None, headers=None):
        """Resume a subscription.

        Resume a subscription object.
        Payments will start to be created again based on the subscriptions
        recurrence rules.
        The `charge_date` on the next payment will be the same as the
        subscriptions `earliest_charge_date_after_resume`
        
        This fails with:
        
        - `forbidden` if the subscription was created by an app and you are not
        authenticated as that app, or if the subscription was not created by an
        app and you are authenticated as an app
        
        - `validation_failed` if invalid data is provided when attempting to
        resume a subscription.
        
        - `subscription_not_paused` if the subscription is not paused.
        

        Args:
              identity (string): Unique identifier, beginning with "SB".
              params (dict, optional): Request body.

        Returns:
              Subscription
        """
        path = self._sub_url_params('/subscriptions/:identity/actions/resume', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

    def cancel(self,identity,params=None, headers=None):
        """Cancel a subscription.

        Immediately cancels a subscription; no more payments will be created
        under it. Any metadata supplied to this endpoint will be stored on the
        payment cancellation event it causes.
        
        This will fail with a cancellation_failed error if the subscription is
        already cancelled or finished.

        Args:
              identity (string): Unique identifier, beginning with "SB".
              params (dict, optional): Request body.

        Returns:
              Subscription
        """
        path = self._sub_url_params('/subscriptions/:identity/actions/cancel', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\tax_rates_service.py
Nome: tax_rates_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class TaxRatesService(base_service.BaseService):
    """Service class that provides access to the tax_rates
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.TaxRate
    RESOURCE_NAME = 'tax_rates'


    def list(self,params=None, headers=None):
        """List tax rates.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of all
        tax rates.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of TaxRate instances
        """
        path = '/tax_rates'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single tax rate.

        Retrieves the details of a tax rate.

        Args:
              identity (string): The unique identifier created by the jurisdiction, tax type and version
              params (dict, optional): Query string parameters.

        Returns:
              TaxRate
        """
        path = self._sub_url_params('/tax_rates/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\webhooks_service.py
Nome: webhooks_service.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class WebhooksService(base_service.BaseService):
    """Service class that provides access to the webhooks
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.Webhook
    RESOURCE_NAME = 'webhooks'


    def list(self,params=None, headers=None):
        """List webhooks.

        Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
        webhooks.

        Args:
              params (dict, optional): Query string parameters.

        Returns:
              ListResponse of Webhook instances
        """
        path = '/webhooks'
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)

    def all(self, params=None):
        if params is None:
            params = {}
        return Paginator(self, params)
    
  

    def get(self,identity,params=None, headers=None):
        """Get a single webhook.

        Retrieves the details of an existing webhook.

        Args:
              identity (string): Unique identifier, beginning with "WB".
              params (dict, optional): Query string parameters.

        Returns:
              Webhook
        """
        path = self._sub_url_params('/webhooks/:identity', {
          
            'identity': identity,
          })
        

        response = self._perform_request('GET', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)
  

    def retry(self,identity,params=None, headers=None):
        """Retry a webhook.

        Requests for a previous webhook to be sent again

        Args:
              identity (string): Unique identifier, beginning with "WB".
              params (dict, optional): Request body.

        Returns:
              Webhook
        """
        path = self._sub_url_params('/webhooks/:identity/actions/retry', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {'data': params}
        response = self._perform_request('POST', path, params, headers,
                                         retry_failures=False)
        return self._resource_for(response)
  

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\gocardless_pro\services\__init__.py
Nome: __init__.py
----------------------------------------
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

from .bank_authorisations_service import BankAuthorisationsService
from .bank_details_lookups_service import BankDetailsLookupsService
from .billing_requests_service import BillingRequestsService
from .billing_request_flows_service import BillingRequestFlowsService
from .billing_request_templates_service import BillingRequestTemplatesService
from .blocks_service import BlocksService
from .creditors_service import CreditorsService
from .creditor_bank_accounts_service import CreditorBankAccountsService
from .currency_exchange_rates_service import CurrencyExchangeRatesService
from .customers_service import CustomersService
from .customer_bank_accounts_service import CustomerBankAccountsService
from .customer_notifications_service import CustomerNotificationsService
from .events_service import EventsService
from .instalment_schedules_service import InstalmentSchedulesService
from .institutions_service import InstitutionsService
from .mandates_service import MandatesService
from .mandate_imports_service import MandateImportsService
from .mandate_import_entries_service import MandateImportEntriesService
from .mandate_pdfs_service import MandatePdfsService
from .payer_authorisations_service import PayerAuthorisationsService
from .payments_service import PaymentsService
from .payouts_service import PayoutsService
from .payout_items_service import PayoutItemsService
from .redirect_flows_service import RedirectFlowsService
from .refunds_service import RefundsService
from .scenario_simulators_service import ScenarioSimulatorsService
from .subscriptions_service import SubscriptionsService
from .tax_rates_service import TaxRatesService
from .webhooks_service import WebhooksService

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\models\models.py
Nome: models.py
----------------------------------------
# -*- coding: utf-8 -*-

from odoo import models, fields, api, exceptions
import logging
import datetime
import json
import time

import uuid
import werkzeug

from werkzeug import urls

_logger = logging.getLogger(__name__)

try:
    from .. import gocardless_pro
except ImportError as err:
    _logger.debug(err)    
#endtry

class GC_Importer(models.TransientModel):
    _inherit = 'base_import.import'

    
    def execute_import(self, fields, columns, options, dryrun=False):
        res_import = super(GC_Importer, self).execute_import(fields, columns, options, dryrun)

        # if we're in a dryrun then don't do anything
        if dryrun:
            return res_import

        # we only want to override for gocardless.mandate models
        if self.res_model == 'gocardless.mandate':
            # it's go time!
            for m in self.env['gocardless.mandate'].sudo().search(['&',('partner_id','=?',False),('partner_email','!=','')]):
#                try:
                    p = self.env['res.partner'].sudo().search(['&',('mandate_id','=',False),('email','=',m.partner_email)], limit=1)
                    _logger.debug("Matched mandate {} to {}".format(m.gc_mandate_id, p.name))
                    m.write({
                        'partner_id': p.id,
                        #'gc_last_state_change': datetime.date.today()
                    })
                    p.write({
                        'gc_state': 'complete',
                        'mandate_id': m.id
                    })
#                except:
#                    continue
            #rof
        #endif
        return res_import
    #end do

#end GC_Importer


class GCPayment(models.Model):
    _name = 'gocardless.payment'
    _description = 'GoCardless Payment'
    
    _rec_name   = 'gc_payment_id'

    amount = fields.Float("Transaction amount")
    
    claim_date  = fields.Datetime("Date claimed")
    post_date   = fields.Datetime("Date posted")
    payout_date = fields.Datetime("Date paid out")

    gc_payment_state = fields.Selection([
        ['pending','Pending'],
        ['created','Created'],
        ['pending_customer_approval','Pending Customer Approval'],
        ['customer_approval_granted','Customer approval: Granted'],
        ['customer_approval_rejected','Customer approval: Rejected'],
        ['customer_approval_denied', 'Customer approval: Denied'],
        ['pending_submission','Pending Submission'],
        ['submitted','Submitted'],
        ['confirmed','Confirmed'],
        ['cancelled','Cancelled'],
        ['failed','Failed'],
        ['charged_back','Charged back'],
        ['chargeback_cancelled','Chargeback cancelled'],
        ['paid_out','Paid out'],
        ['late_failure_settled','Late failure settled'],
        ['chargeback_settled','Chargeback settled'],
        ['resubmission_requested','Resubmission requested']        
    ], 
        string="Payment State",
        default='created'
    )

    last_state_change = fields.Datetime("Last state change on")

    gc_payment_id = fields.Char("Transaction ID")
    
    invoice_id = fields.Many2one('account.move')

    mandate_id  = fields.Many2one(comodel_name='gocardless.mandate',string='Mandate')

    event_ids   = fields.One2many(comodel_name='gocardless.event', inverse_name='payment_id', string="Events")

    
    def updatePaymentsBatchRun(self):
        # Method no longer used - keeping its stub to avoid
        # unnecessary cron exceptions
        _logger.warning("Deprecated cron job: remove 'Gocardless: Payment Update Batch' from scheduled actions")        
        pass

    
    def retry_payment(self):
        ICPSudo = self.env['ir.config_parameter'].sudo()
        client = gocardless_pro.Client(
            access_token = ICPSudo.get_param('gocardless.gc_access_token'),
            environment = ICPSudo.get_param('gocardless.gc_environment')
        )

        ret = False
        try:
            ret = client.payments.retry(self.gc_payment_id)
        except gocardless_pro.errors.ApiError as inst:
            raise exceptions.UserError(
                "The payment retry could not be completed for the following reason: {}"
                .format(
                    inst.message
                )
            )
            return

        self.write({'gc_payment_state': 'pending'})
        return ret
        


    
    def gc_cancel_payment(self):
        ICPSudo = self.env['ir.config_parameter'].sudo()
        client = gocardless_pro.Client(
            access_token = ICPSudo.get_param('gocardless.gc_access_token'),
            environment = ICPSudo.get_param('gocardless.gc_environment')
        )

        try:
            client.payments.cancel(self.gc_payment_id)
        except gocardless_pro.errors.ApiError as inst:
            raise exceptions.UserError(
                "The payment could not be cancelled for the following reason: {}"
                .format(
                    inst.message
                )
            )


#end GCPayment

class Invoice(models.Model):
    _inherit = 'account.move'

    # Odoo 13 compatibility thunks
    number = fields.Char(related='name', store=False)

    gc_last_payment_attempt = fields.Datetime("Date of last payment attempt", copy=False)

    gc_payment_attempted = fields.Boolean("GC Charged", copy=False)

    # calculate default value for pay_by_gc
    def _gc_get_pay_by_gc(self):
        for rec in self:
            return rec.partner_id.use_gc

    # gc_pay_by_gc = fields.Boolean("Take payment for this invoice by GoCardless", default=_gc_get_pay_by_gc)
    
    gc_retry_payment = fields.Boolean("Retry payment?", copy=False)

    gc_enable_payment_recreate = fields.Boolean("Recreate payment available", default=False, copy=False)

    gc_payments = fields.One2many(string="Payment Records", comodel_name='gocardless.payment', inverse_name='invoice_id', copy=False)

    active_payment_id   = fields.Many2one(comodel_name='gocardless.payment', string='Current Payment', copy=False)

    gc_display_gc = fields.Boolean(string="GoCardless Chargeable", store=False, compute='_compute_display_gc', search='_display_gc_search', copy=False)

    @api.depends('partner_id')
    def _compute_display_gc(self):
        if (self.env['ir.config_parameter'].sudo().get_param('gocardless.gc_access_token') not in ['', False, None]):
            for rec in self:
                rec.gc_display_gc = (rec.partner_id.gc_state not in ['setup', 'pending'])
        else:
            for rec in self:
                rec.gc_display_gc = False

    def _display_gc_search(self, operator, value):
        recs = self.search([]).filtered(lambda x : x.gc_display_gc is True)
        if recs:
            return [('id', 'in', [x.id for x in recs])]

    @api.onchange('partner_id')
    def _onchange_partner(self):
        #self.gc_pay_by_gc = self.partner_id.use_gc
        pass
        

    
    def action_gocardless_retry_payment(self):
        oops = False
        try:
            return self.active_payment_id.retry_payment()
        except exceptions.UserError as inst:
            _logger.debug("OOPS")
            oops = inst
            if "inactive mandate" in inst.message:
                _logger.debug("Enabling recreate button")
                self.gc_enable_payment_recreate = True
                self.write({
                    'gc_enable_payment_recreate': True
                })
                self.env.cr.commit()
        finally:            
            if oops:
                _logger.debug("We got an oops, raising it")
                raise oops
        # self.gc_retry_payment = True
        # return self.action_gocardless_take_payment()

    
    def action_gocardless_recreate_payment(self):
        self.gc_retry_payment = True
        return self.action_gocardless_take_payment()        

    
    def action_gocardless_take_payment(self):
        invoice = self
        
        ICPSudo = self.env['ir.config_parameter'].sudo()
        client = gocardless_pro.Client(
            access_token = ICPSudo.get_param('gocardless.gc_access_token'),
            environment = ICPSudo.get_param('gocardless.gc_environment')
        )

        try:
            payment = client.payments.create(
                params = {
                    "amount" : int((invoice.amount_total * 100)), # format amount in cents
                    "app_fee" : int((invoice.amount_total * 100) * 0.01), # DO NOT MODIFY THIS LINE, IT IS HOW WE GET PAID FOR OUR WORK. MODIFYING THIS LINE WILL VOID YOUR SUPPORT.
                    "currency" : invoice.currency_id.name,
                    "retry_if_possible": True,
                    "links" : {
                        "mandate" : invoice.partner_id.gc_mandate_id
                    },
                    "metadata": {
                        "invoice_number": invoice.number
                    }
                },
                headers = {
                    'Idempotency-Key': '{}-{}'.format(invoice.partner_id.gc_mandate_id, invoice.number) if not invoice.gc_retry_payment else 'retry-{}-{}-{}'.format(invoice.partner_id.gc_mandate_id, invoice.number, datetime.datetime.now())
                                                        # this key allows us to set a unique id for the tx in question
                                                        # - making sure we don't accidentally bill a partner twice
                }
            )
        except gocardless_pro.errors.ApiError as inst:
            raise exceptions.Warning(
                "Payment could not be submitted to GoCardless for the following reason: {}"
                .format(
                    inst.message
                )
            )

        invoice.write({
            'gc_last_payment_attempt': datetime.datetime.now(),
            'gc_payment_attempted': True,           # we've attempted to take payment
            'gc_retry_payment': False,              # if we've done a manual retry, cancel this too
            'gc_enable_payment_recreate': False     # we definitely want to cancel this one
            })

        mandate = self.env['gocardless.mandate'].search([('gc_mandate_id','=',invoice.partner_id.gc_mandate_id)], limit=1)

        p = self.env['gocardless.payment'].sudo().create({
            'amount': invoice.amount_total,
            'claim_date': datetime.datetime.now(),
            'mandate_id': mandate.id,
            'gc_payment_state': 'pending',
            'gc_payment_id': payment.id,
            'invoice_id': invoice.id
        })

        invoice.write({
            'active_payment_id': p.id
        })

        invoice.message_post(body="GoCardless payment requested for {} {} with payment ID {}".format(
            invoice.currency_id.name, invoice.amount_total, payment.id
        ))
        time.sleep(0.1) # important to avoid GoCardless API flooding & rate limit exceptions

    
    def takePaymentBatchRun(self):
        _logger.warning("Deprecated cron job: remove 'Gocardless: Invoice Take Payment Batch' from scheduled actions")
        pass

    def processPaymentEvent(self, event, gc_payment, journal):
        payment = self.env['account.payment.register'].with_context(active_model='account.move',active_ids=[self.id])
        payment.create({
            'payment_type': 'inbound',
            'amount': gc_payment.amount,
            'payment_date': datetime.date.today(),
            'journal_id': int(journal.id),
            'currency_id': int(self.currency_id.id),
            'communication': self.number,                            
            'partner_type': 'customer', #TODO: sort out the hardcoded bit here if needed
            'partner_id': int(self.partner_id.id),
        }).action_create_payments()


#end Invoice

class GC_Mandate(models.Model):
    _name = 'gocardless.mandate'
    _description = 'GoCardless Mandate'

    _rec_name   = 'gc_mandate_id'

    gc_state    = fields.Selection(
        [
            ['pending','Pending'],
            ['created','Created'],
            ['pending_submission','Pending Submission'],
            ['submitted','Submitted'],
            ['active','Active'],
            ['reinstated','Reinstated'],
            ['cancelled','Cancelled'],
            ['failed','Failed'],
            ['consumed','Consumed'],
            ['blocked','Blocked'],
            ['suspended_by_payer','Suspended by payer'],
            ['expired','Expired'],
            ['resubmission_requested','Resubmission requested'],
            ['replaced','Replaced'],
            ['pending_customer_approval','Pending customer approval'],
            ['customer_approval_granted','Customer approval granted'],
            ['customer_approval_skipped','Customer approval skipped']
        ], 
        string="Mandate state:",
        required=True
    )

    gc_last_state_change = fields.Date("Last updated", 
        default=datetime.date(year=1970,month=1,day=1)
    )

    gc_mandate_id       = fields.Char("GoCardless Mandate ID", required=True)

    event_ids           = fields.One2many(comodel_name='gocardless.event', inverse_name='mandate_id', string="Events")

    partner_id          = fields.Many2one(comodel_name='res.partner', string='Partner')
    partner_email       = fields.Char(string='Email', related='partner_id.email', store=True, readonly=False)

    
    def mandateUpdate(self):
        # Method no longer used - keeping its stub to avoid
        # unnecessary cron exceptions
        _logger.warning("Deprecated cron job: remove 'Gocardless: Mandate Update Batch' from scheduled actions")
        pass

#end GC_Mandate


class GC_Event(models.Model):
    _name = 'gocardless.event'
    _description = 'GoCardless Event'

    _rec_name = 'event_id'

    event_id        = fields.Char(string="GoCardless Event ID")
    action          = fields.Char(string="Action")
    created_at      = fields.Datetime(string="Event Date")

    cause           = fields.Char(string="Reason")
    ev_description  = fields.Char(string="Reason Description")
    
    ev_origin       = fields.Selection(
        selection = [
            ('bank','Bank'),
            ('gocardless','GoCardless'),
            ('api','API'),
            ('customer','Customer'),
            ('payer','Payer')
        ],
        string="Event origin"
    )

    ev_reason_code  = fields.Char(string="Bank Reason Code")
    ev_scheme       = fields.Char(string="Direct Debit Scheme")

    resource_type   = fields.Selection(
        selection = [
            ('payments','Payment'),
            ('mandates','Mandate'),
            ('payouts','Payout'),
            ('refunds','Refunds'),
            ('subscriptions','Subscriptions'),
            ('creditors', 'Creditors'),
            ('billing_requests','Billing Requests'),
            ('instalment_schedules','Instalment Schedule'),
            ('payer_authorisations','Payer Authorisation')
        ],
        string="Resource type"
    )

    payment_id      = fields.Many2one(comodel_name='gocardless.payment',string="Payment")
    mandate_id      = fields.Many2one(comodel_name='gocardless.mandate',string="Mandate")

    
    def do_full_event_refresh(self):
        self.process_events()

    
    def doEvents(self):
        # we're in the batch run, so pick up the last 14 days
        date_cutoff = "{}T{}Z".format(datetime.date.today() - datetime.timedelta(days=14), datetime.datetime.min.time())        
        self.process_events(date_cutoff)

    def process_events(self, date_cutoff=None):
        # Here we go with one huge-ass batch run...
        # It's about here that I started to lose my mind ;-)

        ICPSudo = self.env['ir.config_parameter'].sudo()
        gctoken = ICPSudo.get_param('gocardless.gc_access_token')
        gcenv = ICPSudo.get_param('gocardless.gc_environment')

        client = gocardless_pro.Client(
            access_token = gctoken,
            environment = gcenv
        )

        events = client.events.list(
            params = {
                "created_at[gte]": date_cutoff
            } if date_cutoff else {
                "limit": 500
            }
        ).records
        
        count = 0
        for event in events:
            # Heavy lifting loop. Should probably look at refactoring this into an event dispatcher.
            # Actually yeah, that's a good idea.
            # Edit: we did it.
            
            # anyway, to business.

            existing_event = False

            # first, make sure we don't already have the event ID in the database.
            if len(self.search([('event_id','=',event.id)])._ids) > 0:
                # event already exists (length of search result > 0),
                # so get on with the next one
                existing_event = self.env['gocardless.event'].sudo().search([('event_id','=',event.id)], limit=1)

            # parse the date into a format Python (and thus Odoo) actually likes:
            eventDate = datetime.datetime.strptime(event.created_at, "%Y-%m-%dT%H:%M:%S.%fZ")

            if not existing_event:
            # let's go ahead and create the event
                self.env['gocardless.event'].sudo().create({
                    'event_id':         event.id,
                    'action':           event.action,
                    'created_at':       eventDate,
                    'cause':            event.details.cause,
                    'ev_description':   event.details.description,
                    'ev_origin':        event.details.origin,
                    'ev_reason_code':   event.details.reason_code,
                    'ev_scheme':        event.details.scheme,
                    'resource_type':    event.resource_type,
                    'mandate_id':       self.env['gocardless.mandate'].search([('gc_mandate_id','=',event.links.mandate)], limit=1).id if event.resource_type == 'mandates' else None,
                    'payment_id':       self.env['gocardless.payment'].search([('gc_payment_id','=',event.links.payment)], limit=1).id if event.resource_type == 'payments' else None                
                })
            else:
                # event already exists
                # are we in a reprocess? let's work this out from what we know
                if date_cutoff:
                    # there's a cutoff date specified, so no we're not
                    continue
                else:
                    # we're in a reprocess, update the event
                    existing_event.write({
                        'event_id':         event.id,
                        'action':           event.action,
                        'created_at':       eventDate,
                        'cause':            event.details.cause,
                        'ev_description':   event.details.description,
                        'ev_origin':        event.details.origin,
                        'ev_reason_code':   event.details.reason_code,
                        'ev_scheme':        event.details.scheme,
                        'resource_type':    event.resource_type,
                        'mandate_id':       self.env['gocardless.mandate'].search([('gc_mandate_id','=',event.links.mandate)], limit=1).id if event.resource_type == 'mandates' else None,
                        'payment_id':       self.env['gocardless.payment'].search([('gc_payment_id','=',event.links.payment)], limit=1).id if event.resource_type == 'payments' else None                
                    })



            if event.resource_type == 'payments':
                self.dispatchPaymentEvents(event)
            elif event.resource_type == 'mandates':
                self.dispatchMandateEvents(event)
            #endif

            count += 1

        #rof
        _logger.info('Processed {} events'.format(count))
    #end doEvents

    def dispatchPaymentEvents(self, event):
        ICPSudo = self.env['ir.config_parameter'].sudo()

        post_journals = ICPSudo.get_param('gocardless.gc_keep_journal')
        jid = ICPSudo.get_param('gocardless.gc_journal_id')
        journal = self.env['account.journal'].search([('id','=',jid)])


        gc_payments = self.env['gocardless.payment'].sudo().search([('gc_payment_id','=',event.links.payment)])
        for gc_payment in gc_payments:
            eventDate = datetime.datetime.strptime(event.created_at, "%Y-%m-%dT%H:%M:%S.%fZ")
            if (gc_payment.gc_payment_state != event.action) and (eventDate > (fields.Datetime.from_string(gc_payment.last_state_change) if gc_payment.last_state_change else datetime.datetime(1970,1,1))):     
                # let's check we actually need to update something (disabled for debug)
                # pick up the previous state
                prev_state = gc_payment.gc_payment_state                
                vals = {
                    'gc_payment_state': event.action
                }

                # updated logic to catch missed 'confirmed' events
                if (event.action == 'confirmed') or (event.action == 'paid_out' and prev_state != 'confirmed'):
                    vals.update({'post_date': eventDate})
                    
                    if post_journals:
                        gc_payment.invoice_id.processPaymentEvent(event, gc_payment, journal)
                    #endif
                #endif

                if event.action == 'paid_out':
                    vals.update({'payout_date': eventDate})

                vals.update({'last_state_change': eventDate})
                gc_payment.write(vals)

                msg = "Payment update: Payment ID {} State: {} Amount: {}".format(gc_payment.gc_payment_id, gc_payment.gc_payment_state, gc_payment.amount)
                gc_payment.invoice_id.message_post(body=msg)

            #endif

        pass

    def dispatchMandateEvents(self, event):
        
        for mandate in self.env['gocardless.mandate'].sudo().search([('gc_mandate_id','=',event.links.mandate)]):
            eventDate = datetime.datetime.strptime(event.created_at, "%Y-%m-%dT%H:%M:%S.%fZ")
            if event.action == 'mandate_replaced':
                mandate.write({
                    'gc_mandate_id': event.links.new_mandate,
                    'gc_last_state_change': eventDate
                })                
                return

            if (mandate.gc_state != event.action) and (eventDate > fields.Datetime.from_string(mandate.gc_last_state_change)):     
                # let's check we actually need to update something (disabled for debug)
                mandate.write({
                    'gc_state': event.action,
                    'gc_last_state_change': eventDate
                })
                msg = "GoCardless: Mandate ID {} changed state to {}".format(mandate.gc_mandate_id,mandate.gc_state)
                mandate.partner_id.message_post(body=msg)
            #endif
        #rof

                        


class GC_Partner(models.Model):
    _inherit = 'res.partner'

    # use_gc      = fields.Boolean("Use GoCardless to collect payments?", default=False)
    use_gc      = fields.Boolean(compute='_compute_use_gc', store=False)

    @api.depends('gc_state')
    def _compute_use_gc(self):
        for rec in self:
            rec.use_gc = (rec.gc_state in ['pending', 'complete'])

    gc_state    = fields.Selection(
        [
            ['setup','Awaiting Setup'],
            ['pending','Pending'],
            ['complete','Setup Complete']
        ], 
        string="GoCardless setup state:",        
        default='setup'
    )

    gc_mandate_state    = fields.Selection(related='mandate_id.gc_state')

    gc_last_state_change = fields.Date("Last updated", default=datetime.date(year=1970,month=1,day=1))

    gc_mandate_id       = fields.Char("GoCardless Mandate ID", related='mandate_id.gc_mandate_id', store=False)
    gc_redirect_flow_id = fields.Char()
    gc_redirect_url     = fields.Char()

    gc_access_token     = fields.Char()

    mandate_id          = fields.Many2one(
        comodel_name='gocardless.mandate',
        string="GoCardless Mandate")


    
    def action_send_partner_email(self):
        self.send_partner_email(self)
        # self.write({
        #     'use_gc':    True
        # })

    def send_partner_email(self, partner, batch_run = False):
        ICPSudo = self.env['ir.config_parameter'].sudo()

        proceed = (ICPSudo.get_param('gocardless.gc_access_token') not in ['', False, None])

        if not proceed:
            raise exceptions.UserError(
                "Connect to your GoCardless account first!"
            )

        gc_url = ICPSudo.get_param('gocardless.gc_custom_domain')
        
        base_url = ICPSudo.get_param('web.base.url') # default: use Odoo base URL
        
        # check sanity of our custom domain setting - if it passes, use that.
        # because we've already set the Odoo base URL it'll fall back if one of these fails
        if type(gc_url) is str:
            if urls.url_parse(url=gc_url).scheme in ['http', 'https']:
                base_url = gc_url
            #endif
        #endif

        _logger.debug("Got something to do: {}".format(partner.name))
        count = partner.invoice_ids.search_count([('partner_id','=',partner.id),('state','!=','draft')])
        if count <= 0 and batch_run:
            return
        #endif

        gc_token = str(uuid.uuid4())
        redirect_url = urls.url_join(base_url, '/gocardless/activate/?gc_access_token={}'.format(gc_token))
        partner.write({
            'gc_state': 'pending',
            'gc_last_state_change': datetime.date.today(), 
            'gc_redirect_url': redirect_url,
            'gc_access_token': gc_token
        })
        
        # issue the email invite
        mail_template = self.env.ref('gocardless.gc_mandate_invite_email')
        self.env['mail.template'].browse(mail_template.id).send_mail(partner.id)

    
    
    def addPartnerBatchRun(self):

        date_last_week = datetime.date.today() - datetime.timedelta(days=7)
        for partner in self.search([('gc_state', 'in', ['pending', 'complete']),
                '|',
                ('gc_state','=','setup'),
                '&',
                ('gc_state','=','pending'),
                ('gc_last_state_change','<',date_last_week), # resubmit stale requests
            ]):
            self.send_partner_email(partner, batch_run=True)

        #endfor
    #end addPartnerBatchRun

#end Partner



class ResConfigSettings(models.TransientModel):
    
    _inherit = 'res.config.settings'

    gc_access_token     = fields.Char("Access Token")  

    gc_environment      = fields.Selection([['sandbox','Sandbox'],['live','Live']], "API environment", default='sandbox')
    gc_description      = fields.Char("Description (to be shown on the GoCardless mandate page)")
    gc_webhook_secret   = fields.Char("Secret (Optional, for verification of GoCardless callbacks)")
    gc_webhook_url      = fields.Char("Webhook return URL")

    gc_custom_domain    = fields.Char("Custom URL prefix (leave blank to use the default Odoo URL)")

    gc_keep_journal     = fields.Boolean("Record GoCardless payments in an accounting journal?", default=False)

    
    def gocardless_connect(self):
        self.set_values()
        return {
            'type': 'ir.actions.act_url',
            'url': '/gocardless/oauth-begin',
            'target': 'self',
        }

    
    def do_full_event_refresh(self):
        return self.env['gocardless.event'].do_full_event_refresh()

    
    def get_default_journal(self):
        return self.env.ref('gocardless.journal_gocardless').id

    
    def get_journals_selection(self):
        ret = []
        for j in self.env['account.journal']:
            ret.append([j.id, j.name])
        return ret

    gc_journal_id       = fields.Many2one(comodel_name='account.journal',string="Journal to record payments in")
    
    @api.model
    def get_values(self):
        res = super(ResConfigSettings, self).get_values()
        ICPSudo = self.env['ir.config_parameter'].sudo()

        jid = ICPSudo.get_param('gocardless.gc_journal_id')

        kj = ICPSudo.get_param('gocardless.gc_keep_journal')

        res.update(       
            gc_access_token = ICPSudo.get_param('gocardless.gc_access_token'),
            gc_environment = ICPSudo.get_param('gocardless.gc_environment'),
            gc_description = ICPSudo.get_param('gocardless.gc_description'),
            gc_webhook_secret = ICPSudo.get_param('gocardless.gc_webhook_secret'),
            gc_webhook_url = urls.url_join(ICPSudo.get_param('web.base.url'),'/gocardless/webhook/'),
            gc_custom_domain = ICPSudo.get_param('gocardless.gc_custom_domain'),
            gc_keep_journal = kj,
            gc_journal_id = int(jid) or False
        )
        return res
    #end get_values

    
    def set_values(self):
        super(ResConfigSettings, self).set_values()
        ICPSudo = self.env['ir.config_parameter'].sudo()
        ICPSudo.set_param('gocardless.gc_access_token', self.gc_access_token)
        ICPSudo.set_param('gocardless.gc_environment', self.gc_environment)
        ICPSudo.set_param('gocardless.gc_description', self.gc_description)
        ICPSudo.set_param('gocardless.gc_webhook_secret', self.gc_webhook_secret)
        ICPSudo.set_param('gocardless.gc_custom_domain', self.gc_custom_domain)
        ICPSudo.set_param('gocardless.gc_keep_journal', self.gc_keep_journal)
        ICPSudo.set_param('gocardless.gc_journal_id', int(self.gc_journal_id.id))
    #end set_values


#end ResConfigSettings
========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\models\__init__.py
Nome: __init__.py
----------------------------------------
# -*- coding: utf-8 -*-

from . import models
========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\security\ir.model.access.csv
Nome: ir.model.access.csv
----------------------------------------
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_gocardless_payment,GoCardless Payment Access,model_gocardless_payment,account.group_account_invoice,1,0,0,0
access_gocardless_mandate,GoCardless Payment Access,model_gocardless_mandate,account.group_account_invoice,1,1,1,0
access_gocardless_event,GoCardless Payment Access,model_gocardless_event,account.group_account_invoice,1,0,0,0

access_gocardless_wizard,GoCardless Payment Access,model_gocardless_charge_wizard,account.group_account_invoice,1,1,1,0

admin_access_gocardless_payment,GoCardless Payment System Access,model_gocardless_payment,base.group_system,1,0,0,0
admin_access_gocardless_mandate,GoCardless Payment System Access,model_gocardless_mandate,base.group_system,1,1,1,0
admin_access_gocardless_event,GoCardless Payment System Access,model_gocardless_event,base.group_system,1,0,0,0
========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\static\description\index.html
Nome: index.html
----------------------------------------
<section class="oe_container">
    <div class="oe_row oe_spaced">
        <h2 class="oe_slogan oe_mb32" style="color: #069;">Now with default support for GoCardless Success+</h2>
        <h3 class="oe_slogan oe_mb32">Eligible payments will be retried automatically - no action required</h3>
    </div>
    <div class="oe_row text-center">
        <img src="gc-spot.png" />
    </div>
    <div class="oe_row oe_spaced">
        <h2 class="oe_slogan" style="color:#369;">Three <b>currencies</b>. Two <b>continents</b>. One <b>click</b>.</h2>
        <h3 class="oe_slogan oe_mb32">Take payments in the <b>US, UK,</b> and <b>Europe</b> in one system</h3>
        <div class="oe_span4 text-center">
            <span class="fa fa-money fa-5x" style="color:#369;" />
            <h3 class="oe_slogan" style="color: #369;">Get paid on time</h3>
            <p class="oe_mt16">
            Take online payment quickly and easily from your customers by direct debit
            </p>
        </div>
        <div class="oe_span4 text-center">
            <span class="fa fa-gavel fa-5x" style="color:#369;" />
            <h3 class="oe_slogan" style="color: #369;">Stay compliant</h3>
            <p class="oe_mt16">
            No need to handle customers' bank details means no extra compliance burden
            </p>
        </div>
        <div class="oe_span4 text-center">
            <span class="fa fa-repeat fa-5x" style="color:#369;" />
            <h3 class="oe_slogan" style="color: #369;">Stay efficient</h3>
            <p class="oe_mt16">
            Take subsequent direct debits simply by issuing an invoice
            </p>
        </div>
    </div>
</section>

<section class="oe_container oe_dark">
    <div class="oe_row oe_spaced">
        <h2 class="oe_slogan" style="color:#369;">Taking payments just got easier</h2>
        <h3 class="oe_slogan">Simplify your billing workflow</h3>
        <p class="oe_mt32" style="text-align: justify;text-align-last: center;">
            Collect payments, invite new customers and set up Direct Debit mandates with the touch of a button
        </p>
    </div>
    <div class="oe_row oe_spaced">
        <h2 class="oe_slogan" style="color: #369;">Stay informed</h2>
        <h3 class="oe_slogan">Track the status of pending direct debit payments from within Odoo</h3>
        <p class="oe_mt32" style="text-align: justify;text-align-last: center;">
            The GoCardless pane on the invoice information provides a comprehensive look at the current status of the invoice's GoCardless payments
        </p>
        <div class="oe_row_img oe_centered oe_mt32">
            <img style="margin-left: 12.5%; width: 75%;" src="scr2.png">
        </div>
    </div>
</section>

<section class="oe_container">
    <div class="oe_row oe_spaced">
       <h2 class="oe_slogan" style="color:#369;">Fully integrated accounting</h2>
       <h3 class="oe_slogan">Post payments to a dedicated journal &mdash; or update an existing one</h3>
        <p class="oe_mt32" style="text-align: justify;text-align-last: center;">
        J&ouml;tnar Systems has provided full support for Odoo's in-built accounting features. The GoCardless connector will keep track of the progress of pending payments, and can post confirmed payments to a dedicated journal &mdash; or update an existing journal of your choice. Related invoice statuses will update automatically.
        </p>
        <div class="oe_row_img oe_centered oe_mt32">
            <img class="oe_picture oe_screenshot" src="scr3.png">
        </div>
    </div>
</section>

<section class="oe_container">
    <div class="oe_row oe_spaced">
        <h2 class="oe_slogan" style="color:#369;">Simple setup</h2>
        <h3 class="oe_slogan">Easy configuration via Odoo settings</h3>
        <p class="oe_mt32" style="text-align: justify;text-align-last: center;">
        Concise, straightforward settings page enables you to turn the key and go &mdash; simply select your environment, press Connect and follow the prompts. That's it.
        </p>
        <div class="oe_row_img oe_centered oe_mt32">
            <img class="oe_picture oe_screenshot" src="scr4.png">
        </div>
    </div>
</section>
<section class="oe_container">
    <div class="oe_row">
        <div class="oe_span6 text-center" style="min-height: 128px;">
            <img class="oe_picture" src="gocardless.png" style="margin-top: 25%; margin-left: 25%;" />
        </div>
        <div class="oe_span6 text-center">
            <a href="https://www.jotnarsystems.com/odoo-erp" target="_blank">    
                <img class="oe_picture" src="jotnar.png" alt="Jotnar Systems" title="Jotnar Systems" />
            </a>
        </div>        
    </div>
</section>

<section class="oe_container">
    <div class="oe_row oe_spaced">
        <h2 class="oe_slogan" style="color: #369;">Important information</h2>
        <p class="oe_mt32" style="text-align: justify;">
            This application will charge a 1% fee per transaction via GoCardless. This fee covers our costs of maintaining and supporting the application, and is how we get paid for our work. Please note that interfering with the code to circumvent this fee will result in zero support being given.
        </p>
        <p class="oe_mt32" style="text-align: justify;">
            Requires creation of a free account with GoCardless. This application transmits the following data to GoCardless Ltd for the purpose of setting up a Direct Debit mandate and taking payments: 
            Customer email address, invoice number, invoice amount. None of your customers' information is shared with J&ouml;tnar Systems at any time. For more information view our <a href="https://www.jotnarsystems.com/privacy-policy">Privacy Policy.</a>
        </p>
        <p class="oe_mt32" style="text-align: justify; font-weight: bold; color: #933;">
            Please note: This add-on is provided for convenience only. At no time will J&ouml;tnar Systems be held liable for any payment collected in error through use of this add-on, even in the case of malfunction.
            It is the user's own responsibility to ensure that payments submitted to GoCardless are valid and due for collection, and that any payment submitted in error is properly cancelled within the GoCardless website itself.
        </p>
    </div>
</section>
========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\views\templates.xml
Nome: templates.xml
----------------------------------------
<odoo>
    <data>
        <!-- <template id="listing"> -->
        <!--   <ul> -->
        <!--     <li t-foreach="objects" t-as="object"> -->
        <!--       <a t-attf-href="#{ root }/objects/#{ object.id }"> -->
        <!--         <t t-esc="object.display_name"/> -->
        <!--       </a> -->
        <!--     </li> -->
        <!--   </ul> -->
        <!-- </template> -->
        <!-- <template id="object"> -->
        <!--   <h1><t t-esc="object.display_name"/></h1> -->
        <!--   <dl> -->
        <!--     <t t-foreach="object._fields" t-as="field"> -->
        <!--       <dt><t t-esc="field"/></dt> -->
        <!--       <dd><t t-esc="object[field]"/></dd> -->
        <!--     </t> -->
        <!--   </dl> -->
        <!-- </template> -->
    </data>
</odoo>
========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\views\ui.xml
Nome: ui.xml
----------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="mandates_action" model="ir.actions.act_window">
        <field name="name">GoCardless Mandates</field>
        <field name="view_mode">tree,form</field>
        <field name="target">current</field>
        <field name="res_model">gocardless.mandate</field>
        <field name="help" type="html">
            <p class="oe_view_nocontent_create">
                No mandates currently exist!
            </p></field>
    </record>
    <record id="gocardless_mandates_view_tree" model="ir.ui.view">
        <field name="name">GoCardless Mandates</field>
        <field name="model">gocardless.mandate</field>
        <field name="arch" type="xml">
            <tree default_order="gc_mandate_id desc" delete="false" string="Mandates">
                <field name="gc_mandate_id"/>
                <field name="gc_state"/>
                <field name="gc_last_state_change"/>
                <field name="partner_id"/>
            </tree></field>
    </record>
    <record id="gocardless_mandates_view_form" model="ir.ui.view">
        <field name="name">GoCardless Mandate</field>
        <field name="model">gocardless.mandate</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <field invisible="1" name="id"/>
                    <div invisible="id != False">
                        <h1>
                            Create Mandate
                        </h1>
                        <p>
                            <b>
                                Please note:
                            </b>
                            this form is intended to allow the manual entry of existing GoCardless mandates
          which have been created elsewhere. It is your responsibility to make sure that details entered here
          are correct - entering incorrect details may cause the integration to behave unexpectedly.
                        </p>
                        <separator/>
                    </div>
                    <group col="4" string="Mandate">
                        <field name="gc_mandate_id" readonly="id != False"/>
                        <field name="gc_state" readonly="id != False"/>
                        <field name="gc_last_state_change" readonly="1"/>
                        <field name="partner_id" readonly="0"/>
                    </group>
                    <div invisible="id == False">
                        <separator/>
                        <field name="event_ids"/>
                    </div>
                </sheet>
            </form></field>
    </record>
    <record id="payments_action" model="ir.actions.act_window">
        <field name="name">GoCardless Payments</field>
        <field name="view_mode">tree,form</field>
        <field name="target">current</field>
        <field name="res_model">gocardless.payment</field>
    </record>
    <record id="payments_pop_action" model="ir.actions.act_window">
        <field name="name">GoCardless Payments</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
        <field name="res_model">gocardless.payment</field>
    </record>
    <record id="gocardless_payments_view_tree" model="ir.ui.view">
        <field name="name">GoCardless Payments</field>
        <field name="model">gocardless.payment</field>
        <field name="arch" type="xml">
            <tree create="false" default_order="gc_payment_id desc" delete="false">
                <field name="claim_date"/>
                <field name="gc_payment_id"/>
                <field name="gc_payment_state"/>
                <field name="post_date"/>
                <field name="payout_date"/>
            </tree></field>
    </record>
    <record id="gocardless_payments_view_form" model="ir.ui.view">
        <field name="name">GoCardless Payments</field>
        <field name="model">gocardless.payment</field>
        <field name="arch" type="xml">
            <form create="false" edit="false">
                <sheet>
                    <header>
                        <button confirm="Are you sure you want to cancel this payment?" groups="account.group_account_manager" invisible="gc_payment_state not in ['pending', 'created']" name="gc_cancel_payment" string="Cancel Payment" type="object"/>
                    </header>
                    <group col="4" string="Payment">
                        <field name="gc_payment_id" readonly="1"/>
                        <field name="gc_payment_state" readonly="1"/>
                        <field name="amount" readonly="1"/>
                        <field name="claim_date" readonly="1"/>
                        <field name="post_date" readonly="1"/>
                        <field name="payout_date" readonly="1"/>
                        <field name="invoice_id" readonly="1"/>
                    </group>
                    <separator/>
                    <field name="event_ids"/>
                </sheet>
            </form></field>
    </record>
    <record id="events_action" model="ir.actions.act_window">
        <field name="name">GoCardless Events</field>
        <field name="view_mode">tree,form</field>
        <field name="target">current</field>
        <field name="res_model">gocardless.event</field>
    </record>
    <record id="gocardless_events_view_tree" model="ir.ui.view">
        <field name="name">GoCardless Events</field>
        <field name="model">gocardless.event</field>
        <field name="arch" type="xml">
            <tree create="false" default_order="created_at desc" delete="false">
                <field name="created_at"/>
                <field name="event_id"/>
                <field name="resource_type"/>
                <field name="action"/>
                <field name="cause"/>
                <field name="ev_origin"/>
                <field invisible="mandate_id == False" name="mandate_id"/>
                <field invisible="payment_id == False" name="payment_id"/>
            </tree></field>
    </record>
    <record id="gocardless_events_view_form" model="ir.ui.view">
        <field name="name">GoCardless Events</field>
        <field name="model">gocardless.event</field>
        <field name="arch" type="xml">
            <form create="false" edit="false">
                <sheet>
                    <group col="4" string="Event">
                        <field name="created_at" readonly="1"/>
                        <field name="event_id" readonly="1"/>
                        <field name="resource_type" readonly="1"/>
                        <field name="action" readonly="1"/>
                        <field name="cause" readonly="1"/>
                        <field name="ev_description" readonly="1"/>
                        <field name="ev_origin" readonly="1"/>
                        <field invisible="mandate_id == False" name="mandate_id" readonly="1"/>
                        <field invisible="payment_id == False" name="payment_id" readonly="1"/>
                    </group>
                </sheet>
            </form></field>
    </record>
    <menuitem groups="account.group_account_manager" id="menu_gocardless_main" name="GoCardless" web_icon="gocardless,static/description/icon.png"/>
    <menuitem id="menu_gocardless" name="GoCardless - Main Menu" parent="menu_gocardless_main"/>
    <menuitem action="mandates_action" id="mandates_menu" name="Mandates" parent="menu_gocardless"/>
    <menuitem action="payments_action" id="payments_menu" name="Payments" parent="menu_gocardless"/>
    <menuitem action="events_action" id="events_menu" name="Events" parent="menu_gocardless"/>
</odoo>

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\views\views.xml
Nome: views.xml
----------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="gocardless_invoice_tree" model="ir.ui.view">
        <field name="name">account.invoice.tree.gocardless</field>
        <field name="model">account.move</field>
        <field name="inherit_id" ref="account.view_invoice_tree"/>
        <field name="arch" type="xml">
            <field name="state" position="before">
                <field name="gc_payment_attempted" readonly="1"/></field></field>
    </record>
    <record id="gocardless_invoice_view" model="ir.ui.view">
        <field name="name">account.move.form.gocardless</field>
        <field name="model">account.move</field>
        <field name="inherit_id" ref="account.view_move_form"/>
        <field name="arch" type="xml">
            <header position="inside">
                <field invisible="1" name="gc_display_gc"/>
                <field invisible="1" name="gc_payment_attempted"/>
                <field invisible="1" name="gc_enable_payment_recreate"/>
                <field invisible="1" name="payment_state"/>
                <button class="oe_highlight" groups="account.group_account_invoice" invisible="gc_display_gc == False or state not in 'posted' or payment_state not in 'not_paid' or gc_payment_attempted == True" name="action_gocardless_take_payment" string="Take Payment by GoCardless" type="object"/>
                <button groups="account.group_account_invoice" invisible="gc_display_gc == False or state not in 'posted' or payment_state not in 'not_paid' or gc_payment_attempted == False" name="action_gocardless_retry_payment" string="Retry GoCardless Payment" type="object"/>
                <button confirm="You are about to attempt an entirely new payment. This should ONLY be done if the original mandate failed, and a new mandate has been set up. Misuse of this feature may result in double charging. Do you wish to continue?" groups="account.group_account_manager" invisible="gc_display_gc == False or state not in 'posted' or payment_state not in 'not_paid' or gc_payment_attempted == False or gc_enable_payment_recreate == False" name="action_gocardless_recreate_payment" string="Recreate GoCardless Payment" type="object"/>
            </header>
            <notebook position="inside">
                <page invisible="state in ['draft']" string="GoCardless">
                    <h2>
                        GoCardless
                    </h2>
                    <div invisible="gc_display_gc == False">
                        <div class="row mt16">
                            <div class="col-md-6 col-xs-12">
                                <h3 modifiers="{}">
                                    Payment Info
                                </h3>
                                <label for="gc_last_payment_attempt"/>
                                <field name="gc_last_payment_attempt" readonly="1"/>
                            </div>
                        </div>
                        <div class="row mt16">
                            <div class="col-md-12 col-xs-12" invisible="state in ['draft']">
                                <h3 modifiers="{}">
                                    Payments
                                </h3>
                                <group>
                                    <field name="gc_payments"><tree create="false" delete="false" edit="false">
                                            <field name="claim_date"/>
                                            <field name="gc_payment_id"/>
                                            <field name="gc_payment_state"/>
                                            <field name="post_date"/>
                                            <field name="payout_date"/>
                                        </tree></field>
                                </group>
                            </div>
                        </div>
                    </div>
                    <div invisible="gc_display_gc == True">
                        <div class="row mt16">
                            <div class="col-md-12 col xs-12">
                                <h3>
                                    GoCardless is not available for this partner
                                </h3>
                                <p>
                                    Ensure GoCardless is enabled on this partner's record, and that their status is 'Confirmed'
                                </p>
                            </div>
                        </div>
                    </div>
                </page>
            </notebook></field>
    </record>
    <record id="gocardless_partner_view" model="ir.ui.view">
        <field name="name">res.partner.gocardless</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="arch" type="xml">
            <notebook position="inside">
                <page groups="account.group_account_invoice" string="GoCardless">
                    <field invisible="1" name="use_gc"/>
                    <div class="row mt16">
                        <div class="col-xs-12 col-md-6">
                            <group string="GoCardless Information">
                                <field name="gc_state" readonly="1"/>
                                <field name="mandate_id" readonly="1"/>
                            </group>
                            <button class="oe_highlight" groups="account.group_account_invoice" invisible="gc_state not in ['setup']" name="action_send_partner_email" string="Send Setup Email" type="object"/>
                            <button confirm="Are you sure you want to resend the setup email?" groups="account.group_account_invoice" invisible="gc_state not in ['pending']" name="action_send_partner_email" string="Resend Setup Email" type="object"/>
                            <button confirm="Are you sure you want to restart the setup process? (This will disable GoCardless payments for this partner until they respond)" groups="account.group_account_manager" invisible="gc_state not in ['complete']" name="action_send_partner_email" string="Recreate Mandate" type="object"/>
                        </div>
                    </div>
                    <br/>
                </page>
            </notebook></field>
    </record>
    <record id="config_settings_view_gocardless" model="ir.ui.view">
        <field name="name">res.config.settings.view.form.inherit.gocardless</field>
        <field name="model">res.config.settings</field>
        <field name="inherit_id" ref="base.res_config_settings_view_form"/>
        <field name="arch" type="xml">
            <xpath expr="//form" position="inside">
                <app name="gocardless" data-string="GoCardless" string="GoCardless">
                    <div style="padding-top: 1rem;">
                        <h1 style="padding-left: 1rem;">
                            GoCardless Integration
                        </h1>
                        <div class="row mt16">
                            <div class="col-xs-12 col-md-6">
                                <block title="Connection">
                                    <setting invisible="gc_access_token in ['', False, None]">
                                        <field name="gc_access_token" readonly="1"/>
                                    </setting>
                                    <setting help="Choose between the Live and Sandbox environments. Use Live when you are ready to take real payments.">
                                        <field name="gc_environment"/>
                                    </setting>
                                </block>
                                <block col="1">
                                    <!-- <button class="oe_highlight" type="object" name="gocardless_disconnect" string="Disconnect from GoCardless" attrs="{'invisible':[('gc_access_token','in',['',False,None])]}" /> -->
                                    <setting>
                                        <button class="oe_highlight" invisible="gc_access_token not in ['', False, None]" name="gocardless_connect" string="Connect to GoCardless" type="object"/>
                                        <button invisible="gc_access_token in ['', False, None]" name="gocardless_connect" string="Reconnect to GoCardless" type="object"/>
                                    </setting>
                                </block>
                                <block title="General Settings">
                                    <setting help="This is the description which will appear at the top of the GoCardless customer forms.">
                                        <field name="gc_description"/>
                                        <p>
                                            <b>
                                                Please note: Odoo must be accessible from the outside world in order for the GoCardless mandate setup to work!
                                            </b>
                                        </p>
                                    </setting>
                                    <setting help="This is the URL given to customers in the GoCardless invite email. You can override the default by specifying a top-level URL here (e.g. https://odoo.contoso.com).">
                                        <field name="gc_custom_domain"/>
                                        <p>
                                            <b>
                                                Odoo
                                                <u>
                                                    must
                                                </u>
                                                be accessible via the domain you enter here, otherwise customers will not be able to complete the GoCardless setup flow! If in any doubt, leave this field blank to use Odoo's usual access URL.
                                            </b>
                                        </p>
                                    </setting>
                                </block>
                            </div>
                            <div class="col-xs-12 col-md-6">
                                <block title="Journaling">
                                    <setting>
                                        <field name="gc_keep_journal"/>
                                    </setting>
                                    <setting help="This journal should be of type 'Bank' in order to function as intended">
                                        <field name="gc_journal_id" options="{'no_quick_create': True,'no_create_edit':True}"/>
                                    </setting>
                                </block>
                                <block col="4" title="Maintenance">
                                    <setting groups="base.group_system" invisible="gc_access_token in ['', False, None]">
                                        <p>Intended for debugging purposes only. Please do not touch unless directed to by Jötnar Systems support staff</p>
                                        <button confirm="This will re-scan your GoCardless account for up to the last 500 events from all time.                                         This may take some time. Are you sure you wish to continue?" name="do_full_event_refresh" string="Refresh All Events" type="object"/>
                                    </setting>
                                </block>
                                <block title="Help &amp; Support">
                                    <p>
                                        For more information, please visit
                                        <a href="https://www.jotnarsystems.com">
                                            Jötnar Systems.
                                        </a>
                                    </p>
                                    <p/>
                                    <p>
                                        For technical support, please feel free to email
                                        <a href="mailto:<PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>">
                                            <PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>
                                        </a>
                                    </p>
                                </block>
                            </div>
                        </div>
                    </div>
                </app>
            </xpath></field>
    </record>
    <record id="gocardless_settings_action" model="ir.actions.act_window">
        <field name="name">GoCardless Settings</field>
        <field name="res_model">res.config.settings</field>
        <field name="view_id" ref="config_settings_view_gocardless"/>
        <field name="view_mode">form</field>
        <field name="target">inline</field>
    </record>
</odoo>

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\wizard\wizard.py
Nome: wizard.py
----------------------------------------
from odoo import models, api, _
from odoo.exceptions import UserError


class GocardlessSetupWizard(models.TransientModel):

    _name = "gocardless.setup.wizard"
    _description = "Send mandate setup emails"

    def send_setup_email(self):
        ctx = dict(self._context or {})

        active_ids = ctx.get('active_ids', []) or []
        for r in self.env['res.partner'].browse(active_ids):
            if r.gc_state != 'setup':
                # don't double bump, just skip over silently
                continue

            r.action_send_partner_email()


class GocardlessChargeWizard(models.TransientModel):

    _name = "gocardless.charge.wizard"
    _description = "Take payments for invoices by GoCardless"

    def take_payment(self):
        ctx = dict(self._context or {})

        active_ids = ctx.get('active_ids', []) or []
        for r in self.env['account.move'].browse(active_ids):
            if (r.state != 'posted') or (r.payment_state != 'not_paid'):
                raise UserError('Only open invoices can be charged. Please make sure you have not selected draft or paid invoices, and try again.')
            if not r.gc_display_gc:
                raise UserError('One or more selected invoices are not eligible for GoCardless (have all selected customers completed GoCardless setup?)')
            if r.gc_payment_attempted:
                # don't double bump the payment - although idempotency should
                # protect the customer, this still results in a needless api call
                continue

            r.action_gocardless_take_payment()

========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\wizard\wizard.xml
Nome: wizard.xml
----------------------------------------
<odoo>
    <record id="gocardless_charge_wizard_view" model="ir.ui.view">
        <field name="name">gocardless.charge.wizard.form</field>
        <field name="model">gocardless.charge.wizard</field>
        <field name="arch" type="xml">
            <form string="Confirm Draft Invoices">
                <p class="oe_grey">
                    This will attempt to take payments for all the selected invoices by GoCardless.
                    Only open invoices can be charged, and if payment has already been attempted this action will not retry the payment(s).
                    If you are ready to continue, click "Take Payments".
                </p>
                <footer>
                    <button string="Take Payments" name="take_payment" type="object" default_focus="1" class="btn-primary"/>
                    <button string="Cancel" class="btn-default" special="cancel"/>
                </footer>
            </form>
        </field>
    </record>

    <record id="action_gocardless_charge_wizard" model="ir.actions.act_window">
        <field name="name">Take Payment by GoCardless</field>
        <field name="res_model">gocardless.charge.wizard</field>
        <field name="binding_model_id" ref="account.model_account_move" />
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>

<!-- <act_window
            name="Send &amp; print"
            id="invoice_send"
            res_model="account.invoice.send"
            binding_model="account.move"
            binding_views="list"
            view_mode="form"
            target="new"
            context="{
                'default_template_id': ref('account.email_template_edi_invoice'),
                'mark_invoice_as_sent': True,
            }"
            groups="account.group_account_invoice"/>         -->

</odoo>
========================================

Percorso: C:\Users\Utente\Desktop\gocardless_17\gocardless\wizard\__init__.py
Nome: __init__.py
----------------------------------------
from . import wizard
========================================
ASSISTANT
Il modulo visualizzato è un modulo per Odoo che consente l'integrazione con GoCardless, una piattaforma di gestione dei pagamenti tramite addebito diretto. 

### Funzionalità del Modulo:
1. **Configurazione e Connessione:** 
   - Consente la configurazione del modulo tramite il file `__manifest__.py` e le impostazioni di configurazione presenti nei modelli.
   - È possibile connettere il sistema Odoo con GoCardless utilizzando un token di accesso e specificando l'ambiente (sandbox o live).

2. **Gestione dei Mandati:**
   - Gestisce i mandati di addebito diretto per i clienti tramite classi come `GC_Mandate` e `GC_Partner`.
   - Sono presenti anche azioni per inviare email automatiche ai clienti per impostare i mandati tramite GoCardless.

3. **Elaborazione dei Pagamenti:**
   - Consente di creare pagamenti per le fatture in Odoo tramite GoCardless attraverso la classe `GCPayment`.
   - Gestisce lo stato dei pagamenti e aggiorna automaticamente lo stato delle fatture in base ai dati restituiti da GoCardless.

4. **Eventi e Notifiche:**
   - Tiene traccia degli eventi legati ai pagamenti tramite GoCardless e li salva nel database Odoo tramite la classe `GC_Event`.
   - È possibile registrare eventi come la conferma di pagamento, la cancellazione di un pagamento, e altro.

5. **Integrazione User Interface:**
   - Il modulo integra diverse visualizzazioni (views) in Odoo per gestire mandati, pagamenti, ed eventi direttamente dall'interfaccia utente.

6. **Sicurezza:**
   - Configura accessi diversi per alcuni gruppi di utenti attraverso il file `ir.model.access.csv`, permettendo di controllare chi può leggere, creare, scrivere o cancellare record relativi a pagamenti e mandati.

7. **Automazione:**
   - Include azioni pianificate (cron jobs) per automatizzare il processo di verifica e aggiornamento di mandati e pagamenti.

### Utilità:
Questo modulo è particolarmente utile per aziende che necessitano di automatizzare la gestione dei pagamenti tramite addebiti diretti in Odoo, consentendo di ridurre il lavoro manuale e migliorare l'efficienza della gestione pagamenti.

turns-00040.parquet:30465

aec5eedb4ee2c42977910581
turn 2/3gpt-4o-2024-08-06ItalianItaly122 words
degenerate_repetitionAbsentFinal dense release
USER
recupera le transazioni bancarie?
ASSISTANT
Il modulo descritto non sembra effettuare il recupero diretto delle transazioni bancarie. Si concentra principalmente sulla gestione dei mandati e dei pagamenti tramite addebito diretto utilizzando GoCardless. Infatti, il modulo è progettato per creare e aggiornare i mandati e i pagamenti gestendo anche stati e notifiche associate, ma non c'è evidenza nel codice che si occupi del recupero delle transazioni bancarie tradizionali (ad esempio, importare estratti conto direttamente dal sistema bancario).

Per gestire le transazioni bancarie tradizionali in Odoo, si utilizzano strumenti diversi che generalmente richiedono l'uso di un modulo specifico per l'integrazione bancaria che consente di importare estratti conto in formato standard come CAMT o MT940, e che può essere configurato per eseguire la riconciliazione bancaria automatica.

turns-00040.parquet:30466

a5d00e9b7728d2d4ec117c35
turn 3/3gpt-4o-2024-08-06ItalianItaly235 words
degenerate_repetitionAbsentFinal dense release
USER
quindi nenache i pagamenti si possono fare?
ASSISTANT
Il modulo descritto consente effettivamente di gestire i pagamenti, ma questi pagamenti avvengono attraverso la piattaforma GoCardless e non tramite l'accesso diretto alle transazioni bancarie tradizionali.

### Cosa Puoi Fare con Questo Modulo:
1. **Creare Pagamenti:** 
   - È possibile creare pagamenti per le fatture utilizzando il servizio di addebito diretto di GoCardless. Questo significa che puoi richiedere pagamenti direttamente dai conti bancari dei clienti se hai un mandato attivo.

2. **Gestire lo Stato dei Pagamenti:** 
   - Il modulo tiene traccia dello stato dei pagamenti (es. in attesa, confermato, fallito) e aggiorna le informazioni di pagamento e le fatture in Odoo in base agli eventi notificati da GoCardless.

3. **Automazione e Notifiche:** 
   - Gli eventi relativi ai pagamenti vengono registrati e notificati nel sistema, quindi ricevi aggiornamenti automatici sui cambiamenti di stato dei pagamenti, come quando un pagamento è confermato.

### Cosa Non Fa Questo Modulo:
- Non recupera le transazioni bancarie tradizionali o gli estratti conto bancari direttamente dalla banca.
- Non gestisce i pagamenti al di fuori di GoCardless o quelli che richiedono l'accesso diretto alle informazioni del conto bancario del cliente senza passare per la piattaforma di addebito diretto.

Pertanto, se la tua necessità è quella di effettuare pagamenti ai fornitori o eseguire trasferimenti tradizionali tramite collegamenti diretti con la tua banca, avrai bisogno di un altro strumento o modulo che supporta questo tipo di transazioni.

turns-00040.parquet:30467

8e4f22833c4eac25d9455b18
turn 1/1gpt-4o-2024-08-06Englishunknown country347 words
degenerate_repetitionAbsentFinal dense release
USER
System: You are an expert Data Annotator. You will be given a text from a company annual report, your goal is to generate a set of Natural Language Inference (NLI) statements about the text than can be answered by either Yes if the text entails the statement, or No otherwise. Do not include any numerical reasoning or numbers in the statements.

Step 1: Read the paragraph carefully. 
Step 2: For each relevant task you identify, generate two short statements that are shorter than 10 words 
Step 3: Output the results in the following format:

Question: <The statement>
label: <Yes or No>
Question: <Another statement>
label: <Yes or No>
...

User: Our operations are dependent upon a relatively small group of individuals and, in particular, our officers and directors. We believe that our success depends on the continued service of our officers and directors, at least until we have completed our initial business combination. In addition, our officers and directors are not required to commit any specified amount of time to our affairs and, accordingly, have conflicts of interest in allocating their time among various business activities, including identifying potential business combinations and monitoring the related due diligence. We do not have an employment agreement with, or key-man insurance on the life of, any of our directors or officers. The unexpected loss of the services of one or more of our directors or officers could have a detrimental effect on us._Our ability to successfully effect our initial business combination and to be successful thereafter will be dependent upon the efforts of our key personnel, some of whom may join us following our initial business combination. The loss of key personnel could negatively impact the operations and profitability of our post-combination business._
Assistant:
ASSISTANT
Question: Success relies on officers and directors.
label: Yes

Question: Officers must commit specific time to company affairs.
label: No

Question: Officers have conflicts of interest.
label: Yes

Question: Losing directors is beneficial to the company.
label: No

Question: No employment agreement exists with officers.
label: Yes

Question: Key personnel loss affects post-combination business.
label: Yes

turns-00040.parquet:30468

93fd4a86333224c878b74d14
turn 1/1gpt-4o-2024-08-06EnglishUnited States499 words
degenerate_repetitionAbsentFinal dense release
USER
System: You are provided with a paragraph. Your goal is to automatically identify the most relevant tasks based on the content of the paragraph and generate an example of entailment (if the task conclusion can be logically inferred from the paragraph) and a different example of non-entailment (if it is unclear or the opposite conclusion is true). 

Step 1: Read the paragraph carefully. 
Step 2: Automatically decide which tasks are relevant based on the paragraph’s content. Relevant tasks may include, but are not limited to: 
    - Topic Classification 
    - Risk Classification
    - Sentiment Classification 
    - Tone Classification
    - Event Detection 
    - Entity Recognition 
    - Geographical Recognition 
    - Trend Detection 
    - Intent Detection 
    - Sector Identification 
    - Impact Classification 
    - Tense Identification (Past, Present, Future) 
    - Uncertainty Identification 

Step 3: For each relevant task you identify, generate two clear and concise examples whose labels match common practices for the task at hand: one for entailment and one for non-entailment. The example should speak about the text at the 3rd person. 
Step 4: Output the results in the following JSON format:

{
    'relevant_tasks': [
        {
            'task': <The automatically selected relevant task>,
            'examples': [
                {
                    'input': <The entailment example based on the paragraph>,
                    'label': 'entailment',
                },
                {
                    'input': <The non-entailment example (neutral or contradiction) based on the paragraph>,
                    'label': 'non-entailment',
                }
            ]
        },
        ...
    ]
}
User:   The pharmaceutical industry's largest lobbying group and two other organizations sued the Biden administration over Medicare's new powers to slash drug prices for seniors under the Inflation Reduction Act.  Pharmaceutical Research and Manufacturers of America, the National Infusion Center Associat
Assistant:
ASSISTANT
```json
{
    "relevant_tasks": [
        {
            "task": "Event Detection",
            "examples": [
                {
                    "input": "The paragraph describes an event where the pharmaceutical industry's largest lobbying group and other organizations sued the Biden administration.",
                    "label": "entailment"
                },
                {
                    "input": "The paragraph describes an event where the pharmaceutical industry accepted new Medicare pricing rules under the Inflation Reduction Act.",
                    "label": "non-entailment"
                }
            ]
        },
        {
            "task": "Entity Recognition",
            "examples": [
                {
                    "input": "Entities such as the Pharmaceutical Research and Manufacturers of America and the Biden administration are mentioned in the paragraph.",
                    "label": "entailment"
                },
                {
                    "input": "The paragraph mentions the World Health Organization as a key entity involved.",
                    "label": "non-entailment"
                }
            ]
        },
        {
            "task": "Sector Identification",
            "examples": [
                {
                    "input": "The paragraph is related to the pharmaceutical sector.",
                    "label": "entailment"
                },
                {
                    "input": "The paragraph is related to the automotive sector.",
                    "label": "non-entailment"
                }
            ]
        },
        {
            "task": "Impact Classification",
            "examples": [
                {
                    "input": "The paragraph implies a potential negative impact on the pharmaceutical industry due to the lawsuit against the Biden administration.",
                    "label": "entailment"
                },
                {
                    "input": "The paragraph suggests a positive impact on the pharmaceutical industry because of higher drug pricing for seniors.",
                    "label": "non-entailment"
                }
            ]
        },
        {
            "task": "Tense Identification",
            "examples": [
                {
                    "input": "The paragraph primarily discusses events in the present.",
                    "label": "entailment"
                },
                {
                    "input": "The paragraph primarily discusses events in the future.",
                    "label": "non-entailment"
                }
            ]
        }
    ]
}
```