{"action":"created","comment":{"url":"https://api.github.com/repos/kaltura/clients-generator/pulls/comments/206435302","pull_request_review_id":141845433,"id":206435302,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjQzNTMwMg==","diff_hunk":"@@ -75,231 +65,231 @@ public BaseRequestBuilder<T> SetCompletion(OnErrorHandler errorHandler)\n             return this;\n         }\n \n+        public virtual Params getParameters(bool includeServiceAndAction)\n+        {\n+            Params kparams = new Params();\n+\n+            if (client != null)\n+                kparams.Add(client.RequestConfiguration.ToParams(false));\n+\n+            kparams.Add(base.ToParams(false));\n+\n+            if (includeServiceAndAction)\n+                kparams.Add(\"service\", service);\n+\n+            return kparams;\n+        }\n+\n+        public virtual Files getFiles()\n+        {\n+            return new Files();\n+        }\n+\n         public virtual BaseRequestBuilder<T> Build(Client client)\n         {\n             this.client = client;\n             Boundary = \"---------------------------\" + DateTime.Now.Ticks.ToString(\"x\");\n             return this;\n         }\n-\n-        public void Execute(Client client = null)\n+        \n+        public virtual void OnComplete(object response, Exception error)\n         {\n-            startTime = DateTime.Now;\n-\n-            if (this.client == null)\n+            if (onCompletion != null)\n             {\n-                this.Build(client);\n+                onCompletion((T)response, error);\n             }\n-\n-            if (this.client == null)\n+            if (onError != null && error != null)\n             {\n-                OnComplete(null, new ClientException(\"No client instance defined\"));\n+                onError(error);\n             }\n+        }\n \n-            string url = client.Configuration.ServiceUrl + \"/api_v3\" + getPath();\n-            this.Log(\"url: [\" + url + \"]\");\n+        public async Task<T> ExecuteAsync(Client client = null)\n+        {\n+            var sw = new Stopwatch();\n+            sw.Start();\n \n-            // build request\n-            request = (HttpWebRequest)HttpWebRequest.Create(url);\n-            if (getFiles().Count == 0)\n-            {\n-                request.Timeout = client.Configuration.Timeout;\n-            }\n-            else\n-            {\n-                request.Timeout = Timeout.Infinite;\n-            }\n-            request.Method = \"POST\";\n+            if (this.client == null) { this.Build(client); }\n+            if (this.client == null) { OnComplete(null, new ClientException(\"No client instance defined\")); }\n \n-            request.Headers = getHeaders();\n-            request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;\n-            request.Accept = \"application/xml\";\n-            request.ContentType = getContentType();\n+            var url = client.Configuration.ServiceUrl + \"/api_v3\" + getPath();\n+\n+            var requestId = (Interlocked.Increment(ref Client.REQUEST_COUNTER)).ToString(\"X5\");","path":"sources/csharp2/KalturaClient/Request/BaseRequestBuilder.cs","position":139,"original_position":139,"commit_id":"bb3875b375584968d445088b63b833149dd520ff","original_commit_id":"bb3875b375584968d445088b63b833149dd520ff","user":{"login":"tan-tan-kanarek","id":1793469,"node_id":"MDQ6VXNlcjE3OTM0Njk=","avatar_url":"https://avatars1.githubusercontent.com/u/1793469?v=4","gravatar_id":"","url":"https://api.github.com/users/tan-tan-kanarek","html_url":"https://github.com/tan-tan-kanarek","followers_url":"https://api.github.com/users/tan-tan-kanarek/followers","following_url":"https://api.github.com/users/tan-tan-kanarek/following{/other_user}","gists_url":"https://api.github.com/users/tan-tan-kanarek/gists{/gist_id}","starred_url":"https://api.github.com/users/tan-tan-kanarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tan-tan-kanarek/subscriptions","organizations_url":"https://api.github.com/users/tan-tan-kanarek/orgs","repos_url":"https://api.github.com/users/tan-tan-kanarek/repos","events_url":"https://api.github.com/users/tan-tan-kanarek/events{/privacy}","received_events_url":"https://api.github.com/users/tan-tan-kanarek/received_events","type":"User","site_admin":false},"body":"requestId could be initiated in the constructor.","created_at":"2018-07-31T08:20:17Z","updated_at":"2018-07-31T08:31:16Z","html_url":"https://github.com/kaltura/clients-generator/pull/348#discussion_r206435302","pull_request_url":"https://api.github.com/repos/kaltura/clients-generator/pulls/348","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kaltura/clients-generator/pulls/comments/206435302"},"html":{"href":"https://github.com/kaltura/clients-generator/pull/348#discussion_r206435302"},"pull_request":{"href":"https://api.github.com/repos/kaltura/clients-generator/pulls/348"}}},"pull_request":{"url":"https://api.github.com/repos/kaltura/clients-generator/pulls/348","id":205018580,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MDE4NTgw","html_url":"https://github.com/kaltura/clients-generator/pull/348","diff_url":"https://github.com/kaltura/clients-generator/pull/348.diff","patch_url":"https://github.com/kaltura/clients-generator/pull/348.patch","issue_url":"https://api.github.com/repos/kaltura/clients-generator/issues/348","number":348,"state":"open","locked":false,"title":"refactor BaseRequestBuilder","user":{"login":"arthurvaverko","id":3643617,"node_id":"MDQ6VXNlcjM2NDM2MTc=","avatar_url":"https://avatars1.githubusercontent.com/u/3643617?v=4","gravatar_id":"","url":"https://api.github.com/users/arthurvaverko","html_url":"https://github.com/arthurvaverko","followers_url":"https://api.github.com/users/arthurvaverko/followers","following_url":"https://api.github.com/users/arthurvaverko/following{/other_user}","gists_url":"https://api.github.com/users/arthurvaverko/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurvaverko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurvaverko/subscriptions","organizations_url":"https://api.github.com/users/arthurvaverko/orgs","repos_url":"https://api.github.com/users/arthurvaverko/repos","events_url":"https://api.github.com/users/arthurvaverko/events{/privacy}","received_events_url":"https://api.github.com/users/arthurvaverko/received_events","type":"User","site_admin":false},"body":"- added a thread-safe unique request counter to help identify logs of request\\response\r\n- refactore the async post request handling\r\n- added a new method ExecuteAsync which implements the async\\ await feature","created_at":"2018-07-31T07:22:38Z","updated_at":"2018-07-31T08:31:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25c0bcf34314e570fb4ed913040765c66dd1f329","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kaltura/clients-generator/pulls/348/commits","review_comments_url":"https://api.github.com/repos/kaltura/clients-generator/pulls/348/comments","review_comment_url":"https://api.github.com/repos/kaltura/clients-generator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kaltura/clients-generator/issues/348/comments","statuses_url":"https://api.github.com/repos/kaltura/clients-generator/statuses/bb3875b375584968d445088b63b833149dd520ff","head":{"label":"arthurvaverko:fix/refactor_BaseRequestBuilder_csharp2","ref":"fix/refactor_BaseRequestBuilder_csharp2","sha":"bb3875b375584968d445088b63b833149dd520ff","user":{"login":"arthurvaverko","id":3643617,"node_id":"MDQ6VXNlcjM2NDM2MTc=","avatar_url":"https://avatars1.githubusercontent.com/u/3643617?v=4","gravatar_id":"","url":"https://api.github.com/users/arthurvaverko","html_url":"https://github.com/arthurvaverko","followers_url":"https://api.github.com/users/arthurvaverko/followers","following_url":"https://api.github.com/users/arthurvaverko/following{/other_user}","gists_url":"https://api.github.com/users/arthurvaverko/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurvaverko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurvaverko/subscriptions","organizations_url":"https://api.github.com/users/arthurvaverko/orgs","repos_url":"https://api.github.com/users/arthurvaverko/repos","events_url":"https://api.github.com/users/arthurvaverko/events{/privacy}","received_events_url":"https://api.github.com/users/arthurvaverko/received_events","type":"User","site_admin":false},"repo":{"id":122171891,"node_id":"MDEwOlJlcG9zaXRvcnkxMjIxNzE4OTE=","name":"clients-generator","full_name":"arthurvaverko/clients-generator","owner":{"login":"arthurvaverko","id":3643617,"node_id":"MDQ6VXNlcjM2NDM2MTc=","avatar_url":"https://avatars1.githubusercontent.com/u/3643617?v=4","gravatar_id":"","url":"https://api.github.com/users/arthurvaverko","html_url":"https://github.com/arthurvaverko","followers_url":"https://api.github.com/users/arthurvaverko/followers","following_url":"https://api.github.com/users/arthurvaverko/following{/other_user}","gists_url":"https://api.github.com/users/arthurvaverko/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurvaverko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurvaverko/subscriptions","organizations_url":"https://api.github.com/users/arthurvaverko/orgs","repos_url":"https://api.github.com/users/arthurvaverko/repos","events_url":"https://api.github.com/users/arthurvaverko/events{/privacy}","received_events_url":"https://api.github.com/users/arthurvaverko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arthurvaverko/clients-generator","description":null,"fork":true,"url":"https://api.github.com/repos/arthurvaverko/clients-generator","forks_url":"https://api.github.com/repos/arthurvaverko/clients-generator/forks","keys_url":"https://api.github.com/repos/arthurvaverko/clients-generator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arthurvaverko/clients-generator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arthurvaverko/clients-generator/teams","hooks_url":"https://api.github.com/repos/arthurvaverko/clients-generator/hooks","issue_events_url":"https://api.github.com/repos/arthurvaverko/clients-generator/issues/events{/number}","events_url":"https://api.github.com/repos/arthurvaverko/clients-generator/events","assignees_url":"https://api.github.com/repos/arthurvaverko/clients-generator/assignees{/user}","branches_url":"https://api.github.com/repos/arthurvaverko/clients-generator/branches{/branch}","tags_url":"https://api.github.com/repos/arthurvaverko/clients-generator/tags","blobs_url":"https://api.github.com/repos/arthurvaverko/clients-generator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arthurvaverko/clients-generator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arthurvaverko/clients-generator/git/refs{/sha}","trees_url":"https://api.github.com/repos/arthurvaverko/clients-generator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arthurvaverko/clients-generator/statuses/{sha}","languages_url":"https://api.github.com/repos/arthurvaverko/clients-generator/languages","stargazers_url":"https://api.github.com/repos/arthurvaverko/clients-generator/stargazers","contributors_url":"https://api.github.com/repos/arthurvaverko/clients-generator/contributors","subscribers_url":"https://api.github.com/repos/arthurvaverko/clients-generator/subscribers","subscription_url":"https://api.github.com/repos/arthurvaverko/clients-generator/subscription","commits_url":"https://api.github.com/repos/arthurvaverko/clients-generator/commits{/sha}","git_commits_url":"https://api.github.com/repos/arthurvaverko/clients-generator/git/commits{/sha}","comments_url":"https://api.github.com/repos/arthurvaverko/clients-generator/comments{/number}","issue_comment_url":"https://api.github.com/repos/arthurvaverko/clients-generator/issues/comments{/number}","contents_url":"https://api.github.com/repos/arthurvaverko/clients-generator/contents/{+path}","compare_url":"https://api.github.com/repos/arthurvaverko/clients-generator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arthurvaverko/clients-generator/merges","archive_url":"https://api.github.com/repos/arthurvaverko/clients-generator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arthurvaverko/clients-generator/downloads","issues_url":"https://api.github.com/repos/arthurvaverko/clients-generator/issues{/number}","pulls_url":"https://api.github.com/repos/arthurvaverko/clients-generator/pulls{/number}","milestones_url":"https://api.github.com/repos/arthurvaverko/clients-generator/milestones{/number}","notifications_url":"https://api.github.com/repos/arthurvaverko/clients-generator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arthurvaverko/clients-generator/labels{/name}","releases_url":"https://api.github.com/repos/arthurvaverko/clients-generator/releases{/id}","deployments_url":"https://api.github.com/repos/arthurvaverko/clients-generator/deployments","created_at":"2018-02-20T08:23:36Z","updated_at":"2018-02-20T08:23:40Z","pushed_at":"2018-07-31T07:22:00Z","git_url":"git://github.com/arthurvaverko/clients-generator.git","ssh_url":"git@github.com:arthurvaverko/clients-generator.git","clone_url":"https://github.com/arthurvaverko/clients-generator.git","svn_url":"https://github.com/arthurvaverko/clients-generator","homepage":null,"size":21756,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"Mercury-13.14.0"}},"base":{"label":"kaltura:Naos-14.4.0","ref":"Naos-14.4.0","sha":"b201140892d8191aad4477b8a769ee273ba7cca2","user":{"login":"kaltura","id":319096,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxOTA5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/319096?v=4","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"repo":{"id":61802496,"node_id":"MDEwOlJlcG9zaXRvcnk2MTgwMjQ5Ng==","name":"clients-generator","full_name":"kaltura/clients-generator","owner":{"login":"kaltura","id":319096,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxOTA5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/319096?v=4","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaltura/clients-generator","description":null,"fork":false,"url":"https://api.github.com/repos/kaltura/clients-generator","forks_url":"https://api.github.com/repos/kaltura/clients-generator/forks","keys_url":"https://api.github.com/repos/kaltura/clients-generator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaltura/clients-generator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaltura/clients-generator/teams","hooks_url":"https://api.github.com/repos/kaltura/clients-generator/hooks","issue_events_url":"https://api.github.com/repos/kaltura/clients-generator/issues/events{/number}","events_url":"https://api.github.com/repos/kaltura/clients-generator/events","assignees_url":"https://api.github.com/repos/kaltura/clients-generator/assignees{/user}","branches_url":"https://api.github.com/repos/kaltura/clients-generator/branches{/branch}","tags_url":"https://api.github.com/repos/kaltura/clients-generator/tags","blobs_url":"https://api.github.com/repos/kaltura/clients-generator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaltura/clients-generator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaltura/clients-generator/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaltura/clients-generator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaltura/clients-generator/statuses/{sha}","languages_url":"https://api.github.com/repos/kaltura/clients-generator/languages","stargazers_url":"https://api.github.com/repos/kaltura/clients-generator/stargazers","contributors_url":"https://api.github.com/repos/kaltura/clients-generator/contributors","subscribers_url":"https://api.github.com/repos/kaltura/clients-generator/subscribers","subscription_url":"https://api.github.com/repos/kaltura/clients-generator/subscription","commits_url":"https://api.github.com/repos/kaltura/clients-generator/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaltura/clients-generator/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaltura/clients-generator/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaltura/clients-generator/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaltura/clients-generator/contents/{+path}","compare_url":"https://api.github.com/repos/kaltura/clients-generator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaltura/clients-generator/merges","archive_url":"https://api.github.com/repos/kaltura/clients-generator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaltura/clients-generator/downloads","issues_url":"https://api.github.com/repos/kaltura/clients-generator/issues{/number}","pulls_url":"https://api.github.com/repos/kaltura/clients-generator/pulls{/number}","milestones_url":"https://api.github.com/repos/kaltura/clients-generator/milestones{/number}","notifications_url":"https://api.github.com/repos/kaltura/clients-generator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaltura/clients-generator/labels{/name}","releases_url":"https://api.github.com/repos/kaltura/clients-generator/releases{/id}","deployments_url":"https://api.github.com/repos/kaltura/clients-generator/deployments","created_at":"2016-06-23T12:10:46Z","updated_at":"2018-07-26T09:18:32Z","pushed_at":"2018-07-31T07:22:39Z","git_url":"git://github.com/kaltura/clients-generator.git","ssh_url":"git@github.com:kaltura/clients-generator.git","clone_url":"https://github.com/kaltura/clients-generator.git","svn_url":"https://github.com/kaltura/clients-generator","homepage":null,"size":21880,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":17,"open_issues":4,"watchers":5,"default_branch":"Naos-14.4.0"}},"_links":{"self":{"href":"https://api.github.com/repos/kaltura/clients-generator/pulls/348"},"html":{"href":"https://github.com/kaltura/clients-generator/pull/348"},"issue":{"href":"https://api.github.com/repos/kaltura/clients-generator/issues/348"},"comments":{"href":"https://api.github.com/repos/kaltura/clients-generator/issues/348/comments"},"review_comments":{"href":"https://api.github.com/repos/kaltura/clients-generator/pulls/348/comments"},"review_comment":{"href":"https://api.github.com/repos/kaltura/clients-generator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kaltura/clients-generator/pulls/348/commits"},"statuses":{"href":"https://api.github.com/repos/kaltura/clients-generator/statuses/bb3875b375584968d445088b63b833149dd520ff"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tan-tan-kanarek"}}