# 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 VerificationDetailsService(base_service.BaseService):
    """Service class that provides access to the verification_details
    endpoints of the GoCardless Pro API.
    """

    RESOURCE_CLASS = resources.VerificationDetail
    RESOURCE_NAME = 'verification_details'


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

        Creates a new verification detail

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

        Returns:
              VerificationDetail
        """
        path = '/verification_details'
        
        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 verification details.

        Returns a list of verification details belonging to a creditor.

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

        Returns:
              ListResponse of VerificationDetail instances
        """
        path = '/verification_details'
        

        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)
    
  
