@@ -118,53 +118,65 @@ func (s *OrgIntegrationTestSuite) TestUpdate() {
118118
119119 s .Run ("org non existent" , func () {
120120 // org not found
121- _ , err := s .Organization .Update (ctx , s .user .ID , uuid .NewString (), nil , nil , nil , nil , nil , nil )
121+ _ , err := s .Organization .Update (ctx , s .user .ID , uuid .NewString (), & biz. OrganizationUpdateOpts {} )
122122 s .Error (err )
123123 s .True (biz .IsNotFound (err ))
124124 })
125125
126126 s .Run ("org not accessible to user" , func () {
127127 org2 , err := s .Organization .CreateWithRandomName (ctx )
128128 require .NoError (s .T (), err )
129- _ , err = s .Organization .Update (ctx , s .user .ID , org2 .Name , nil , nil , nil , nil , nil , nil )
129+ _ , err = s .Organization .Update (ctx , s .user .ID , org2 .Name , & biz. OrganizationUpdateOpts {} )
130130 s .Error (err )
131131 s .True (biz .IsNotFound (err ))
132132 })
133133
134134 s .Run ("valid block on policy violation update" , func () {
135- got , err := s .Organization .Update (ctx , s .user .ID , s .org .Name , toPtrBool (true ), nil , nil , nil , nil , nil )
135+ got , err := s .Organization .Update (ctx , s .user .ID , s .org .Name , & biz.OrganizationUpdateOpts {
136+ BlockOnPolicyViolation : toPtrBool (true ),
137+ })
136138 s .NoError (err )
137139 s .True (got .BlockOnPolicyViolation )
138140 })
139141
140142 s .Run ("valid policy allowed hostnames update" , func () {
141- got , err := s .Organization .Update (ctx , s .user .ID , s .org .Name , nil , []string {"foo.com" , "bar.com" }, nil , nil , nil , nil )
143+ got , err := s .Organization .Update (ctx , s .user .ID , s .org .Name , & biz.OrganizationUpdateOpts {
144+ PoliciesAllowedHostnames : []string {"foo.com" , "bar.com" },
145+ })
142146 s .NoError (err )
143147 s .Equal ([]string {"foo.com" , "bar.com" }, got .PoliciesAllowedHostnames )
144148 })
145149
146150 s .Run ("clear policy allowed hostnames" , func () {
147- got , err := s .Organization .Update (ctx , s .user .ID , s .org .Name , nil , []string {}, nil , nil , nil , nil )
151+ got , err := s .Organization .Update (ctx , s .user .ID , s .org .Name , & biz.OrganizationUpdateOpts {
152+ PoliciesAllowedHostnames : []string {},
153+ })
148154 s .NoError (err )
149155 s .Equal ([]string {}, got .PoliciesAllowedHostnames )
150156 })
151157
152158 s .Run ("valid enable AI agent collector update" , func () {
153- got , err := s .Organization .Update (ctx , s .user .ID , s .org .Name , nil , nil , nil , nil , nil , toPtrBool (true ))
159+ got , err := s .Organization .Update (ctx , s .user .ID , s .org .Name , & biz.OrganizationUpdateOpts {
160+ EnableAIAgentCollector : toPtrBool (true ),
161+ })
154162 s .NoError (err )
155163 s .True (got .EnableAIAgentCollector )
156164
157- got , err = s .Organization .Update (ctx , s .user .ID , s .org .Name , nil , nil , nil , nil , nil , toPtrBool (false ))
165+ got , err = s .Organization .Update (ctx , s .user .ID , s .org .Name , & biz.OrganizationUpdateOpts {
166+ EnableAIAgentCollector : toPtrBool (false ),
167+ })
158168 s .NoError (err )
159169 s .False (got .EnableAIAgentCollector )
160170 })
161171
162172 s .Run ("but not passing a value doesn't clear the hostnames value" , func () {
163- got , err := s .Organization .Update (ctx , s .user .ID , s .org .Name , nil , []string {"foo.com" , "bar.com" }, nil , nil , nil , nil )
173+ got , err := s .Organization .Update (ctx , s .user .ID , s .org .Name , & biz.OrganizationUpdateOpts {
174+ PoliciesAllowedHostnames : []string {"foo.com" , "bar.com" },
175+ })
164176 s .NoError (err )
165177 s .Equal ([]string {"foo.com" , "bar.com" }, got .PoliciesAllowedHostnames )
166178
167- got , err = s .Organization .Update (ctx , s .user .ID , s .org .Name , nil , nil , nil , nil , nil , nil )
179+ got , err = s .Organization .Update (ctx , s .user .ID , s .org .Name , & biz. OrganizationUpdateOpts {} )
168180 s .NoError (err )
169181 s .Equal ([]string {"foo.com" , "bar.com" }, got .PoliciesAllowedHostnames )
170182 })
0 commit comments