@@ -28,14 +28,10 @@ import (
28
28
)
29
29
30
30
type AccountServiceIface interface {
31
- AddAccountToProject (p * AddAccountToProjectParams ) (* AddAccountToProjectResponse , error )
32
- NewAddAccountToProjectParams (projectid string ) * AddAccountToProjectParams
33
31
CreateAccount (p * CreateAccountParams ) (* CreateAccountResponse , error )
34
32
NewCreateAccountParams (email string , firstname string , lastname string , password string , username string ) * CreateAccountParams
35
33
DeleteAccount (p * DeleteAccountParams ) (* DeleteAccountResponse , error )
36
34
NewDeleteAccountParams (id string ) * DeleteAccountParams
37
- DeleteAccountFromProject (p * DeleteAccountFromProjectParams ) (* DeleteAccountFromProjectResponse , error )
38
- NewDeleteAccountFromProjectParams (account string , projectid string ) * DeleteAccountFromProjectParams
39
35
DisableAccount (p * DisableAccountParams ) (* DisableAccountResponse , error )
40
36
NewDisableAccountParams (lock bool ) * DisableAccountParams
41
37
EnableAccount (p * EnableAccountParams ) (* EnableAccountResponse , error )
@@ -58,154 +54,6 @@ type AccountServiceIface interface {
58
54
NewUpdateAccountParams () * UpdateAccountParams
59
55
}
60
56
61
- type AddAccountToProjectParams struct {
62
- p map [string ]interface {}
63
- }
64
-
65
- func (p * AddAccountToProjectParams ) toURLValues () url.Values {
66
- u := url.Values {}
67
- if p .p == nil {
68
- return u
69
- }
70
- if v , found := p .p ["account" ]; found {
71
- u .Set ("account" , v .(string ))
72
- }
73
- if v , found := p .p ["email" ]; found {
74
- u .Set ("email" , v .(string ))
75
- }
76
- if v , found := p .p ["projectid" ]; found {
77
- u .Set ("projectid" , v .(string ))
78
- }
79
- if v , found := p .p ["projectroleid" ]; found {
80
- u .Set ("projectroleid" , v .(string ))
81
- }
82
- if v , found := p .p ["roletype" ]; found {
83
- u .Set ("roletype" , v .(string ))
84
- }
85
- return u
86
- }
87
-
88
- func (p * AddAccountToProjectParams ) SetAccount (v string ) {
89
- if p .p == nil {
90
- p .p = make (map [string ]interface {})
91
- }
92
- p .p ["account" ] = v
93
- }
94
-
95
- func (p * AddAccountToProjectParams ) GetAccount () (string , bool ) {
96
- if p .p == nil {
97
- p .p = make (map [string ]interface {})
98
- }
99
- value , ok := p .p ["account" ].(string )
100
- return value , ok
101
- }
102
-
103
- func (p * AddAccountToProjectParams ) SetEmail (v string ) {
104
- if p .p == nil {
105
- p .p = make (map [string ]interface {})
106
- }
107
- p .p ["email" ] = v
108
- }
109
-
110
- func (p * AddAccountToProjectParams ) GetEmail () (string , bool ) {
111
- if p .p == nil {
112
- p .p = make (map [string ]interface {})
113
- }
114
- value , ok := p .p ["email" ].(string )
115
- return value , ok
116
- }
117
-
118
- func (p * AddAccountToProjectParams ) SetProjectid (v string ) {
119
- if p .p == nil {
120
- p .p = make (map [string ]interface {})
121
- }
122
- p .p ["projectid" ] = v
123
- }
124
-
125
- func (p * AddAccountToProjectParams ) GetProjectid () (string , bool ) {
126
- if p .p == nil {
127
- p .p = make (map [string ]interface {})
128
- }
129
- value , ok := p .p ["projectid" ].(string )
130
- return value , ok
131
- }
132
-
133
- func (p * AddAccountToProjectParams ) SetProjectroleid (v string ) {
134
- if p .p == nil {
135
- p .p = make (map [string ]interface {})
136
- }
137
- p .p ["projectroleid" ] = v
138
- }
139
-
140
- func (p * AddAccountToProjectParams ) GetProjectroleid () (string , bool ) {
141
- if p .p == nil {
142
- p .p = make (map [string ]interface {})
143
- }
144
- value , ok := p .p ["projectroleid" ].(string )
145
- return value , ok
146
- }
147
-
148
- func (p * AddAccountToProjectParams ) SetRoletype (v string ) {
149
- if p .p == nil {
150
- p .p = make (map [string ]interface {})
151
- }
152
- p .p ["roletype" ] = v
153
- }
154
-
155
- func (p * AddAccountToProjectParams ) GetRoletype () (string , bool ) {
156
- if p .p == nil {
157
- p .p = make (map [string ]interface {})
158
- }
159
- value , ok := p .p ["roletype" ].(string )
160
- return value , ok
161
- }
162
-
163
- // You should always use this function to get a new AddAccountToProjectParams instance,
164
- // as then you are sure you have configured all required params
165
- func (s * AccountService ) NewAddAccountToProjectParams (projectid string ) * AddAccountToProjectParams {
166
- p := & AddAccountToProjectParams {}
167
- p .p = make (map [string ]interface {})
168
- p .p ["projectid" ] = projectid
169
- return p
170
- }
171
-
172
- // Adds account to a project
173
- func (s * AccountService ) AddAccountToProject (p * AddAccountToProjectParams ) (* AddAccountToProjectResponse , error ) {
174
- resp , err := s .cs .newRequest ("addAccountToProject" , p .toURLValues ())
175
- if err != nil {
176
- return nil , err
177
- }
178
-
179
- var r AddAccountToProjectResponse
180
- if err := json .Unmarshal (resp , & r ); err != nil {
181
- return nil , err
182
- }
183
-
184
- // If we have a async client, we need to wait for the async result
185
- if s .cs .async {
186
- b , err := s .cs .GetAsyncJobResult (r .JobID , s .cs .timeout )
187
- if err != nil {
188
- if err == AsyncTimeoutErr {
189
- return & r , err
190
- }
191
- return nil , err
192
- }
193
-
194
- if err := json .Unmarshal (b , & r ); err != nil {
195
- return nil , err
196
- }
197
- }
198
-
199
- return & r , nil
200
- }
201
-
202
- type AddAccountToProjectResponse struct {
203
- Displaytext string `json:"displaytext"`
204
- JobID string `json:"jobid"`
205
- Jobstatus int `json:"jobstatus"`
206
- Success bool `json:"success"`
207
- }
208
-
209
57
type CreateAccountParams struct {
210
58
p map [string ]interface {}
211
59
}
@@ -672,101 +520,6 @@ type DeleteAccountResponse struct {
672
520
Success bool `json:"success"`
673
521
}
674
522
675
- type DeleteAccountFromProjectParams struct {
676
- p map [string ]interface {}
677
- }
678
-
679
- func (p * DeleteAccountFromProjectParams ) toURLValues () url.Values {
680
- u := url.Values {}
681
- if p .p == nil {
682
- return u
683
- }
684
- if v , found := p .p ["account" ]; found {
685
- u .Set ("account" , v .(string ))
686
- }
687
- if v , found := p .p ["projectid" ]; found {
688
- u .Set ("projectid" , v .(string ))
689
- }
690
- return u
691
- }
692
-
693
- func (p * DeleteAccountFromProjectParams ) SetAccount (v string ) {
694
- if p .p == nil {
695
- p .p = make (map [string ]interface {})
696
- }
697
- p .p ["account" ] = v
698
- }
699
-
700
- func (p * DeleteAccountFromProjectParams ) GetAccount () (string , bool ) {
701
- if p .p == nil {
702
- p .p = make (map [string ]interface {})
703
- }
704
- value , ok := p .p ["account" ].(string )
705
- return value , ok
706
- }
707
-
708
- func (p * DeleteAccountFromProjectParams ) SetProjectid (v string ) {
709
- if p .p == nil {
710
- p .p = make (map [string ]interface {})
711
- }
712
- p .p ["projectid" ] = v
713
- }
714
-
715
- func (p * DeleteAccountFromProjectParams ) GetProjectid () (string , bool ) {
716
- if p .p == nil {
717
- p .p = make (map [string ]interface {})
718
- }
719
- value , ok := p .p ["projectid" ].(string )
720
- return value , ok
721
- }
722
-
723
- // You should always use this function to get a new DeleteAccountFromProjectParams instance,
724
- // as then you are sure you have configured all required params
725
- func (s * AccountService ) NewDeleteAccountFromProjectParams (account string , projectid string ) * DeleteAccountFromProjectParams {
726
- p := & DeleteAccountFromProjectParams {}
727
- p .p = make (map [string ]interface {})
728
- p .p ["account" ] = account
729
- p .p ["projectid" ] = projectid
730
- return p
731
- }
732
-
733
- // Deletes account from the project
734
- func (s * AccountService ) DeleteAccountFromProject (p * DeleteAccountFromProjectParams ) (* DeleteAccountFromProjectResponse , error ) {
735
- resp , err := s .cs .newRequest ("deleteAccountFromProject" , p .toURLValues ())
736
- if err != nil {
737
- return nil , err
738
- }
739
-
740
- var r DeleteAccountFromProjectResponse
741
- if err := json .Unmarshal (resp , & r ); err != nil {
742
- return nil , err
743
- }
744
-
745
- // If we have a async client, we need to wait for the async result
746
- if s .cs .async {
747
- b , err := s .cs .GetAsyncJobResult (r .JobID , s .cs .timeout )
748
- if err != nil {
749
- if err == AsyncTimeoutErr {
750
- return & r , err
751
- }
752
- return nil , err
753
- }
754
-
755
- if err := json .Unmarshal (b , & r ); err != nil {
756
- return nil , err
757
- }
758
- }
759
-
760
- return & r , nil
761
- }
762
-
763
- type DeleteAccountFromProjectResponse struct {
764
- Displaytext string `json:"displaytext"`
765
- JobID string `json:"jobid"`
766
- Jobstatus int `json:"jobstatus"`
767
- Success bool `json:"success"`
768
- }
769
-
770
523
type DisableAccountParams struct {
771
524
p map [string ]interface {}
772
525
}
0 commit comments