atlassian.net-sdk-v2.0 /Atlassian.Jira/Remote/JiraRemoteServiceWrapper.cs

Language C# Lines 626
MD5 Hash bc2181ec1f4b69b59e1616bb6385293f Estimated Cost $13,021 (why?)
Repository https://bitbucket.org/yyo/atlassian.net-sdk-v2.0.git View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Xml;
using RestSharp;
using Newtonsoft.Json.Linq;

namespace Atlassian.Jira.Remote
{
    /// <summary>
    /// Wraps the auto-generated JiraSoapServiceClient proxy
    /// </summary>
    internal class JiraRemoteServiceWrapper: IJiraRemoteService
    {
        private readonly JiraSoapServiceClient _client;
        private readonly string _url;
        private readonly string _username;
        private readonly string _password;

        public JiraRemoteServiceWrapper(string jiraBaseUrl)
            : this(jiraBaseUrl, null, null)
        {
        }

        public JiraRemoteServiceWrapper(string jiraBaseUrl, string username, string password)
        {
            _client = JiraRemoteServiceFactory.Create(jiraBaseUrl);
            _url = jiraBaseUrl.EndsWith("/") ? jiraBaseUrl : jiraBaseUrl += "/";
            _username = username;
            _password = password;
        }

        public string Url
        {
            get
            {
                return _url;
            }
        }

        public string GetJsonFromJqlSearch(string jql, int startAt, int maxResults, string[] fields = null)
        {
            var restClient = new RestClient(_url);
            if (!String.IsNullOrEmpty(_username) && !String.IsNullOrEmpty(_password))
            {
                restClient.Authenticator = new HttpBasicAuthenticator(_username, _password);
            }

            var request = new RestRequest();
            request.Method = Method.POST;
            request.Resource = "rest/api/latest/search";
            request.RequestFormat = DataFormat.Json;
            request.AddBody(new { jql = jql, startAt = startAt, maxResults = maxResults, fields = fields });

            var response = restClient.Execute(request);

            return response.Content;
        }

        public int GetIssueCountFromJqlSearch(string jql)
        {
            var json = JObject.Parse(GetJsonFromJqlSearch(jql, 0, 1, new string[1] { "summary" }));
            return (int) json["total"];
        }

        public string Login(string username, string password)
        {
            return _client.login(username, password);
        }

        public RemoteIssue[] GetIssuesFromJqlSearch(string token, string jqlSearch, int maxNumResults)
        {
            return _client.getIssuesFromJqlSearch(token, jqlSearch, maxNumResults);
        }

        public RemoteIssue CreateIssue(string token, RemoteIssue newIssue)
        {
            
            return _client.createIssue(token, newIssue);
        }

        public RemoteIssue UpdateIssue(string token, string key, RemoteFieldValue[] fields)
        {
            return _client.updateIssue(token, key, fields);
        }

        public RemoteAttachment[] GetAttachmentsFromIssue(string token, string key)
        {
            return _client.getAttachmentsFromIssue(token, key);
        }

        public bool AddBase64EncodedAttachmentsToIssue(string token, string key, string[] fileNames, string[] base64EncodedAttachmentData)
        {
            return _client.addBase64EncodedAttachmentsToIssue(token, key, fileNames, base64EncodedAttachmentData);
        }

        public RemoteComment[] GetCommentsFromIssue(string token, string key)
        {
            return _client.getComments(token, key);
        }

        public void AddComment(string token, string key, RemoteComment comment)
        {
            _client.addComment(token, key, comment);
        }

        public RemoteIssueType[] GetIssueTypes(string token, string projectId)
        {
            if (String.IsNullOrEmpty(projectId))
            {
                return _client.getIssueTypes(token);
            }
            else
            {
                return _client.getIssueTypesForProject(token, projectId);
            }
        }

        public RemotePriority[] GetPriorities(string token)
        {
            return _client.getPriorities(token);
        }

        public RemoteResolution[] GetResolutions(string token)
        {
            return _client.getResolutions(token);
        }

        public RemoteStatus[] GetStatuses(string token)
        {
            return _client.getStatuses(token);
        }

        public RemoteVersion[] GetVersions(string token, string projectKey)
        {
            return _client.getVersions(token, projectKey);
        }

        public RemoteComponent[] GetComponents(string token, string projectKey)
        {
            return _client.getComponents(token, projectKey);
        }

        public RemoteField[] GetCustomFields(string token)
        {
            return _client.getCustomFields(token);
        }

        public RemoteField[] GetFieldsForEdit(string token, string key)
        {
            return _client.getFieldsForEdit(token, key);
        }

        public RemoteWorklog AddWorklogAndAutoAdjustRemainingEstimate(string token, string key, RemoteWorklog worklog)
        {
            return _client.addWorklogAndAutoAdjustRemainingEstimate(token, key, worklog);
        }

        public RemoteWorklog AddWorklogAndRetainRemainingEstimate(string token, string key, RemoteWorklog worklog)
        {
            return _client.addWorklogAndRetainRemainingEstimate(token, key, worklog);
        }

        public RemoteWorklog AddWorklogWithNewRemainingEstimate(string token, string key, RemoteWorklog worklog, string newRemainingEstimate)
        {
            return _client.addWorklogWithNewRemainingEstimate(token, key, worklog, newRemainingEstimate);
        }

        public RemoteWorklog[] GetWorkLogs(string token, string key)
        {
            return _client.getWorklogs(token, key);
        }

        public RemoteProject[] GetProjects(string token)
        {
            return _client.getProjectsNoSchemes(token);
        }

        public RemoteIssue CreateIssueWithParent(string token, RemoteIssue newIssue, string parentIssueKey)
        {
            return _client.createIssueWithParent(token, newIssue, parentIssueKey);
        }

        public RemoteFilter[] GetFavouriteFilters(string token)
        {
            return _client.getFavouriteFilters(token);
        }

        public RemoteIssue[] GetIssuesFromFilterWithLimit(string token, string filterId, int offset, int maxResults)
        {
            return _client.getIssuesFromFilterWithLimit(token, filterId, offset, maxResults);
        }

        public RemoteNamedObject[] GetAvailableActions(string token, string issueKey)
        {
            return _client.getAvailableActions(token, issueKey);
        }

        public RemoteIssue ProgressWorkflowAction(string token, string issueKey, string actionId, RemoteFieldValue[] remoteFieldValues)
        {
            return _client.progressWorkflowAction(token, issueKey, actionId, remoteFieldValues);
        }


        public void AddActorsToProjectRole(string in0, string[] in1, RemoteProjectRole in2, RemoteProject in3, string in4)
        {
            _client.addActorsToProjectRole(in0, in1, in2, in3, in4);
        }

        public void AddDefaultActorsToProjectRole(string in0, string[] in1, RemoteProjectRole in2, string in3)
        {
            _client.addDefaultActorsToProjectRole(in0, in1, in2, in3);
        }

        public RemotePermissionScheme AddPermissionTo(string in0, RemotePermissionScheme in1, RemotePermission in2, RemoteEntity in3)
        {
            return _client.addPermissionTo(in0, in1, in2, in3);

        }

        public void AddUserToGroup(string in0, RemoteGroup in1, RemoteUser in2)
        {
            _client.addUserToGroup(in0, in1, in2);
        }

        public RemoteVersion AddVersion(string in0, string in1, RemoteVersion in2)
        {
            return _client.addVersion(in0, in1, in2);
        }

        public void ArchiveVersion(string in0, string in1, string in2, bool in3)
        {
            _client.archiveVersion(in0, in1, in2, in3);
        }

        public RemoteGroup CreateGroup(string in0, string in1, RemoteUser in2)
        {
            return _client.createGroup(in0, in1, in2);
        }

        public RemoteIssue CreateIssueWithSecurityLevel(string in0, RemoteIssue in1, long in2)
        {
            return _client.createIssueWithSecurityLevel(in0, in1, in2);
        }

        public RemotePermissionScheme CreatePermissionScheme(string in0, string in1, string in2)
        {
            return _client.createPermissionScheme(in0, in1, in2);
        }

        public RemoteProject CreateProject(string in0, string in1, string in2, string in3, string in4, string in5, RemotePermissionScheme in6, RemoteScheme in7, RemoteScheme in8)
        {
            return _client.createProject(in0, in1, in2, in3, in4, in5, in6, in7, in8);
        }

        public RemoteProject CreateProjectFromObject(string in0, RemoteProject in1)
        {
            return _client.createProjectFromObject(in0, in1);
        }

        public RemoteProjectRole CreateProjectRole(string in0, RemoteProjectRole in1)
        {
            return _client.createProjectRole(in0, in1);
        }

        public RemoteUser CreateUser(string in0, string in1, string in2, string in3, string in4)
        {
            return _client.createUser(in0, in1, in2, in3, in4);
        }

        public void DeleteGroup(string in0, string in1, string in2)
        {
            _client.deleteGroup(in0, in1, in2);
        }

        public void DeleteIssue(string in0, string in1)
        {
            _client.deleteIssue(in0, in1);
        }

        public RemotePermissionScheme DeletePermissionFrom(string in0, RemotePermissionScheme in1, RemotePermission in2, RemoteEntity in3)
        {
            return _client.deletePermissionFrom(in0, in1, in2, in3);
        }

        public void DeletePermissionScheme(string in0, string in1)
        {
            _client.deletePermissionScheme(in0, in1);
        }

        public void DeleteProject(string in0, string in1)
        {
            _client.deleteProject(in0, in1);
        }

        public void DeleteProjectAvatar(string in0, long in1)
        {
            _client.deleteProjectAvatar(in0, in1);
        }

        public void DeleteProjectRole(string in0, RemoteProjectRole in1, bool in2)
        {
            _client.deleteProjectRole(in0, in1, in2);
        }

        public void DeleteUser(string in0, string in1)
        {
            _client.deleteUser(in0, in1);
        }

        public void DeleteWorklogAndAutoAdjustRemainingEstimate(string in0, string in1)
        {
            _client.deleteWorklogAndAutoAdjustRemainingEstimate(in0, in1);
        }

        public void DeleteWorklogAndRetainRemainingEstimate(string in0, string in1)
        {
            _client.deleteWorklogAndRetainRemainingEstimate(in0, in1);
        }

        public void DeleteWorklogWithNewRemainingEstimate(string in0, string in1, string in2)
        {
            _client.deleteWorklogWithNewRemainingEstimate(in0, in1, in2);
        }

        public RemoteComment EditComment(string in0, RemoteComment in1)
        {
            return _client.editComment(in0, in1);
        }

        public RemotePermission[] GetAllPermissions(string in0)
        {
            return _client.getAllPermissions(in0);
        }

        public RemoteScheme[] GetAssociatedNotificationSchemes(string in0, RemoteProjectRole in1)
        {
            return _client.getAssociatedNotificationSchemes(in0, in1);
        }

        public RemoteScheme[] GetAssociatedPermissionSchemes(string in0, RemoteProjectRole in1)
        {
            return _client.getAssociatedPermissionSchemes(in0, in1);
        }

        public RemoteComment GetComment(string in0, long in1)
        {
            return _client.getComment(in0, in1);
        }

        public RemoteComment[] GetComments(string in0, string in1)
        {
            return _client.getComments(in0, in1);
        }

        public RemoteConfiguration GetConfiguration(string in0)
        {
            return _client.getConfiguration(in0);
        }

        public RemoteRoleActors GetDefaultRoleActors(string in0, RemoteProjectRole in1)
        {
            return _client.getDefaultRoleActors(in0, in1);
        }

        public RemoteField[] GetFieldsForAction(string in0, string in1, string in2)
        {
            return _client.getFieldsForAction(in0, in1, in2);
        }

        public RemoteGroup GetGroup(string in0, string in1)
        {
            return _client.getGroup(in0, in1);
        }

        public RemoteIssue GetIssue(string in0, string in1)
        {
            return _client.getIssue(in0, in1);
        }

        public RemoteIssue GetIssueById(string in0, string in1)
        {
            return _client.getIssueById(in0, in1);
        }

        public long GetIssueCountForFilter(string in0, string in1)
        {
            return _client.getIssueCountForFilter(in0, in1);
        }

        public RemoteIssue[] GetIssuesFromTextSearchWithLimit(string in0, string in1, int in2, int in3)
        {
            return _client.getIssuesFromTextSearchWithLimit(in0, in1, in2, in3);
        }

        public RemoteIssue[] GetIssuesFromTextSearchWithProject(string in0, string[] in1, string in2, int in3)
        {
            return _client.getIssuesFromTextSearchWithProject(in0, in1, in2, in3);
        }

        public RemoteIssueType[] GetIssueTypes(string in0)
        {
            return _client.getIssueTypes(in0);
        }

        public RemoteIssueType[] GetIssueTypesForProject(string in0, string in1)
        {
            return _client.getIssueTypesForProject(in0, in1);
        }

        public RemoteScheme[] GetNotificationSchemes(string in0)
        {
            return _client.getNotificationSchemes(in0);
        }

        public RemotePermissionScheme[] GetPermissionSchemes(string in0)
        {
            return _client.getPermissionSchemes(in0);
        }

        public RemoteAvatar GetProjectAvatar(string in0, string in1)
        {
            return _client.getProjectAvatar(in0, in1);
        }

        public RemoteAvatar[] GetProjectAvatars(string in0, string in1, bool in2)
        {
            return _client.getProjectAvatars(in0, in1, in2);
        }

        public RemoteProject GetProjectById(string in0, long in1)
        {
            return _client.getProjectById(in0, in1);
        }

        public RemoteProject GetProjectByKey(string in0, string in1)
        {
            return _client.getProjectByKey(in0, in1);
        }

        public RemoteProjectRole GetProjectRole(string in0, long in1)
        {
            return _client.getProjectRole(in0, in1);
        }

        public RemoteProjectRoleActors GetProjectRoleActors(string in0, RemoteProjectRole in1, RemoteProject in2)
        {
            return _client.getProjectRoleActors(in0, in1, in2);
        }

        public RemoteProjectRole[] GetProjectRoles(string in0)
        {
            return _client.getProjectRoles(in0);
        }

        public RemoteProject[] GetProjectsNoSchemes(string in0)
        {
            return _client.getProjectsNoSchemes(in0);
        }

        public RemoteProject GetProjectWithSchemesById(string in0, long in1)
        {
            return _client.getProjectWithSchemesById(in0, in1);
        }

        public DateTime GetResolutionDateById(string in0, long in1)
        {
            return _client.getResolutionDateById(in0, in1);
        }

        public DateTime GetResolutionDateByKey(string in0, string in1)
        {
            return _client.getResolutionDateByKey(in0, in1);
        }

        public RemoteSecurityLevel GetSecurityLevel(string in0, string in1)
        {
            return _client.getSecurityLevel(in0, in1);
        }

        public RemoteSecurityLevel[] GetSecurityLevels(string in0, string in1)
        {
            return _client.getSecurityLevels(in0, in1);
        }

        public RemoteScheme[] GetSecuritySchemes(string in0)
        {
            return _client.getSecuritySchemes(in0);
        }

        public RemoteServerInfo GetServerInfo(string in0)
        {
            return _client.getServerInfo(in0);
        }

        public RemoteIssueType[] GetSubTaskIssueTypes(string in0)
        {
            return _client.getSubTaskIssueTypes(in0);
        }

        public RemoteIssueType[] GetSubTaskIssueTypesForProject(string in0, string in1)
        {
            return _client.getSubTaskIssueTypesForProject(in0, in1);
        }

        public RemoteUser GetUser(string in0, string in1)
        {
            return _client.getUser(in0, in1);
        }

        public RemoteWorklog[] GetWorklogs(string in0, string in1)
        {
            return _client.getWorklogs(in0, in1);
        }

        public bool HasPermissionToCreateWorklog(string in0, string in1)
        {
            return _client.hasPermissionToCreateWorklog(in0, in1);
        }

        public bool HasPermissionToDeleteWorklog(string in0, string in1)
        {
            return _client.hasPermissionToDeleteWorklog(in0, in1);
        }

        public bool HasPermissionToEditComment(string in0, RemoteComment in1)
        {
            return _client.hasPermissionToEditComment(in0, in1);
        }

        public bool HasPermissionToUpdateWorklog(string in0, string in1)
        {
            return _client.hasPermissionToUpdateWorklog(in0, in1);
        }

        public bool IsProjectRoleNameUnique(string in0, string in1)
        {
            return _client.isProjectRoleNameUnique(in0, in1);
        }

        public bool Logout(string in0)
        {
            return _client.logout(in0);
        }

        public void RefreshCustomFields(string in0)
        {
            _client.refreshCustomFields(in0);
        }

        public void ReleaseVersion(string in0, string in1, RemoteVersion in2)
        {
            _client.releaseVersion(in0, in1, in2);
        }

        public void RemoveActorsFromProjectRole(string in0, string[] in1, RemoteProjectRole in2, RemoteProject in3, string in4)
        {
            _client.removeActorsFromProjectRole(in0, in1, in2, in3, in4);
        }

        public void RemoveAllRoleActorsByNameAndType(string in0, string in1, string in2)
        {
            _client.removeAllRoleActorsByNameAndType(in0, in1, in2);
        }

        public void RemoveAllRoleActorsByProject(string in0, RemoteProject in1)
        {
            _client.removeAllRoleActorsByProject(in0, in1);
        }

        public void RemoveDefaultActorsFromProjectRole(string in0, string[] in1, RemoteProjectRole in2, string in3)
        {
            _client.removeDefaultActorsFromProjectRole(in0, in1, in2, in3);
        }

        public void RemoveUserFromGroup(string in0, RemoteGroup in1, RemoteUser in2)
        {
            _client.removeUserFromGroup(in0, in1, in2);
        }

        public void SetNewProjectAvatar(string in0, string in1, string in2, string in3)
        {
            _client.setNewProjectAvatar(in0, in1, in2, in3);
        }

        public void SetProjectAvatar(string in0, string in1, long in2)
        {
            _client.setProjectAvatar(in0, in1, in2);
        }

        public RemoteGroup UpdateGroup(string in0, RemoteGroup in1)
        {
            return _client.updateGroup(in0, in1);
        }

        public RemoteProject UpdateProject(string in0, RemoteProject in1)
        {
            return _client.updateProject(in0, in1);
        }

        public void UpdateProjectRole(string in0, RemoteProjectRole in1)
        {
            _client.updateProjectRole(in0, in1);
        }

        public void UpdateWorklogAndAutoAdjustRemainingEstimate(string in0, RemoteWorklog in1)
        {
            _client.updateWorklogAndAutoAdjustRemainingEstimate(in0, in1);
        }

        public void UpdateWorklogAndRetainRemainingEstimate(string in0, RemoteWorklog in1)
        {
            _client.updateWorklogAndRetainRemainingEstimate(in0, in1);
        }

        public void UpdateWorklogWithNewRemainingEstimate(string in0, RemoteWorklog in1, string in2)
        {
            _client.updateWorklogWithNewRemainingEstimate(in0, in1, in2);
        }


        
    }
}
Back to Top