def list_agreements_as_lazy(name, agreement_option, custom_headers:nil)
      response = list_agreements_async(name, agreement_option, custom_headers:custom_headers).value!
      unless response.nil?
        page = response.body
        page.next_method = Proc.new do |next_page_link|
          list_agreements_next_async(next_page_link, custom_headers:custom_headers)
        end
        page
      end
    end
def list_agreements_as_lazy(name, agreement_option, custom_headers:nil)
      response = list_agreements_async(name, agreement_option, custom_headers:custom_headers).value!
      unless response.nil?
        page = response.body
        page.next_method = Proc.new do |next_page_link|
          list_agreements_next_async(next_page_link, custom_headers:custom_headers)
        end
        page
      end
    end
Gets all legal agreements that user needs to accept before purchasing a
 domain.

 Gets all legal agreements that user needs to accept before purchasing a
 domain.

 @param name [String] Name of the top-level domain.
 @param agreement_option [TopLevelDomainAgreementOption] Domain agreement
 options.
 @param custom_headers [Hash{String => String}] A hash of custom headers that
 will be added to the HTTP request.

 @return [TldLegalAgreementCollection] which provide lazy access to pages of
 the response.