Any provision of law to the contrary notwithstanding, a city, county, or city and county may enter into contracts commonly known as “interest rate swap agreements” or “forward payment conversion agreements” with any person providing for the exchange of payments between the person and the city, county, or city and county, including, without limitation, contracts providing for the exchange of fixed interest payments for floating payments or floating interest payments for fixed payments, or a combination thereof. The contracts may be made upon the terms and conditions established by the legislative body of the city, county, or city and county. The authority conferred by this section includes the authority to enter into any and all contracts incident to the exercise of the authority conferred by this section including, without limitation, contracts to obtain credit enhancement devices and contracts for the performance of professional services. However, these contracts may be made only if all securities or bonds included in the contracts are rated in one of the three highest rating categories by two nationally recognized rating agencies selected by the legislative body of the city, county, or city and county, and if there has been receipt, from any rating agency rating the bonds, of written evidence that the contract will not adversely affect the rating.