*1208The plaintiff issued an insurance policy to Park House Hotel Corp. (hereinafter Park Hotel) for its hotel, located in Brooklyn (hereinafter the premises). This policy covered the Park Hotel for any damages, costs, and/or expenses resulting from, among other things, a fire. On November 5, 2006, a fire occurred within the premises.
Prior to the fire, Park Hotel had retained the defendant Altertec Energy Conservation, LLC (hereinafter Altertec), to install an electric generator system at the premises.
Thereafter, pursuant to a repair agreement executed May 5, 2004, Park Hotel retained the defendant Energy Spectrum Developers, LLC (hereinafter Energy Spectrum), to complete the installation. The agreement stated that Energy Spectrum was “agreeable to providing . . . services to [Park Hotel], but only upon the express terms and conditions as set forth in this Agreement.”
Paragraph two of the agreement provided that Energy Spectrum made “no representation or warranty whatsoever as to the condition of the [electric generator] System, or as to its operational capacity or capability after the repairs [we]re undertaken or actually made.” The agreement reiterated in paragraph four that Energy Spectrum’s work was “not warrantied in any manner whatsoever, as to either parts or services.”
Paragraph seven of the agreement provided that Park Hotel thereby indemnified and held Energy Spectrum harmless from and against any and all claims arising directly or indirectly, from, inter alia, “any . capability or warranty for the System to actually work and/or perform as may have been discussed with, guaranteed by, or implied by, any other contractors ... or the service, maintenance or other working status of the System on the date hereof or at any date in the future” and “[ajny other *1209matter not due to [Energy Spectrum’s] willful misconduct under this Agreement.” It was agreed that the indemnification provision would survive termination of the agreement.
As a result of the fire, Park Hotel submitted a claim in the sum of $101,096 to the plaintiff. The plaintiff indemnified Park Hotel for that loss and became subrogated to Park Hotel’s rights against the defendants.
The plaintiff, as subrogee of Park Hotel, commenced this action against Altertec and Energy Spectrum to recover damages for negligence and breach of contract. After Energy Spectrum answered the complaint, it moved for summary judgment dismissing the complaint insofar as asserted against it.
In its motion, Energy Spectrum argued that the provisions of the agreement precluded the plaintiff, as Park Hotel’s subrogee, from asserting claims of negligence and breach of contract against it. The plaintiff opposed the motion on the ground that it was premature, since discovery had not been completed. The plaintiff had yet to depose a representative of Energy Spectrum about the “terms and conditions of th[e] ‘Repair Agreement.’ ” In reply, Energy Spectrum argued that since the plaintiff did not seek to recover damages for any willful misconduct on its behalf and failed to assert that the agreement was not authentic or that its terms were ambiguous, an award of summary judgment in its favor was appropriate.
The Supreme Court denied Energy Spectrum’s motion with leave to renew upon the completion of discovery in accordance with CPLR 3212 (f). The Supreme Court found that the indemnification provision in the agreement was void and unenforceable, relying on Itri Brick & Concrete Corp. v Aetna Cas. & Sur. Co. (89 NY2d 786, 794 [1997]). It found that a question of fact existed with respect to Energy Spectrum’s negligence and, therefore, a deposition of a representative of Energy Spectrum was necessary with respect to the negligence claim. Energy Spectrum appeals. We reverse.
“Subrogation, an equitable doctrine, allows an insurer to stand in the shoes of its insured and seek indemnification from third parties whose wrongdoing has caused a loss for which the insurer is bound to reimburse” (Kaf-Kaf Inc. v Rodless Decorations, 90 NY2d 654, 660 [1997]; see Gulf Ins. Co. v Quality Bldg. Contr., Inc., 58 AD3d 595, 597 [2009]). The insurer’s rights against a third party are derivative and limited to the rights the insured would have against that third party (see Humbach v Goldstein, 229 AD2d 64, 67 [1997]). Therefore, “[an] insurer can only recover if the insured could have recovered and its claim as subrogee is subject to whatever defenses the third party might have asserted against its insured” (id. at 67).
*1210Here, the plaintiff could only recover damages from Energy Spectrum for negligence and breach of contract if Park Hotel could recover damages for those claims. Since the agreement clearly provided that Energy Spectrum would be held harmless by Park Hotel against all claims except any claims premised upon a theory of willful misconduct and Energy Spectrum disclaimed any warranties for the work, neither the plaintiff nor Park Hotel could recover damages resulting from Energy Spectrum’s negligence or breach of contract (see Greenfield v Philles Records, 98 NY2d 562, 569 [2002]; Johnston v MGM Emerald Enters., Inc., 69 AD3d 674, 677 [2010]; Henrich v Phazar Antenna Corp., 33 AD3d 864, 867 [2006]). By submitting a copy of the agreement in support of its motion, Energy Spectrum established its entitlement to judgment as a matter of law, since clear and complete agreements will be enforced according to their terms (see Greenfield v Philles Records, 98 NY2d at 569; Johnston v MGM Emerald Enters., Inc., 69 AD3d at 677; Henrich v Phazar Antenna Corp., 33 AD3d at 867).
The provision in the agreement requiring Park Hotel to indemnify and hold Energy Spectrum harmless for damages resulting from Energy Spectrum’s negligence was not unenforceable pursuant to General Obligations Law § 5-322.1 (see Fisher v Biderman, 154 AD2d 155 [1990]; see e.g. Board of Educ., Union Free School Dist. No. 3, Town of Brookhaven v Valden Assoc., 46 NY2d 653 [1979]; Failla v A. F. A. Protective Sys., 139 AD2d 693 [1988]).
General Obligations Law § 5-322.1 (1) provides that: “A covenant, promise, agreement or understanding in, or in connection with or collateral to a contract or agreement relative to the construction, alteration, repair or maintenance of a building, structure, appurtenances and appliances . . . purporting to indemnify or hold harmless the promisee against liability for . . . damage to property contributed to, caused by or resulting from the negligence of the promisee, his agents or employees, or indemnitee, whether such negligence be in whole or in part, is against public policy and is void and unenforceable . . . This subdivision shall not preclude a promisee requiring indemnification for damages arising out of . . . damage to property caused by or resulting from the negligence of a party other than the promisee, whether or not the promisor is partially negligent.”
However, in enacting this statute, in 1975, the Legislature sought, “to prevent a prevalent practice in the construction industry of requiring subcontractors to assume liability by contract for the negligence of others. The Legislature concluded that such ‘coercive’ bidding requirements unnecessarily *1211increased the cost of construction by limiting the number of contractors able to obtain the necessary hold harmless insurance, and unfairly imposed liability on subcontractors for the negligence of others over whom they had no control. The agreements also needlessly created expensive double coverage for hold harmless or general liability insurance” (Itri Brick & Concrete Corp. v Aetna Cas. & Sur. Co., 89 NY2d at 794, citing Brown v Two Exch. Plaza Partners, 76 NY2d 172, 179-180 [1990], citing Mem of Assemblyman Brown, 1975 NY Legis Ann, at 311).
When interpreting a statute, a court’s primary function is “to ascertain and effectuate the purpose of the Legislature” by looking at the entire statute, its legislative history and any related statutes (Rankin v Shanker, 23 NY2d 111, 114 [1968]; see Fumarelli v Marsam Dev., 92 NY2d 298, 303 [1998]). In considering the legislative purpose behind General Obligations Law § 5-322.1, it is apparent that the Legislature did not intend to preclude agreements like the subject agreement made between sophisticated business entities free to agree to any terms they choose (see Itri Brick & Concrete Corp. v Aetna Cas. & Sur. Co., 89 NY2d at 794; Brown v Two Exch. Plaza Partners, 76 NY2d at 179-180; Fisher v Biderman, 154 AD2d 155 [1990]; see generally Venetoklis Family L.P. v Kora Devs., LLC, 74 AD3d 1057, 1058 [2010]; Hollander v Lipman, 65 AD3d 1086, 1087 [2009]). “Nothing in [the] legislative history [of General Obligations Law § 5-322.1] appears to support the invalidation of the indemnification provisions of the contracts in issue” or an owner’s valid business decision to become, in essence, a self-insurer (Fisher v Biderman, 154 AD2d at 162).
Here, it is the owner of the premises which has agreed to indemnify the contractor. Protecting the owner in such a situation, where it was free to contract in any manner it chose, does not serve the legislative purpose. Consequently, since the parties set down their agreement in a clear, complete document, their writing should be enforced according to its terms (see Henrich v Phazar Antenna Corp., 33 AD3d at 867). “A contract will be interpreted in accordance with the intent of the parties as expressed in the language of the agreement” (Johnston v MGM Emerald Enters., Inc., 69 AD3d at 677; see Greenfield v Philles Records, 98 NY2d at 569).
Since General Obligations Law § 5-322.1 does not bar the enforceability of the indemnification provision in the subject agreement, it was improper for the Supreme Court to have denied Energy Spectrum’s motion on the ground that discovery on the issue of negligence was necessary.
*1212In response to Energy Spectrum’s establishment of its entitlement to judgment as a matter of law, the plaintiff failed to raise a triable issue of fact or establish that additional discovery was necessary to oppose the motion. While the plaintiff claimed that discovery was necessary, it failed to submit any affidavits establishing that facts existed which were essential to justify opposition to the motion but were not in its possession in light of the fact that discovery had yet to be completed (see CPLR 3212 [f]; Rodriguez v DeStefano, 72 AD3d 926 [2010]; Juseinoski v New York Hosp. Med. Ctr. of Queens, 29 AD3d 636, 637 [2006]). “The mere hope or speculation that evidence sufficient to defeat a motion for summary judgment may be uncovered during the discovery process is insufficient to deny the motion” (Arpi v New York City Tr. Auth., 42 AD3d 478, 479 [2007]; see Orange County-Poughkeepsie Ltd. Partnership v Bonte, 37 AD3d 684, 687 [2007]). Consequently, the Supreme Court should have granted Energy Spectrum’s motion for summary judgment dismissing the complaint insofar as asserted against it. Dillon, J.P, Balkin, Belen and Austin, JJ., concur.