addPolicy(policyDocument) { if (this.Policies && typeof(this.Policies) === "string") { throw new Error("Policies property is already set to string, cannot add new policy document"); } if (this.Policies == null) { this.Policies = [{ Version: '2012-10-17', Statement: []}]; } this.Policies[0].Statement.push(policyDocument); return this; }