gitlab
Version:
Full NodeJS implementation of the GitLab API. Supports Promises, Async/Await.
1 lines • 65.3 kB
JavaScript
import{shim as t}from"universal-url";import e from"li";import{camelizeKeys as o,decamelizeKeys as n}from"humps";import r from"ky-universal";import s from"form-data";import{stringify as p}from"query-string";import i from"randomstring";var u=function(t,e){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};function c(t,e){function o(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var a=function(){return(a=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function m(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&(o[n[r]]=t[n[r]])}return o}function h(t,e,o,n){return new(o||(o=Promise))(function(r,s){function p(t){try{u(n.next(t))}catch(t){s(t)}}function i(t){try{u(n.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new o(function(e){e(t.value)}).then(p,i)}u((n=n.apply(t,e||[])).next())})}function d(t,e){var o,n,r,s,p={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function i(s){return function(i){return function(s){if(o)throw new TypeError("Generator is already executing.");for(;p;)try{if(o=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return p.label++,{value:s[1],done:!1};case 5:p.label++,n=s[1],s=[0];continue;case 7:s=p.ops.pop(),p.trys.pop();continue;default:if(!(r=(r=p.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){p=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){p.label=s[1];break}if(6===s[0]&&p.label<r[1]){p.label=r[1],r=s;break}if(r&&p.label<r[2]){p.label=r[2],p.ops.push(s);break}r[2]&&p.ops.pop(),p.trys.pop();continue}s=e.call(t,p)}catch(t){s=[6,t],n=0}finally{o=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,i])}}}function l(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,s=o.call(t),p=[];try{for(;(void 0===e||e-- >0)&&!(n=s.next()).done;)p.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return p}function f(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l(arguments[e]));return t}function y(t,n,r){return void 0===r&&(r={}),h(this,void 0,void 0,function(){var s,p,i,u,c,a,h,l,I,v,R,U,C;return d(this,function(d){switch(d.label){case 0:return s=r.showPagination,p=r.maxPages,i=r.sudo,u=m(r,["showPagination","maxPages","sudo"]),[4,t.requester.get(t,n,{query:u||{},sudo:i})];case 1:return c=d.sent(),a=c.headers,h=c.body,l={total:a["x-total"],next:parseInt(a["x-next-page"],10)||null,current:parseInt(a["x-page"],10)||1,previous:a["x-prev-page"]||null,perPage:a["x-per-page"],totalPages:a["x-total-pages"]},I=!p||l.current<p,t.camelize&&(h=o(h)),!u.page&&I&&l.next?(v=e.parse(a.link).next,R=t.url.split("/").pop()||"",U=new RegExp(".+/api/v\\d(/"+R+")?/"),[4,y(t,v.replace(U,""),{maxPages:p,sudo:i,showPagination:!0})]):[3,3];case 2:C=d.sent(),l=C.pagination,h=f(h,C.data),d.label=3;case 3:return[2,(u.page||h.length>0)&&s?{data:h,pagination:l}:h]}})})}function I(t,e,o){if(void 0===o&&(o={}),"function"!=typeof t.requester.stream)throw new Error("Stream method is not implementated in requester!");return t.requester.stream(t,e,{query:o})}function v(t,e,o){return void 0===o&&(o={}),h(this,void 0,void 0,function(){var n,r;return d(this,function(s){switch(s.label){case 0:return n=o.sudo,r=m(o,["sudo"]),[4,t.requester.post(t,e,{body:r,sudo:n})];case 1:return[2,s.sent().body]}})})}function R(t,e,o){return void 0===o&&(o={}),h(this,void 0,void 0,function(){var n;return d(this,function(r){switch(r.label){case 0:return o.sudo,n=m(o,["sudo"]),[4,t.requester.put(t,e,{body:n})];case 1:return[2,r.sent().body]}})})}function U(t,e,o){return void 0===o&&(o={}),h(this,void 0,void 0,function(){var n,r;return d(this,function(s){switch(s.label){case 0:return n=o.sudo,r=m(o,["sudo"]),[4,t.requester.delete(t,e,{query:r,sudo:n})];case 1:return[2,s.sent().body]}})})}function C(t){return function(e){var o=this;Object.entries(t||{}).forEach(function(t){var n=l(t,2),r=n[0],s=n[1];o[r]=new s(e)})}}function j(t,e,o){return/^[A-Z0-9_]+$/.test(t)?t:e(t,o)}var g={};function b(t){return h(this,void 0,void 0,function(){var e,o;return d(this,function(n){switch(n.label){case 0:return e=t.headers.get("content-type")||"",[4,t.text()];case 1:if(o=n.sent(),e.includes("json"))try{return[2,JSON.parse(o||"{}")]}catch(t){return[2,{}]}return[2,o]}})})}["get","post","put","delete","stream"].forEach(function(t){g[t]=function(e,o,i){return h(this,void 0,void 0,function(){var u,c,m,h,y,I;return d(this,function(d){switch(d.label){case 0:u=function(t,e){var o=e.body,r=e.query,i=e.sudo,u=e.method,c=new Headers(t.headers),a=o;return i&&c.append("sudo",""+i),"object"!=typeof o||o instanceof s||(a=JSON.stringify(n(o,j)),c.append("content-type","application/json")),{timeout:t.requestTimeout,headers:c,method:"stream"===u?"get":u,onProgress:"stream"===u?function(){}:void 0,searchParams:p(n(r||{}),{arrayFormat:"bracket"}),prefixUrl:t.url,body:a}}(e,a({},i,{method:t})),d.label=1;case 1:return d.trys.push([1,3,,6]),[4,r(o,u)];case 2:return c=d.sent(),[3,6];case 3:return(m=d.sent()).response?[4,m.response.json()]:[3,5];case 4:h=d.sent(),m.description=h.error||h.message,d.label=5;case 5:throw m;case 6:return y=c.status,I=function(t){var e={};return f(t.headers.entries()).forEach(function(t){var o=l(t,2),n=o[0],r=o[1];e[n]=r}),e}(c),[4,b(c)];case 7:return[2,{body:d.sent(),headers:I,status:y}]}})})}});var _=function(){return function(t){var e=t.token,o=t.jobToken,n=t.oauthToken,r=t.sudo,s=t.host,p=void 0===s?"https://gitlab.com":s,i=t.url,u=void 0===i?"":i,c=t.version,a=void 0===c?"v4":c,m=t.camelize,h=void 0!==m&&m,d=t.rejectUnauthorized,l=void 0===d||d,f=t.requester,y=void 0===f?g:f,I=t.requestTimeout,v=void 0===I?3e5:I;this.url=[p,"api",a,u].join("/"),this.headers={},this.rejectUnauthorized=l,this.camelize=h,this.requester=y,this.requestTimeout=v,n?this.headers.authorization="Bearer "+n:o?this.headers["job-token"]=o:e&&(this.headers["private-token"]=e),r&&(this.headers.Sudo=""+r)}}(),w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t){return y(this,"groups",t)},e.prototype.create=function(t){return v(this,"groups",t)},e.prototype.createLDAPLink=function(t,e,o,n,r){return v(this,"groups/"+encodeURIComponent(t)+"/ldap_group_links",a({cn:e,groupAccess:o,provider:n},r))},e.prototype.edit=function(t,e){return R(this,"groups/"+encodeURIComponent(t),e)},e.prototype.remove=function(t,e){return U(this,"groups/"+encodeURIComponent(t),e)},e.prototype.removeLDAPLink=function(t,e,o){void 0===o&&(o={});var n=o.provider,r=m(o,["provider"]);return U(this,"groups/"+encodeURIComponent(t)+"/ldap_group_links/"+(n?n+"/"+e:""+e),r)},e.prototype.search=function(t,e){return y(this,"groups",a({search:t},e))},e.prototype.show=function(t,e){return y(this,"groups/"+encodeURIComponent(t),e)},e.prototype.subgroups=function(t,e){return y(this,"groups/"+encodeURIComponent(t)+"/subgroups",e)},e.prototype.syncLDAP=function(t,e){return v(this,"groups/"+encodeURIComponent(t)+"/ldap_sync",e)},e}(_),k=function(t){function e(e,o){return t.call(this,a({url:e},o))||this}return c(e,t),e.prototype.all=function(t){return y(this,encodeURIComponent(t)+"/access_requests")},e.prototype.request=function(t){return v(this,encodeURIComponent(t)+"/access_requests")},e.prototype.approve=function(t,e,o){var n=o.accessLevel,r=l([t,e].map(encodeURIComponent),2);return v(this,r[0]+"/access_requests/"+r[1]+"/approve",{accessLevel:n})},e.prototype.deny=function(t,e){var o=l([t,e].map(encodeURIComponent),2);return U(this,o[0]+"/access_requests/"+o[1])},e}(_);function q(t,e,o,n,r){var s=l([t,o].map(encodeURIComponent),2),p=[s[0],e,s[1]];return r&&p.push("notes",encodeURIComponent(r)),p.push(encodeURIComponent("award_emoji")),n&&p.push(encodeURIComponent(n)),p.join("/")}var P=function(t){function e(e,o){var n=t.call(this,a({url:"projects"},o))||this;return n.resourceType=e,n}return c(e,t),e.prototype.all=function(t,e,o,n){return y(this,q(t,this.resourceType,e,null,o),n)},e.prototype.award=function(t,e,o,n,r){return v(this,q(t,this.resourceType,e,null,n),a({name:o},r))},e.prototype.remove=function(t,e,o,n,r){return U(this,q(t,this.resourceType,e,o,n),r)},e.prototype.show=function(t,e,o,n,r){return y(this,q(t,this.resourceType,e,o,n),r)},e}(_),T=function(t){function e(e,o){return t.call(this,a({url:e},o))||this}return c(e,t),e.prototype.add=function(t,e){return v(this,encodeURIComponent(t)+"/badges",e)},e.prototype.all=function(t,e){return y(this,encodeURIComponent(t)+"/badges",e)},e.prototype.edit=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,n[0]+"/badges/"+n[1],o)},e.prototype.preview=function(t,e,o,n){return y(this,encodeURIComponent(t)+"/badges/render",a({linkUrl:e,imageUrl:o},n))},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,n[0]+"/badges/"+n[1],o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,n[0]+"/badges/"+n[1],o)},e}(_),S=function(t){function e(e,o){return t.call(this,a({url:e},o))||this}return c(e,t),e.prototype.all=function(t,e){return y(this,encodeURIComponent(t)+"/custom_attributes",e)},e.prototype.set=function(t,e,o,n){var r=l([t,e].map(encodeURIComponent),2);return R(this,r[0]+"/custom_attributes/"+r[1],a({value:o},n))},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,n[0]+"/custom_attributes/"+n[1],o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,n[0]+"/custom_attributes/"+n[1],o)},e}(_),x=function(t){function e(e,o,n){var r=t.call(this,a({url:e},n))||this;return r.resource2Type=o,r}return c(e,t),e.prototype.addNote=function(t,e,o,n,r,s){if(!r)throw new Error("Missing required content argument");var p=l([t,e,o,n].map(encodeURIComponent),4),i=p[0],u=p[1],c=p[2],m=p[3];return v(this,i+"/"+this.resource2Type+"/"+u+"/discussions/"+c+"/notes",a({body:r,noteId:m},s))},e.prototype.all=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2),r=n[0],s=n[1];return y(this,r+"/"+this.resource2Type+"/"+s+"/discussions",o)},e.prototype.create=function(t,e,o,n){if(!o)throw new Error("Missing required content argument");var r=l([t,e].map(encodeURIComponent),2),s=r[0],p=r[1];return v(this,s+"/"+this.resource2Type+"/"+p+"/discussions",a({body:o},n))},e.prototype.editNote=function(t,e,o,n,r){var s=l([t,e,o,n].map(encodeURIComponent),4),p=s[0],i=s[1],u=s[2],c=s[3];return R(this,p+"/"+this.resource2Type+"/"+i+"/discussions/"+u+"/notes/"+c,{body:r})},e.prototype.removeNote=function(t,e,o,n,r){var s=l([t,e,o,n].map(encodeURIComponent),4),p=s[0],i=s[1],u=s[2],c=s[3];return U(this,p+"/"+this.resource2Type+"/"+i+"/discussions/"+u+"/notes/"+c,r)},e.prototype.show=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3),s=r[0],p=r[1],i=r[2];return y(this,s+"/"+this.resource2Type+"/"+p+"/discussions/"+i,n)},e}(_),A=function(t){function e(e,o){return t.call(this,a({url:e},o))||this}return c(e,t),e.prototype.all=function(t,e){return y(this,encodeURIComponent(t)+"/boards",e)},e.prototype.create=function(t,e,o){return v(this,encodeURIComponent(t)+"/boards",a({name:e},o))},e.prototype.createList=function(t,e,o,n){var r=l([t,e].map(encodeURIComponent),2);return v(this,r[0]+"/boards/"+r[1]+"/lists",a({labelId:o},n))},e.prototype.edit=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,n[0]+"/boards/"+n[1],o)},e.prototype.editList=function(t,e,o,n,r){var s=l([t,e,o].map(encodeURIComponent),3);return R(this,s[0]+"/boards/"+s[1]+"/lists/"+s[2],a({position:n},r))},e.prototype.lists=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,n[0]+"/boards/"+n[1]+"/lists",o)},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,n[0]+"/boards/"+n[1],o)},e.prototype.removeList=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return U(this,r[0]+"/boards/"+r[1]+"/lists/"+r[2],n)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,n[0]+"/boards/"+n[1],o)},e.prototype.showList=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return y(this,r[0]+"/boards/"+r[1]+"/lists/"+r[2],n)},e}(_),E=function(t){function e(e,o){return t.call(this,a({url:e},o))||this}return c(e,t),e.prototype.all=function(t,e,o){void 0===e&&(e=!1);var n=[encodeURIComponent(t),"members"];return e&&n.push("all"),y(this,n.join("/"),{options:o})},e.prototype.add=function(t,e,o,n){var r=l([t,e].map(encodeURIComponent),2),s=r[0],p=r[1];return v(this,s+"/members",a({userId:p,accessLevel:o},n))},e.prototype.edit=function(t,e,o,n){var r=l([t,e].map(encodeURIComponent),2);return R(this,r[0]+"/members/"+r[1],a({accessLevel:o},n))},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,n[0]+"/members/"+n[1],o)},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,n[0]+"/members/"+n[1],o)},e}(_),M=function(t){function e(e,o){return t.call(this,a({url:e},o))||this}return c(e,t),e.prototype.all=function(t,e){return y(this,encodeURIComponent(t)+"/milestones",e)},e.prototype.create=function(t,e,o){return v(this,encodeURIComponent(t)+"/milestones",a({title:e},o))},e.prototype.edit=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,n[0]+"/milestones/"+n[1],o)},e.prototype.issues=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,n[0]+"/milestones/"+n[1]+"/issues",o)},e.prototype.mergeRequests=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,n[0]+"/milestones/"+n[1]+"/merge_requests",o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,n[0]+"/milestones/"+n[1],o)},e}(_),G=function(t){function e(e,o,n){var r=t.call(this,a({url:e},n))||this;return r.resource2Type=o,r}return c(e,t),e.prototype.all=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2),r=n[0],s=n[1];return y(this,r+"/"+this.resource2Type+"/"+s+"/notes",o)},e.prototype.create=function(t,e,o,n){var r=l([t,e].map(encodeURIComponent),2),s=r[0],p=r[1];return v(this,s+"/"+this.resource2Type+"/"+p+"/notes",a({body:o},n))},e.prototype.edit=function(t,e,o,n,r){var s=l([t,e,o].map(encodeURIComponent),3),p=s[0],i=s[1],u=s[2];return R(this,p+"/"+this.resource2Type+"/"+i+"/notes/"+u,a({body:n},r))},e.prototype.remove=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3),s=r[0],p=r[1],i=r[2];return U(this,s+"/"+this.resource2Type+"/"+p+"/notes/"+i,n)},e.prototype.show=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3),s=r[0],p=r[1],i=r[2];return y(this,s+"/"+this.resource2Type+"/"+p+"/notes/"+i,n)},e}(_),L=function(t){function e(e,o){return t.call(this,a({url:["templates",e].join("/")},o))||this}return c(e,t),e.prototype.all=function(t){return y(this,"",t)},e.prototype.show=function(t,e){return v(this,""+encodeURIComponent(t),e)},e}(_),O=function(t){function e(e,o){return t.call(this,a({url:e},o))||this}return c(e,t),e.prototype.all=function(t,e){return y(this,encodeURIComponent(t)+"/variables",e)},e.prototype.create=function(t,e){return v(this,encodeURIComponent(t)+"/variables",e)},e.prototype.edit=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,n[0]+"/variables/"+n[1],o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,n[0]+"/variables/"+n[1],o)},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,n[0]+"/variables/"+n[1],o)},e}(_),D=function(t){function e(e){return t.call(this,"groups",e)||this}return c(e,t),e}(k),N=function(t){function e(e){return t.call(this,"groups",e)||this}return c(e,t),e}(T),B=function(t){function e(e){return t.call(this,"groups",e)||this}return c(e,t),e}(S),F=function(t){function e(e){return t.call(this,"groups",e)||this}return c(e,t),e}(A),z=function(t){function e(e){return t.call(this,"groups",e)||this}return c(e,t),e}(E),K=function(t){function e(e){return t.call(this,"groups",e)||this}return c(e,t),e}(M),V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"groups/"+encodeURIComponent(t)+"/projects",e)},e.prototype.add=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"groups/"+n[0]+"/projects/"+n[1],o)},e}(_),J=function(t){function e(e){return t.call(this,"groups",e)||this}return c(e,t),e}(O),H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"groups/"+encodeURIComponent(t)+"/epics",e)},e.prototype.create=function(t,e,o){return v(this,"groups/"+encodeURIComponent(t)+"/epics",a({title:e},o))},e.prototype.edit=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,"groups/"+n[0]+"/epics/"+n[1],o)},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"groups/"+n[0]+"/epics/"+n[1],o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"groups/"+n[0]+"/epics/"+n[1],o)},e}(_),W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"groups/"+n[0]+"/epics/"+n[1]+"/issues",o)},e.prototype.assign=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return R(this,"groups/"+r[0]+"/epics/"+r[1]+"/issues/"+r[2],n)},e.prototype.edit=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return U(this,"groups/"+r[0]+"/epics/"+r[1]+"/issues/"+r[2],n)},e.prototype.remove=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return U(this,"groups/"+r[0]+"/epics/"+r[1]+"/issues/"+r[2],n)},e}(_),Y=function(t){function e(e){return t.call(this,"groups","epics",e)||this}return c(e,t),e}(G),Z=function(t){function e(e){return t.call(this,"groups","epics",e)||this}return c(e,t),e}(x),$=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t){return y(this,"users",t)},e.prototype.activities=function(t){return y(this,"users/activities",t)},e.prototype.projects=function(t,e){return y(this,"users/"+encodeURIComponent(t)+"/projects",e)},e.prototype.block=function(t,e){return v(this,"users/"+encodeURIComponent(t)+"/block",e)},e.prototype.create=function(t){return v(this,"users",t)},e.prototype.current=function(t){return y(this,"user",t)},e.prototype.edit=function(t,e){return R(this,"users/"+encodeURIComponent(t),e)},e.prototype.events=function(t,e){return y(this,"users/"+encodeURIComponent(t)+"/events",e)},e.prototype.session=function(t,e,o){return v(this,"session",a({email:t,password:e},o))},e.prototype.search=function(t,e){return y(this,"users",a({search:t},e))},e.prototype.show=function(t,e){return y(this,"users/"+encodeURIComponent(t),e)},e.prototype.remove=function(t,e){return U(this,"users/"+encodeURIComponent(t),e)},e.prototype.unblock=function(t,e){return v(this,"users/"+encodeURIComponent(t)+"/unblock",e)},e}(_),Q=function(t){function e(e){return t.call(this,"users",e)||this}return c(e,t),e}(S),X=function(t){return t?"users/"+encodeURIComponent(t)+"/emails":"user/emails"},tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t){void 0===t&&(t={});var e=t.userId,o=m(t,["userId"]);return y(this,X(e),o)},e.prototype.add=function(t,e){void 0===e&&(e={});var o=e.userId,n=m(e,["userId"]);return v(this,X(o),a({email:t},n))},e.prototype.show=function(t,e){return y(this,"user/emails/"+encodeURIComponent(t),e)},e.prototype.remove=function(t,e){void 0===e&&(e={});var o=e.userId,n=m(e,["userId"]),r=encodeURIComponent(t);return U(this,X(o)+"/"+r,n)},e}(_),et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"users/"+encodeURIComponent(t)+"/impersonation_tokens",e)},e.prototype.add=function(t,e,o,n,r){return v(this,"users/"+encodeURIComponent(t)+"/impersonation_tokens",a({name:e,expiresAt:n,scopes:o},r))},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"users/"+n[0]+"/impersonation_tokens/"+n[1],o)},e.prototype.revoke=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"users/"+n[0]+"/impersonation_tokens/"+n[1],o)},e}(_),ot=function(t){return t?"users/"+encodeURIComponent(t)+"/keys":"user/keys"},nt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t){void 0===t&&(t={});var e=t.userId,o=m(t,["userId"]);return y(this,ot(e),o)},e.prototype.create=function(t,e,o){void 0===o&&(o={});var n=o.userId,r=m(o,["userId"]);return v(this,ot(n),a({title:t,key:e},r))},e.prototype.show=function(t,e){return y(this,"user/keys/"+encodeURIComponent(t),e)},e.prototype.remove=function(t,e){void 0===e&&(e={});var o=e.userId,n=m(e,["userId"]),r=encodeURIComponent(t);return U(this,ot(o)+"/"+r,n)},e}(_),rt=function(t){return t?"users/"+encodeURIComponent(t)+"/gpg_keys":"users/gpg_keys"},st=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t){void 0===t&&(t={});var e=t.userId,o=m(t,["userId"]);return y(this,rt(e),o)},e.prototype.add=function(t,e,o){void 0===o&&(o={});var n=o.userId,r=m(o,["userId"]);return v(this,rt(n),a({title:t,key:e},r))},e.prototype.show=function(t,e){void 0===e&&(e={});var o=e.userId,n=m(e,["userId"]),r=encodeURIComponent(t);return y(this,rt(o)+"/"+r,n)},e.prototype.remove=function(t,e){void 0===e&&(e={});var o=e.userId,n=m(e,["userId"]),r=encodeURIComponent(t);return U(this,rt(o)+"/"+r,n)},e}(_),pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/repository/branches",e)},e.prototype.create=function(t,e,o,n){return v(this,"projects/"+encodeURIComponent(t)+"/repository/branches",a({branch:e,ref:o},n))},e.prototype.protect=function(t,e,o){return v(this,"projects/"+encodeURIComponent(t)+"/protected_branches",a({name:e},o))},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/repository/branches/"+n[1],o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/repository/branches/"+n[1],o)},e.prototype.unprotect=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,"projects/"+n[0]+"/repository/branches/"+n[1]+"/unprotect",o)},e}(_),it=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/repository/commits",e)},e.prototype.cherryPick=function(t,e,o,n){return v(this,"projects/"+encodeURIComponent(t)+"/repository/commits/"+e+"/cherry_pick",a({branch:o},n))},e.prototype.comments=function(t,e,o){return y(this,"projects/"+encodeURIComponent(t)+"/repository/commits/"+e+"/comments",o)},e.prototype.create=function(t,e,o,n,r){return void 0===n&&(n=[]),v(this,"projects/"+encodeURIComponent(t)+"/repository/commits",a({branch:e,commitMessage:o,actions:n},r))},e.prototype.createComment=function(t,e,o,n){return v(this,"projects/"+encodeURIComponent(t)+"/repository/commits/"+e+"/comments",a({note:o},n))},e.prototype.diff=function(t,e,o){return y(this,"projects/"+encodeURIComponent(t)+"/repository/commits/"+e+"/diff",o)},e.prototype.editStatus=function(t,e,o){return v(this,"projects/"+encodeURIComponent(t)+"/statuses/"+e,o)},e.prototype.references=function(t,e,o){return y(this,"projects/"+encodeURIComponent(t)+"/repository/commits/"+e+"/refs",o)},e.prototype.show=function(t,e,o){return y(this,"projects/"+encodeURIComponent(t)+"/repository/commits/"+e,o)},e.prototype.status=function(t,e,o){return y(this,"projects/"+encodeURIComponent(t)+"/repository/commits/"+e+"/statuses",o)},e.prototype.mergeRequests=function(t,e,o){return y(this,"projects/"+encodeURIComponent(t)+"/repository/commits/"+e+"/merge_requests",o)},e}(_),ut=function(t){function e(e){return t.call(this,"projects","commits",e)||this}return c(e,t),e}(x),ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.repositories=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/registry/repositories",e)},e.prototype.tags=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/registry/repositories/"+n[1]+"/tags",o)},e.prototype.removeRepository=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/registry/repositories/"+n[1],o)},e.prototype.removeTag=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return U(this,"projects/"+r[0]+"/registry/repositories/"+r[1]+"/tags/"+r[2],n)},e.prototype.removeTags=function(t,e,o,n){var r=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+r[0]+"/registry/repositories/"+r[1]+"/tags",a({tagNameRegex:o},n))},e.prototype.showTag=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return y(this,"projects/"+r[0]+"/registry/repositories/"+r[1]+"/tags/"+r[2],n)},e}(_),at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/deployments",e)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/deployments/"+n[1],o)},e}(_),mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.add=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/deploy_keys",e)},e.prototype.all=function(t){var e=t.projectId,o=m(t,["projectId"]);return y(this,e?"projects/"+encodeURIComponent(e)+"/deploy_keys":"deploy_keys",o)},e.prototype.edit=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,"projects/"+n[0]+"/deploy_keys/"+n[1],o)},e.prototype.enable=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/deploy_keys/"+n[1]+"/enable",o)},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/deploy_keys/"+n[1],o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/deploy_keys/"+n[1],o)},e}(_),ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/environments",e)},e.prototype.create=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/environments",e)},e.prototype.edit=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,"projects/"+n[0]+"/environments/"+n[1],o)},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/environments/"+n[1],o)},e.prototype.stop=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/environments/"+n[1]+"/stop",o)},e}(_),dt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.addSpentTime=function(t,e,o,n){var r=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+r[0]+"/issues/"+r[1]+"/add_spent_time",a({duration:o},n))},e.prototype.addTimeEstimate=function(t,e,o,n){var r=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+r[0]+"/issues/"+r[1]+"/time_estimate",a({duration:o},n))},e.prototype.all=function(t){void 0===t&&(t={});var e=t.projectId,o=t.groupId,n=m(t,["projectId","groupId"]);return y(this,e?"projects/"+encodeURIComponent(e)+"/issues":o?"groups/"+encodeURIComponent(o)+"/issues":"issues",n)},e.prototype.create=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/issues",e)},e.prototype.edit=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,"projects/"+n[0]+"/issues/"+n[1],o)},e.prototype.link=function(t,e,o,n,r){var s=l([t,e].map(encodeURIComponent),2),p=s[0],i=s[1],u=l([o,n].map(encodeURIComponent),2),c=u[0],m=u[1];return v(this,"projects/"+p+"/issues/"+i+"/links",a({targetProjectId:c,targetIssueId:m},r))},e.prototype.participants=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/issues/"+n[1]+"/participants",o)},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/issues/"+n[1],o)},e.prototype.resetSpentTime=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/issues/"+n[1]+"/reset_spent_time",o)},e.prototype.resetTimeEstimate=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/issues/"+n[1]+"/reset_time_estimate",o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/issues/"+n[1],o)},e.prototype.subscribe=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/issues/"+n[1]+"/subscribe",o)},e.prototype.timeStats=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/issues/"+n[1]+"/time_stats",o)},e.prototype.unsubscribe=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/issues/"+n[1]+"/unsubscribe",o)},e}(_),lt=function(t){function e(e){return t.call(this,"projects","issues",e)||this}return c(e,t),e}(G),ft=function(t){function e(e){return t.call(this,"projects","issues",e)||this}return c(e,t),e}(x),yt=function(t){function e(e){return t.call(this,"issues",e)||this}return c(e,t),e}(P),It=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/jobs",e)},e.prototype.cancel=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/jobs/"+n[1]+"/cancel",o)},e.prototype.downloadSingleArtifactFile=function(t,e,o,n){var r=n.stream,s=void 0!==r&&r,p=m(n,["stream"]),i=l([t,e].map(encodeURIComponent),2),u=i[0],c=i[1];return s?I(this,"projects/"+u+"/jobs/"+c+"/artifacts/"+o,p):y(this,"projects/"+u+"/jobs/"+c+"/artifacts/"+o,p)},e.prototype.downloadLatestArtifactFile=function(t,e,o,n){var r=n.stream,s=void 0!==r&&r,p=m(n,["stream"]),i=l([t,e,o].map(encodeURIComponent),3),u=i[0],c=i[1],a=i[2];return s?I(this,"projects/"+u+"/jobs/artifacts/"+c+"/download?job="+a,p):y(this,"projects/"+u+"/jobs/artifacts/"+c+"/download?job="+a,p)},e.prototype.downloadTraceFile=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/jobs/"+n[1]+"/trace",o)},e.prototype.erase=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/jobs/"+n[1]+"/erase",o)},e.prototype.eraseArtifacts=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/jobs/"+n[1]+"/artifacts",o)},e.prototype.keepArtifacts=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/jobs/"+n[1]+"/artifacts/keep",o)},e.prototype.play=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/jobs/"+n[1]+"/play",o)},e.prototype.retry=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/jobs/"+n[1]+"/retry",o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/jobs/"+n[1],o)},e.prototype.showPipelineJobs=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/pipelines/"+n[1]+"/jobs",o)},e}(_),vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/labels",e)},e.prototype.create=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/labels",e)},e.prototype.edit=function(t,e,o){return R(this,"projects/"+encodeURIComponent(t)+"/labels",a({name:e},o))},e.prototype.remove=function(t,e,o){return U(this,"projects/"+encodeURIComponent(t)+"/labels",a({name:e},o))},e.prototype.subscribe=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/issues/"+n[1]+"/subscribe",o)},e.prototype.unsubscribe=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/issues/"+n[1]+"/unsubscribe",o)},e}(_),Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.accept=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/merge",o)},e.prototype.addSpentTime=function(t,e,o,n){var r=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+r[0]+"/merge_requests/"+r[1]+"/add_spent_time",a({duration:o},n))},e.prototype.addTimeEstimate=function(t,e,o,n){var r=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+r[0]+"/merge_requests/"+r[1]+"/time_estimate",a({duration:o},n))},e.prototype.all=function(t){var e=t.projectId,o=t.groupId,n=m(t,["projectId","groupId"]);return y(this,e?"projects/"+encodeURIComponent(e)+"/merge_requests":o?"groups/"+encodeURIComponent(o)+"/merge_requests":"merge_requests",n)},e.prototype.approve=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/approve",o)},e.prototype.approvals=function(t,e){var o,n=e.mergerequestIId,r=m(e,["mergerequestIId"]),s=encodeURIComponent(t);n?o="projects/"+s+"/merge_requests/"+encodeURIComponent(n)+"/approvals":o="projects/"+s+"/approvals";return y(this,o,r)},e.prototype.approvers=function(t,e,o,n){var r,s=n.mergerequestIId,p=m(n,["mergerequestIId"]),i=encodeURIComponent(t);s?r="projects/"+i+"/merge_requests/"+encodeURIComponent(s)+"/approvers":r="projects/"+i+"/approvers";return R(this,r,a({approverIds:e,approverGroupIds:o},p))},e.prototype.cancelOnPipelineSucess=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/cancel_merge_when_pipeline_succeeds",o)},e.prototype.changes=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/changes",o)},e.prototype.closesIssues=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/closes_issues",o)},e.prototype.commits=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/commits",o)},e.prototype.create=function(t,e,o,n,r){var s=encodeURIComponent(t);return v(this,"projects/"+s+"/merge_requests",a({id:s,sourceBranch:e,targetBranch:o,title:n},r))},e.prototype.edit=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,"projects/"+n[0]+"/merge_requests/"+n[1],o)},e.prototype.editApprovals=function(t,e){var o,n=e.mergerequestIId,r=m(e,["mergerequestIId"]),s=encodeURIComponent(t);n?o="projects/"+s+"/merge_requests/"+encodeURIComponent(n)+"/approvals":o="projects/"+s+"/approvals";return v(this,o,r)},e.prototype.participants=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/participants",o)},e.prototype.pipelines=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/pipelines",o)},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/merge_requests/"+n[1],o)},e.prototype.resetSpentTime=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/reset_spent_time",o)},e.prototype.resetTimeEstimate=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/reset_time_estimate",o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/merge_requests/"+n[1],o)},e.prototype.timeStats=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/time_stats",o)},e.prototype.version=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return y(this,"projects/"+r[0]+"/merge_requests/"+r[1]+"/versions/"+r[2],n)},e.prototype.versions=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/versions",o)},e.prototype.unapprove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/approve",o)},e.prototype.unsubscribe=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/merge_requests/"+n[1]+"/unsubscribe",o)},e}(_),Ut=function(t){function e(e){return t.call(this,"merge_requests",e)||this}return c(e,t),e}(P),Ct=function(t){function e(e){return t.call(this,"projects","merge_requests",e)||this}return c(e,t),e}(x),jt=function(t){function e(e){return t.call(this,"projects","merge_requests",e)||this}return c(e,t),e}(G),gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/pipelines",e)},e.prototype.create=function(t,e,o){return v(this,"projects/"+encodeURIComponent(t)+"/pipeline",a({ref:e},o))},e.prototype.show=function(t,e,o){return y(this,"projects/"+encodeURIComponent(t)+"/pipelines/"+e,o)},e.prototype.retry=function(t,e,o){return v(this,"projects/"+encodeURIComponent(t)+"/pipelines/"+e+"/retry",o)},e.prototype.cancel=function(t,e,o){return v(this,"projects/"+encodeURIComponent(t)+"/pipelines/"+e+"/cancel",o)},e.prototype.showJobs=function(t,e,o){return y(this,"projects/"+encodeURIComponent(t)+"/pipelines/"+e+"/jobs",o)},e}(_),bt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/pipeline_schedules",e)},e.prototype.create=function(t,e,o,n,r){return v(this,"projects/"+encodeURIComponent(t)+"/pipeline_schedules",a({description:e,ref:o,cron:n},r))},e.prototype.edit=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,"projects/"+n[0]+"/pipeline_schedules/"+n[1],o)},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/pipeline_schedules/"+n[1],o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/pipeline_schedules/"+n[1],o)},e.prototype.takeOwnership=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/pipeline_schedules/"+n[1]+"/take_ownership",o)},e}(_),_t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/pipeline_schedules/"+n[1]+"/variables",o)},e.prototype.create=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+n[0]+"/pipeline_schedules/"+n[1]+"/variables",o)},e.prototype.edit=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return R(this,"projects/"+r[0]+"/pipeline_schedules/"+r[1]+"/variables/"+r[2],n)},e.prototype.show=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return y(this,"projects/"+r[0]+"/pipeline_schedules/"+r[1]+"/variables/"+r[2],n)},e.prototype.remove=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return U(this,"projects/"+r[0]+"/pipeline_schedules/"+r[1]+"/variables/"+r[2],n)},e}(_),wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t){return y(this,"projects",t)},e.prototype.archive=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/archive",e)},e.prototype.create=function(t){var e=t.userId,o=m(t,["userId"]);return v(this,e?"projects/user/"+encodeURIComponent(e):"projects",o)},e.prototype.edit=function(t,e){return R(this,"projects/"+encodeURIComponent(t),e)},e.prototype.events=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/events",e)},e.prototype.fork=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/fork",e)},e.prototype.forks=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/forks",e)},e.prototype.languages=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/languages",e)},e.prototype.mirrorPull=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/mirror/pull",e)},e.prototype.remove=function(t,e){return U(this,"projects/"+encodeURIComponent(t),e)},e.prototype.removeFork=function(t,e){return U(this,"projects/"+encodeURIComponent(t)+"/fork",e)},e.prototype.search=function(t){return y(this,"projects",{search:t})},e.prototype.share=function(t,e,o,n){return v(this,"projects/"+encodeURIComponent(t)+"/share",a({groupId:e,groupAccess:o},n))},e.prototype.show=function(t,e){return y(this,"projects/"+encodeURIComponent(t),e)},e.prototype.star=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/star",e)},e.prototype.statuses=function(t,e,o,n){return v(this,"projects/"+encodeURIComponent(t)+"/statuses/"+e,a({state:o},n))},e.prototype.transfer=function(t,e){return R(this,"projects/"+encodeURIComponent(t)+"/transfer",{namespace:e})},e.prototype.unarchive=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/unarchive",e)},e.prototype.unshare=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/share/"+n[1],o)},e.prototype.unstar=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/unstar",e)},e.prototype.updatePushRule=function(t,e){return R(this,"projects/"+encodeURIComponent(t)+"/push_rule",e)},e.prototype.upload=function(t,e,o){void 0===o&&(o={});var n=encodeURIComponent(t),r=new s,p={filename:i.generate(8),contentType:"application/octet-stream"};return r.append("file",e,Object.assign(p,o)),v(this,"projects/"+n+"/uploads",r)},e}(_),kt=function(t){function e(e){return t.call(this,"projects",e)||this}return c(e,t),e}(k),qt=function(t){function e(e){return t.call(this,"projects",e)||this}return c(e,t),e}(T),Pt=function(t){function e(e){return t.call(this,"projects",e)||this}return c(e,t),e}(S),Tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.download=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/export/download",e)},e.prototype.exportStatus=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/export",e)},e.prototype.import=function(t,e){var o=new s;return o.append("file",t,{filename:e,contentType:"application/octet-stream"}),v(this,"projects/import",o)},e.prototype.importStatus=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/import",e)},e.prototype.schedule=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/export",e)},e}(_),St=function(t){function e(e){return t.call(this,"projects",e)||this}return c(e,t),e}(A),xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/hooks",e)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/hooks/"+n[1],o)},e.prototype.add=function(t,e,o){return v(this,"projects/"+encodeURIComponent(t)+"/hooks",a({url:e},o))},e.prototype.edit=function(t,e,o,n){var r=l([t,e].map(encodeURIComponent),2);return R(this,"projects/"+r[0]+"/hooks/"+r[1],a({url:o},n))},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/hooks/"+n[1],o)},e}(_),At=function(t){function e(e){return t.call(this,"projects",e)||this}return c(e,t),e}(E),Et=function(t){function e(e){return t.call(this,"projects",e)||this}return c(e,t),e}(M),Mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/snippets",e)},e.prototype.content=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/snippets/"+n[1]+"/raw",o)},e.prototype.create=function(t,e,o,n,r,s){return v(this,"projects/"+encodeURIComponent(t)+"/snippets",a({title:e,fileName:o,code:n,visibility:r},s))},e.prototype.edit=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,"projects/"+n[0]+"/snippets/"+n[1],o)},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/snippets/"+n[1],o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/snippets/"+n[1],o)},e.prototype.userAgentDetails=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/snippets/"+n[1]+"/user_agent_detail",o)},e}(_),Gt=function(t){function e(e){return t.call(this,"projects","snippets",e)||this}return c(e,t),e}(G),Lt=function(t){function e(e){return t.call(this,"projects","snippets",e)||this}return c(e,t),e}(x),Ot=function(t){function e(e){return t.call(this,"issues",e)||this}return c(e,t),e}(P),Dt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/protected_branches",e)},e.prototype.protect=function(t,e,o){return v(this,"projects/"+encodeURIComponent(t)+"/protected_branches",a({name:e},o))},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/protected_branches/"+n[1],o)},e.prototype.unprotect=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/protected_branches/"+n[1],o)},e}(_),Nt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/protected_tags",e)},e.prototype.protect=function(t,e,o){return v(this,"projects/"+encodeURIComponent(t)+"/protected_tags",a({name:e},o))},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/protected_tags/"+n[1],o)},e.prototype.unprotect=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/protected_tags/"+n[1],o)},e}(_),Bt=function(t){function e(e){return t.call(this,"projects",e)||this}return c(e,t),e}(O),Ft=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.create=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/push_rule",e)},e.prototype.edit=function(t,e){e.upsert;var o=m(e,["upsert"]),n=encodeURIComponent(t);try{return R(this,"projects/"+n+"/push_rule",o)}catch(e){if(e.message.includes("exist"))return this.create(t,o);throw e}},e.prototype.remove=function(t,e){return U(this,"projects/"+encodeURIComponent(t)+"/push_rule",e)},e.prototype.show=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/push_rule",e)},e}(_),zt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/releases",e)},e.prototype.create=function(t,e){return v(this,"projects/"+encodeURIComponent(t)+"/releases",e)},e.prototype.edit=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return R(this,"projects/"+n[0]+"/releases/"+n[1],o)},e.prototype.remove=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return U(this,"projects/"+n[0]+"/releases/"+n[1],o)},e.prototype.show=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/releases/"+n[1],o)},e}(_),Kt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.all=function(t,e,o){var n=l([t,e].map(encodeURIComponent),2);return y(this,"projects/"+n[0]+"/releases/"+n[1]+"/assets/links",o)},e.prototype.create=function(t,e,o,n,r){var s=l([t,e].map(encodeURIComponent),2);return v(this,"projects/"+s[0]+"/releases/"+s[1]+"/assets/links",a({name:o,url:n},r))},e.prototype.edit=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return R(this,"projects/"+r[0]+"/releases/"+r[1]+"/assets/links/"+r[2],n)},e.prototype.remove=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return U(this,"projects/"+r[0]+"/releases/"+r[1]+"/assets/links/"+r[2],n)},e.prototype.show=function(t,e,o,n){var r=l([t,e,o].map(encodeURIComponent),3);return y(this,"projects/"+r[0]+"/releases/"+r[1]+"/assets/links/"+r[2],n)},e}(_),Vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.compare=function(t,e,o,n){return y(this,"projects/"+encodeURIComponent(t)+"/repository/compare",a({from:e,to:o},n))},e.prototype.contributors=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/repository/contributors",e)},e.prototype.showArchive=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/repository/archive",e)},e.prototype.showBlob=function(t,e,o){return y(this,"projects/"+encodeURIComponent(t)+"/repository/blobs/"+e,o)},e.prototype.showBlobRaw=function(t,e,o){return y(this,"projects/"+encodeURIComponent(t)+"/repository/blobs/"+e+"/raw",o)},e.prototype.tree=function(t,e){return y(this,"projects/"+encodeURIComponent(t)+"/repository/tree",e)},e}(_),Jt=function(t){function e(){return null!==t&&t.apply(this,argume