Build.PL100644000766000024 45513621075102 14304 0ustar00aranstaff000000000000GitLab-API-v4-0.25# ========================================================================= # THIS FILE IS AUTOMATICALLY GENERATED BY MINILLA. # DO NOT EDIT DIRECTLY. # ========================================================================= use 5.008_001; use strict; use Module::Build::Tiny 0.035; Build_PL(); Changes100644000766000024 1436313621075102 14346 0ustar00aranstaff000000000000GitLab-API-v4-0.25Revision history for Perl extension GitLab-API-v4. 0.25 2020-02-12T22:20:48Z - Add the delete_pipeline method. 0.24 2020-02-12T22:09:39Z - Add all the container registry methods. - Add http_tiny_request and http_tiny_response to ::RESTClient. This should help people debug issues easier. 0.23 2019-10-18T19:55:06Z - Fix delete_runner so that it doesn't try to decode the response. - Any 204 response now just blanket returns undef. - More contextual JSON decoding error messages. 0.22 2019-09-13T15:02:28Z - Add the statistics method. - The delete_user method can now take parameters, allowing for use of the hard_delete parameter. 0.21 2019-08-24T18:56:13Z - The release endpoint returns a 403 on an unknown tag rather than a 404 like it should. This condition is now detected and treated like a 404. 0.20 2019-07-23T21:42:37Z - The preexisting create_release and edit_release methods have been renamed to create_tag_release and update_tag_release to make room for the new releases API. - Added methods for the new (added in GitLab 11.7) releases and release links APIs. 0.19 2019-05-17T20:40:22Z - Live tests now run against GitLab CE 11.10.4 (was 11.2.3). - Add GitLab::API::v4::WWWClient. - Add GitLab::API::v4::Mock for writing unit tests. - Switch to the GNU General Public License version 3. 0.18 2019-04-01T04:35:02Z - Add SUPPORT section to the docs. - The archive method no longer tries to decode the response. - Add the commit_refs method. - Add the trigger_pipeline method. - Document some create_pipeline method parameters. 0.17 2019-02-20T22:47:58Z - Require perl 5.10.1 as I give up trying to support 5.8 due to other modules requiring 5.10 and strictures/multidimensional issues. - Simplify VERSION declarations. 0.16 2019-02-18T06:21:15Z - Migrate build tooling from Dist::Zilla to Minilla. 0.15 2019-01-09 - BREAKING CHANGE: gitlab-api-v4 now takes parameters in the form of param:value rather than --param=value. This is to avoid foot-gun ambiguities when options have the same names as parameters (such as --url). - Add --pretty and --canonical options to gitlab-api-v4. 0.14 2018-12-04 - Add all_project_members and all_group_members methods. - gitlab-api-v4 now handles -- like you'd expect your typical linux tooling would. 0.13 2018-11-08 - group() now accepts parameters. - Add the transfer_project_to_namespace() method. 0.12 2018-09-11 - Added API methods for Protected Tags, Search, Project Import/Export, Project Badges, Resource Label Events, Discussions, Markdown, Group Issue Boards, Group Badges, and Snippets. - Reorganized project/group members/access requests sections to better match the official API. - Renamed the various project snippet methods to have "project" in their name. - Added constants for the snippet visibility levels. - Overhauled the POD heading layout in order to avoid the massive TOC. - Fix minor typo. 0.11 2018-09-01 - Fixed the raw_file method to not try to decode the respository file contents and instead just return the undecoded response content. - Renamed the POD section "FILE METHODS" to "REPOSITORY FILE METHODS", to better match the GitLab API docs. - Add the hidden NO_ACCESS constant to ::Constants. - Live tests now run against GitLab CE 11.2.3 (was 10.2.2). 0.10 2018-06-05 - Fix project_hook() so it uses the correct path. - create_project_hook() and edit_project_hook() now return their decoded response (the hook). - delete_project_hook() no longer tries to return anything as a successful delete is a 204 (no content) and a failed one is a 404. - Tests for all of the above. - Fix typo. 0.09 2018-05-28 - Ensure chmod 600 of ~/.gitlab-api-v4-config is maintained. - Enable and fix upload_file_to_project by using HTTP::Tiny::Multipart. - Individual methods may now have a custom note added to their POD. - Added a self-contained unit test, unit.t, which can be expanded on in the future. This is unlike regression.t which requires that a GitLab installation be available. - Added the rest_client_class argument. 0.08 2018-05-14 - Many API endpoints which return lists and did not support parameters now do in order for pagination arguments, and the paginator, to be used with them. - Add project_languages method. - Remove upload_file_to_project since it doesn't work. Will re-add when it is made to work later. 0.07 2018-05-10 - Completely overhaul ::RestClient to use HTTP::Tiny instead of Role::REST::Client. This change will make it much easier to alter the behavior of the HTTP communication. - ::RestClient now supports the ability to decode non-ref JSON, such as unblock_user which returns just a JSON boolean. - block_user and unblock_user now return their decoded response. - delete_user is no longer expected to return anything. - Response decoding will now only be attempted for methods which are expected to return something. Slight optimization. - A 404 on a non-returning method throws an exception now, matching the docs. - The *_token arguments are now stored in a closure to help users avoid accidentally dumping them somewhere such as logs. - Added all methods for the TODO API. 0.06 2018-04-09 - Add the project_service method. 0.05 2018-03-06 - Fixup gitlab-api-v4 to support parameters who's values are empty or have whitespace in them. 0.04 2018-02-03 - Support parameters in the project method. - Allow wide characters when printing the response output in the gitlab-api-v4 script. 0.03 2018-01-12 - Greatly extended authentication and configuration options for the gitlab-api-v4 script; added GitLab::API::v4::Config. - The gitlab-api-v4 script now always outputs JSON (the default was YAML, with the option to pick other formats). - Fixed the fork_project method to hit the correct URL. 0.02 2017-12-15 - Fix double-slashes in URL paths. - Fixed gitlab-api-v4 script to actually work. 0.01 2017-12-11 - Added the sudo method and the sudo_user argument. - Split the token arguments into the access_token and private_token arguments. - Removed the login/email/password arguments as they are not supported by v4. - Many many methods added/removed/renamed/modified. - Imported GitLab::API::v3 @ fb9253c58b68ca1be71feedf12c1d6004c8ba8d6. LICENSE100644000766000024 10451513621075102 14077 0ustar00aranstaff000000000000GitLab-API-v4-0.25 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . META.json100644000766000024 1040613621075102 14466 0ustar00aranstaff000000000000GitLab-API-v4-0.25{ "abstract" : "A complete GitLab API v4 client.", "author" : [ "Aran Clary Deltac " ], "dynamic_config" : 0, "generated_by" : "Minilla/v3.1.4", "license" : [ "gpl_3" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "GitLab-API-v4", "no_index" : { "directory" : [ "t", "xt", "inc", "share", "eg", "examples", "author", "builder" ] }, "prereqs" : { "configure" : { "requires" : { "Module::Build::Tiny" : "0.035" } }, "develop" : { "requires" : { "Test::CPAN::Meta" : "0", "Test::MinimumVersion::Fast" : "0.04", "Test::PAUSE::Permissions" : "0.04", "Test::Pod" : "1.41", "Test::Spellunker" : "v0.2.7" } }, "runtime" : { "requires" : { "Carp" : "0", "Const::Fast" : "0.014", "Exporter" : "0", "Getopt::Long" : "0", "HTTP::Tiny" : "0.059", "HTTP::Tiny::Multipart" : "0.05", "IO::Prompter" : "0.004014", "JSON" : "2.59", "Log::Any" : "1.703", "Log::Any::Adapter" : "1.703", "Log::Any::Adapter::Screen" : "0.13", "Moo" : "2.003000", "Path::Tiny" : "0.079", "Pod::Usage" : "0", "Try::Tiny" : "0.28", "Types::Common::Numeric" : "1.002001", "Types::Common::String" : "1.002001", "Types::Standard" : "1.002001", "URI" : "1.62", "URI::Escape" : "1.72", "namespace::clean" : "0.27", "perl" : "5.010001", "strictures" : "2.000003" } }, "test" : { "requires" : { "Log::Any::Adapter::TAP" : "0.003003", "MIME::Base64" : "3.15", "Test2::V0" : "0.000094" } } }, "provides" : { "GitLab::API::v4" : { "file" : "lib/GitLab/API/v4.pm", "version" : "0.25" }, "GitLab::API::v4::Config" : { "file" : "lib/GitLab/API/v4/Config.pm", "version" : "0.25" }, "GitLab::API::v4::Constants" : { "file" : "lib/GitLab/API/v4/Constants.pm", "version" : "0.25" }, "GitLab::API::v4::Mock" : { "file" : "lib/GitLab/API/v4/Mock.pm", "version" : "0.25" }, "GitLab::API::v4::Mock::Engine" : { "file" : "lib/GitLab/API/v4/Mock/Engine.pm", "version" : "0.25" }, "GitLab::API::v4::Mock::RESTClient" : { "file" : "lib/GitLab/API/v4/Mock/RESTClient.pm", "version" : "0.25" }, "GitLab::API::v4::Paginator" : { "file" : "lib/GitLab/API/v4/Paginator.pm", "version" : "0.25" }, "GitLab::API::v4::RESTClient" : { "file" : "lib/GitLab/API/v4/RESTClient.pm", "version" : "0.25" }, "GitLab::API::v4::WWWClient" : { "file" : "lib/GitLab/API/v4/WWWClient.pm", "version" : "0.25" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/bluefeet/GitLab-API-v4/issues" }, "homepage" : "https://github.com/bluefeet/GitLab-API-v4", "repository" : { "url" : "git://github.com/bluefeet/GitLab-API-v4.git", "web" : "https://github.com/bluefeet/GitLab-API-v4" } }, "version" : "0.25", "x_authority" : "cpan:BLUEFEET", "x_contributors" : [ "Dave Webb ", "Dmitry Frolov ", "Dotan Dimet ", "José Joaquín Atria ", "Kieren Diment ", "Luc Didry ", "Marek R. Sotola ", "Nigel Gregoire ", "Simon Ruderich ", "Thomas Klausner ", "gregor herrmann ", "royce55 ", "trunov-ms " ], "x_serialization_backend" : "JSON::PP version 4.04", "x_static_install" : 1 } README.md100644000766000024 36763113621075102 14363 0ustar00aranstaff000000000000GitLab-API-v4-0.25# NAME GitLab::API::v4 - A complete GitLab API v4 client. # SYNOPSIS ```perl use GitLab::API::v4; my $api = GitLab::API::v4->new( url => $v4_api_url, private_token => $token, ); my $branches = $api->branches( $project_id ); ``` # DESCRIPTION This module provides a one-to-one interface with the GitLab API v4. Much is not documented here as it would just be duplicating GitLab's own [API Documentation](http://doc.gitlab.com/ce/api/README.html). Note that this distribution also includes the [gitlab-api-v4](https://metacpan.org/pod/gitlab-api-v4) command-line interface (CLI). ## Upgrading If you are upgrading from [GitLab::API::v3](https://metacpan.org/pod/GitLab::API::v3) make sure you read: [https://docs.gitlab.com/ce/api/v3\_to\_v4.html](https://docs.gitlab.com/ce/api/v3_to_v4.html) Also, review the `Changes` file included in the distribution as it outlines the changes made to convert the v3 module to v4: [https://github.com/bluefeet/GitLab-API-v4/blob/master/Changes](https://github.com/bluefeet/GitLab-API-v4/blob/master/Changes) Finally, be aware that many methods were added, removed, renamed, and/or altered. If you want to review exactly what was changed you can use GitHub's compare tool: [https://github.com/bluefeet/GitLab-API-v4/compare/72e384775c9570f60f8ef68dee3a1eecd347fb69...master](https://github.com/bluefeet/GitLab-API-v4/compare/72e384775c9570f60f8ef68dee3a1eecd347fb69...master) Or clone the repo and run this command: `git diff 72e384775c9570f60f8ef68dee3a1eecd347fb69..HEAD -- author/sections/` ## Credentials Authentication credentials may be defined by setting either the ["access\_token"](#access_token) or ["private\_token"](#private_token) arguments. If no credentials are supplied then the client will be anonymous and greatly limited in what it can do with the API. Extra care has been taken to hide the token arguments behind closures. This way, if you dump your api object, your tokens won't accidentally leak into places you don't want them to. ## Constants The GitLab API, in rare cases, uses a hard-coded value to represent a state. To make life easier the [GitLab::API::v4::Constants](https://metacpan.org/pod/GitLab::API::v4::Constants) module exposes these states as named variables. ## Exceptions The API methods will all throw a useful exception if an unsuccessful response is received from the API. That is except for `GET` requests that return a `404` response - these will return `undef` for methods that return a value. If you'd like to catch and handle these exceptions consider using [Try::Tiny](https://metacpan.org/pod/Try::Tiny). ## Logging This module uses [Log::Any](https://metacpan.org/pod/Log::Any) and produces some debug messages here and there, but the most useful bits are the info messages produced just before each API call. ## Project ID Note that many API calls require a `$project_id`. This can be specified as a numeric project `ID` or, in many cases, maybe all cases, as a `NAMESPACE_PATH/PROJECT_PATH` string. The GitLab documentation on this point is vague. # REQUIRED ARGUMENTS ## url The URL to your v4 API endpoint. Typically this will be something like `https://git.example.com/api/v4`. # OPTIONAL ARGUMENTS ## access\_token A GitLab API OAuth2 token. If set then ["private\_token"](#private_token) may not be set. See [https://docs.gitlab.com/ce/api/#oauth2-tokens](https://docs.gitlab.com/ce/api/#oauth2-tokens). ## private\_token A GitLab API personal token. If set then ["access\_token"](#access_token) may not be set. See [https://docs.gitlab.com/ce/api/#personal-access-tokens](https://docs.gitlab.com/ce/api/#personal-access-tokens). ## retries The number of times the request should be retried in case it fails (5XX HTTP response code). Defaults to `0` (false), meaning that a failed request will not be retried. ## sudo\_user The user to execute API calls as. You may find it more useful to use the ["sudo"](#sudo) method instead. See [https://docs.gitlab.com/ce/api/#sudo](https://docs.gitlab.com/ce/api/#sudo). ## rest\_client An instance of [GitLab::API::v4::RESTClient](https://metacpan.org/pod/GitLab::API::v4::RESTClient) (or whatever ["rest\_client\_class"](#rest_client_class) is set to). Typically you will not be setting this as it defaults to a new instance and customization should not be necessary. ## rest\_client\_class The class to use when constructing the ["rest\_client"](#rest_client). Defaults to [GitLab::API::v4::RESTClient](https://metacpan.org/pod/GitLab::API::v4::RESTClient). # UTILITY METHODS ## paginator ```perl my $paginator = $api->paginator( $method, @method_args ); my $members = $api->paginator('group_members', $group_id); while (my $member = $members->next()) { ... } my $users_pager = $api->paginator('users'); while (my $users = $users_pager->next_page()) { ... } my $all_open_issues = $api->paginator( 'issues', $project_id, { state=>'opened' }, )->all(); ``` Given a method who supports the `page` and `per_page` parameters, and returns an array ref, this will return a [GitLab::API::v4::Paginator](https://metacpan.org/pod/GitLab::API::v4::Paginator) object that will allow you to walk the records one page or one record at a time. ## sudo ``` $api->sudo('fred')->create_issue(...); ``` Returns a new instance of [GitLab::API::v4](https://metacpan.org/pod/GitLab::API::v4) with the ["sudo\_user"](#sudo_user) argument set. See [https://docs.gitlab.com/ce/api/#sudo](https://docs.gitlab.com/ce/api/#sudo). # API METHODS ## Award Emoji See [https://docs.gitlab.com/ce/api/award\_emoji.html](https://docs.gitlab.com/ce/api/award_emoji.html). - issue\_award\_emojis ```perl my $award_emojis = $api->issue_award_emojis( $project_id, $issue_iid, \%params, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/award_emoji` and returns the decoded response content. - merge\_request\_award\_emojis ```perl my $award_emojis = $api->merge_request_award_emojis( $project_id, $merge_request_iid, \%params, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/award_emoji` and returns the decoded response content. - snippet\_award\_emojis ```perl my $award_emojis = $api->snippet_award_emojis( $project_id, $merge_request_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_id/award_emoji` and returns the decoded response content. - issue\_award\_emoji ```perl my $award_emoji = $api->issue_award_emoji( $project_id, $issue_iid, $award_id, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/award_emoji/:award_id` and returns the decoded response content. - merge\_request\_award\_emoji ```perl my $award_emoji = $api->merge_request_award_emoji( $project_id, $merge_request_iid, $award_id, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/award_emoji/:award_id` and returns the decoded response content. - snippet\_award\_emoji ```perl my $award_emoji = $api->snippet_award_emoji( $project_id, $snippet_id, $award_id, ); ``` Sends a `GET` request to `projects/:project_id/snippets/:snippet_id/award_emoji/:award_id` and returns the decoded response content. - create\_issue\_award\_emoji ```perl my $award_emoji = $api->create_issue_award_emoji( $project_id, $issue_iid, \%params, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/award_emoji` and returns the decoded response content. - create\_merge\_request\_award\_emoji ```perl my $award_emoji = $api->create_merge_request_award_emoji( $project_id, $merge_request_iid, \%params, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests/:merge_request_iid/award_emoji` and returns the decoded response content. - create\_snippet\_award\_emoji ```perl my $award_emoji = $api->create_snippet_award_emoji( $project_id, $snippet_id, ); ``` Sends a `POST` request to `projects/:project_id/snippets/:snippet_id/award_emoji` and returns the decoded response content. - delete\_issue\_award\_emoji ```perl my $award_emoji = $api->delete_issue_award_emoji( $project_id, $issue_id, $award_id, ); ``` Sends a `DELETE` request to `projects/:project_id/issues/:issue_id/award_emoji/:award_id` and returns the decoded response content. - delete\_merge\_request\_award\_emoji ```perl my $award_emoji = $api->delete_merge_request_award_emoji( $project_id, $merge_request_id, $award_id, ); ``` Sends a `DELETE` request to `projects/:project_id/merge_requests/:merge_request_id/award_emoji/:award_id` and returns the decoded response content. - delete\_snippet\_award\_emoji ```perl my $award_emoji = $api->delete_snippet_award_emoji( $project_id, $snippet_id, $award_id, ); ``` Sends a `DELETE` request to `projects/:project_id/snippets/:snippet_id/award_emoji/:award_id` and returns the decoded response content. - issue\_note\_award\_emojis ```perl my $award_emojis = $api->issue_note_award_emojis( $project_id, $issue_iid, $note_id, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/notes/:note_id/award_emoji` and returns the decoded response content. - issue\_note\_award\_emoji ```perl my $award_emoji = $api->issue_note_award_emoji( $project_id, $issue_iid, $note_id, $award_id, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id` and returns the decoded response content. - create\_issue\_note\_award\_emoji ```perl my $award_emoji = $api->create_issue_note_award_emoji( $project_id, $issue_iid, $note_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/notes/:note_id/award_emoji` and returns the decoded response content. - delete\_issue\_note\_award\_emoji ```perl my $award_emoji = $api->delete_issue_note_award_emoji( $project_id, $issue_iid, $note_id, $award_id, ); ``` Sends a `DELETE` request to `projects/:project_id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id` and returns the decoded response content. - merge\_request\_note\_award\_emojis ```perl my $award_emojis = $api->merge_request_note_award_emojis( $project_id, $merge_request_iid, $note_id, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji` and returns the decoded response content. - merge\_request\_note\_award\_emoji ```perl my $award_emoji = $api->merge_request_note_award_emoji( $project_id, $merge_request_iid, $note_id, $award_id, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji/:award_id` and returns the decoded response content. - create\_merge\_request\_note\_award\_emoji ```perl my $award_emoji = $api->create_merge_request_note_award_emoji( $project_id, $merge_request_iid, $note_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji` and returns the decoded response content. - delete\_merge\_request\_note\_award\_emoji ```perl my $award_emoji = $api->delete_merge_request_note_award_emoji( $project_id, $merge_request_iid, $note_id, $award_id, ); ``` Sends a `DELETE` request to `projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji/:award_id` and returns the decoded response content. ## Branches See [https://docs.gitlab.com/ce/api/branches.html](https://docs.gitlab.com/ce/api/branches.html). - branches ```perl my $branches = $api->branches( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/branches` and returns the decoded response content. - branch ```perl my $branch = $api->branch( $project_id, $branch_name, ); ``` Sends a `GET` request to `projects/:project_id/repository/branches/:branch_name` and returns the decoded response content. - create\_branch ```perl my $branch = $api->create_branch( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/repository/branches` and returns the decoded response content. - delete\_branch ``` $api->delete_branch( $project_id, $branch_name, ); ``` Sends a `DELETE` request to `projects/:project_id/repository/branches/:branch_name`. - delete\_merged\_branches ``` $api->delete_merged_branches( $project_id, ); ``` Sends a `DELETE` request to `projects/:project_id/repository/merged_branches`. ## Broadcast Messages See [https://docs.gitlab.com/ce/api/broadcast\_messages.html](https://docs.gitlab.com/ce/api/broadcast_messages.html). - broadcast\_messages ```perl my $messages = $api->broadcast_messages( \%params, ); ``` Sends a `GET` request to `broadcast_messages` and returns the decoded response content. - broadcast\_message ```perl my $message = $api->broadcast_message( $message_id, ); ``` Sends a `GET` request to `broadcast_messages/:message_id` and returns the decoded response content. - create\_broadcast\_message ```perl my $message = $api->create_broadcast_message( \%params, ); ``` Sends a `POST` request to `broadcast_messages` and returns the decoded response content. - edit\_broadcast\_message ```perl my $message = $api->edit_broadcast_message( $message_id, \%params, ); ``` Sends a `PUT` request to `broadcast_messages/:message_id` and returns the decoded response content. - delete\_broadcast\_message ``` $api->delete_broadcast_message( $message_id, ); ``` Sends a `DELETE` request to `broadcast_messages/:message_id`. ## Project-level Variables See [https://docs.gitlab.com/ce/api/project\_level\_variables.html](https://docs.gitlab.com/ce/api/project_level_variables.html). - project\_variables ```perl my $variables = $api->project_variables( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/variables` and returns the decoded response content. - project\_variable ```perl my $variable = $api->project_variable( $project_id, $variable_key, ); ``` Sends a `GET` request to `projects/:project_id/variables/:variable_key` and returns the decoded response content. - create\_project\_variable ```perl my $variable = $api->create_project_variable( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/variables` and returns the decoded response content. - edit\_project\_variable ```perl my $variable = $api->edit_project_variable( $project_id, $variable_key, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/variables/:variable_key` and returns the decoded response content. - delete\_project\_variable ``` $api->delete_project_variable( $project_id, $variable_key, ); ``` Sends a `DELETE` request to `projects/:project_id/variables/:variable_key`. ## Group-level Variables See [https://docs.gitlab.com/ce/api/group\_level\_variables.html](https://docs.gitlab.com/ce/api/group_level_variables.html). - group\_variables ```perl my $variables = $api->group_variables( $group_id, \%params, ); ``` Sends a `GET` request to `groups/:group_id/variables` and returns the decoded response content. - group\_variable ```perl my $variable = $api->group_variable( $group_id, $variable_key, ); ``` Sends a `GET` request to `groups/:group_id/variables/:variable_key` and returns the decoded response content. - create\_group\_variable ```perl my $variable = $api->create_group_variable( $group_id, \%params, ); ``` Sends a `POST` request to `groups/:group_id/variables` and returns the decoded response content. - edit\_group\_variable ```perl my $variable = $api->edit_group_variable( $group_id, $variable_key, \%params, ); ``` Sends a `PUT` request to `groups/:group_id/variables/:variable_key` and returns the decoded response content. - delete\_group\_variable ``` $api->delete_group_variable( $group_id, $variable_key, ); ``` Sends a `DELETE` request to `groups/:group_id/variables/:variable_key`. ## Snippets See [https://docs.gitlab.com/ce/api/snippets.html](https://docs.gitlab.com/ce/api/snippets.html). - snippets ```perl my $snippets = $api->snippets(); ``` Sends a `GET` request to `snippets` and returns the decoded response content. - snippet ```perl my $snippet = $api->snippet( $snippet_id, ); ``` Sends a `GET` request to `snippets/:snippet_id` and returns the decoded response content. - create\_snippet ```perl my $snippet = $api->create_snippet( \%params, ); ``` Sends a `POST` request to `snippets` and returns the decoded response content. - edit\_snippet ```perl my $snippet = $api->edit_snippet( $snippet_id, \%params, ); ``` Sends a `PUT` request to `snippets/:snippet_id` and returns the decoded response content. - delete\_snippet ``` $api->delete_snippet( $snippet_id, ); ``` Sends a `DELETE` request to `snippets/:snippet_id`. - public\_snippets ```perl my $snippets = $api->public_snippets( \%params, ); ``` Sends a `GET` request to `snippets/public` and returns the decoded response content. - snippet\_user\_agent\_detail ```perl my $user_agent = $api->snippet_user_agent_detail( $snippet_id, ); ``` Sends a `GET` request to `snippets/:snippet_id/user_agent_detail` and returns the decoded response content. ## Commits See [https://docs.gitlab.com/ce/api/commits.html](https://docs.gitlab.com/ce/api/commits.html). - commits ```perl my $commits = $api->commits( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/commits` and returns the decoded response content. - create\_commit ```perl my $commit = $api->create_commit( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/repository/commits` and returns the decoded response content. - commit ```perl my $commit = $api->commit( $project_id, $commit_sha, ); ``` Sends a `GET` request to `projects/:project_id/repository/commits/:commit_sha` and returns the decoded response content. - commit\_refs ```perl my $refs = $api->commit_refs( $project_id, $commit_sha, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/commits/:commit_sha/refs` and returns the decoded response content. - cherry\_pick\_commit ```perl my $commit = $api->cherry_pick_commit( $project_id, $commit_sha, \%params, ); ``` Sends a `POST` request to `projects/:project_id/repository/commits/:commit_sha/cherry_pick` and returns the decoded response content. - commit\_diff ```perl my $diff = $api->commit_diff( $project_id, $commit_sha, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/commits/:commit_sha/diff` and returns the decoded response content. - commit\_comments ```perl my $comments = $api->commit_comments( $project_id, $commit_sha, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/commits/:commit_sha/comments` and returns the decoded response content. - create\_commit\_comment ``` $api->create_commit_comment( $project_id, $commit_sha, \%params, ); ``` Sends a `POST` request to `projects/:project_id/repository/commits/:commit_sha/comments`. - commit\_statuses ```perl my $build_statuses = $api->commit_statuses( $project_id, $commit_sha, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/commits/:commit_sha/statuses` and returns the decoded response content. - create\_commit\_status ```perl my $build_status = $api->create_commit_status( $project_id, $commit_sha, \%params, ); ``` Sends a `POST` request to `projects/:project_id/statuses/:commit_sha` and returns the decoded response content. ## Container Registry See [https://docs.gitlab.com/ce/api/container\_registry.html](https://docs.gitlab.com/ce/api/container_registry.html). - registry\_repositories\_in\_project ```perl my $registry_repositories = $api->registry_repositories_in_project( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/registry/repositories` and returns the decoded response content. - registry\_repositories\_in\_group ```perl my $registry_repositories = $api->registry_repositories_in_group( $id, \%params, ); ``` Sends a `GET` request to `groups/:id/registry/repositories` and returns the decoded response content. - delete\_registry\_repository ``` $api->delete_registry_repository( $project_id, $repository_id, ); ``` Sends a `DELETE` request to `projects/:project_id/registry/repositories/:repository_id`. - registry\_repository\_tags ```perl my $tags = $api->registry_repository_tags( $project_id, $repository_id, ); ``` Sends a `GET` request to `projects/:project_id/registry/repositories/:repository_id/tags` and returns the decoded response content. - registry\_repository\_tag ```perl my $tag = $api->registry_repository_tag( $project_id, $repository_id, $tag_name, ); ``` Sends a `GET` request to `projects/:project_id/registry/repositories/:repository_id/tags/:tag_name` and returns the decoded response content. - delete\_registry\_repository\_tag ``` $api->delete_registry_repository_tag( $project_id, $repository_id, $tag_name, ); ``` Sends a `DELETE` request to `projects/:project_id/registry/repositories/:repository_id/tags/:tag_name`. - bulk\_delete\_registry\_repository\_tags ``` $api->bulk_delete_registry_repository_tags( $project_id, $repository_id, \%params, ); ``` Sends a `DELETE` request to `projects/:project_id/registry/repositories/:repository_id/tags`. ## Custom Attributes See [https://docs.gitlab.com/ce/api/custom\_attributes.html](https://docs.gitlab.com/ce/api/custom_attributes.html). - custom\_user\_attributes ```perl my $attributes = $api->custom_user_attributes( $user_id, ); ``` Sends a `GET` request to `users/:user_id/custom_attributes` and returns the decoded response content. - custom\_group\_attributes ```perl my $attributes = $api->custom_group_attributes( $group_id, ); ``` Sends a `GET` request to `groups/:group_id/custom_attributes` and returns the decoded response content. - custom\_project\_attributes ```perl my $attributes = $api->custom_project_attributes( $project_id, ); ``` Sends a `GET` request to `projects/:project_id/custom_attributes` and returns the decoded response content. - custom\_user\_attribute ```perl my $attribute = $api->custom_user_attribute( $user_id, $attribute_key, ); ``` Sends a `GET` request to `users/:user_id/custom_attributes/:attribute_key` and returns the decoded response content. - custom\_group\_attribute ```perl my $attribute = $api->custom_group_attribute( $group_id, $attribute_key, ); ``` Sends a `GET` request to `groups/:group_id/custom_attributes/:attribute_key` and returns the decoded response content. - custom\_project\_attribute ```perl my $attribute = $api->custom_project_attribute( $project_id, $attribute_key, ); ``` Sends a `GET` request to `projects/:project_id/custom_attributes/:attribute_key` and returns the decoded response content. - set\_custom\_user\_attribute ```perl my $attribute = $api->set_custom_user_attribute( $user_id, $attribute_key, \%params, ); ``` Sends a `PUT` request to `users/:user_id/custom_attributes/:attribute_key` and returns the decoded response content. - set\_custom\_group\_attribute ```perl my $attribute = $api->set_custom_group_attribute( $group_id, $attribute_key, \%params, ); ``` Sends a `PUT` request to `groups/:group_id/custom_attributes/:attribute_key` and returns the decoded response content. - set\_custom\_project\_attribute ```perl my $attribute = $api->set_custom_project_attribute( $project_id, $attribute_key, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/custom_attributes/:attribute_key` and returns the decoded response content. - delete\_custom\_user\_attribute ```perl $api->delete_custom_user_attribute( $user_id, $attribute_key, ); ``` Sends a `DELETE` request to `users/:user_id/custom_attributes/:attribute_key`. - delete\_custom\_group\_attribute ``` $api->delete_custom_group_attribute( $group_id, $attribute_key, ); ``` Sends a `DELETE` request to `groups/:group_id/custom_attributes/:attribute_key`. - delete\_custom\_project\_attribute ``` $api->delete_custom_project_attribute( $project_id, $attribute_key, ); ``` Sends a `DELETE` request to `projects/:project_id/custom_attributes/:attribute_key`. ## Deployments See [https://docs.gitlab.com/ce/api/deployments.html](https://docs.gitlab.com/ce/api/deployments.html). - deployments ```perl my $deployments = $api->deployments( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/deployments` and returns the decoded response content. - deployment ```perl my $deployment = $api->deployment( $project_id, $deployment_id, ); ``` Sends a `GET` request to `projects/:project_id/deployments/:deployment_id` and returns the decoded response content. ## Deploy Keys See [https://docs.gitlab.com/ce/api/deploy\_keys.html](https://docs.gitlab.com/ce/api/deploy_keys.html). - all\_deploy\_keys ```perl my $keys = $api->all_deploy_keys( \%params, ); ``` Sends a `GET` request to `deploy_keys` and returns the decoded response content. - deploy\_keys ```perl my $keys = $api->deploy_keys( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/deploy_keys` and returns the decoded response content. - deploy\_key ```perl my $key = $api->deploy_key( $project_id, $key_id, ); ``` Sends a `GET` request to `projects/:project_id/deploy_keys/:key_id` and returns the decoded response content. - create\_deploy\_key ```perl my $key = $api->create_deploy_key( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/deploy_keys` and returns the decoded response content. - delete\_deploy\_key ``` $api->delete_deploy_key( $project_id, $key_id, ); ``` Sends a `DELETE` request to `projects/:project_id/deploy_keys/:key_id`. - enable\_deploy\_key ```perl my $key = $api->enable_deploy_key( $project_id, $key_id, ); ``` Sends a `POST` request to `projects/:project_id/deploy_keys/:key_id/enable` and returns the decoded response content. ## Environments See [https://docs.gitlab.com/ce/api/environments.html](https://docs.gitlab.com/ce/api/environments.html). - environments ```perl my $environments = $api->environments( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/environments` and returns the decoded response content. - create\_environment ```perl my $environment = $api->create_environment( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/environments` and returns the decoded response content. - edit\_environment ```perl my $environment = $api->edit_environment( $project_id, $environments_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/environments/:environments_id` and returns the decoded response content. - delete\_environment ``` $api->delete_environment( $project_id, $environment_id, ); ``` Sends a `DELETE` request to `projects/:project_id/environments/:environment_id`. - stop\_environment ```perl my $environment = $api->stop_environment( $project_id, $environment_id, ); ``` Sends a `POST` request to `projects/:project_id/environments/:environment_id/stop` and returns the decoded response content. ## Events See [https://docs.gitlab.com/ce/api/events.html](https://docs.gitlab.com/ce/api/events.html). - all\_events ```perl my $events = $api->all_events( \%params, ); ``` Sends a `GET` request to `events` and returns the decoded response content. - user\_events ```perl my $events = $api->user_events( $user_id, \%params, ); ``` Sends a `GET` request to `users/:user_id/events` and returns the decoded response content. - project\_events ```perl my $events = $api->project_events( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/events` and returns the decoded response content. ## Feature flags See [https://docs.gitlab.com/ce/api/features.html](https://docs.gitlab.com/ce/api/features.html). - features ```perl my $features = $api->features(); ``` Sends a `GET` request to `features` and returns the decoded response content. - set\_feature ```perl my $feature = $api->set_feature( $name, \%params, ); ``` Sends a `POST` request to `features/:name` and returns the decoded response content. ## Gitignores See [https://docs.gitlab.com/ce/api/templates/gitignores.html](https://docs.gitlab.com/ce/api/templates/gitignores.html). - gitignores\_templates ```perl my $templates = $api->gitignores_templates( \%params, ); ``` Sends a `GET` request to `templates/gitignores` and returns the decoded response content. - gitignores\_template ```perl my $template = $api->gitignores_template( $template_key, ); ``` Sends a `GET` request to `templates/gitignores/:template_key` and returns the decoded response content. ## GitLab CI YMLs See [https://docs.gitlab.com/ce/api/templates/gitlab\_ci\_ymls.html](https://docs.gitlab.com/ce/api/templates/gitlab_ci_ymls.html). - gitlab\_ci\_ymls\_templates ```perl my $templates = $api->gitlab_ci_ymls_templates( \%params, ); ``` Sends a `GET` request to `templates/gitlab_ci_ymls` and returns the decoded response content. - gitlab\_ci\_ymls\_template ```perl my $template = $api->gitlab_ci_ymls_template( $template_key, ); ``` Sends a `GET` request to `templates/gitlab_ci_ymls/:template_key` and returns the decoded response content. ## Groups See [https://docs.gitlab.com/ce/api/groups.html](https://docs.gitlab.com/ce/api/groups.html). - groups ```perl my $groups = $api->groups( \%params, ); ``` Sends a `GET` request to `groups` and returns the decoded response content. - group\_subgroups ```perl my $subgroups = $api->group_subgroups( $group_id, \%params, ); ``` Sends a `GET` request to `groups/:group_id/subgroups` and returns the decoded response content. - group\_projects ```perl my $projects = $api->group_projects( $group_id, \%params, ); ``` Sends a `GET` request to `groups/:group_id/projects` and returns the decoded response content. - group ```perl my $group = $api->group( $group_id, \%params, ); ``` Sends a `GET` request to `groups/:group_id` and returns the decoded response content. - create\_group ``` $api->create_group( \%params, ); ``` Sends a `POST` request to `groups`. - transfer\_project\_to\_group ``` $api->transfer_project_to_group( $group_id, $project_id, ); ``` Sends a `POST` request to `groups/:group_id/projects/:project_id`. - edit\_group ```perl my $group = $api->edit_group( $group_id, \%params, ); ``` Sends a `PUT` request to `groups/:group_id` and returns the decoded response content. - delete\_group ``` $api->delete_group( $group_id, ); ``` Sends a `DELETE` request to `groups/:group_id`. - sync\_group\_with\_ldap ``` $api->sync_group_with_ldap( $group_id, ); ``` Sends a `POST` request to `groups/:group_id/ldap_sync`. - create\_ldap\_group\_link ``` $api->create_ldap_group_link( $group_id, \%params, ); ``` Sends a `POST` request to `groups/:group_id/ldap_group_links`. - delete\_ldap\_group\_link ``` $api->delete_ldap_group_link( $group_id, $cn, ); ``` Sends a `DELETE` request to `groups/:group_id/ldap_group_links/:cn`. - delete\_ldap\_provider\_group\_link ``` $api->delete_ldap_provider_group_link( $group_id, $provider, $cn, ); ``` Sends a `DELETE` request to `groups/:group_id/ldap_group_links/:provider/:cn`. ## Group access requests See [https://docs.gitlab.com/ce/api/access\_requests.html](https://docs.gitlab.com/ce/api/access_requests.html). - group\_access\_requests ```perl my $requests = $api->group_access_requests( $group_id, \%params, ); ``` Sends a `GET` request to `groups/:group_id/access_requests` and returns the decoded response content. - request\_group\_access ```perl my $request = $api->request_group_access( $group_id, ); ``` Sends a `POST` request to `groups/:group_id/access_requests` and returns the decoded response content. - approve\_group\_access ```perl my $request = $api->approve_group_access( $group_id, $user_id, ); ``` Sends a `PUT` request to `groups/:group_id/access_requests/:user_id/approve` and returns the decoded response content. - deny\_group\_access ```perl $api->deny_group_access( $group_id, $user_id, ); ``` Sends a `DELETE` request to `groups/:group_id/access_requests/:user_id`. ## Group badges See [https://docs.gitlab.com/ce/api/group\_badges.html](https://docs.gitlab.com/ce/api/group_badges.html). - group\_badges ```perl my $badges = $api->group_badges( $group_id, ); ``` Sends a `GET` request to `groups/:group_id/badges` and returns the decoded response content. - group\_badge ```perl my $badge = $api->group_badge( $group_id, $badge_id, ); ``` Sends a `GET` request to `groups/:group_id/badges/:badge_id` and returns the decoded response content. - create\_group\_badge ```perl my $badge = $api->create_group_badge( $group_id, \%params, ); ``` Sends a `POST` request to `groups/:group_id/badges` and returns the decoded response content. - edit\_group\_badge ```perl my $badge = $api->edit_group_badge( $group_id, $badge_id, \%params, ); ``` Sends a `PUT` request to `groups/:group_id/badges/:badge_id` and returns the decoded response content. - delete\_group\_badge ``` $api->delete_group_badge( $group_id, $badge_id, ); ``` Sends a `DELETE` request to `groups/:group_id/badges/:badge_id`. - preview\_group\_badge ```perl my $preview = $api->preview_group_badge( $group_id, \%params, ); ``` Sends a `GET` request to `groups/:group_id/badges/render` and returns the decoded response content. ## Group members See [https://docs.gitlab.com/ce/api/members.html](https://docs.gitlab.com/ce/api/members.html). - group\_members ```perl my $members = $api->group_members( $group_id, \%params, ); ``` Sends a `GET` request to `groups/:group_id/members` and returns the decoded response content. - all\_group\_members ```perl my $members = $api->all_group_members( $group_id, \%params, ); ``` Sends a `GET` request to `groups/:group_id/members/all` and returns the decoded response content. - group\_member ```perl my $member = $api->group_member( $project_id, $user_id, ); ``` Sends a `GET` request to `groups/:project_id/members/:user_id` and returns the decoded response content. - add\_group\_member ```perl my $member = $api->add_group_member( $group_id, \%params, ); ``` Sends a `POST` request to `groups/:group_id/members` and returns the decoded response content. - update\_group\_member ```perl my $member = $api->update_group_member( $group_id, $user_id, \%params, ); ``` Sends a `PUT` request to `groups/:group_id/members/:user_id` and returns the decoded response content. - remove\_group\_member ```perl $api->remove_group_member( $group_id, $user_id, ); ``` Sends a `DELETE` request to `groups/:group_id/members/:user_id`. ## Issues See [https://docs.gitlab.com/ce/api/issues.html](https://docs.gitlab.com/ce/api/issues.html). - global\_issues ```perl my $issues = $api->global_issues( \%params, ); ``` Sends a `GET` request to `issues` and returns the decoded response content. - group\_issues ```perl my $issues = $api->group_issues( $group_id, \%params, ); ``` Sends a `GET` request to `groups/:group_id/issues` and returns the decoded response content. - issues ```perl my $issues = $api->issues( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/issues` and returns the decoded response content. - issue ```perl my $issue = $api->issue( $project_id, $issue_iid, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid` and returns the decoded response content. - create\_issue ```perl my $issue = $api->create_issue( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/issues` and returns the decoded response content. - edit\_issue ```perl my $issue = $api->edit_issue( $project_id, $issue_iid, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/issues/:issue_iid` and returns the decoded response content. - delete\_issue ``` $api->delete_issue( $project_id, $issue_iid, ); ``` Sends a `DELETE` request to `projects/:project_id/issues/:issue_iid`. - move\_issue ```perl my $issue = $api->move_issue( $project_id, $issue_iid, \%params, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/move` and returns the decoded response content. - subscribe\_to\_issue ```perl my $issue = $api->subscribe_to_issue( $project_id, $issue_iid, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/subscribe` and returns the decoded response content. - unsubscribe\_from\_issue ```perl my $issue = $api->unsubscribe_from_issue( $project_id, $issue_iid, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/unsubscribe` and returns the decoded response content. - create\_issue\_todo ```perl my $todo = $api->create_issue_todo( $project_id, $issue_iid, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/todo` and returns the decoded response content. - set\_issue\_time\_estimate ```perl my $tracking = $api->set_issue_time_estimate( $project_id, $issue_iid, \%params, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/time_estimate` and returns the decoded response content. - reset\_issue\_time\_estimate ```perl my $tracking = $api->reset_issue_time_estimate( $project_id, $issue_iid, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/reset_time_estimate` and returns the decoded response content. - add\_issue\_spent\_time ```perl my $tracking = $api->add_issue_spent_time( $project_id, $issue_iid, \%params, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/add_spent_time` and returns the decoded response content. - reset\_issue\_spent\_time ```perl my $tracking = $api->reset_issue_spent_time( $project_id, $issue_iid, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/reset_spent_time` and returns the decoded response content. - issue\_time\_stats ```perl my $tracking = $api->issue_time_stats( $project_id, $issue_iid, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/time_stats` and returns the decoded response content. - issue\_closed\_by ```perl my $merge_requests = $api->issue_closed_by( $project_id, $issue_iid, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/closed_by` and returns the decoded response content. - issue\_user\_agent\_detail ```perl my $user_agent = $api->issue_user_agent_detail( $project_id, $issue_iid, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/user_agent_detail` and returns the decoded response content. ## Issue Boards See [https://docs.gitlab.com/ce/api/boards.html](https://docs.gitlab.com/ce/api/boards.html). - project\_boards ```perl my $boards = $api->project_boards( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/boards` and returns the decoded response content. - project\_board\_lists ```perl my $lists = $api->project_board_lists( $project_id, $board_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/boards/:board_id/lists` and returns the decoded response content. - project\_board\_list ```perl my $list = $api->project_board_list( $project_id, $board_id, $list_id, ); ``` Sends a `GET` request to `projects/:project_id/boards/:board_id/lists/:list_id` and returns the decoded response content. - create\_project\_board\_list ```perl my $list = $api->create_project_board_list( $project_id, $board_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/boards/:board_id/lists` and returns the decoded response content. - edit\_project\_board\_list ```perl my $list = $api->edit_project_board_list( $project_id, $board_id, $list_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/boards/:board_id/lists/:list_id` and returns the decoded response content. - delete\_project\_board\_list ``` $api->delete_project_board_list( $project_id, $board_id, $list_id, ); ``` Sends a `DELETE` request to `projects/:project_id/boards/:board_id/lists/:list_id`. ## Group Issue Boards See [https://docs.gitlab.com/ce/api/group\_boards.html](https://docs.gitlab.com/ce/api/group_boards.html). - group\_boards ```perl my $boards = $api->group_boards( $group_id, ); ``` Sends a `GET` request to `groups/:group_id/boards` and returns the decoded response content. - group\_board ```perl my $board = $api->group_board( $group_id, $board_id, ); ``` Sends a `GET` request to `groups/:group_id/boards/:board_id` and returns the decoded response content. - group\_board\_lists ```perl my $lists = $api->group_board_lists( $group_id, $board_id, ); ``` Sends a `GET` request to `groups/:group_id/boards/:board_id/lists` and returns the decoded response content. - group\_board\_list ```perl my $list = $api->group_board_list( $group_id, $board_id, $list_id, ); ``` Sends a `GET` request to `groups/:group_id/boards/:board_id/lists/:list_id` and returns the decoded response content. - create\_group\_board\_list ```perl my $list = $api->create_group_board_list( $group_id, $board_id, \%params, ); ``` Sends a `POST` request to `groups/:group_id/boards/:board_id/lists` and returns the decoded response content. - edit\_group\_board\_list ```perl my $list = $api->edit_group_board_list( $group_id, $board_id, $list_id, \%params, ); ``` Sends a `PUT` request to `groups/:group_id/boards/:board_id/lists/:list_id` and returns the decoded response content. - delete\_group\_board\_list ``` $api->delete_group_board_list( $group_id, $board_id, $list_id, ); ``` Sends a `DELETE` request to `groups/:group_id/boards/:board_id/lists/:list_id`. ## Jobs See [https://docs.gitlab.com/ce/api/jobs.html](https://docs.gitlab.com/ce/api/jobs.html). - jobs ```perl my $jobs = $api->jobs( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/jobs` and returns the decoded response content. - pipeline\_jobs ```perl my $jobs = $api->pipeline_jobs( $project_id, $pipeline_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/pipelines/:pipeline_id/jobs` and returns the decoded response content. - job ```perl my $job = $api->job( $project_id, $job_id, ); ``` Sends a `GET` request to `projects/:project_id/jobs/:job_id` and returns the decoded response content. - job\_artifacts ```perl my $artifacts = $api->job_artifacts( $project_id, $job_id, ); ``` Sends a `GET` request to `projects/:project_id/jobs/:job_id/artifacts` and returns the decoded response content. - job\_artifacts\_archive ```perl my $archive = $api->job_artifacts_archive( $project_id, $ref_name, \%params, ); ``` Sends a `GET` request to `projects/:project_id/jobs/artifacts/:ref_name/download` and returns the decoded response content. - job\_artifacts\_file ```perl my $file = $api->job_artifacts_file( $project_id, $job_id, $artifact_path, ); ``` Sends a `GET` request to `projects/:project_id/jobs/:job_id/artifacts/:artifact_path` and returns the decoded response content. - job\_trace\_file ```perl my $file = $api->job_trace_file( $project_id, $job_id, ); ``` Sends a `GET` request to `projects/:project_id/jobs/:job_id/trace` and returns the decoded response content. - cancel\_job ```perl my $job = $api->cancel_job( $project_id, $job_id, ); ``` Sends a `POST` request to `projects/:project_id/jobs/:job_id/cancel` and returns the decoded response content. - retry\_job ```perl my $job = $api->retry_job( $project_id, $job_id, ); ``` Sends a `POST` request to `projects/:project_id/jobs/:job_id/retry` and returns the decoded response content. - erase\_job ```perl my $job = $api->erase_job( $project_id, $job_id, ); ``` Sends a `POST` request to `projects/:project_id/jobs/:job_id/erase` and returns the decoded response content. - keep\_job\_artifacts ```perl my $job = $api->keep_job_artifacts( $project_id, $job_id, ); ``` Sends a `POST` request to `projects/:project_id/jobs/:job_id/artifacts/keep` and returns the decoded response content. - play\_job ```perl my $job = $api->play_job( $project_id, $job_id, ); ``` Sends a `POST` request to `projects/:project_id/jobs/:job_id/play` and returns the decoded response content. ## Keys See [https://docs.gitlab.com/ce/api/keys.html](https://docs.gitlab.com/ce/api/keys.html). - key ```perl my $key = $api->key( $key_id, ); ``` Sends a `GET` request to `keys/:key_id` and returns the decoded response content. ## Labels See [https://docs.gitlab.com/ce/api/labels.html](https://docs.gitlab.com/ce/api/labels.html). - labels ```perl my $labels = $api->labels( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/labels` and returns the decoded response content. - create\_label ```perl my $label = $api->create_label( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/labels` and returns the decoded response content. - delete\_label ``` $api->delete_label( $project_id, \%params, ); ``` Sends a `DELETE` request to `projects/:project_id/labels`. - edit\_label ```perl my $label = $api->edit_label( $project_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/labels` and returns the decoded response content. - subscribe\_to\_label ```perl my $label = $api->subscribe_to_label( $project_id, $label_id, ); ``` Sends a `POST` request to `projects/:project_id/labels/:label_id/subscribe` and returns the decoded response content. - unsubscribe\_from\_label ```perl $api->unsubscribe_from_label( $project_id, $label_id, ); ``` Sends a `POST` request to `projects/:project_id/labels/:label_id/unsubscribe`. ## Markdown See [https://docs.gitlab.com/ce/api/markdown.html](https://docs.gitlab.com/ce/api/markdown.html). - markdown ```perl my $html = $api->markdown( \%params, ); ``` Sends a `POST` request to `markdown` and returns the decoded response content. ## Merge requests See [https://docs.gitlab.com/ce/api/merge\_requests.html](https://docs.gitlab.com/ce/api/merge_requests.html). - global\_merge\_requests ```perl my $merge_requests = $api->global_merge_requests( \%params, ); ``` Sends a `GET` request to `merge_requests` and returns the decoded response content. - merge\_requests ```perl my $merge_requests = $api->merge_requests( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests` and returns the decoded response content. - merge\_request ```perl my $merge_request = $api->merge_request( $project_id, $merge_request_iid, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid` and returns the decoded response content. - merge\_request\_commits ```perl my $commits = $api->merge_request_commits( $project_id, $merge_request_iid, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/commits` and returns the decoded response content. - merge\_request\_with\_changes ```perl my $merge_request = $api->merge_request_with_changes( $project_id, $merge_request_iid, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/changes` and returns the decoded response content. - create\_merge\_request ```perl my $merge_request = $api->create_merge_request( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests` and returns the decoded response content. - edit\_merge\_request ```perl my $merge_request = $api->edit_merge_request( $project_id, $merge_request_iid, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/merge_requests/:merge_request_iid` and returns the decoded response content. - delete\_merge\_request ``` $api->delete_merge_request( $project_id, $merge_request_iid, ); ``` Sends a `DELETE` request to `projects/:project_id/merge_requests/:merge_request_iid`. - accept\_merge\_request ```perl my $merge_request = $api->accept_merge_request( $project_id, $merge_request_iid, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/merge_requests/:merge_request_iid/merge` and returns the decoded response content. - cancel\_merge\_when\_pipeline\_succeeds ```perl my $merge_request = $api->cancel_merge_when_pipeline_succeeds( $project_id, $merge_request_iid, ); ``` Sends a `PUT` request to `projects/:project_id/merge_requests/:merge_request_iid/cancel_merge_when_pipeline_succeeds` and returns the decoded response content. - merge\_request\_closes\_issues ```perl my $issues = $api->merge_request_closes_issues( $project_id, $merge_request_iid, \%params, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/closes_issues` and returns the decoded response content. - subscribe\_to\_merge\_request ```perl my $merge_request = $api->subscribe_to_merge_request( $project_id, $merge_request_iid, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests/:merge_request_iid/subscribe` and returns the decoded response content. - unsubscribe\_from\_merge\_request ```perl my $merge_request = $api->unsubscribe_from_merge_request( $project_id, $merge_request_iid, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests/:merge_request_iid/unsubscribe` and returns the decoded response content. - create\_merge\_request\_todo ```perl my $todo = $api->create_merge_request_todo( $project_id, $merge_request_iid, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests/:merge_request_iid/todo` and returns the decoded response content. - merge\_request\_diff\_versions ```perl my $versions = $api->merge_request_diff_versions( $project_id, $merge_request_iid, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/versions` and returns the decoded response content. - merge\_request\_diff\_version ```perl my $version = $api->merge_request_diff_version( $project_id, $merge_request_iid, $version_id, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/versions/:version_id` and returns the decoded response content. - set\_merge\_request\_time\_estimate ```perl my $tracking = $api->set_merge_request_time_estimate( $project_id, $merge_request_iid, \%params, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests/:merge_request_iid/time_estimate` and returns the decoded response content. - reset\_merge\_request\_time\_estimate ```perl my $tracking = $api->reset_merge_request_time_estimate( $project_id, $merge_request_iid, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests/:merge_request_iid/reset_time_estimate` and returns the decoded response content. - add\_merge\_request\_spent\_time ```perl my $tracking = $api->add_merge_request_spent_time( $project_id, $merge_request_iid, \%params, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests/:merge_request_iid/add_spent_time` and returns the decoded response content. - reset\_merge\_request\_spent\_time ```perl my $tracking = $api->reset_merge_request_spent_time( $project_id, $merge_request_iid, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests/:merge_request_iid/reset_spent_time` and returns the decoded response content. - merge\_request\_time\_stats ```perl my $tracking = $api->merge_request_time_stats( $project_id, $merge_request_iid, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/time_stats` and returns the decoded response content. ## Milestones See [https://docs.gitlab.com/ce/api/milestones.html](https://docs.gitlab.com/ce/api/milestones.html). - project\_milestones ```perl my $milestones = $api->project_milestones( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/milestones` and returns the decoded response content. - project\_milestone ```perl my $milestone = $api->project_milestone( $project_id, $milestone_id, ); ``` Sends a `GET` request to `projects/:project_id/milestones/:milestone_id` and returns the decoded response content. - create\_project\_milestone ```perl my $milestone = $api->create_project_milestone( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/milestones` and returns the decoded response content. - edit\_project\_milestone ```perl my $milestone = $api->edit_project_milestone( $project_id, $milestone_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/milestones/:milestone_id` and returns the decoded response content. - project\_milestone\_issues ```perl my $issues = $api->project_milestone_issues( $project_id, $milestone_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/milestones/:milestone_id/issues` and returns the decoded response content. - project\_milestone\_merge\_requests ```perl my $merge_requests = $api->project_milestone_merge_requests( $project_id, $milestone_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/milestones/:milestone_id/merge_requests` and returns the decoded response content. ## Group milestones See [https://docs.gitlab.com/ce/api/group\_milestones.html](https://docs.gitlab.com/ce/api/group_milestones.html). - group\_milestones ```perl my $milestones = $api->group_milestones( $group_id, \%params, ); ``` Sends a `GET` request to `groups/:group_id/milestones` and returns the decoded response content. - group\_milestone ```perl my $milestone = $api->group_milestone( $group_id, $milestone_id, ); ``` Sends a `GET` request to `groups/:group_id/milestones/:milestone_id` and returns the decoded response content. - create\_group\_milestone ```perl my $milestone = $api->create_group_milestone( $group_id, \%params, ); ``` Sends a `POST` request to `groups/:group_id/milestones` and returns the decoded response content. - edit\_group\_milestone ```perl my $milestone = $api->edit_group_milestone( $group_id, $milestone_id, \%params, ); ``` Sends a `PUT` request to `groups/:group_id/milestones/:milestone_id` and returns the decoded response content. - group\_milestone\_issues ```perl my $issues = $api->group_milestone_issues( $group_id, $milestone_id, \%params, ); ``` Sends a `GET` request to `groups/:group_id/milestones/:milestone_id/issues` and returns the decoded response content. - group\_milestone\_merge\_requests ```perl my $merge_requests = $api->group_milestone_merge_requests( $group_id, $milestone_id, \%params, ); ``` Sends a `GET` request to `groups/:group_id/milestones/:milestone_id/merge_requests` and returns the decoded response content. ## Namespaces See [https://docs.gitlab.com/ce/api/namespaces.html](https://docs.gitlab.com/ce/api/namespaces.html). - namespaces ```perl my $namespaces = $api->namespaces( \%params, ); ``` Sends a `GET` request to `namespaces` and returns the decoded response content. - namespace ```perl my $namespace = $api->namespace( $namespace_id, ); ``` Sends a `GET` request to `namespaces/:namespace_id` and returns the decoded response content. ## Notes See [https://docs.gitlab.com/ce/api/notes.html](https://docs.gitlab.com/ce/api/notes.html). - issue\_notes ```perl my $notes = $api->issue_notes( $project_id, $issue_iid, \%params, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/notes` and returns the decoded response content. - issue\_note ```perl my $note = $api->issue_note( $project_id, $issue_iid, $note_id, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/notes/:note_id` and returns the decoded response content. - create\_issue\_note ```perl my $note = $api->create_issue_note( $project_id, $issue_iid, \%params, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/notes` and returns the decoded response content. - edit\_issue\_note ``` $api->edit_issue_note( $project_id, $issue_iid, $note_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/issues/:issue_iid/notes/:note_id`. - delete\_issue\_note ``` $api->delete_issue_note( $project_id, $issue_iid, $note_id, ); ``` Sends a `DELETE` request to `projects/:project_id/issues/:issue_iid/notes/:note_id`. - snippet\_notes ```perl my $notes = $api->snippet_notes( $project_id, $snippet_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/snippets/:snippet_id/notes` and returns the decoded response content. - snippet\_note ```perl my $note = $api->snippet_note( $project_id, $snippet_id, $note_id, ); ``` Sends a `GET` request to `projects/:project_id/snippets/:snippet_id/notes/:note_id` and returns the decoded response content. - create\_snippet\_note ```perl my $note = $api->create_snippet_note( $project_id, $snippet_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/snippets/:snippet_id/notes` and returns the decoded response content. - edit\_snippet\_note ``` $api->edit_snippet_note( $project_id, $snippet_id, $note_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/snippets/:snippet_id/notes/:note_id`. - delete\_snippet\_note ``` $api->delete_snippet_note( $project_id, $snippet_id, $note_id, ); ``` Sends a `DELETE` request to `projects/:project_id/snippets/:snippet_id/notes/:note_id`. - merge\_request\_notes ```perl my $notes = $api->merge_request_notes( $project_id, $merge_request_iid, \%params, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/notes` and returns the decoded response content. - merge\_request\_note ```perl my $note = $api->merge_request_note( $project_id, $merge_request_iid, $note_id, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id` and returns the decoded response content. - create\_merge\_request\_note ```perl my $note = $api->create_merge_request_note( $project_id, $merge_request_iid, \%params, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests/:merge_request_iid/notes` and returns the decoded response content. - edit\_merge\_request\_note ``` $api->edit_merge_request_note( $project_id, $merge_request_iid, $note_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id`. - delete\_merge\_request\_note ``` $api->delete_merge_request_note( $project_id, $merge_request_iid, $note_id, ); ``` Sends a `DELETE` request to `projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id`. ## Discussions See [https://docs.gitlab.com/ce/api/discussions.html](https://docs.gitlab.com/ce/api/discussions.html). - issue\_discussions ```perl my $discussions = $api->issue_discussions( $project_id, $issue_iid, \%params, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/discussions` and returns the decoded response content. - issue\_discussion ```perl my $discussion = $api->issue_discussion( $project_id, $issue_iid, $discussion_id, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/discussions/:discussion_id` and returns the decoded response content. - create\_issue\_discussion ```perl my $discussion = $api->create_issue_discussion( $project_id, $issue_iid, \%params, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/discussions` and returns the decoded response content. - create\_issue\_discussion\_note ``` $api->create_issue_discussion_note( $project_id, $issue_iid, $discussion_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/issues/:issue_iid/discussions/:discussion_id/notes`. - edit\_issue\_discussion\_note ``` $api->edit_issue_discussion_note( $project_id, $issue_iid, $discussion_id, $note_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id`. - delete\_issue\_discussion\_note ``` $api->delete_issue_discussion_note( $project_id, $issue_iid, $discussion_id, $note_id, ); ``` Sends a `DELETE` request to `projects/:project_id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id`. - project\_snippet\_discussions ```perl my $discussions = $api->project_snippet_discussions( $project_id, $snippet_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/snippets/:snippet_id/discussions` and returns the decoded response content. - project\_snippet\_discussion ```perl my $discussion = $api->project_snippet_discussion( $project_id, $snippet_id, $discussion_id, ); ``` Sends a `GET` request to `projects/:project_id/snippets/:snippet_id/discussions/:discussion_id` and returns the decoded response content. - create\_project\_snippet\_discussion ```perl my $discussion = $api->create_project_snippet_discussion( $project_id, $snippet_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/snippets/:snippet_id/discussions` and returns the decoded response content. - create\_project\_snippet\_discussion\_note ``` $api->create_project_snippet_discussion_note( $project_id, $snippet_id, $discussion_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/snippets/:snippet_id/discussions/:discussion_id/notes`. - edit\_project\_snippet\_discussion\_note ``` $api->edit_project_snippet_discussion_note( $project_id, $snippet_id, $discussion_id, $note_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/snippets/:snippet_id/discussions/:discussion_id/notes/:note_id`. - delete\_project\_snippet\_discussion\_note ``` $api->delete_project_snippet_discussion_note( $project_id, $snippet_id, $discussion_id, $note_id, ); ``` Sends a `DELETE` request to `projects/:project_id/snippets/:snippet_id/discussions/:discussion_id/notes/:note_id`. - merge\_request\_discussions ```perl my $discussions = $api->merge_request_discussions( $project_id, $merge_request_iid, \%params, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/discussions` and returns the decoded response content. - merge\_request\_discussion ```perl my $discussion = $api->merge_request_discussion( $project_id, $merge_request_iid, $discussion_id, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id` and returns the decoded response content. - create\_merge\_request\_discussion ```perl my $discussion = $api->create_merge_request_discussion( $project_id, $merge_request_iid, \%params, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests/:merge_request_iid/discussions` and returns the decoded response content. - resolve\_merge\_request\_discussion ``` $api->resolve_merge_request_discussion( $project_id, $merge_request_iid, $discussion_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id`. - create\_merge\_request\_discussion\_note ``` $api->create_merge_request_discussion_note( $project_id, $merge_request_iid, $discussion_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes`. - edit\_merge\_request\_discussion\_note ``` $api->edit_merge_request_discussion_note( $project_id, $merge_request_iid, $discussion_id, $note_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes/:note_id`. - delete\_merge\_request\_discussion\_note ``` $api->delete_merge_request_discussion_note( $project_id, $merge_request_iid, $discussion_id, $note_id, ); ``` Sends a `DELETE` request to `projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes/:note_id`. - commit\_discussions ```perl my $discussions = $api->commit_discussions( $project_id, $commit_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/commits/:commit_id/discussions` and returns the decoded response content. - commit\_discussion ```perl my $discussion = $api->commit_discussion( $project_id, $commit_id, $discussion_id, ); ``` Sends a `GET` request to `projects/:project_id/commits/:commit_id/discussions/:discussion_id` and returns the decoded response content. - create\_commit\_discussion ```perl my $discussion = $api->create_commit_discussion( $project_id, $commit_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/commits/:commit_id/discussions` and returns the decoded response content. - create\_commit\_discussion\_note ``` $api->create_commit_discussion_note( $project_id, $commit_id, $discussion_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/commits/:commit_id/discussions/:discussion_id/notes`. - edit\_commit\_discussion\_note ``` $api->edit_commit_discussion_note( $project_id, $commit_id, $discussion_id, $note_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/commits/:commit_id/discussions/:discussion_id/notes/:note_id`. - delete\_commit\_discussion\_note ``` $api->delete_commit_discussion_note( $project_id, $commit_id, $discussion_id, $note_id, ); ``` Sends a `DELETE` request to `projects/:project_id/commits/:commit_id/discussions/:discussion_id/notes/:note_id`. ## Resource label events See [https://docs.gitlab.com/ce/api/resource\_label\_events.html](https://docs.gitlab.com/ce/api/resource_label_events.html). - issue\_resource\_label\_events ```perl my $events = $api->issue_resource_label_events( $project_id, $issue_iid, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/resource_label_events` and returns the decoded response content. - issue\_resource\_label\_event ```perl my $event = $api->issue_resource_label_event( $project_id, $issue_iid, $resource_label_event_id, ); ``` Sends a `GET` request to `projects/:project_id/issues/:issue_iid/resource_label_events/:resource_label_event_id` and returns the decoded response content. - merge\_request\_resource\_label\_events ```perl my $events = $api->merge_request_resource_label_events( $project_id, $merge_request_iid, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/resource_label_events` and returns the decoded response content. - merge\_request\_resource\_label\_event ```perl my $event = $api->merge_request_resource_label_event( $project_id, $merge_request_iid, $resource_label_event_id, ); ``` Sends a `GET` request to `projects/:project_id/merge_requests/:merge_request_iid/resource_label_events/:resource_label_event_id` and returns the decoded response content. ## Notification settings See [https://docs.gitlab.com/ce/api/notification\_settings.html](https://docs.gitlab.com/ce/api/notification_settings.html). - global\_notification\_settings ```perl my $settings = $api->global_notification_settings(); ``` Sends a `GET` request to `notification_settings` and returns the decoded response content. - set\_global\_notification\_settings ```perl my $settings = $api->set_global_notification_settings( \%params, ); ``` Sends a `PUT` request to `notification_settings` and returns the decoded response content. - group\_notification\_settings ```perl my $settings = $api->group_notification_settings( $group_id, ); ``` Sends a `GET` request to `groups/:group_id/notification_settings` and returns the decoded response content. - project\_notification\_settings ```perl my $settings = $api->project_notification_settings( $project_id, ); ``` Sends a `GET` request to `projects/:project_id/notification_settings` and returns the decoded response content. - set\_group\_notification\_settings ```perl my $settings = $api->set_group_notification_settings( $group_id, \%params, ); ``` Sends a `PUT` request to `groups/:group_id/notification_settings` and returns the decoded response content. - set\_project\_notification\_settings ```perl my $settings = $api->set_project_notification_settings( $project_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/notification_settings` and returns the decoded response content. ## Licenses See [https://docs.gitlab.com/ce/api/templates/licenses.html](https://docs.gitlab.com/ce/api/templates/licenses.html). - license\_templates ```perl my $templates = $api->license_templates( \%params, ); ``` Sends a `GET` request to `templates/licenses` and returns the decoded response content. - license\_template ```perl my $template = $api->license_template( $template_key, \%params, ); ``` Sends a `GET` request to `templates/licenses/:template_key` and returns the decoded response content. ## Pages domains See [https://docs.gitlab.com/ce/api/pages\_domains.html](https://docs.gitlab.com/ce/api/pages_domains.html). - global\_pages\_domains ```perl my $domains = $api->global_pages_domains( \%params, ); ``` Sends a `GET` request to `pages/domains` and returns the decoded response content. - pages\_domains ```perl my $domains = $api->pages_domains( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/pages/domains` and returns the decoded response content. - pages\_domain ```perl my $domain = $api->pages_domain( $project_id, $domain, ); ``` Sends a `GET` request to `projects/:project_id/pages/domains/:domain` and returns the decoded response content. - create\_pages\_domain ```perl my $domain = $api->create_pages_domain( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/pages/domains` and returns the decoded response content. - edit\_pages\_domain ```perl my $domain = $api->edit_pages_domain( $project_id, $domain, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/pages/domains/:domain` and returns the decoded response content. - delete\_pages\_domain ``` $api->delete_pages_domain( $project_id, $domain, ); ``` Sends a `DELETE` request to `projects/:project_id/pages/domains/:domain`. ## Pipelines See [https://docs.gitlab.com/ce/api/pipelines.html](https://docs.gitlab.com/ce/api/pipelines.html). - pipelines ```perl my $pipelines = $api->pipelines( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/pipelines` and returns the decoded response content. - pipeline ```perl my $pipeline = $api->pipeline( $project_id, $pipeline_id, ); ``` Sends a `GET` request to `projects/:project_id/pipelines/:pipeline_id` and returns the decoded response content. - create\_pipeline ```perl my $pipeline = $api->create_pipeline( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/pipeline` and returns the decoded response content. Git ref (branch or tag) name must be specified in the `ref` field of the `%params` hash. It's also possible to pass variables to a pipeline in the `variables` field like in the following example: ```perl my $pipeline = $api->create_pipeline( $project_id, { 'ref' => 'master', variables => [ { 'key' => 'VARIABLE1', 'value' => 'VALUE1' }, { 'key' => 'VARIABLE2', 'value' => 'VALUE2' }, ], }, ); ``` - retry\_pipeline\_jobs ```perl my $pipeline = $api->retry_pipeline_jobs( $project_id, $pipeline_id, ); ``` Sends a `POST` request to `projects/:project_id/pipelines/:pipeline_id/retry` and returns the decoded response content. - cancel\_pipeline\_jobs ```perl my $pipeline = $api->cancel_pipeline_jobs( $project_id, $pipeline_id, ); ``` Sends a `POST` request to `projects/:project_id/pipelines/:pipeline_id/cancel` and returns the decoded response content. - delete\_pipeline ``` $api->delete_pipeline( $project_id, $pipeline_id, ); ``` Sends a `DELETE` request to `projects/:project_id/pipelines/:pipeline_id`. ## Pipeline triggers See [https://docs.gitlab.com/ce/api/pipeline\_triggers.html](https://docs.gitlab.com/ce/api/pipeline_triggers.html). - triggers ```perl my $triggers = $api->triggers( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/triggers` and returns the decoded response content. - trigger ```perl my $trigger = $api->trigger( $project_id, $trigger_id, ); ``` Sends a `GET` request to `projects/:project_id/triggers/:trigger_id` and returns the decoded response content. - create\_trigger ```perl my $trigger = $api->create_trigger( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/triggers` and returns the decoded response content. - edit\_trigger ```perl my $trigger = $api->edit_trigger( $project_id, $trigger_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/triggers/:trigger_id` and returns the decoded response content. - take\_ownership\_of\_trigger ```perl my $trigger = $api->take_ownership_of_trigger( $project_id, $trigger_id, ); ``` Sends a `POST` request to `projects/:project_id/triggers/:trigger_id/take_ownership` and returns the decoded response content. - delete\_trigger ``` $api->delete_trigger( $project_id, $trigger_id, ); ``` Sends a `DELETE` request to `projects/:project_id/triggers/:trigger_id`. - trigger\_pipeline ```perl my $pipeline = $api->trigger_pipeline( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/trigger/pipeline` and returns the decoded response content. The API authentication token (["private\_token"](#private_token) or ["access\_token"](#access_token) parameters in a constructor) is not needed when using this method, however You must pass trigger token (generated at the trigger creation) as `token` field and git ref name as `ref` field in the `%params` hash. You can also pass variables to be set in a pipeline in the `variables` field. Example: ```perl my $pipeline = $api->trigger_pipeline( $project_id, { token => 'd69dba9162ab6ac72fa0993496286ada', 'ref' => 'master', variables => { variable1 => 'value1', variable2 => 'value2', }, }, ); ``` Read more at [https://docs.gitlab.com/ce/ci/triggers/#triggering-a-pipeline](https://docs.gitlab.com/ce/ci/triggers/#triggering-a-pipeline). ## Pipeline schedules See [https://docs.gitlab.com/ce/api/pipeline\_schedules.html](https://docs.gitlab.com/ce/api/pipeline_schedules.html). - pipeline\_schedules ```perl my $schedules = $api->pipeline_schedules( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/pipeline_schedules` and returns the decoded response content. - pipeline\_schedule ```perl my $schedule = $api->pipeline_schedule( $project_id, $pipeline_schedule_id, ); ``` Sends a `GET` request to `projects/:project_id/pipeline_schedules/:pipeline_schedule_id` and returns the decoded response content. - create\_pipeline\_schedule ```perl my $schedule = $api->create_pipeline_schedule( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/pipeline_schedules` and returns the decoded response content. - edit\_pipeline\_schedule ```perl my $schedule = $api->edit_pipeline_schedule( $project_id, $pipeline_schedule_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/pipeline_schedules/:pipeline_schedule_id` and returns the decoded response content. - take\_ownership\_of\_pipeline\_schedule ```perl my $schedule = $api->take_ownership_of_pipeline_schedule( $project_id, $pipeline_schedule_id, ); ``` Sends a `POST` request to `projects/:project_id/pipeline_schedules/:pipeline_schedule_id/take_ownership` and returns the decoded response content. - delete\_pipeline\_schedule ```perl my $schedule = $api->delete_pipeline_schedule( $project_id, $pipeline_schedule_id, ); ``` Sends a `DELETE` request to `projects/:project_id/pipeline_schedules/:pipeline_schedule_id` and returns the decoded response content. - create\_pipeline\_schedule\_variable ```perl my $variable = $api->create_pipeline_schedule_variable( $project_id, $pipeline_schedule_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/pipeline_schedules/:pipeline_schedule_id/variables` and returns the decoded response content. - edit\_pipeline\_schedule\_variable ```perl my $variable = $api->edit_pipeline_schedule_variable( $project_id, $pipeline_schedule_id, $variable_key, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/pipeline_schedules/:pipeline_schedule_id/variables/:variable_key` and returns the decoded response content. - delete\_pipeline\_schedule\_variable ```perl my $variable = $api->delete_pipeline_schedule_variable( $project_id, $pipeline_schedule_id, $variable_key, ); ``` Sends a `DELETE` request to `projects/:project_id/pipeline_schedules/:pipeline_schedule_id/variables/:variable_key` and returns the decoded response content. ## Projects See [https://docs.gitlab.com/ce/api/projects.html](https://docs.gitlab.com/ce/api/projects.html). - projects ```perl my $projects = $api->projects( \%params, ); ``` Sends a `GET` request to `projects` and returns the decoded response content. - user\_projects ```perl my $projects = $api->user_projects( $user_id, \%params, ); ``` Sends a `GET` request to `users/:user_id/projects` and returns the decoded response content. - project ```perl my $project = $api->project( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id` and returns the decoded response content. - project\_users ```perl my $users = $api->project_users( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/users` and returns the decoded response content. - create\_project ```perl my $project = $api->create_project( \%params, ); ``` Sends a `POST` request to `projects` and returns the decoded response content. - create\_project\_for\_user ```perl $api->create_project_for_user( $user_id, \%params, ); ``` Sends a `POST` request to `projects/user/:user_id`. - edit\_project ``` $api->edit_project( $project_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id`. - fork\_project ``` $api->fork_project( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/fork`. - project\_forks ```perl my $forks = $api->project_forks( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/forks` and returns the decoded response content. - start\_project ```perl my $project = $api->start_project( $project_id, ); ``` Sends a `POST` request to `projects/:project_id/star` and returns the decoded response content. - unstar\_project ```perl my $project = $api->unstar_project( $project_id, ); ``` Sends a `POST` request to `projects/:project_id/unstar` and returns the decoded response content. - project\_languages ```perl my $languages = $api->project_languages( $project_id, ); ``` Sends a `GET` request to `projects/:project_id/languages` and returns the decoded response content. - archive\_project ```perl my $project = $api->archive_project( $project_id, ); ``` Sends a `POST` request to `projects/:project_id/archive` and returns the decoded response content. - unarchive\_project ```perl my $project = $api->unarchive_project( $project_id, ); ``` Sends a `POST` request to `projects/:project_id/unarchive` and returns the decoded response content. - delete\_project ``` $api->delete_project( $project_id, ); ``` Sends a `DELETE` request to `projects/:project_id`. - upload\_file\_to\_project ```perl my $upload = $api->upload_file_to_project( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/uploads` and returns the decoded response content. The `file` parameter must point to a readable file on the local filesystem. - share\_project\_with\_group ``` $api->share_project_with_group( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/share`. - unshare\_project\_with\_group ``` $api->unshare_project_with_group( $project_id, $group_id, ); ``` Sends a `DELETE` request to `projects/:project_id/share/:group_id`. - project\_hooks ```perl my $hooks = $api->project_hooks( $project_id, ); ``` Sends a `GET` request to `projects/:project_id/hooks` and returns the decoded response content. - project\_hook ```perl my $hook = $api->project_hook( $project_id, $hook_id, ); ``` Sends a `GET` request to `projects/:project_id/hooks/:hook_id` and returns the decoded response content. - create\_project\_hook ```perl my $hook = $api->create_project_hook( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/hooks` and returns the decoded response content. - edit\_project\_hook ```perl my $hook = $api->edit_project_hook( $project_id, $hook_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/hooks/:hook_id` and returns the decoded response content. - delete\_project\_hook ``` $api->delete_project_hook( $project_id, $hook_id, ); ``` Sends a `DELETE` request to `projects/:project_id/hooks/:hook_id`. - set\_project\_fork ``` $api->set_project_fork( $project_id, $from_project_id, ); ``` Sends a `POST` request to `projects/:project_id/fork/:from_project_id`. - clear\_project\_fork ``` $api->clear_project_fork( $project_id, ); ``` Sends a `DELETE` request to `projects/:project_id/fork`. - start\_housekeeping ```perl $api->start_housekeeping( $project_id, ); ``` Sends a `POST` request to `projects/:project_id/housekeeping`. - transfer\_project\_to\_namespace ``` $api->transfer_project_to_namespace( $project_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/transfer`. ## Project access requests See [https://docs.gitlab.com/ce/api/access\_requests.html](https://docs.gitlab.com/ce/api/access_requests.html). - project\_access\_requests ```perl my $requests = $api->project_access_requests( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/access_requests` and returns the decoded response content. - request\_project\_access ```perl my $request = $api->request_project_access( $project_id, ); ``` Sends a `POST` request to `projects/:project_id/access_requests` and returns the decoded response content. - approve\_project\_access ```perl my $request = $api->approve_project_access( $project_id, $user_id, ); ``` Sends a `PUT` request to `projects/:project_id/access_requests/:user_id/approve` and returns the decoded response content. - deny\_project\_access ```perl $api->deny_project_access( $project_id, $user_id, ); ``` Sends a `DELETE` request to `projects/:project_id/access_requests/:user_id`. ## Project badges See [https://docs.gitlab.com/ce/api/project\_badges.html](https://docs.gitlab.com/ce/api/project_badges.html). - project\_badges ```perl my $badges = $api->project_badges( $project_id, ); ``` Sends a `GET` request to `projects/:project_id/badges` and returns the decoded response content. - project\_badge ```perl my $badge = $api->project_badge( $project_id, $badge_id, ); ``` Sends a `GET` request to `projects/:project_id/badges/:badge_id` and returns the decoded response content. - create\_project\_badge ```perl my $badge = $api->create_project_badge( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/badges` and returns the decoded response content. - edit\_project\_badge ```perl my $badge = $api->edit_project_badge( $project_id, $badge_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/badges/:badge_id` and returns the decoded response content. - delete\_project\_badge ``` $api->delete_project_badge( $project_id, $badge_id, ); ``` Sends a `DELETE` request to `projects/:project_id/badges/:badge_id`. - preview\_project\_badge ```perl my $preview = $api->preview_project_badge( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/badges/render` and returns the decoded response content. ## Project import/export See [https://docs.gitlab.com/ce/api/project\_import\_export.html](https://docs.gitlab.com/ce/api/project_import_export.html). - schedule\_project\_export ``` $api->schedule_project_export( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/export`. - project\_export\_status ```perl my $status = $api->project_export_status( $project_id, ); ``` Sends a `GET` request to `projects/:project_id/export` and returns the decoded response content. - download\_project\_export ```perl my $download = $api->download_project_export( $project_id, ); ``` Sends a `GET` request to `projects/:project_id/export/download` and returns the decoded response content. - schedule\_project\_import ``` $api->schedule_project_import( \%params, ); ``` Sends a `POST` request to `projects/import`. - project\_import\_status ```perl my $status = $api->project_import_status( $project_id, ); ``` Sends a `GET` request to `projects/:project_id/import` and returns the decoded response content. ## Project members See [https://docs.gitlab.com/ce/api/members.html](https://docs.gitlab.com/ce/api/members.html). - project\_members ```perl my $members = $api->project_members( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/members` and returns the decoded response content. - all\_project\_members ```perl my $members = $api->all_project_members( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/members/all` and returns the decoded response content. - project\_member ```perl my $member = $api->project_member( $project_id, $user_id, ); ``` Sends a `GET` request to `projects/:project_id/members/:user_id` and returns the decoded response content. - add\_project\_member ```perl my $member = $api->add_project_member( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/members` and returns the decoded response content. - update\_project\_member ```perl my $member = $api->update_project_member( $project_id, $user_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/members/:user_id` and returns the decoded response content. - remove\_project\_member ```perl $api->remove_project_member( $project_id, $user_id, ); ``` Sends a `DELETE` request to `projects/:project_id/members/:user_id`. ## Project snippets See [https://docs.gitlab.com/ce/api/project\_snippets.html](https://docs.gitlab.com/ce/api/project_snippets.html). - project\_snippets ```perl my $snippets = $api->project_snippets( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/snippets` and returns the decoded response content. - project\_snippet ```perl my $snippet = $api->project_snippet( $project_id, $snippet_id, ); ``` Sends a `GET` request to `projects/:project_id/snippets/:snippet_id` and returns the decoded response content. - create\_project\_snippet ``` $api->create_project_snippet( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/snippets`. - edit\_project\_snippet ``` $api->edit_project_snippet( $project_id, $snippet_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/snippets/:snippet_id`. - delete\_project\_snippet ``` $api->delete_project_snippet( $project_id, $snippet_id, ); ``` Sends a `DELETE` request to `projects/:project_id/snippets/:snippet_id`. - project\_snippet\_content ```perl my $content = $api->project_snippet_content( $project_id, $snippet_id, ); ``` Sends a `GET` request to `projects/:project_id/snippets/:snippet_id/raw` and returns the decoded response content. - project\_snippet\_user\_agent\_detail ```perl my $user_agent = $api->project_snippet_user_agent_detail( $project_id, $snippet_id, ); ``` Sends a `GET` request to `projects/:project_id/snippets/:snippet_id/user_agent_detail` and returns the decoded response content. ## Protected branches See [https://docs.gitlab.com/ce/api/protected\_branches.html](https://docs.gitlab.com/ce/api/protected_branches.html). - protected\_branches ```perl my $branches = $api->protected_branches( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/protected_branches` and returns the decoded response content. - protected\_branch ```perl my $branch = $api->protected_branch( $project_id, $branch_name, ); ``` Sends a `GET` request to `projects/:project_id/protected_branches/:branch_name` and returns the decoded response content. - protect\_branch ```perl my $branch = $api->protect_branch( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/protected_branches` and returns the decoded response content. - unprotect\_branch ``` $api->unprotect_branch( $project_id, $branch_name, ); ``` Sends a `DELETE` request to `projects/:project_id/protected_branches/:branch_name`. ## Protected tags See [https://docs.gitlab.com/ce/api/protected\_tags.html](https://docs.gitlab.com/ce/api/protected_tags.html). - protected\_tags ```perl my $tags = $api->protected_tags( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/protected_tags` and returns the decoded response content. - protected\_tag ```perl my $tag = $api->protected_tag( $project_id, $tag_name, ); ``` Sends a `GET` request to `projects/:project_id/protected_tags/:tag_name` and returns the decoded response content. - protect\_tag ```perl my $tag = $api->protect_tag( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/protected_tags` and returns the decoded response content. - unprotect\_tag ``` $api->unprotect_tag( $project_id, $tag_name, ); ``` Sends a `DELETE` request to `projects/:project_id/protected_tags/:tag_name`. ## Releases See [https://docs.gitlab.com/ce/api/releases/index.html](https://docs.gitlab.com/ce/api/releases/index.html). - releases ```perl my $releases = $api->releases( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/releases` and returns the decoded response content. - release ```perl my $release = $api->release( $project_id, $tag_name, ); ``` Sends a `GET` request to `projects/:project_id/releases/:tag_name` and returns the decoded response content. - create\_release ```perl my $release = $api->create_release( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/releases` and returns the decoded response content. - update\_release ```perl my $release = $api->update_release( $project_id, $tag_name, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/releases/:tag_name` and returns the decoded response content. - delete\_release ```perl my $release = $api->delete_release( $project_id, $tag_name, ); ``` Sends a `DELETE` request to `projects/:project_id/releases/:tag_name` and returns the decoded response content. ## Release Links See [https://docs.gitlab.com/ce/api/releases/links.html](https://docs.gitlab.com/ce/api/releases/links.html). - release\_links ```perl my $links = $api->release_links( $project_id, $tag_name, \%params, ); ``` Sends a `GET` request to `projects/:project_id/releases/:tag_name/assets/links` and returns the decoded response content. - release\_link ```perl my $link = $api->release_link( $project_id, $tag_name, $link_id, ); ``` Sends a `GET` request to `projects/:project_id/releases/:tag_name/assets/links/:link_id` and returns the decoded response content. - create\_release\_link ```perl my $link = $api->create_release_link( $project_id, $tag_name, \%params, ); ``` Sends a `POST` request to `projects/:project_id/releases/:tag_name/assets/links` and returns the decoded response content. - update\_release\_link ```perl my $link = $api->update_release_link( $project_id, $tag_name, $link_id, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/releases/:tag_name/assets/links/:link_id` and returns the decoded response content. - delete\_release\_link ```perl my $link = $api->delete_release_link( $project_id, $tag_name, $link_id, ); ``` Sends a `DELETE` request to `projects/:project_id/releases/:tag_name/assets/links/:link_id` and returns the decoded response content. ## Repositories See [https://docs.gitlab.com/ce/api/repositories.html](https://docs.gitlab.com/ce/api/repositories.html). - tree ```perl my $tree = $api->tree( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/tree` and returns the decoded response content. - blob ```perl my $blob = $api->blob( $project_id, $sha, ); ``` Sends a `GET` request to `projects/:project_id/repository/blobs/:sha` and returns the decoded response content. - raw\_blob ```perl my $raw_blob = $api->raw_blob( $project_id, $sha, ); ``` Sends a `GET` request to `projects/:project_id/repository/blobs/:sha/raw` and returns the decoded response content. - archive ```perl my $archive = $api->archive( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/archive` and returns the raw response content. - compare ```perl my $comparison = $api->compare( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/compare` and returns the decoded response content. - contributors ```perl my $contributors = $api->contributors( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/contributors` and returns the decoded response content. ## Repository files See [https://docs.gitlab.com/ce/api/repository\_files.html](https://docs.gitlab.com/ce/api/repository_files.html). - file ```perl my $file = $api->file( $project_id, $file_path, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/files/:file_path` and returns the decoded response content. - raw\_file ```perl my $content = $api->raw_file( $project_id, $file_path, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/files/:file_path/raw` and returns the raw response content. - create\_file ``` $api->create_file( $project_id, $file_path, \%params, ); ``` Sends a `POST` request to `projects/:project_id/repository/files/:file_path`. - edit\_file ``` $api->edit_file( $project_id, $file_path, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/repository/files/:file_path`. - delete\_file ``` $api->delete_file( $project_id, $file_path, \%params, ); ``` Sends a `DELETE` request to `projects/:project_id/repository/files/:file_path`. ## Runners See [https://docs.gitlab.com/ce/api/runners.html](https://docs.gitlab.com/ce/api/runners.html). - runners ```perl my $runners = $api->runners( \%params, ); ``` Sends a `GET` request to `runners` and returns the decoded response content. - all\_runners ```perl my $runners = $api->all_runners( \%params, ); ``` Sends a `GET` request to `runners/all` and returns the decoded response content. - runner ```perl my $runner = $api->runner( $runner_id, ); ``` Sends a `GET` request to `runners/:runner_id` and returns the decoded response content. - update\_runner ```perl my $runner = $api->update_runner( $runner_id, \%params, ); ``` Sends a `PUT` request to `runners/:runner_id` and returns the decoded response content. - delete\_runner ``` $api->delete_runner( $runner_id, ); ``` Sends a `DELETE` request to `runners/:runner_id`. - runner\_jobs ```perl my $jobs = $api->runner_jobs( $runner_id, \%params, ); ``` Sends a `GET` request to `runners/:runner_id/jobs` and returns the decoded response content. - project\_runners ```perl my $runners = $api->project_runners( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/runners` and returns the decoded response content. - enable\_project\_runner ```perl my $runner = $api->enable_project_runner( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/runners` and returns the decoded response content. - disable\_project\_runner ```perl my $runner = $api->disable_project_runner( $project_id, $runner_id, ); ``` Sends a `DELETE` request to `projects/:project_id/runners/:runner_id` and returns the decoded response content. ## Search See [https://docs.gitlab.com/ce/api/search.html](https://docs.gitlab.com/ce/api/search.html). - search ```perl my $results = $api->search( \%params, ); ``` Sends a `GET` request to `search` and returns the decoded response content. ## Services See [https://docs.gitlab.com/ce/api/services.html](https://docs.gitlab.com/ce/api/services.html). - project\_service ```perl my $service = $api->project_service( $project_id, $service_name, ); ``` Sends a `GET` request to `projects/:project_id/services/:service_name` and returns the decoded response content. - edit\_project\_service ``` $api->edit_project_service( $project_id, $service_name, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/services/:service_name`. - delete\_project\_service ``` $api->delete_project_service( $project_id, $service_name, ); ``` Sends a `DELETE` request to `projects/:project_id/services/:service_name`. ## Application settings See [https://docs.gitlab.com/ce/api/settings.html](https://docs.gitlab.com/ce/api/settings.html). - settings ```perl my $settings = $api->settings(); ``` Sends a `GET` request to `application/settings` and returns the decoded response content. - update\_settings ```perl my $settings = $api->update_settings( \%params, ); ``` Sends a `PUT` request to `application/settings` and returns the decoded response content. ## Application statistics See [https://docs.gitlab.com/ce/api/statistics.html](https://docs.gitlab.com/ce/api/statistics.html). - statistics ```perl my $statistics = $api->statistics(); ``` Sends a `GET` request to `application/statistics` and returns the decoded response content. ## Sidekiq Metrics See [https://docs.gitlab.com/ce/api/sidekiq\_metrics.html](https://docs.gitlab.com/ce/api/sidekiq_metrics.html). - queue\_metrics ```perl my $metrics = $api->queue_metrics(); ``` Sends a `GET` request to `sidekiq/queue_metrics` and returns the decoded response content. - process\_metrics ```perl my $metrics = $api->process_metrics(); ``` Sends a `GET` request to `sidekiq/process_metrics` and returns the decoded response content. - job\_stats ```perl my $stats = $api->job_stats(); ``` Sends a `GET` request to `sidekiq/job_stats` and returns the decoded response content. - compound\_metrics ```perl my $metrics = $api->compound_metrics(); ``` Sends a `GET` request to `sidekiq/compound_metrics` and returns the decoded response content. ## System hooks See [https://docs.gitlab.com/ce/api/system\_hooks.html](https://docs.gitlab.com/ce/api/system_hooks.html). - hooks ```perl my $hooks = $api->hooks( \%params, ); ``` Sends a `GET` request to `hooks` and returns the decoded response content. - create\_hook ``` $api->create_hook( \%params, ); ``` Sends a `POST` request to `hooks`. - test\_hook ```perl my $hook = $api->test_hook( $hook_id, ); ``` Sends a `GET` request to `hooks/:hook_id` and returns the decoded response content. - delete\_hook ``` $api->delete_hook( $hook_id, ); ``` Sends a `DELETE` request to `hooks/:hook_id`. ## Tags See [https://docs.gitlab.com/ce/api/tags.html](https://docs.gitlab.com/ce/api/tags.html). - tags ```perl my $tags = $api->tags( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/repository/tags` and returns the decoded response content. - tag ```perl my $tag = $api->tag( $project_id, $tag_name, ); ``` Sends a `GET` request to `projects/:project_id/repository/tags/:tag_name` and returns the decoded response content. - create\_tag ```perl my $tag = $api->create_tag( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/repository/tags` and returns the decoded response content. - delete\_tag ``` $api->delete_tag( $project_id, $tag_name, ); ``` Sends a `DELETE` request to `projects/:project_id/repository/tags/:tag_name`. - create\_tag\_release ```perl my $release = $api->create_tag_release( $project_id, $tag_name, \%params, ); ``` Sends a `POST` request to `projects/:project_id/repository/tags/:tag_name/release` and returns the decoded response content. - update\_tag\_release ```perl my $release = $api->update_tag_release( $project_id, $tag_name, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/repository/tags/:tag_name/release` and returns the decoded response content. ## Todos See [https://docs.gitlab.com/ce/api/todos.html](https://docs.gitlab.com/ce/api/todos.html). - todos ```perl my $todos = $api->todos( \%params, ); ``` Sends a `GET` request to `todos` and returns the decoded response content. - mark\_todo\_done ```perl my $todo = $api->mark_todo_done( $todo_id, ); ``` Sends a `POST` request to `todos/:todo_id/mark_as_done` and returns the decoded response content. - mark\_all\_todos\_done ``` $api->mark_all_todos_done(); ``` Sends a `POST` request to `todos/mark_as_done`. ## Users See [https://docs.gitlab.com/ce/api/users.html](https://docs.gitlab.com/ce/api/users.html). - users ```perl my $users = $api->users( \%params, ); ``` Sends a `GET` request to `users` and returns the decoded response content. - user ```perl my $user = $api->user( $user_id, ); ``` Sends a `GET` request to `users/:user_id` and returns the decoded response content. - create\_user ```perl $api->create_user( \%params, ); ``` Sends a `POST` request to `users`. - edit\_user ```perl $api->edit_user( $user_id, \%params, ); ``` Sends a `PUT` request to `users/:user_id`. - delete\_user ```perl $api->delete_user( $user_id, \%params, ); ``` Sends a `DELETE` request to `users/:user_id`. - current\_user ```perl my $user = $api->current_user(); ``` Sends a `GET` request to `user` and returns the decoded response content. - current\_user\_ssh\_keys ```perl my $keys = $api->current_user_ssh_keys( \%params, ); ``` Sends a `GET` request to `user/keys` and returns the decoded response content. - user\_ssh\_keys ```perl my $keys = $api->user_ssh_keys( $user_id, \%params, ); ``` Sends a `GET` request to `users/:user_id/keys` and returns the decoded response content. - user\_ssh\_key ```perl my $key = $api->user_ssh_key( $key_id, ); ``` Sends a `GET` request to `user/keys/:key_id` and returns the decoded response content. - create\_current\_user\_ssh\_key ```perl $api->create_current_user_ssh_key( \%params, ); ``` Sends a `POST` request to `user/keys`. - create\_user\_ssh\_key ```perl $api->create_user_ssh_key( $user_id, \%params, ); ``` Sends a `POST` request to `users/:user_id/keys`. - delete\_current\_user\_ssh\_key ```perl $api->delete_current_user_ssh_key( $key_id, ); ``` Sends a `DELETE` request to `user/keys/:key_id`. - delete\_user\_ssh\_key ```perl $api->delete_user_ssh_key( $user_id, $key_id, ); ``` Sends a `DELETE` request to `users/:user_id/keys/:key_id`. - current\_user\_gpg\_keys ```perl my $keys = $api->current_user_gpg_keys( \%params, ); ``` Sends a `GET` request to `user/gpg_keys` and returns the decoded response content. - current\_user\_gpg\_key ```perl my $key = $api->current_user_gpg_key( $key_id, ); ``` Sends a `GET` request to `user/gpg_keys/:key_id` and returns the decoded response content. - create\_current\_user\_gpg\_key ```perl $api->create_current_user_gpg_key( \%params, ); ``` Sends a `POST` request to `user/gpg_keys`. - delete\_current\_user\_gpg\_key ```perl $api->delete_current_user_gpg_key( $key_id, ); ``` Sends a `DELETE` request to `user/gpg_keys/:key_id`. - user\_gpg\_keys ```perl my $keys = $api->user_gpg_keys( $user_id, \%params, ); ``` Sends a `GET` request to `users/:user_id/gpg_keys` and returns the decoded response content. - user\_gpg\_key ```perl my $key = $api->user_gpg_key( $user_id, $key_id, ); ``` Sends a `GET` request to `users/:user_id/gpg_keys/:key_id` and returns the decoded response content. - create\_user\_gpg\_key ```perl my $keys = $api->create_user_gpg_key( $user_id, \%params, ); ``` Sends a `POST` request to `users/:user_id/gpg_keys` and returns the decoded response content. - delete\_user\_gpg\_key ```perl $api->delete_user_gpg_key( $user_id, $key_id, ); ``` Sends a `DELETE` request to `users/:user_id/gpg_keys/:key_id`. - current\_user\_emails ```perl my $emails = $api->current_user_emails( \%params, ); ``` Sends a `GET` request to `user/emails` and returns the decoded response content. - user\_emails ```perl my $emails = $api->user_emails( $user_id, \%params, ); ``` Sends a `GET` request to `users/:user_id/emails` and returns the decoded response content. - current\_user\_email ```perl my $email = $api->current_user_email( $email_id, ); ``` Sends a `GET` request to `user/emails/:email_id` and returns the decoded response content. - create\_current\_user\_email ```perl my $email = $api->create_current_user_email( \%params, ); ``` Sends a `POST` request to `user/emails` and returns the decoded response content. - create\_user\_email ```perl my $email = $api->create_user_email( $user_id, \%params, ); ``` Sends a `POST` request to `users/:user_id/emails` and returns the decoded response content. - delete\_current\_user\_email ```perl $api->delete_current_user_email( $email_id, ); ``` Sends a `DELETE` request to `user/emails/:email_id`. - delete\_user\_email ```perl $api->delete_user_email( $user_id, $email_id, ); ``` Sends a `DELETE` request to `users/:user_id/emails/:email_id`. - block\_user ```perl my $success = $api->block_user( $user_id, ); ``` Sends a `POST` request to `users/:user_id/block` and returns the decoded response content. - unblock\_user ```perl my $success = $api->unblock_user( $user_id, ); ``` Sends a `POST` request to `users/:user_id/unblock` and returns the decoded response content. - user\_impersonation\_tokens ```perl my $tokens = $api->user_impersonation_tokens( $user_id, \%params, ); ``` Sends a `GET` request to `users/:user_id/impersonation_tokens` and returns the decoded response content. - user\_impersonation\_token ```perl my $token = $api->user_impersonation_token( $user_id, $impersonation_token_id, ); ``` Sends a `GET` request to `users/:user_id/impersonation_tokens/:impersonation_token_id` and returns the decoded response content. - create\_user\_impersonation\_token ```perl my $token = $api->create_user_impersonation_token( $user_id, \%params, ); ``` Sends a `POST` request to `users/:user_id/impersonation_tokens` and returns the decoded response content. - delete\_user\_impersonation\_token ```perl $api->delete_user_impersonation_token( $user_id, $impersonation_token_id, ); ``` Sends a `DELETE` request to `users/:user_id/impersonation_tokens/:impersonation_token_id`. - all\_user\_activities ```perl my $activities = $api->all_user_activities( \%params, ); ``` Sends a `GET` request to `user/activities` and returns the decoded response content. ## Validate the .gitlab-ci.yml See [https://docs.gitlab.com/ce/api/lint.html](https://docs.gitlab.com/ce/api/lint.html). - lint ```perl my $result = $api->lint( \%params, ); ``` Sends a `POST` request to `lint` and returns the decoded response content. ## Version See [https://docs.gitlab.com/ce/api/version.html](https://docs.gitlab.com/ce/api/version.html). - version ```perl my $version = $api->version(); ``` Sends a `GET` request to `version` and returns the decoded response content. ## Wikis See [https://docs.gitlab.com/ce/api/wikis.html](https://docs.gitlab.com/ce/api/wikis.html). - wiki\_pages ```perl my $pages = $api->wiki_pages( $project_id, \%params, ); ``` Sends a `GET` request to `projects/:project_id/wikis` and returns the decoded response content. - wiki\_page ```perl my $pages = $api->wiki_page( $project_id, $slug, ); ``` Sends a `GET` request to `projects/:project_id/wikis/:slug` and returns the decoded response content. - create\_wiki\_page ```perl my $page = $api->create_wiki_page( $project_id, \%params, ); ``` Sends a `POST` request to `projects/:project_id/wikis` and returns the decoded response content. - edit\_wiki\_page ```perl my $page = $api->edit_wiki_page( $project_id, $slug, \%params, ); ``` Sends a `PUT` request to `projects/:project_id/wikis/:slug` and returns the decoded response content. - delete\_wiki\_page ``` $api->delete_wiki_page( $project_id, $slug, ); ``` Sends a `DELETE` request to `projects/:project_id/wikis/:slug`. # CONTRIBUTING This module is auto-generated from a set of YAML files defining the interface of GitLab's API. If you'd like to contribute to this module then please feel free to make a [fork on GitHub](https://github.com/bluefeet/GitLab-API-v4) and submit a pull request, just make sure you edit the files in the `authors/` directory instead of `lib/GitLab/API/v4.pm` directly. Please see [https://github.com/bluefeet/GitLab-API-v4/blob/master/author/README.pod](https://github.com/bluefeet/GitLab-API-v4/blob/master/author/README.pod) for more information. Alternatively, you can [open a ticket](https://github.com/bluefeet/GitLab-API-v4/issues). # SUPPORT Please submit bugs and feature requests to the GitLab-API-v4 GitHub issue tracker: [https://github.com/bluefeet/GitLab-API-v4/issues](https://github.com/bluefeet/GitLab-API-v4/issues) # ACKNOWLEDGEMENTS Thanks to [ZipRecruiter](https://www.ziprecruiter.com/) for encouraging their employees to contribute back to the open source ecosystem. Without their dedication to quality software development this distribution would not exist. # AUTHORS ``` Aran Clary Deltac Dotan Dimet Nigel Gregoire trunov-ms Marek R. Sotola José Joaquín Atria Dave Webb Simon Ruderich royce55 gregor herrmann Luc Didry Kieren Diment Dmitry Frolov Thomas Klausner ``` # COPYRIGHT AND LICENSE Copyright (C) 2014 Aran Clary Deltac This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/). README.pod100644000766000024 227313621075102 15773 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author =pod The C directory contains the logic for generating the v4.pm module. =head1 DATA FILES The C drives the order and configuration of individual sections. The YAML files in the C directory have lines like this: - SUB: HTTP_METHOD PATH - SUB: RETURN = HTTP_METHOD PATH? =head2 SUB The name if the subroutine that will be created in v4.pm. =head2 RETURN The name of the return variable if any. This is used as part of generating the documentation. If no return variable is declared then the subroutine will return an empty list no matter what the API response returns. =head2 HTTP_METHOD One of GET, POST, PUT, or DELETE. =head2 PATH The path to the API endpoint (after the /api/v4 bit). The path is a list of static and dynamic strings separate by forward slashes. So, if you have: /foo/:bar/baz Then the API subroutine would require one argument which would be injected in place of C<:bar>. =head2 ? If the PATH ends with a C then this signifies that the API endpoint accepts query parameters. =head1 GENERATING To generate C do this: cd author perl generate.pl > ../lib/GitLab/API/v4.pm =cut config.yml100644000766000024 1467113621075102 16347 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author--- sections: - award_emoji: head: Award Emoji doc_url: https://docs.gitlab.com/ce/api/award_emoji.html - branches: head: Branches doc_url: https://docs.gitlab.com/ce/api/branches.html - broadcast_messages: head: Broadcast Messages doc_url: https://docs.gitlab.com/ce/api/broadcast_messages.html - project_level_variables: head: Project-level Variables doc_url: https://docs.gitlab.com/ce/api/project_level_variables.html - group_level_variables: head: Group-level Variables doc_url: https://docs.gitlab.com/ce/api/group_level_variables.html - snippets: head: Snippets doc_url: https://docs.gitlab.com/ce/api/snippets.html - commits: head: Commits doc_url: https://docs.gitlab.com/ce/api/commits.html - container_registry: head: Container Registry doc_url: https://docs.gitlab.com/ce/api/container_registry.html - custom_attributes: head: Custom Attributes doc_url: https://docs.gitlab.com/ce/api/custom_attributes.html - deployments: head: Deployments doc_url: https://docs.gitlab.com/ce/api/deployments.html - deploy_keys: head: Deploy Keys doc_url: https://docs.gitlab.com/ce/api/deploy_keys.html - environments: head: Environments doc_url: https://docs.gitlab.com/ce/api/environments.html - events: head: Events doc_url: https://docs.gitlab.com/ce/api/events.html - features: head: Feature flags doc_url: https://docs.gitlab.com/ce/api/features.html - gitignores_templates: head: Gitignores doc_url: https://docs.gitlab.com/ce/api/templates/gitignores.html - gitlab_ci_ymls_templates: head: GitLab CI YMLs doc_url: https://docs.gitlab.com/ce/api/templates/gitlab_ci_ymls.html - groups: head: Groups doc_url: https://docs.gitlab.com/ce/api/groups.html - group_access_requests: head: Group access requests doc_url: https://docs.gitlab.com/ce/api/access_requests.html - group_badges: head: Group badges doc_url: https://docs.gitlab.com/ce/api/group_badges.html - group_members: head: Group members doc_url: https://docs.gitlab.com/ce/api/members.html - issues: head: Issues doc_url: https://docs.gitlab.com/ce/api/issues.html - boards: head: Issue Boards doc_url: https://docs.gitlab.com/ce/api/boards.html - group_boards: head: Group Issue Boards doc_url: https://docs.gitlab.com/ce/api/group_boards.html - jobs: head: Jobs doc_url: https://docs.gitlab.com/ce/api/jobs.html - keys: head: Keys doc_url: https://docs.gitlab.com/ce/api/keys.html - labels: head: Labels doc_url: https://docs.gitlab.com/ce/api/labels.html - markdown: head: Markdown doc_url: https://docs.gitlab.com/ce/api/markdown.html - merge_requests: head: Merge requests doc_url: https://docs.gitlab.com/ce/api/merge_requests.html - milestones: head: Milestones doc_url: https://docs.gitlab.com/ce/api/milestones.html - group_milestones: head: Group milestones doc_url: https://docs.gitlab.com/ce/api/group_milestones.html - namespaces: head: Namespaces doc_url: https://docs.gitlab.com/ce/api/namespaces.html - notes: head: Notes doc_url: https://docs.gitlab.com/ce/api/notes.html - discussions: head: Discussions doc_url: https://docs.gitlab.com/ce/api/discussions.html - resource_label_events: head: Resource label events doc_url: https://docs.gitlab.com/ce/api/resource_label_events.html - notification_settings: head: Notification settings doc_url: https://docs.gitlab.com/ce/api/notification_settings.html - licenses_templates: head: Licenses doc_url: https://docs.gitlab.com/ce/api/templates/licenses.html - page_domains: head: Pages domains doc_url: https://docs.gitlab.com/ce/api/pages_domains.html - pipelines: head: Pipelines doc_url: https://docs.gitlab.com/ce/api/pipelines.html - pipeline_triggers: head: Pipeline triggers doc_url: https://docs.gitlab.com/ce/api/pipeline_triggers.html - pipeline_schedules: head: Pipeline schedules doc_url: https://docs.gitlab.com/ce/api/pipeline_schedules.html - projects: head: Projects doc_url: https://docs.gitlab.com/ce/api/projects.html - project_access_requests: head: Project access requests doc_url: https://docs.gitlab.com/ce/api/access_requests.html - project_badges: head: Project badges doc_url: https://docs.gitlab.com/ce/api/project_badges.html - project_import_export: head: Project import/export doc_url: https://docs.gitlab.com/ce/api/project_import_export.html - project_members: head: Project members doc_url: https://docs.gitlab.com/ce/api/members.html - project_snippets: head: Project snippets doc_url: https://docs.gitlab.com/ce/api/project_snippets.html - protected_branches: head: Protected branches doc_url: https://docs.gitlab.com/ce/api/protected_branches.html - protected_tags: head: Protected tags doc_url: https://docs.gitlab.com/ce/api/protected_tags.html - releases: head: Releases doc_url: https://docs.gitlab.com/ce/api/releases/index.html - release_links: head: Release Links doc_url: https://docs.gitlab.com/ce/api/releases/links.html - repositories: head: Repositories doc_url: https://docs.gitlab.com/ce/api/repositories.html - repository_files: head: Repository files doc_url: https://docs.gitlab.com/ce/api/repository_files.html - runners: head: Runners doc_url: https://docs.gitlab.com/ce/api/runners.html - search: head: Search doc_url: https://docs.gitlab.com/ce/api/search.html - services: head: Services doc_url: https://docs.gitlab.com/ce/api/services.html - settings: head: Application settings doc_url: https://docs.gitlab.com/ce/api/settings.html - statistics: head: Application statistics doc_url: https://docs.gitlab.com/ce/api/statistics.html - sidekiq_metrics: head: Sidekiq Metrics doc_url: https://docs.gitlab.com/ce/api/sidekiq_metrics.html - system_hooks: head: System hooks doc_url: https://docs.gitlab.com/ce/api/system_hooks.html - tags: head: Tags doc_url: https://docs.gitlab.com/ce/api/tags.html - todos: head: Todos doc_url: https://docs.gitlab.com/ce/api/todos.html - users: head: Users doc_url: https://docs.gitlab.com/ce/api/users.html - lint: head: Validate the .gitlab-ci.yml doc_url: https://docs.gitlab.com/ce/api/lint.html - version: head: Version doc_url: https://docs.gitlab.com/ce/api/version.html - wikis: head: Wikis doc_url: https://docs.gitlab.com/ce/api/wikis.html footer.pm100644000766000024 433313621075102 16165 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author1; __END__ =head1 CONTRIBUTING This module is auto-generated from a set of YAML files defining the interface of GitLab's API. If you'd like to contribute to this module then please feel free to make a L and submit a pull request, just make sure you edit the files in the C directory instead of C directly. Please see L for more information. Alternatively, you can L. =head1 SUPPORT Please submit bugs and feature requests to the GitLab-API-v4 GitHub issue tracker: L =head1 ACKNOWLEDGEMENTS Thanks to L for encouraging their employees to contribute back to the open source ecosystem. Without their dedication to quality software development this distribution would not exist. =head1 AUTHORS Aran Clary Deltac Dotan Dimet Nigel Gregoire trunov-ms Marek R. Sotola José Joaquín Atria Dave Webb Simon Ruderich royce55 gregor herrmann Luc Didry Kieren Diment Dmitry Frolov Thomas Klausner =head1 COPYRIGHT AND LICENSE Copyright (C) 2014 Aran Clary Deltac This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see L. =cut generate.pl100755000766000024 1003113621075102 16473 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author#!/usr/bin/env perl use strictures 1; use YAML::XS qw(); use Data::Dumper; use Path::Tiny; my $dir = path('sections'); my $header = path('header.pm')->slurp(); my $footer = path('footer.pm')->slurp(); my $config = YAML::XS::Load( path('config.yml')->slurp() ); print $header; print "=head1 API METHODS\n\n"; foreach my $section_pack (@{ $config->{sections} }) { foreach my $section_name (keys %$section_pack) { my $section = $section_pack->{$section_name}; my $file = $dir->child("$section_name.yml"); my $endpoints = YAML::XS::Load( $file->slurp() ); print "=head2 $section->{head}\n\n"; print "See L<$section->{doc_url}>.\n\n"; print "=over\n\n"; foreach my $endpoint (@$endpoints) { if (keys(%$endpoint) == 1) { my ($method) = keys %$endpoint; $endpoint = { method => $method, spec => $endpoint->{$method}, }; } my $method = $endpoint->{method}; my $spec = $endpoint->{spec}; my ($return, $verb, $path, $params_ok); if ($spec =~ m{^(?:(\S+) = |)(GET|POST|PUT|DELETE) ([^/\s]\S*?[^/\s]?)(\??)$}) { ($return, $verb, $path, $params_ok) = ($1, $2, $3, $4); } else { die "Invalid spec ($method): $spec"; } my $no_decode = 0; $no_decode = 1 if !$return; $no_decode = 1 if $endpoint->{no_decode}; print "=item $method\n\n"; print ' '; print "my \$$return = " if $return; print "\$api->$method("; my @args = ( map { ($_ =~ m{^:(.+)$}) ? "\$$1" : () } split(m{/}, $path) ); push @args, '\%params' if $params_ok; if (@args) { print "\n" . join('', map { " $_,\n" } @args ); print ' '; } print ");\n\n"; print "Sends a C<$verb> request to C<$path>"; print ' and returns the ' . ($no_decode ? 'raw' : 'decoded') . ' response content' if $return; print ".\n\n"; print "$endpoint->{note}\n" if $endpoint->{note}; print "=cut\n\n"; print "sub $method {\n"; print " my \$self = shift;\n"; if (@args) { my $min_args = @args; my $max_args = @args; $min_args-- if $params_ok; if ($min_args == $max_args) { print " croak '$method must be called with $min_args arguments' if \@_ != $min_args;\n"; } else { print " croak '$method must be called with $min_args to $max_args arguments' if \@_ < $min_args or \@_ > $max_args;\n"; } my $i = 0; foreach my $arg (@args) { my $is_params = ($params_ok and $i==$#args) ? 1 : 0; if ($is_params) { print " croak 'The last argument ($arg) to $method must be a hash ref' if defined(\$_[$i]) and ref(\$_[$i]) ne 'HASH';\n"; } else { my $number = $i + 1; print " croak 'The #$number argument ($arg) to $method must be a scalar' if ref(\$_[$i]) or (!defined \$_[$i]);\n"; } $i ++; } print " my \$params = (\@_ == $max_args) ? pop() : undef;\n" if $params_ok; } else { print " croak \"The $method method does not take any arguments\" if \@_;\n"; } print " my \$options = {};\n"; print " \$options->{decode} = 0;\n" if $no_decode; if ($params_ok) { my $params_key = ($verb eq 'GET' or $verb eq 'HEAD') ? 'query' : 'content'; print " \$options->{$params_key} = \$params if defined \$params;\n"; } print ' '; print 'return ' if $return; print "\$self->_call_rest_client( '$verb', '$path', [\@_], \$options );\n"; print " return;\n" if !$return; print "}\n\n"; } print "=back\n\n"; }} print "=cut\n\n"; print $footer; header.pm100644000766000024 2160713621075102 16142 0ustar00aranstaff000000000000GitLab-API-v4-0.25/authorpackage GitLab::API::v4; our $VERSION = '0.24'; =encoding utf8 =head1 NAME GitLab::API::v4 - A complete GitLab API v4 client. =head1 SYNOPSIS use GitLab::API::v4; my $api = GitLab::API::v4->new( url => $v4_api_url, private_token => $token, ); my $branches = $api->branches( $project_id ); =head1 DESCRIPTION This module provides a one-to-one interface with the GitLab API v4. Much is not documented here as it would just be duplicating GitLab's own L. Note that this distribution also includes the L command-line interface (CLI). =head2 Upgrading If you are upgrading from L make sure you read: L Also, review the C file included in the distribution as it outlines the changes made to convert the v3 module to v4: L Finally, be aware that many methods were added, removed, renamed, and/or altered. If you want to review exactly what was changed you can use GitHub's compare tool: L Or clone the repo and run this command: C =head2 Credentials Authentication credentials may be defined by setting either the L or L arguments. If no credentials are supplied then the client will be anonymous and greatly limited in what it can do with the API. Extra care has been taken to hide the token arguments behind closures. This way, if you dump your api object, your tokens won't accidentally leak into places you don't want them to. =head2 Constants The GitLab API, in rare cases, uses a hard-coded value to represent a state. To make life easier the L module exposes these states as named variables. =head2 Exceptions The API methods will all throw a useful exception if an unsuccessful response is received from the API. That is except for C requests that return a C<404> response - these will return C for methods that return a value. If you'd like to catch and handle these exceptions consider using L. =head2 Logging This module uses L and produces some debug messages here and there, but the most useful bits are the info messages produced just before each API call. =head2 Project ID Note that many API calls require a C<$project_id>. This can be specified as a numeric project C or, in many cases, maybe all cases, as a C string. The GitLab documentation on this point is vague. =cut use Carp qw( croak ); use GitLab::API::v4::Paginator; use GitLab::API::v4::RESTClient; use Log::Any qw( $log ); use Types::Common::Numeric -types; use Types::Common::String -types; use Types::Standard -types; use Moo; use strictures 2; use namespace::clean; sub BUILD { my ($self) = @_; # Ensure any token arguments get moved into their closure before we return # the built object. $self->access_token(); $self->private_token(); $log->debugf( "An instance of %s has been created.", ref($self) ); return; } sub _call_rest_client { my ($self, $verb, $path, $path_vars, $options) = @_; $options->{headers} = $self->_auth_headers(); return $self->rest_client->request( $verb, $path, $path_vars, $options, ); } sub _auth_headers { my ($self) = @_; my $headers = {}; $headers->{'authorization'} = 'Bearer ' . $self->access_token() if defined $self->access_token(); $headers->{'private-token'} = $self->private_token() if defined $self->private_token(); $headers->{'sudo'} = $self->sudo_user() if defined $self->sudo_user(); return $headers; } sub _clone_args { my ($self) = @_; return { url => $self->url(), retries => $self->retries(), rest_client => $self->rest_client(), (defined $self->access_token()) ? (access_token=>$self->access_token()) : (), (defined $self->private_token()) ? (private_token=>$self->private_token()) : (), }; } sub _clone { my $self = shift; my $class = ref $self; my $args = { %{ $self->_clone_args() }, %{ $class->BUILDARGS( @_ ) }, }; return $class->new( $args ); } # Little utility method that avoids any ambiguity in whether a closer is # causing circular references. Don't ever pass it a ref. sub _make_safe_closure { my ($ret) = @_; return sub{ $ret }; } =head1 REQUIRED ARGUMENTS =head2 url The URL to your v4 API endpoint. Typically this will be something like C. =cut has url => ( is => 'ro', isa => NonEmptySimpleStr, required => 1, ); =head1 OPTIONAL ARGUMENTS =head2 access_token A GitLab API OAuth2 token. If set then L may not be set. See L. =cut has _access_token_arg => ( is => 'ro', isa => NonEmptySimpleStr, init_arg => 'access_token', clearer => '_clear_access_token_arg', ); has _access_token_closure => ( is => 'lazy', isa => CodeRef, init_arg => undef, builder => '_build_access_token_closure', ); sub _build_access_token_closure { my ($self) = @_; my $token = $self->_access_token_arg(); $self->_clear_access_token_arg(); return _make_safe_closure( $token ); } sub access_token { my ($self) = @_; return $self->_access_token_closure->(); } =head2 private_token A GitLab API personal token. If set then L may not be set. See L. =cut has _private_token_arg => ( is => 'ro', isa => NonEmptySimpleStr, init_arg => 'private_token', clearer => '_clear_private_token_arg', ); has _private_token_closure => ( is => 'lazy', isa => CodeRef, init_arg => undef, builder => '_build_private_token_closure', ); sub _build_private_token_closure { my ($self) = @_; my $token = $self->_private_token_arg(); $self->_clear_private_token_arg(); return _make_safe_closure( $token ); } sub private_token { my ($self) = @_; return $self->_private_token_closure->(); } =head2 retries The number of times the request should be retried in case it fails (5XX HTTP response code). Defaults to C<0> (false), meaning that a failed request will not be retried. =cut has retries => ( is => 'ro', isa => PositiveOrZeroInt, default => 0, ); =head2 sudo_user The user to execute API calls as. You may find it more useful to use the L method instead. See L. =cut has sudo_user => ( is => 'ro', isa => NonEmptySimpleStr, ); =head2 rest_client An instance of L (or whatever L is set to). Typically you will not be setting this as it defaults to a new instance and customization should not be necessary. =cut has rest_client => ( is => 'lazy', isa => InstanceOf[ 'GitLab::API::v4::RESTClient' ], ); sub _build_rest_client { my ($self) = @_; return $self->rest_client_class->new( base_url => $self->url(), retries => $self->retries(), ); } =head2 rest_client_class The class to use when constructing the L. Defaults to L. =cut has rest_client_class => ( is => 'lazy', isa => NonEmptySimpleStr, ); sub _build_rest_client_class { return 'GitLab::API::v4::RESTClient'; } =head1 UTILITY METHODS =head2 paginator my $paginator = $api->paginator( $method, @method_args ); my $members = $api->paginator('group_members', $group_id); while (my $member = $members->next()) { ... } my $users_pager = $api->paginator('users'); while (my $users = $users_pager->next_page()) { ... } my $all_open_issues = $api->paginator( 'issues', $project_id, { state=>'opened' }, )->all(); Given a method who supports the C and C parameters, and returns an array ref, this will return a L object that will allow you to walk the records one page or one record at a time. =cut sub paginator { my ($self, $method, @args) = @_; my $params = (ref($args[-1]) eq 'HASH') ? pop(@args) : {}; return GitLab::API::v4::Paginator->new( api => $self, method => $method, args => \@args, params => $params, ); } =head2 sudo $api->sudo('fred')->create_issue(...); Returns a new instance of L with the L argument set. See L. =cut sub sudo { my ($self, $user) = @_; return $self->_clone( sudo_user => $user, ); } award_emoji.yml100644000766000024 513613621075102 21166 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - issue_award_emojis: award_emojis = GET projects/:project_id/issues/:issue_iid/award_emoji? - merge_request_award_emojis: award_emojis = GET projects/:project_id/merge_requests/:merge_request_iid/award_emoji? - snippet_award_emojis: award_emojis = GET projects/:project_id/merge_requests/:merge_request_id/award_emoji? - issue_award_emoji: award_emoji = GET projects/:project_id/issues/:issue_iid/award_emoji/:award_id - merge_request_award_emoji: award_emoji = GET projects/:project_id/merge_requests/:merge_request_iid/award_emoji/:award_id - snippet_award_emoji: award_emoji = GET projects/:project_id/snippets/:snippet_id/award_emoji/:award_id - create_issue_award_emoji: award_emoji = POST projects/:project_id/issues/:issue_iid/award_emoji? - create_merge_request_award_emoji: award_emoji = POST projects/:project_id/merge_requests/:merge_request_iid/award_emoji? - create_snippet_award_emoji: award_emoji = POST projects/:project_id/snippets/:snippet_id/award_emoji - delete_issue_award_emoji: award_emoji = DELETE projects/:project_id/issues/:issue_id/award_emoji/:award_id - delete_merge_request_award_emoji: award_emoji = DELETE projects/:project_id/merge_requests/:merge_request_id/award_emoji/:award_id - delete_snippet_award_emoji: award_emoji = DELETE projects/:project_id/snippets/:snippet_id/award_emoji/:award_id - issue_note_award_emojis: award_emojis = GET projects/:project_id/issues/:issue_iid/notes/:note_id/award_emoji - issue_note_award_emoji: award_emoji = GET projects/:project_id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id - create_issue_note_award_emoji: award_emoji = POST projects/:project_id/issues/:issue_iid/notes/:note_id/award_emoji? - delete_issue_note_award_emoji: award_emoji = DELETE projects/:project_id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id - merge_request_note_award_emojis: award_emojis = GET projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji - merge_request_note_award_emoji: award_emoji = GET projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji/:award_id - create_merge_request_note_award_emoji: award_emoji = POST projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji? - delete_merge_request_note_award_emoji: award_emoji = DELETE projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji/:award_id # What about snippets? Do we make snippet_note_award_emoji methods? The docs only # reference issues and merge requests. Its probably a failing in GitLab's regularly # inconsistent documentation. If they exist feel free to add them here and make a PR. boards.yml100644000766000024 76113621075102 20136 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - project_boards: boards = GET projects/:project_id/boards? - project_board_lists: lists = GET projects/:project_id/boards/:board_id/lists? - project_board_list: list = GET projects/:project_id/boards/:board_id/lists/:list_id - create_project_board_list: list = POST projects/:project_id/boards/:board_id/lists? - edit_project_board_list: list = PUT projects/:project_id/boards/:board_id/lists/:list_id? - delete_project_board_list: DELETE projects/:project_id/boards/:board_id/lists/:list_id branches.yml100644000766000024 117713621075102 20473 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - branches: branches = GET projects/:project_id/repository/branches? - branch: branch = GET projects/:project_id/repository/branches/:branch_name - create_branch: branch = POST projects/:project_id/repository/branches? - delete_branch: DELETE projects/:project_id/repository/branches/:branch_name - delete_merged_branches: DELETE projects/:project_id/repository/merged_branches # These are not implemented as they are already deprecated in the v4 API docs. #- protect_branch: PUT /projects/:project_id/repository/branches/:branch_name/protect? #- unprotect_branch: PUT /projects/:project_id/repository/branches/:branch_name/unprotect broadcast_messages.yml100644000766000024 51013621075102 22505 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - broadcast_messages: messages = GET broadcast_messages? - broadcast_message: message = GET broadcast_messages/:message_id - create_broadcast_message: message = POST broadcast_messages? - edit_broadcast_message: message = PUT broadcast_messages/:message_id? - delete_broadcast_message: DELETE broadcast_messages/:message_id commits.yml100644000766000024 153713621075102 20361 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - commits: commits = GET projects/:project_id/repository/commits? - create_commit: commit = POST projects/:project_id/repository/commits? - commit: commit = GET projects/:project_id/repository/commits/:commit_sha - commit_refs: refs = GET projects/:project_id/repository/commits/:commit_sha/refs? - cherry_pick_commit: commit = POST projects/:project_id/repository/commits/:commit_sha/cherry_pick? - commit_diff: diff = GET projects/:project_id/repository/commits/:commit_sha/diff? - commit_comments: comments = GET projects/:project_id/repository/commits/:commit_sha/comments? - create_commit_comment: POST projects/:project_id/repository/commits/:commit_sha/comments? - commit_statuses: build_statuses = GET projects/:project_id/repository/commits/:commit_sha/statuses? - create_commit_status: build_status = POST projects/:project_id/statuses/:commit_sha? container_registry.yml100644000766000024 134413621075102 22614 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - registry_repositories_in_project: registry_repositories = GET projects/:project_id/registry/repositories? - registry_repositories_in_group: registry_repositories = GET groups/:id/registry/repositories? - delete_registry_repository: DELETE projects/:project_id/registry/repositories/:repository_id - registry_repository_tags: tags = GET projects/:project_id/registry/repositories/:repository_id/tags - registry_repository_tag: tag = GET projects/:project_id/registry/repositories/:repository_id/tags/:tag_name - delete_registry_repository_tag: DELETE projects/:project_id/registry/repositories/:repository_id/tags/:tag_name - bulk_delete_registry_repository_tags: DELETE projects/:project_id/registry/repositories/:repository_id/tags? custom_attributes.yml100644000766000024 210213621075102 22453 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - custom_user_attributes: attributes = GET users/:user_id/custom_attributes - custom_group_attributes: attributes = GET groups/:group_id/custom_attributes - custom_project_attributes: attributes = GET projects/:project_id/custom_attributes - custom_user_attribute: attribute = GET users/:user_id/custom_attributes/:attribute_key - custom_group_attribute: attribute = GET groups/:group_id/custom_attributes/:attribute_key - custom_project_attribute: attribute = GET projects/:project_id/custom_attributes/:attribute_key - set_custom_user_attribute: attribute = PUT users/:user_id/custom_attributes/:attribute_key? - set_custom_group_attribute: attribute = PUT groups/:group_id/custom_attributes/:attribute_key? - set_custom_project_attribute: attribute = PUT projects/:project_id/custom_attributes/:attribute_key? - delete_custom_user_attribute: DELETE users/:user_id/custom_attributes/:attribute_key - delete_custom_group_attribute: DELETE groups/:group_id/custom_attributes/:attribute_key - delete_custom_project_attribute: DELETE projects/:project_id/custom_attributes/:attribute_key deploy_keys.yml100644000766000024 60313621075102 21206 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - all_deploy_keys: keys = GET deploy_keys? - deploy_keys: keys = GET projects/:project_id/deploy_keys? - deploy_key: key = GET projects/:project_id/deploy_keys/:key_id - create_deploy_key: key = POST projects/:project_id/deploy_keys? - delete_deploy_key: DELETE projects/:project_id/deploy_keys/:key_id - enable_deploy_key: key = POST projects/:project_id/deploy_keys/:key_id/enable deployments.yml100644000766000024 22613621075102 21223 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - deployments: deployments = GET projects/:project_id/deployments? - deployment: deployment = GET projects/:project_id/deployments/:deployment_id discussions.yml100644000766000024 554013621075102 21252 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - issue_discussions: discussions = GET projects/:project_id/issues/:issue_iid/discussions? - issue_discussion: discussion = GET projects/:project_id/issues/:issue_iid/discussions/:discussion_id - create_issue_discussion: discussion = POST projects/:project_id/issues/:issue_iid/discussions? - create_issue_discussion_note: POST projects/:project_id/issues/:issue_iid/discussions/:discussion_id/notes? - edit_issue_discussion_note: PUT projects/:project_id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id? - delete_issue_discussion_note: DELETE projects/:project_id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id - project_snippet_discussions: discussions = GET projects/:project_id/snippets/:snippet_id/discussions? - project_snippet_discussion: discussion = GET projects/:project_id/snippets/:snippet_id/discussions/:discussion_id - create_project_snippet_discussion: discussion = POST projects/:project_id/snippets/:snippet_id/discussions? - create_project_snippet_discussion_note: POST projects/:project_id/snippets/:snippet_id/discussions/:discussion_id/notes? - edit_project_snippet_discussion_note: PUT projects/:project_id/snippets/:snippet_id/discussions/:discussion_id/notes/:note_id? - delete_project_snippet_discussion_note: DELETE projects/:project_id/snippets/:snippet_id/discussions/:discussion_id/notes/:note_id - merge_request_discussions: discussions = GET projects/:project_id/merge_requests/:merge_request_iid/discussions? - merge_request_discussion: discussion = GET projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id - create_merge_request_discussion: discussion = POST projects/:project_id/merge_requests/:merge_request_iid/discussions? - resolve_merge_request_discussion: PUT projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id? - create_merge_request_discussion_note: POST projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes? - edit_merge_request_discussion_note: PUT projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes/:note_id? - delete_merge_request_discussion_note: DELETE projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes/:note_id - commit_discussions: discussions = GET projects/:project_id/commits/:commit_id/discussions? - commit_discussion: discussion = GET projects/:project_id/commits/:commit_id/discussions/:discussion_id - create_commit_discussion: discussion = POST projects/:project_id/commits/:commit_id/discussions? - create_commit_discussion_note: POST projects/:project_id/commits/:commit_id/discussions/:discussion_id/notes? - edit_commit_discussion_note: PUT projects/:project_id/commits/:commit_id/discussions/:discussion_id/notes/:note_id? - delete_commit_discussion_note: DELETE projects/:project_id/commits/:commit_id/discussions/:discussion_id/notes/:note_id environments.yml100644000766000024 63513621075102 21413 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - environments: environments = GET projects/:project_id/environments? - create_environment: environment = POST projects/:project_id/environments? - edit_environment: environment = PUT projects/:project_id/environments/:environments_id? - delete_environment: DELETE projects/:project_id/environments/:environment_id - stop_environment: environment = POST projects/:project_id/environments/:environment_id/stop events.yml100644000766000024 22613621075102 20164 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - all_events: events = GET events? - user_events: events = GET users/:user_id/events? - project_events: events = GET projects/:project_id/events? features.yml100644000766000024 12613621075102 20475 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - features: features = GET features - set_feature: feature = POST features/:name? gitignores_templates.yml100644000766000024 21313621075102 23104 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - gitignores_templates: templates = GET templates/gitignores? - gitignores_template: template = GET templates/gitignores/:template_key gitlab_ci_ymls_templates.yml100644000766000024 23313621075102 23715 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - gitlab_ci_ymls_templates: templates = GET templates/gitlab_ci_ymls? - gitlab_ci_ymls_template: template = GET templates/gitlab_ci_ymls/:template_key group_access_requests.yml100644000766000024 46413621075102 23274 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - group_access_requests: requests = GET groups/:group_id/access_requests? - request_group_access: request = POST groups/:group_id/access_requests - approve_group_access: request = PUT groups/:group_id/access_requests/:user_id/approve - deny_group_access: DELETE groups/:group_id/access_requests/:user_id group_badges.yml100644000766000024 57113621075102 21324 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - group_badges: badges = GET groups/:group_id/badges - group_badge: badge = GET groups/:group_id/badges/:badge_id - create_group_badge: badge = POST groups/:group_id/badges? - edit_group_badge: badge = PUT groups/:group_id/badges/:badge_id? - delete_group_badge: DELETE groups/:group_id/badges/:badge_id - preview_group_badge: preview = GET groups/:group_id/badges/render? group_boards.yml100644000766000024 101013621075102 21356 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - group_boards: boards = GET groups/:group_id/boards - group_board: board = GET groups/:group_id/boards/:board_id - group_board_lists: lists = GET groups/:group_id/boards/:board_id/lists - group_board_list: list = GET groups/:group_id/boards/:board_id/lists/:list_id - create_group_board_list: list = POST groups/:group_id/boards/:board_id/lists? - edit_group_board_list: list = PUT groups/:group_id/boards/:board_id/lists/:list_id? - delete_group_board_list: DELETE groups/:group_id/boards/:board_id/lists/:list_id group_level_variables.yml100644000766000024 55313621075102 23236 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - group_variables: variables = GET groups/:group_id/variables? - group_variable: variable = GET groups/:group_id/variables/:variable_key - create_group_variable: variable = POST groups/:group_id/variables? - edit_group_variable: variable = PUT groups/:group_id/variables/:variable_key? - delete_group_variable: DELETE groups/:group_id/variables/:variable_key group_members.yml100644000766000024 60213621075102 21524 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - group_members: members = GET groups/:group_id/members? - all_group_members: members = GET groups/:group_id/members/all? - group_member: member = GET groups/:project_id/members/:user_id - add_group_member: member = POST groups/:group_id/members? - update_group_member: member = PUT groups/:group_id/members/:user_id? - remove_group_member: DELETE groups/:group_id/members/:user_id group_milestones.yml100644000766000024 77013621075102 22262 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - group_milestones: milestones = GET groups/:group_id/milestones? - group_milestone: milestone = GET groups/:group_id/milestones/:milestone_id - create_group_milestone: milestone = POST groups/:group_id/milestones? - edit_group_milestone: milestone = PUT groups/:group_id/milestones/:milestone_id? - group_milestone_issues: issues = GET groups/:group_id/milestones/:milestone_id/issues? - group_milestone_merge_requests: merge_requests = GET groups/:group_id/milestones/:milestone_id/merge_requests? groups.yml100644000766000024 123113621075102 20214 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - groups: groups = GET groups? - group_subgroups: subgroups = GET groups/:group_id/subgroups? - group_projects: projects = GET groups/:group_id/projects? - group: group = GET groups/:group_id? - create_group: POST groups? - transfer_project_to_group: POST groups/:group_id/projects/:project_id - edit_group: group = PUT groups/:group_id? - delete_group: DELETE groups/:group_id - sync_group_with_ldap: POST groups/:group_id/ldap_sync - create_ldap_group_link: POST groups/:group_id/ldap_group_links? - delete_ldap_group_link: DELETE groups/:group_id/ldap_group_links/:cn - delete_ldap_provider_group_link: DELETE groups/:group_id/ldap_group_links/:provider/:cn issues.yml100644000766000024 255213621075102 20217 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - global_issues: issues = GET issues? - group_issues: issues = GET groups/:group_id/issues? - issues: issues = GET projects/:project_id/issues? - issue: issue = GET projects/:project_id/issues/:issue_iid - create_issue: issue = POST projects/:project_id/issues? - edit_issue: issue = PUT projects/:project_id/issues/:issue_iid? - delete_issue: DELETE projects/:project_id/issues/:issue_iid - move_issue: issue = POST projects/:project_id/issues/:issue_iid/move? - subscribe_to_issue: issue = POST projects/:project_id/issues/:issue_iid/subscribe - unsubscribe_from_issue: issue = POST projects/:project_id/issues/:issue_iid/unsubscribe - create_issue_todo: todo = POST projects/:project_id/issues/:issue_iid/todo - set_issue_time_estimate: tracking = POST projects/:project_id/issues/:issue_iid/time_estimate? - reset_issue_time_estimate: tracking = POST projects/:project_id/issues/:issue_iid/reset_time_estimate - add_issue_spent_time: tracking = POST projects/:project_id/issues/:issue_iid/add_spent_time? - reset_issue_spent_time: tracking = POST projects/:project_id/issues/:issue_iid/reset_spent_time - issue_time_stats: tracking = GET projects/:project_id/issues/:issue_iid/time_stats - issue_closed_by: merge_requests = GET projects/:project_id/issues/:issue_iid/closed_by - issue_user_agent_detail: user_agent = GET projects/:project_id/issues/:issue_iid/user_agent_detail jobs.yml100644000766000024 152213621075102 17635 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - jobs: jobs = GET projects/:project_id/jobs? - pipeline_jobs: jobs = GET projects/:project_id/pipelines/:pipeline_id/jobs? - job: job = GET projects/:project_id/jobs/:job_id - job_artifacts: artifacts = GET projects/:project_id/jobs/:job_id/artifacts - job_artifacts_archive: archive = GET projects/:project_id/jobs/artifacts/:ref_name/download? - job_artifacts_file: file = GET projects/:project_id/jobs/:job_id/artifacts/:artifact_path - job_trace_file: file = GET projects/:project_id/jobs/:job_id/trace - cancel_job: job = POST projects/:project_id/jobs/:job_id/cancel - retry_job: job = POST projects/:project_id/jobs/:job_id/retry - erase_job: job = POST projects/:project_id/jobs/:job_id/erase - keep_job_artifacts: job = POST projects/:project_id/jobs/:job_id/artifacts/keep - play_job: job = POST projects/:project_id/jobs/:job_id/play keys.yml100644000766000024 4213621075102 17607 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - key: key = GET keys/:key_id labels.yml100644000766000024 60113621075102 20117 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - labels: labels = GET projects/:project_id/labels? - create_label: label = POST projects/:project_id/labels? - delete_label: DELETE projects/:project_id/labels? - edit_label: label = PUT projects/:project_id/labels? - subscribe_to_label: label = POST projects/:project_id/labels/:label_id/subscribe - unsubscribe_from_label: POST projects/:project_id/labels/:label_id/unsubscribe licenses_templates.yml100644000766000024 20213621075102 22535 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - license_templates: templates = GET templates/licenses? - license_template: template = GET templates/licenses/:template_key? lint.yml100644000766000024 4013621075102 17600 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - lint: result = POST lint? markdown.yml100644000766000024 4613621075102 20462 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - markdown: html = POST markdown? merge_requests.yml100644000766000024 431513621075102 21735 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - global_merge_requests: merge_requests = GET merge_requests? - merge_requests: merge_requests = GET projects/:project_id/merge_requests? - merge_request: merge_request = GET projects/:project_id/merge_requests/:merge_request_iid - merge_request_commits: commits = GET projects/:project_id/merge_requests/:merge_request_iid/commits - merge_request_with_changes: merge_request = GET projects/:project_id/merge_requests/:merge_request_iid/changes - create_merge_request: merge_request = POST projects/:project_id/merge_requests? - edit_merge_request: merge_request = PUT projects/:project_id/merge_requests/:merge_request_iid? - delete_merge_request: DELETE projects/:project_id/merge_requests/:merge_request_iid - accept_merge_request: merge_request = PUT projects/:project_id/merge_requests/:merge_request_iid/merge? - cancel_merge_when_pipeline_succeeds: merge_request = PUT projects/:project_id/merge_requests/:merge_request_iid/cancel_merge_when_pipeline_succeeds - merge_request_closes_issues: issues = GET projects/:project_id/merge_requests/:merge_request_iid/closes_issues? - subscribe_to_merge_request: merge_request = POST projects/:project_id/merge_requests/:merge_request_iid/subscribe - unsubscribe_from_merge_request: merge_request = POST projects/:project_id/merge_requests/:merge_request_iid/unsubscribe - create_merge_request_todo: todo = POST projects/:project_id/merge_requests/:merge_request_iid/todo - merge_request_diff_versions: versions = GET projects/:project_id/merge_requests/:merge_request_iid/versions - merge_request_diff_version: version = GET projects/:project_id/merge_requests/:merge_request_iid/versions/:version_id - set_merge_request_time_estimate: tracking = POST projects/:project_id/merge_requests/:merge_request_iid/time_estimate? - reset_merge_request_time_estimate: tracking = POST projects/:project_id/merge_requests/:merge_request_iid/reset_time_estimate - add_merge_request_spent_time: tracking = POST projects/:project_id/merge_requests/:merge_request_iid/add_spent_time? - reset_merge_request_spent_time: tracking = POST projects/:project_id/merge_requests/:merge_request_iid/reset_spent_time - merge_request_time_stats: tracking = GET projects/:project_id/merge_requests/:merge_request_iid/time_stats milestones.yml100644000766000024 103413621075102 21060 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - project_milestones: milestones = GET projects/:project_id/milestones? - project_milestone: milestone = GET projects/:project_id/milestones/:milestone_id - create_project_milestone: milestone = POST projects/:project_id/milestones? - edit_project_milestone: milestone = PUT projects/:project_id/milestones/:milestone_id? - project_milestone_issues: issues = GET projects/:project_id/milestones/:milestone_id/issues? - project_milestone_merge_requests: merge_requests = GET projects/:project_id/milestones/:milestone_id/merge_requests? namespaces.yml100644000766000024 14513621075102 20777 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - namespaces: namespaces = GET namespaces? - namespace: namespace = GET namespaces/:namespace_id notes.yml100644000766000024 245413621075102 20035 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - issue_notes: notes = GET projects/:project_id/issues/:issue_iid/notes? - issue_note: note = GET projects/:project_id/issues/:issue_iid/notes/:note_id - create_issue_note: note = POST projects/:project_id/issues/:issue_iid/notes? - edit_issue_note: PUT projects/:project_id/issues/:issue_iid/notes/:note_id? - delete_issue_note: DELETE projects/:project_id/issues/:issue_iid/notes/:note_id - snippet_notes: notes = GET projects/:project_id/snippets/:snippet_id/notes? - snippet_note: note = GET projects/:project_id/snippets/:snippet_id/notes/:note_id - create_snippet_note: note = POST projects/:project_id/snippets/:snippet_id/notes? - edit_snippet_note: PUT projects/:project_id/snippets/:snippet_id/notes/:note_id? - delete_snippet_note: DELETE projects/:project_id/snippets/:snippet_id/notes/:note_id - merge_request_notes: notes = GET projects/:project_id/merge_requests/:merge_request_iid/notes? - merge_request_note: note = GET projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id - create_merge_request_note: note = POST projects/:project_id/merge_requests/:merge_request_iid/notes? - edit_merge_request_note: PUT projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id? - delete_merge_request_note: DELETE projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id notification_settings.yml100644000766000024 77513621075102 23277 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - global_notification_settings: settings = GET notification_settings - set_global_notification_settings: settings = PUT notification_settings? - group_notification_settings: settings = GET groups/:group_id/notification_settings - project_notification_settings: settings = GET projects/:project_id/notification_settings - set_group_notification_settings: settings = PUT groups/:group_id/notification_settings? - set_project_notification_settings: settings = PUT projects/:project_id/notification_settings? page_domains.yml100644000766000024 64413621075102 21312 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - global_pages_domains: domains = GET pages/domains? - pages_domains: domains = GET projects/:project_id/pages/domains? - pages_domain: domain = GET projects/:project_id/pages/domains/:domain - create_pages_domain: domain = POST projects/:project_id/pages/domains? - edit_pages_domain: domain = PUT projects/:project_id/pages/domains/:domain? - delete_pages_domain: DELETE projects/:project_id/pages/domains/:domain pipeline_schedules.yml100644000766000024 176613621075102 22556 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - pipeline_schedules: schedules = GET projects/:project_id/pipeline_schedules? - pipeline_schedule: schedule = GET projects/:project_id/pipeline_schedules/:pipeline_schedule_id - create_pipeline_schedule: schedule = POST projects/:project_id/pipeline_schedules? - edit_pipeline_schedule: schedule = PUT projects/:project_id/pipeline_schedules/:pipeline_schedule_id? - take_ownership_of_pipeline_schedule: schedule = POST projects/:project_id/pipeline_schedules/:pipeline_schedule_id/take_ownership - delete_pipeline_schedule: schedule = DELETE projects/:project_id/pipeline_schedules/:pipeline_schedule_id - create_pipeline_schedule_variable: variable = POST projects/:project_id/pipeline_schedules/:pipeline_schedule_id/variables? - edit_pipeline_schedule_variable: variable = PUT projects/:project_id/pipeline_schedules/:pipeline_schedule_id/variables/:variable_key? - delete_pipeline_schedule_variable: variable = DELETE projects/:project_id/pipeline_schedules/:pipeline_schedule_id/variables/:variable_key pipeline_triggers.yml100644000766000024 251113621075102 22412 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - triggers: triggers = GET projects/:project_id/triggers? - trigger: trigger = GET projects/:project_id/triggers/:trigger_id - create_trigger: trigger = POST projects/:project_id/triggers? - edit_trigger: trigger = PUT projects/:project_id/triggers/:trigger_id? - take_ownership_of_trigger: trigger = POST projects/:project_id/triggers/:trigger_id/take_ownership - delete_trigger: DELETE projects/:project_id/triggers/:trigger_id - method: trigger_pipeline spec: pipeline = POST projects/:project_id/trigger/pipeline? note: | The API authentication token (L or L parameters in a constructor) is not needed when using this method, however You must pass trigger token (generated at the trigger creation) as C field and git ref name as C field in the C<%params> hash. You can also pass variables to be set in a pipeline in the C field. Example: my $pipeline = $api->trigger_pipeline( $project_id, { token => 'd69dba9162ab6ac72fa0993496286ada', 'ref' => 'master', variables => { variable1 => 'value1', variable2 => 'value2', }, }, ); Read more at L. pipelines.yml100644000766000024 177713621075102 20704 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - pipelines: pipelines = GET projects/:project_id/pipelines? - pipeline: pipeline = GET projects/:project_id/pipelines/:pipeline_id - method: create_pipeline spec: pipeline = POST projects/:project_id/pipeline? note: | Git ref (branch or tag) name must be specified in the C field of the C<%params> hash. It's also possible to pass variables to a pipeline in the C field like in the following example: my $pipeline = $api->create_pipeline( $project_id, { 'ref' => 'master', variables => [ { 'key' => 'VARIABLE1', 'value' => 'VALUE1' }, { 'key' => 'VARIABLE2', 'value' => 'VALUE2' }, ], }, ); - retry_pipeline_jobs: pipeline = POST projects/:project_id/pipelines/:pipeline_id/retry - cancel_pipeline_jobs: pipeline = POST projects/:project_id/pipelines/:pipeline_id/cancel - delete_pipeline: DELETE projects/:project_id/pipelines/:pipeline_id project_access_requests.yml100644000766000024 51413621075102 23602 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - project_access_requests: requests = GET projects/:project_id/access_requests? - request_project_access: request = POST projects/:project_id/access_requests - approve_project_access: request = PUT projects/:project_id/access_requests/:user_id/approve - deny_project_access: DELETE projects/:project_id/access_requests/:user_id project_badges.yml100644000766000024 63513621075102 21637 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - project_badges: badges = GET projects/:project_id/badges - project_badge: badge = GET projects/:project_id/badges/:badge_id - create_project_badge: badge = POST projects/:project_id/badges? - edit_project_badge: badge = PUT projects/:project_id/badges/:badge_id? - delete_project_badge: DELETE projects/:project_id/badges/:badge_id - preview_project_badge: preview = GET projects/:project_id/badges/render? project_import_export.yml100644000766000024 50513621075102 23321 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - schedule_project_export: POST projects/:project_id/export? - project_export_status: status = GET projects/:project_id/export - download_project_export: download = GET projects/:project_id/export/download - schedule_project_import: POST projects/import? - project_import_status: status = GET projects/:project_id/import project_level_variables.yml100644000766000024 61113621075102 23543 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - project_variables: variables = GET projects/:project_id/variables? - project_variable: variable = GET projects/:project_id/variables/:variable_key - create_project_variable: variable = POST projects/:project_id/variables? - edit_project_variable: variable = PUT projects/:project_id/variables/:variable_key? - delete_project_variable: DELETE projects/:project_id/variables/:variable_key project_members.yml100644000766000024 64413621075102 22044 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - project_members: members = GET projects/:project_id/members? - all_project_members: members = GET projects/:project_id/members/all? - project_member: member = GET projects/:project_id/members/:user_id - add_project_member: member = POST projects/:project_id/members? - update_project_member: member = PUT projects/:project_id/members/:user_id? - remove_project_member: DELETE projects/:project_id/members/:user_id project_snippets.yml100644000766000024 105213621075102 22271 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - project_snippets: snippets = GET projects/:project_id/snippets? - project_snippet: snippet = GET projects/:project_id/snippets/:snippet_id - create_project_snippet: POST projects/:project_id/snippets? - edit_project_snippet: PUT projects/:project_id/snippets/:snippet_id? - delete_project_snippet: DELETE projects/:project_id/snippets/:snippet_id - project_snippet_content: content = GET projects/:project_id/snippets/:snippet_id/raw - project_snippet_user_agent_detail: user_agent = GET projects/:project_id/snippets/:snippet_id/user_agent_detail projects.yml100644000766000024 342113621075102 20531 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - projects: projects = GET projects? - user_projects: projects = GET users/:user_id/projects? - project: project = GET projects/:project_id? - project_users: users = GET projects/:project_id/users? - create_project: project = POST projects? - create_project_for_user: POST projects/user/:user_id? - edit_project: PUT projects/:project_id? - fork_project: POST projects/:project_id/fork? - project_forks: forks = GET projects/:project_id/forks? - start_project: project = POST projects/:project_id/star - unstar_project: project = POST projects/:project_id/unstar - project_languages: languages = GET projects/:project_id/languages - archive_project: project = POST projects/:project_id/archive - unarchive_project: project = POST projects/:project_id/unarchive - delete_project: DELETE projects/:project_id - method: upload_file_to_project spec: upload = POST projects/:project_id/uploads? note: The C parameter must point to a readable file on the local filesystem. - share_project_with_group: POST projects/:project_id/share? - unshare_project_with_group: DELETE projects/:project_id/share/:group_id - project_hooks: hooks = GET projects/:project_id/hooks - project_hook: hook = GET projects/:project_id/hooks/:hook_id - create_project_hook: hook = POST projects/:project_id/hooks? - edit_project_hook: hook = PUT projects/:project_id/hooks/:hook_id? - delete_project_hook: DELETE projects/:project_id/hooks/:hook_id - set_project_fork: POST projects/:project_id/fork/:from_project_id - clear_project_fork: DELETE projects/:project_id/fork - start_housekeeping: POST projects/:project_id/housekeeping - transfer_project_to_namespace: PUT projects/:project_id/transfer? # TODO: Support undecoded responses, maybe more. #- download_project_snapshot: snapshot = GET projects/:project_id/snapshot protected_branches.yml100644000766000024 50113621075102 22512 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - protected_branches: branches = GET projects/:project_id/protected_branches? - protected_branch: branch = GET projects/:project_id/protected_branches/:branch_name - protect_branch: branch = POST projects/:project_id/protected_branches? - unprotect_branch: DELETE projects/:project_id/protected_branches/:branch_name protected_tags.yml100644000766000024 42413621075102 21667 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - protected_tags: tags = GET projects/:project_id/protected_tags? - protected_tag: tag = GET projects/:project_id/protected_tags/:tag_name - protect_tag: tag = POST projects/:project_id/protected_tags? - unprotect_tag: DELETE projects/:project_id/protected_tags/:tag_name release_links.yml100644000766000024 71513621075102 21503 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - release_links: links = GET projects/:project_id/releases/:tag_name/assets/links? - release_link: link = GET projects/:project_id/releases/:tag_name/assets/links/:link_id - create_release_link: link = POST projects/:project_id/releases/:tag_name/assets/links? - update_release_link: link = PUT projects/:project_id/releases/:tag_name/assets/links/:link_id? - delete_release_link: link = DELETE projects/:project_id/releases/:tag_name/assets/links/:link_id releases.yml100644000766000024 52313621075102 20463 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - releases: releases = GET projects/:project_id/releases? - release: release = GET projects/:project_id/releases/:tag_name - create_release: release = POST projects/:project_id/releases? - update_release: release = PUT projects/:project_id/releases/:tag_name? - delete_release: release = DELETE projects/:project_id/releases/:tag_name repositories.yml100644000766000024 67613621075102 21420 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - tree: tree = GET projects/:project_id/repository/tree? - blob: blob = GET projects/:project_id/repository/blobs/:sha - raw_blob: raw_blob = GET projects/:project_id/repository/blobs/:sha/raw - method: archive spec: archive = GET projects/:project_id/repository/archive? no_decode: true - compare: comparison = GET projects/:project_id/repository/compare? - contributors: contributors = GET projects/:project_id/repository/contributors? repository_files.yml100644000766000024 61313621075102 22261 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - file: file = GET projects/:project_id/repository/files/:file_path? - method: raw_file spec: content = GET projects/:project_id/repository/files/:file_path/raw? no_decode: true - create_file: POST projects/:project_id/repository/files/:file_path? - edit_file: PUT projects/:project_id/repository/files/:file_path? - delete_file: DELETE projects/:project_id/repository/files/:file_path? resource_label_events.yml100644000766000024 100713621075102 23250 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - issue_resource_label_events: events = GET projects/:project_id/issues/:issue_iid/resource_label_events - issue_resource_label_event: event = GET projects/:project_id/issues/:issue_iid/resource_label_events/:resource_label_event_id - merge_request_resource_label_events: events = GET projects/:project_id/merge_requests/:merge_request_iid/resource_label_events - merge_request_resource_label_event: event = GET projects/:project_id/merge_requests/:merge_request_iid/resource_label_events/:resource_label_event_id runners.yml100644000766000024 74013621075102 20355 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - runners: runners = GET runners? - all_runners: runners = GET runners/all? - runner: runner = GET runners/:runner_id - update_runner: runner = PUT runners/:runner_id? - delete_runner: DELETE runners/:runner_id - runner_jobs: jobs = GET runners/:runner_id/jobs? - project_runners: runners = GET projects/:project_id/runners? - enable_project_runner: runner = POST projects/:project_id/runners? - disable_project_runner: runner = DELETE projects/:project_id/runners/:runner_id search.yml100644000766000024 4413621075102 20103 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - search: results = GET search? services.yml100644000766000024 34713621075102 20507 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - project_service: service = GET projects/:project_id/services/:service_name - edit_project_service: PUT projects/:project_id/services/:service_name? - delete_project_service: DELETE projects/:project_id/services/:service_name settings.yml100644000766000024 15413621075102 20520 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - settings: settings = GET application/settings - update_settings: settings = PUT application/settings? sidekiq_metrics.yml100644000766000024 33013621075102 22033 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - queue_metrics: metrics = GET sidekiq/queue_metrics - process_metrics: metrics = GET sidekiq/process_metrics - job_stats: stats = GET sidekiq/job_stats - compound_metrics: metrics = GET sidekiq/compound_metrics snippets.yml100644000766000024 55313621075102 20530 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - snippets: snippets = GET snippets - snippet: snippet = GET snippets/:snippet_id - create_snippet: snippet = POST snippets? - edit_snippet: snippet = PUT snippets/:snippet_id? - delete_snippet: DELETE snippets/:snippet_id - public_snippets: snippets = GET snippets/public? - snippet_user_agent_detail: user_agent = GET snippets/:snippet_id/user_agent_detail statistics.yml100644000766000024 7213621075102 21031 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - statistics: statistics = GET application/statistics system_hooks.yml100644000766000024 20713621075102 21406 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - hooks: hooks = GET hooks? - create_hook: POST hooks? - test_hook: hook = GET hooks/:hook_id - delete_hook: DELETE hooks/:hook_id tags.yml100644000766000024 67113621075102 17622 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - tags: tags = GET projects/:project_id/repository/tags? - tag: tag = GET projects/:project_id/repository/tags/:tag_name - create_tag: tag = POST projects/:project_id/repository/tags? - delete_tag: DELETE projects/:project_id/repository/tags/:tag_name - create_tag_release: release = POST projects/:project_id/repository/tags/:tag_name/release? - update_tag_release: release = PUT projects/:project_id/repository/tags/:tag_name/release? todos.yml100644000766000024 21113621075102 20002 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - todos: todos = GET todos? - mark_todo_done: todo = POST todos/:todo_id/mark_as_done - mark_all_todos_done: POST todos/mark_as_done users.yml100644000766000024 356613621075102 20053 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - users: users = GET users? - user: user = GET users/:user_id - create_user: POST users? - edit_user: PUT users/:user_id? - delete_user: DELETE users/:user_id? - current_user: user = GET user - current_user_ssh_keys: keys = GET user/keys? - user_ssh_keys: keys = GET users/:user_id/keys? - user_ssh_key: key = GET user/keys/:key_id - create_current_user_ssh_key: POST user/keys? - create_user_ssh_key: POST users/:user_id/keys? - delete_current_user_ssh_key: DELETE user/keys/:key_id - delete_user_ssh_key: DELETE users/:user_id/keys/:key_id - current_user_gpg_keys: keys = GET user/gpg_keys? - current_user_gpg_key: key = GET user/gpg_keys/:key_id - create_current_user_gpg_key: POST user/gpg_keys? - delete_current_user_gpg_key: DELETE user/gpg_keys/:key_id - user_gpg_keys: keys = GET users/:user_id/gpg_keys? - user_gpg_key: key = GET users/:user_id/gpg_keys/:key_id - create_user_gpg_key: keys = POST users/:user_id/gpg_keys? - delete_user_gpg_key: DELETE users/:user_id/gpg_keys/:key_id - current_user_emails: emails = GET user/emails? - user_emails: emails = GET users/:user_id/emails? - current_user_email: email = GET user/emails/:email_id - create_current_user_email: email = POST user/emails? - create_user_email: email = POST users/:user_id/emails? - delete_current_user_email: DELETE user/emails/:email_id - delete_user_email: DELETE users/:user_id/emails/:email_id - block_user: success = POST users/:user_id/block - unblock_user: success = POST users/:user_id/unblock - user_impersonation_tokens: tokens = GET users/:user_id/impersonation_tokens? - user_impersonation_token: token = GET users/:user_id/impersonation_tokens/:impersonation_token_id - create_user_impersonation_token: token = POST users/:user_id/impersonation_tokens? - delete_user_impersonation_token: DELETE users/:user_id/impersonation_tokens/:impersonation_token_id - all_user_activities: activities = GET user/activities? version.yml100644000766000024 4513621075102 20324 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - version: version = GET version wikis.yml100644000766000024 45313621075102 20010 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author/sections--- - wiki_pages: pages = GET projects/:project_id/wikis? - wiki_page: pages = GET projects/:project_id/wikis/:slug - create_wiki_page: page = POST projects/:project_id/wikis? - edit_wiki_page: page = PUT projects/:project_id/wikis/:slug? - delete_wiki_page: DELETE projects/:project_id/wikis/:slug setup-test-container100755000766000024 123213621075102 20347 0ustar00aranstaff000000000000GitLab-API-v4-0.25/author#!/bin/sh docker stop test-gitlab-api-v4 sleep 5 docker run -d --rm \ -p 80:80 \ --name test-gitlab-api-v4 \ gitlab/gitlab-ce:11.10.4-ce.0 echo 1. Open you browser to: http://localhost \(it may take several minutes for it to respond\) echo 2. And set a password for the root user. echo 3. Then login and goto: http://localhost/profile/personal_access_tokens echo 4. Create a new private token \(use this token below\). echo 5. Then set the following env vars: echo export GITLAB_API_V4_URL=http://localhost/api/v4 echo export GITLAB_API_V4_PRIVATE_TOKEN= echo export GITLAB_API_V4_ROOT_PASSWORD= echo 6. You should now be able to run: t/regression.t cpanfile100644000766000024 213413621075102 14530 0ustar00aranstaff000000000000GitLab-API-v4-0.25requires 'perl' => '5.010001'; # Common modules. requires 'Moo' => '2.003000'; requires 'strictures' => '2.000003'; requires 'namespace::clean' => '0.27'; requires 'Types::Standard' => '1.002001'; requires 'Types::Common::String' => '1.002001'; requires 'Types::Common::Numeric' => '1.002001'; requires 'Log::Any' => '1.703'; requires 'Carp' => 0; requires 'JSON' => '2.59'; # Used by GitLab::API::v4::RESTClient. requires 'HTTP::Tiny' => '0.059'; requires 'HTTP::Tiny::Multipart' => '0.05'; requires 'URI' => '1.62'; requires 'URI::Escape' => '1.72'; # Used by GitLab::API::v4::Constants. requires 'Const::Fast' => '0.014'; requires 'Exporter' => 0; # Used by gitlab-api-v4 and/or GitLab::API::v4::Config. requires 'Try::Tiny' => '0.28'; requires 'Getopt::Long' => 0; requires 'Pod::Usage' => 0; requires 'Log::Any::Adapter' => '1.703'; requires 'Log::Any::Adapter::Screen' => '0.13'; requires 'Path::Tiny' => '0.079'; requires 'IO::Prompter' => '0.004014'; on test => sub { requires 'Test2::V0' => '0.000094'; requires 'Log::Any::Adapter::TAP' => '0.003003'; requires 'MIME::Base64' => '3.15'; }; v4.pm100644000766000024 135050713621075102 16327 0ustar00aranstaff000000000000GitLab-API-v4-0.25/lib/GitLab/APIpackage GitLab::API::v4; our $VERSION = '0.25'; =encoding utf8 =head1 NAME GitLab::API::v4 - A complete GitLab API v4 client. =head1 SYNOPSIS use GitLab::API::v4; my $api = GitLab::API::v4->new( url => $v4_api_url, private_token => $token, ); my $branches = $api->branches( $project_id ); =head1 DESCRIPTION This module provides a one-to-one interface with the GitLab API v4. Much is not documented here as it would just be duplicating GitLab's own L. Note that this distribution also includes the L command-line interface (CLI). =head2 Upgrading If you are upgrading from L make sure you read: L Also, review the C file included in the distribution as it outlines the changes made to convert the v3 module to v4: L Finally, be aware that many methods were added, removed, renamed, and/or altered. If you want to review exactly what was changed you can use GitHub's compare tool: L Or clone the repo and run this command: C =head2 Credentials Authentication credentials may be defined by setting either the L or L arguments. If no credentials are supplied then the client will be anonymous and greatly limited in what it can do with the API. Extra care has been taken to hide the token arguments behind closures. This way, if you dump your api object, your tokens won't accidentally leak into places you don't want them to. =head2 Constants The GitLab API, in rare cases, uses a hard-coded value to represent a state. To make life easier the L module exposes these states as named variables. =head2 Exceptions The API methods will all throw a useful exception if an unsuccessful response is received from the API. That is except for C requests that return a C<404> response - these will return C for methods that return a value. If you'd like to catch and handle these exceptions consider using L. =head2 Logging This module uses L and produces some debug messages here and there, but the most useful bits are the info messages produced just before each API call. =head2 Project ID Note that many API calls require a C<$project_id>. This can be specified as a numeric project C or, in many cases, maybe all cases, as a C string. The GitLab documentation on this point is vague. =cut use Carp qw( croak ); use GitLab::API::v4::Paginator; use GitLab::API::v4::RESTClient; use Log::Any qw( $log ); use Types::Common::Numeric -types; use Types::Common::String -types; use Types::Standard -types; use Moo; use strictures 2; use namespace::clean; sub BUILD { my ($self) = @_; # Ensure any token arguments get moved into their closure before we return # the built object. $self->access_token(); $self->private_token(); $log->debugf( "An instance of %s has been created.", ref($self) ); return; } sub _call_rest_client { my ($self, $verb, $path, $path_vars, $options) = @_; $options->{headers} = $self->_auth_headers(); return $self->rest_client->request( $verb, $path, $path_vars, $options, ); } sub _auth_headers { my ($self) = @_; my $headers = {}; $headers->{'authorization'} = 'Bearer ' . $self->access_token() if defined $self->access_token(); $headers->{'private-token'} = $self->private_token() if defined $self->private_token(); $headers->{'sudo'} = $self->sudo_user() if defined $self->sudo_user(); return $headers; } sub _clone_args { my ($self) = @_; return { url => $self->url(), retries => $self->retries(), rest_client => $self->rest_client(), (defined $self->access_token()) ? (access_token=>$self->access_token()) : (), (defined $self->private_token()) ? (private_token=>$self->private_token()) : (), }; } sub _clone { my $self = shift; my $class = ref $self; my $args = { %{ $self->_clone_args() }, %{ $class->BUILDARGS( @_ ) }, }; return $class->new( $args ); } # Little utility method that avoids any ambiguity in whether a closer is # causing circular references. Don't ever pass it a ref. sub _make_safe_closure { my ($ret) = @_; return sub{ $ret }; } =head1 REQUIRED ARGUMENTS =head2 url The URL to your v4 API endpoint. Typically this will be something like C. =cut has url => ( is => 'ro', isa => NonEmptySimpleStr, required => 1, ); =head1 OPTIONAL ARGUMENTS =head2 access_token A GitLab API OAuth2 token. If set then L may not be set. See L. =cut has _access_token_arg => ( is => 'ro', isa => NonEmptySimpleStr, init_arg => 'access_token', clearer => '_clear_access_token_arg', ); has _access_token_closure => ( is => 'lazy', isa => CodeRef, init_arg => undef, builder => '_build_access_token_closure', ); sub _build_access_token_closure { my ($self) = @_; my $token = $self->_access_token_arg(); $self->_clear_access_token_arg(); return _make_safe_closure( $token ); } sub access_token { my ($self) = @_; return $self->_access_token_closure->(); } =head2 private_token A GitLab API personal token. If set then L may not be set. See L. =cut has _private_token_arg => ( is => 'ro', isa => NonEmptySimpleStr, init_arg => 'private_token', clearer => '_clear_private_token_arg', ); has _private_token_closure => ( is => 'lazy', isa => CodeRef, init_arg => undef, builder => '_build_private_token_closure', ); sub _build_private_token_closure { my ($self) = @_; my $token = $self->_private_token_arg(); $self->_clear_private_token_arg(); return _make_safe_closure( $token ); } sub private_token { my ($self) = @_; return $self->_private_token_closure->(); } =head2 retries The number of times the request should be retried in case it fails (5XX HTTP response code). Defaults to C<0> (false), meaning that a failed request will not be retried. =cut has retries => ( is => 'ro', isa => PositiveOrZeroInt, default => 0, ); =head2 sudo_user The user to execute API calls as. You may find it more useful to use the L method instead. See L. =cut has sudo_user => ( is => 'ro', isa => NonEmptySimpleStr, ); =head2 rest_client An instance of L (or whatever L is set to). Typically you will not be setting this as it defaults to a new instance and customization should not be necessary. =cut has rest_client => ( is => 'lazy', isa => InstanceOf[ 'GitLab::API::v4::RESTClient' ], ); sub _build_rest_client { my ($self) = @_; return $self->rest_client_class->new( base_url => $self->url(), retries => $self->retries(), ); } =head2 rest_client_class The class to use when constructing the L. Defaults to L. =cut has rest_client_class => ( is => 'lazy', isa => NonEmptySimpleStr, ); sub _build_rest_client_class { return 'GitLab::API::v4::RESTClient'; } =head1 UTILITY METHODS =head2 paginator my $paginator = $api->paginator( $method, @method_args ); my $members = $api->paginator('group_members', $group_id); while (my $member = $members->next()) { ... } my $users_pager = $api->paginator('users'); while (my $users = $users_pager->next_page()) { ... } my $all_open_issues = $api->paginator( 'issues', $project_id, { state=>'opened' }, )->all(); Given a method who supports the C and C parameters, and returns an array ref, this will return a L object that will allow you to walk the records one page or one record at a time. =cut sub paginator { my ($self, $method, @args) = @_; my $params = (ref($args[-1]) eq 'HASH') ? pop(@args) : {}; return GitLab::API::v4::Paginator->new( api => $self, method => $method, args => \@args, params => $params, ); } =head2 sudo $api->sudo('fred')->create_issue(...); Returns a new instance of L with the L argument set. See L. =cut sub sudo { my ($self, $user) = @_; return $self->_clone( sudo_user => $user, ); } =head1 API METHODS =head2 Award Emoji See L. =over =item issue_award_emojis my $award_emojis = $api->issue_award_emojis( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub issue_award_emojis { my $self = shift; croak 'issue_award_emojis must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to issue_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to issue_award_emojis must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/award_emoji', [@_], $options ); } =item merge_request_award_emojis my $award_emojis = $api->merge_request_award_emojis( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_award_emojis { my $self = shift; croak 'merge_request_award_emojis must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to merge_request_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to merge_request_award_emojis must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/award_emoji', [@_], $options ); } =item snippet_award_emojis my $award_emojis = $api->snippet_award_emojis( $project_id, $merge_request_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub snippet_award_emojis { my $self = shift; croak 'snippet_award_emojis must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to snippet_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_id) to snippet_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to snippet_award_emojis must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_id/award_emoji', [@_], $options ); } =item issue_award_emoji my $award_emoji = $api->issue_award_emoji( $project_id, $issue_iid, $award_id, ); Sends a C request to C and returns the decoded response content. =cut sub issue_award_emoji { my $self = shift; croak 'issue_award_emoji must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to issue_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($award_id) to issue_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/award_emoji/:award_id', [@_], $options ); } =item merge_request_award_emoji my $award_emoji = $api->merge_request_award_emoji( $project_id, $merge_request_iid, $award_id, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_award_emoji { my $self = shift; croak 'merge_request_award_emoji must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to merge_request_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($award_id) to merge_request_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/award_emoji/:award_id', [@_], $options ); } =item snippet_award_emoji my $award_emoji = $api->snippet_award_emoji( $project_id, $snippet_id, $award_id, ); Sends a C request to C and returns the decoded response content. =cut sub snippet_award_emoji { my $self = shift; croak 'snippet_award_emoji must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to snippet_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to snippet_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($award_id) to snippet_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/snippets/:snippet_id/award_emoji/:award_id', [@_], $options ); } =item create_issue_award_emoji my $award_emoji = $api->create_issue_award_emoji( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_issue_award_emoji { my $self = shift; croak 'create_issue_award_emoji must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_issue_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to create_issue_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_issue_award_emoji must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/award_emoji', [@_], $options ); } =item create_merge_request_award_emoji my $award_emoji = $api->create_merge_request_award_emoji( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_merge_request_award_emoji { my $self = shift; croak 'create_merge_request_award_emoji must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_merge_request_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to create_merge_request_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_merge_request_award_emoji must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests/:merge_request_iid/award_emoji', [@_], $options ); } =item create_snippet_award_emoji my $award_emoji = $api->create_snippet_award_emoji( $project_id, $snippet_id, ); Sends a C request to C and returns the decoded response content. =cut sub create_snippet_award_emoji { my $self = shift; croak 'create_snippet_award_emoji must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to create_snippet_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to create_snippet_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/snippets/:snippet_id/award_emoji', [@_], $options ); } =item delete_issue_award_emoji my $award_emoji = $api->delete_issue_award_emoji( $project_id, $issue_id, $award_id, ); Sends a C request to C and returns the decoded response content. =cut sub delete_issue_award_emoji { my $self = shift; croak 'delete_issue_award_emoji must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_issue_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_id) to delete_issue_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($award_id) to delete_issue_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'DELETE', 'projects/:project_id/issues/:issue_id/award_emoji/:award_id', [@_], $options ); } =item delete_merge_request_award_emoji my $award_emoji = $api->delete_merge_request_award_emoji( $project_id, $merge_request_id, $award_id, ); Sends a C request to C and returns the decoded response content. =cut sub delete_merge_request_award_emoji { my $self = shift; croak 'delete_merge_request_award_emoji must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_merge_request_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_id) to delete_merge_request_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($award_id) to delete_merge_request_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'DELETE', 'projects/:project_id/merge_requests/:merge_request_id/award_emoji/:award_id', [@_], $options ); } =item delete_snippet_award_emoji my $award_emoji = $api->delete_snippet_award_emoji( $project_id, $snippet_id, $award_id, ); Sends a C request to C and returns the decoded response content. =cut sub delete_snippet_award_emoji { my $self = shift; croak 'delete_snippet_award_emoji must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_snippet_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to delete_snippet_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($award_id) to delete_snippet_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'DELETE', 'projects/:project_id/snippets/:snippet_id/award_emoji/:award_id', [@_], $options ); } =item issue_note_award_emojis my $award_emojis = $api->issue_note_award_emojis( $project_id, $issue_iid, $note_id, ); Sends a C request to C and returns the decoded response content. =cut sub issue_note_award_emojis { my $self = shift; croak 'issue_note_award_emojis must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to issue_note_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_note_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to issue_note_award_emojis must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/notes/:note_id/award_emoji', [@_], $options ); } =item issue_note_award_emoji my $award_emoji = $api->issue_note_award_emoji( $project_id, $issue_iid, $note_id, $award_id, ); Sends a C request to C and returns the decoded response content. =cut sub issue_note_award_emoji { my $self = shift; croak 'issue_note_award_emoji must be called with 4 arguments' if @_ != 4; croak 'The #1 argument ($project_id) to issue_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to issue_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($award_id) to issue_note_award_emoji must be a scalar' if ref($_[3]) or (!defined $_[3]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id', [@_], $options ); } =item create_issue_note_award_emoji my $award_emoji = $api->create_issue_note_award_emoji( $project_id, $issue_iid, $note_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_issue_note_award_emoji { my $self = shift; croak 'create_issue_note_award_emoji must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to create_issue_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to create_issue_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to create_issue_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to create_issue_note_award_emoji must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/notes/:note_id/award_emoji', [@_], $options ); } =item delete_issue_note_award_emoji my $award_emoji = $api->delete_issue_note_award_emoji( $project_id, $issue_iid, $note_id, $award_id, ); Sends a C request to C and returns the decoded response content. =cut sub delete_issue_note_award_emoji { my $self = shift; croak 'delete_issue_note_award_emoji must be called with 4 arguments' if @_ != 4; croak 'The #1 argument ($project_id) to delete_issue_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to delete_issue_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to delete_issue_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($award_id) to delete_issue_note_award_emoji must be a scalar' if ref($_[3]) or (!defined $_[3]); my $options = {}; return $self->_call_rest_client( 'DELETE', 'projects/:project_id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id', [@_], $options ); } =item merge_request_note_award_emojis my $award_emojis = $api->merge_request_note_award_emojis( $project_id, $merge_request_iid, $note_id, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_note_award_emojis { my $self = shift; croak 'merge_request_note_award_emojis must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to merge_request_note_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_note_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to merge_request_note_award_emojis must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji', [@_], $options ); } =item merge_request_note_award_emoji my $award_emoji = $api->merge_request_note_award_emoji( $project_id, $merge_request_iid, $note_id, $award_id, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_note_award_emoji { my $self = shift; croak 'merge_request_note_award_emoji must be called with 4 arguments' if @_ != 4; croak 'The #1 argument ($project_id) to merge_request_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to merge_request_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($award_id) to merge_request_note_award_emoji must be a scalar' if ref($_[3]) or (!defined $_[3]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji/:award_id', [@_], $options ); } =item create_merge_request_note_award_emoji my $award_emoji = $api->create_merge_request_note_award_emoji( $project_id, $merge_request_iid, $note_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_merge_request_note_award_emoji { my $self = shift; croak 'create_merge_request_note_award_emoji must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to create_merge_request_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to create_merge_request_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to create_merge_request_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to create_merge_request_note_award_emoji must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji', [@_], $options ); } =item delete_merge_request_note_award_emoji my $award_emoji = $api->delete_merge_request_note_award_emoji( $project_id, $merge_request_iid, $note_id, $award_id, ); Sends a C request to C and returns the decoded response content. =cut sub delete_merge_request_note_award_emoji { my $self = shift; croak 'delete_merge_request_note_award_emoji must be called with 4 arguments' if @_ != 4; croak 'The #1 argument ($project_id) to delete_merge_request_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to delete_merge_request_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to delete_merge_request_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($award_id) to delete_merge_request_note_award_emoji must be a scalar' if ref($_[3]) or (!defined $_[3]); my $options = {}; return $self->_call_rest_client( 'DELETE', 'projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji/:award_id', [@_], $options ); } =back =head2 Branches See L. =over =item branches my $branches = $api->branches( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub branches { my $self = shift; croak 'branches must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to branches must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to branches must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/branches', [@_], $options ); } =item branch my $branch = $api->branch( $project_id, $branch_name, ); Sends a C request to C and returns the decoded response content. =cut sub branch { my $self = shift; croak 'branch must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to branch must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($branch_name) to branch must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/branches/:branch_name', [@_], $options ); } =item create_branch my $branch = $api->create_branch( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_branch { my $self = shift; croak 'create_branch must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_branch must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/repository/branches', [@_], $options ); } =item delete_branch $api->delete_branch( $project_id, $branch_name, ); Sends a C request to C. =cut sub delete_branch { my $self = shift; croak 'delete_branch must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($branch_name) to delete_branch must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/repository/branches/:branch_name', [@_], $options ); return; } =item delete_merged_branches $api->delete_merged_branches( $project_id, ); Sends a C request to C. =cut sub delete_merged_branches { my $self = shift; croak 'delete_merged_branches must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to delete_merged_branches must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/repository/merged_branches', [@_], $options ); return; } =back =head2 Broadcast Messages See L. =over =item broadcast_messages my $messages = $api->broadcast_messages( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub broadcast_messages { my $self = shift; croak 'broadcast_messages must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to broadcast_messages must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'broadcast_messages', [@_], $options ); } =item broadcast_message my $message = $api->broadcast_message( $message_id, ); Sends a C request to C and returns the decoded response content. =cut sub broadcast_message { my $self = shift; croak 'broadcast_message must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($message_id) to broadcast_message must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'broadcast_messages/:message_id', [@_], $options ); } =item create_broadcast_message my $message = $api->create_broadcast_message( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_broadcast_message { my $self = shift; croak 'create_broadcast_message must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_broadcast_message must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'broadcast_messages', [@_], $options ); } =item edit_broadcast_message my $message = $api->edit_broadcast_message( $message_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_broadcast_message { my $self = shift; croak 'edit_broadcast_message must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($message_id) to edit_broadcast_message must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to edit_broadcast_message must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'broadcast_messages/:message_id', [@_], $options ); } =item delete_broadcast_message $api->delete_broadcast_message( $message_id, ); Sends a C request to C. =cut sub delete_broadcast_message { my $self = shift; croak 'delete_broadcast_message must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($message_id) to delete_broadcast_message must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'broadcast_messages/:message_id', [@_], $options ); return; } =back =head2 Project-level Variables See L. =over =item project_variables my $variables = $api->project_variables( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_variables { my $self = shift; croak 'project_variables must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_variables must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_variables must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/variables', [@_], $options ); } =item project_variable my $variable = $api->project_variable( $project_id, $variable_key, ); Sends a C request to C and returns the decoded response content. =cut sub project_variable { my $self = shift; croak 'project_variable must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($variable_key) to project_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/variables/:variable_key', [@_], $options ); } =item create_project_variable my $variable = $api->create_project_variable( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_project_variable { my $self = shift; croak 'create_project_variable must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_project_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_project_variable must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/variables', [@_], $options ); } =item edit_project_variable my $variable = $api->edit_project_variable( $project_id, $variable_key, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_project_variable { my $self = shift; croak 'edit_project_variable must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_project_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($variable_key) to edit_project_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_project_variable must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/variables/:variable_key', [@_], $options ); } =item delete_project_variable $api->delete_project_variable( $project_id, $variable_key, ); Sends a C request to C. =cut sub delete_project_variable { my $self = shift; croak 'delete_project_variable must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_project_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($variable_key) to delete_project_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/variables/:variable_key', [@_], $options ); return; } =back =head2 Group-level Variables See L. =over =item group_variables my $variables = $api->group_variables( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub group_variables { my $self = shift; croak 'group_variables must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group_variables must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group_variables must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:group_id/variables', [@_], $options ); } =item group_variable my $variable = $api->group_variable( $group_id, $variable_key, ); Sends a C request to C and returns the decoded response content. =cut sub group_variable { my $self = shift; croak 'group_variable must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to group_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($variable_key) to group_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'groups/:group_id/variables/:variable_key', [@_], $options ); } =item create_group_variable my $variable = $api->create_group_variable( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_group_variable { my $self = shift; croak 'create_group_variable must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to create_group_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_group_variable must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'groups/:group_id/variables', [@_], $options ); } =item edit_group_variable my $variable = $api->edit_group_variable( $group_id, $variable_key, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_group_variable { my $self = shift; croak 'edit_group_variable must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($group_id) to edit_group_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($variable_key) to edit_group_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_group_variable must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'groups/:group_id/variables/:variable_key', [@_], $options ); } =item delete_group_variable $api->delete_group_variable( $group_id, $variable_key, ); Sends a C request to C. =cut sub delete_group_variable { my $self = shift; croak 'delete_group_variable must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to delete_group_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($variable_key) to delete_group_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'groups/:group_id/variables/:variable_key', [@_], $options ); return; } =back =head2 Snippets See L. =over =item snippets my $snippets = $api->snippets(); Sends a C request to C and returns the decoded response content. =cut sub snippets { my $self = shift; croak "The snippets method does not take any arguments" if @_; my $options = {}; return $self->_call_rest_client( 'GET', 'snippets', [@_], $options ); } =item snippet my $snippet = $api->snippet( $snippet_id, ); Sends a C request to C and returns the decoded response content. =cut sub snippet { my $self = shift; croak 'snippet must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($snippet_id) to snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'snippets/:snippet_id', [@_], $options ); } =item create_snippet my $snippet = $api->create_snippet( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_snippet { my $self = shift; croak 'create_snippet must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_snippet must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'snippets', [@_], $options ); } =item edit_snippet my $snippet = $api->edit_snippet( $snippet_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_snippet { my $self = shift; croak 'edit_snippet must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($snippet_id) to edit_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to edit_snippet must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'snippets/:snippet_id', [@_], $options ); } =item delete_snippet $api->delete_snippet( $snippet_id, ); Sends a C request to C. =cut sub delete_snippet { my $self = shift; croak 'delete_snippet must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($snippet_id) to delete_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'snippets/:snippet_id', [@_], $options ); return; } =item public_snippets my $snippets = $api->public_snippets( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub public_snippets { my $self = shift; croak 'public_snippets must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to public_snippets must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'snippets/public', [@_], $options ); } =item snippet_user_agent_detail my $user_agent = $api->snippet_user_agent_detail( $snippet_id, ); Sends a C request to C and returns the decoded response content. =cut sub snippet_user_agent_detail { my $self = shift; croak 'snippet_user_agent_detail must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($snippet_id) to snippet_user_agent_detail must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'snippets/:snippet_id/user_agent_detail', [@_], $options ); } =back =head2 Commits See L. =over =item commits my $commits = $api->commits( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub commits { my $self = shift; croak 'commits must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to commits must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to commits must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/commits', [@_], $options ); } =item create_commit my $commit = $api->create_commit( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_commit { my $self = shift; croak 'create_commit must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_commit must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_commit must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/repository/commits', [@_], $options ); } =item commit my $commit = $api->commit( $project_id, $commit_sha, ); Sends a C request to C and returns the decoded response content. =cut sub commit { my $self = shift; croak 'commit must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to commit must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to commit must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/commits/:commit_sha', [@_], $options ); } =item commit_refs my $refs = $api->commit_refs( $project_id, $commit_sha, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub commit_refs { my $self = shift; croak 'commit_refs must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to commit_refs must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to commit_refs must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to commit_refs must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/commits/:commit_sha/refs', [@_], $options ); } =item cherry_pick_commit my $commit = $api->cherry_pick_commit( $project_id, $commit_sha, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub cherry_pick_commit { my $self = shift; croak 'cherry_pick_commit must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to cherry_pick_commit must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to cherry_pick_commit must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to cherry_pick_commit must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/repository/commits/:commit_sha/cherry_pick', [@_], $options ); } =item commit_diff my $diff = $api->commit_diff( $project_id, $commit_sha, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub commit_diff { my $self = shift; croak 'commit_diff must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to commit_diff must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to commit_diff must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to commit_diff must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/commits/:commit_sha/diff', [@_], $options ); } =item commit_comments my $comments = $api->commit_comments( $project_id, $commit_sha, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub commit_comments { my $self = shift; croak 'commit_comments must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to commit_comments must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to commit_comments must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to commit_comments must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/commits/:commit_sha/comments', [@_], $options ); } =item create_commit_comment $api->create_commit_comment( $project_id, $commit_sha, \%params, ); Sends a C request to C. =cut sub create_commit_comment { my $self = shift; croak 'create_commit_comment must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_commit_comment must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to create_commit_comment must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_commit_comment must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'projects/:project_id/repository/commits/:commit_sha/comments', [@_], $options ); return; } =item commit_statuses my $build_statuses = $api->commit_statuses( $project_id, $commit_sha, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub commit_statuses { my $self = shift; croak 'commit_statuses must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to commit_statuses must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to commit_statuses must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to commit_statuses must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/commits/:commit_sha/statuses', [@_], $options ); } =item create_commit_status my $build_status = $api->create_commit_status( $project_id, $commit_sha, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_commit_status { my $self = shift; croak 'create_commit_status must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_commit_status must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to create_commit_status must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_commit_status must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/statuses/:commit_sha', [@_], $options ); } =back =head2 Container Registry See L. =over =item registry_repositories_in_project my $registry_repositories = $api->registry_repositories_in_project( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub registry_repositories_in_project { my $self = shift; croak 'registry_repositories_in_project must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to registry_repositories_in_project must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to registry_repositories_in_project must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/registry/repositories', [@_], $options ); } =item registry_repositories_in_group my $registry_repositories = $api->registry_repositories_in_group( $id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub registry_repositories_in_group { my $self = shift; croak 'registry_repositories_in_group must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($id) to registry_repositories_in_group must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to registry_repositories_in_group must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:id/registry/repositories', [@_], $options ); } =item delete_registry_repository $api->delete_registry_repository( $project_id, $repository_id, ); Sends a C request to C. =cut sub delete_registry_repository { my $self = shift; croak 'delete_registry_repository must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_registry_repository must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($repository_id) to delete_registry_repository must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/registry/repositories/:repository_id', [@_], $options ); return; } =item registry_repository_tags my $tags = $api->registry_repository_tags( $project_id, $repository_id, ); Sends a C request to C and returns the decoded response content. =cut sub registry_repository_tags { my $self = shift; croak 'registry_repository_tags must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to registry_repository_tags must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($repository_id) to registry_repository_tags must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/registry/repositories/:repository_id/tags', [@_], $options ); } =item registry_repository_tag my $tag = $api->registry_repository_tag( $project_id, $repository_id, $tag_name, ); Sends a C request to C and returns the decoded response content. =cut sub registry_repository_tag { my $self = shift; croak 'registry_repository_tag must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to registry_repository_tag must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($repository_id) to registry_repository_tag must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($tag_name) to registry_repository_tag must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/registry/repositories/:repository_id/tags/:tag_name', [@_], $options ); } =item delete_registry_repository_tag $api->delete_registry_repository_tag( $project_id, $repository_id, $tag_name, ); Sends a C request to C. =cut sub delete_registry_repository_tag { my $self = shift; croak 'delete_registry_repository_tag must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_registry_repository_tag must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($repository_id) to delete_registry_repository_tag must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($tag_name) to delete_registry_repository_tag must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/registry/repositories/:repository_id/tags/:tag_name', [@_], $options ); return; } =item bulk_delete_registry_repository_tags $api->bulk_delete_registry_repository_tags( $project_id, $repository_id, \%params, ); Sends a C request to C. =cut sub bulk_delete_registry_repository_tags { my $self = shift; croak 'bulk_delete_registry_repository_tags must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to bulk_delete_registry_repository_tags must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($repository_id) to bulk_delete_registry_repository_tags must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to bulk_delete_registry_repository_tags must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'DELETE', 'projects/:project_id/registry/repositories/:repository_id/tags', [@_], $options ); return; } =back =head2 Custom Attributes See L. =over =item custom_user_attributes my $attributes = $api->custom_user_attributes( $user_id, ); Sends a C request to C and returns the decoded response content. =cut sub custom_user_attributes { my $self = shift; croak 'custom_user_attributes must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($user_id) to custom_user_attributes must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'users/:user_id/custom_attributes', [@_], $options ); } =item custom_group_attributes my $attributes = $api->custom_group_attributes( $group_id, ); Sends a C request to C and returns the decoded response content. =cut sub custom_group_attributes { my $self = shift; croak 'custom_group_attributes must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to custom_group_attributes must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'groups/:group_id/custom_attributes', [@_], $options ); } =item custom_project_attributes my $attributes = $api->custom_project_attributes( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub custom_project_attributes { my $self = shift; croak 'custom_project_attributes must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to custom_project_attributes must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/custom_attributes', [@_], $options ); } =item custom_user_attribute my $attribute = $api->custom_user_attribute( $user_id, $attribute_key, ); Sends a C request to C and returns the decoded response content. =cut sub custom_user_attribute { my $self = shift; croak 'custom_user_attribute must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to custom_user_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to custom_user_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'users/:user_id/custom_attributes/:attribute_key', [@_], $options ); } =item custom_group_attribute my $attribute = $api->custom_group_attribute( $group_id, $attribute_key, ); Sends a C request to C and returns the decoded response content. =cut sub custom_group_attribute { my $self = shift; croak 'custom_group_attribute must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to custom_group_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to custom_group_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'groups/:group_id/custom_attributes/:attribute_key', [@_], $options ); } =item custom_project_attribute my $attribute = $api->custom_project_attribute( $project_id, $attribute_key, ); Sends a C request to C and returns the decoded response content. =cut sub custom_project_attribute { my $self = shift; croak 'custom_project_attribute must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to custom_project_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to custom_project_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/custom_attributes/:attribute_key', [@_], $options ); } =item set_custom_user_attribute my $attribute = $api->set_custom_user_attribute( $user_id, $attribute_key, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub set_custom_user_attribute { my $self = shift; croak 'set_custom_user_attribute must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($user_id) to set_custom_user_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to set_custom_user_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to set_custom_user_attribute must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'users/:user_id/custom_attributes/:attribute_key', [@_], $options ); } =item set_custom_group_attribute my $attribute = $api->set_custom_group_attribute( $group_id, $attribute_key, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub set_custom_group_attribute { my $self = shift; croak 'set_custom_group_attribute must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($group_id) to set_custom_group_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to set_custom_group_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to set_custom_group_attribute must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'groups/:group_id/custom_attributes/:attribute_key', [@_], $options ); } =item set_custom_project_attribute my $attribute = $api->set_custom_project_attribute( $project_id, $attribute_key, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub set_custom_project_attribute { my $self = shift; croak 'set_custom_project_attribute must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to set_custom_project_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to set_custom_project_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to set_custom_project_attribute must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/custom_attributes/:attribute_key', [@_], $options ); } =item delete_custom_user_attribute $api->delete_custom_user_attribute( $user_id, $attribute_key, ); Sends a C request to C. =cut sub delete_custom_user_attribute { my $self = shift; croak 'delete_custom_user_attribute must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to delete_custom_user_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to delete_custom_user_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'users/:user_id/custom_attributes/:attribute_key', [@_], $options ); return; } =item delete_custom_group_attribute $api->delete_custom_group_attribute( $group_id, $attribute_key, ); Sends a C request to C. =cut sub delete_custom_group_attribute { my $self = shift; croak 'delete_custom_group_attribute must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to delete_custom_group_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to delete_custom_group_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'groups/:group_id/custom_attributes/:attribute_key', [@_], $options ); return; } =item delete_custom_project_attribute $api->delete_custom_project_attribute( $project_id, $attribute_key, ); Sends a C request to C. =cut sub delete_custom_project_attribute { my $self = shift; croak 'delete_custom_project_attribute must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_custom_project_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to delete_custom_project_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/custom_attributes/:attribute_key', [@_], $options ); return; } =back =head2 Deployments See L. =over =item deployments my $deployments = $api->deployments( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub deployments { my $self = shift; croak 'deployments must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to deployments must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to deployments must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/deployments', [@_], $options ); } =item deployment my $deployment = $api->deployment( $project_id, $deployment_id, ); Sends a C request to C and returns the decoded response content. =cut sub deployment { my $self = shift; croak 'deployment must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to deployment must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($deployment_id) to deployment must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/deployments/:deployment_id', [@_], $options ); } =back =head2 Deploy Keys See L. =over =item all_deploy_keys my $keys = $api->all_deploy_keys( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub all_deploy_keys { my $self = shift; croak 'all_deploy_keys must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to all_deploy_keys must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'deploy_keys', [@_], $options ); } =item deploy_keys my $keys = $api->deploy_keys( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub deploy_keys { my $self = shift; croak 'deploy_keys must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to deploy_keys must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to deploy_keys must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/deploy_keys', [@_], $options ); } =item deploy_key my $key = $api->deploy_key( $project_id, $key_id, ); Sends a C request to C and returns the decoded response content. =cut sub deploy_key { my $self = shift; croak 'deploy_key must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to deploy_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($key_id) to deploy_key must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/deploy_keys/:key_id', [@_], $options ); } =item create_deploy_key my $key = $api->create_deploy_key( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_deploy_key { my $self = shift; croak 'create_deploy_key must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_deploy_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_deploy_key must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/deploy_keys', [@_], $options ); } =item delete_deploy_key $api->delete_deploy_key( $project_id, $key_id, ); Sends a C request to C. =cut sub delete_deploy_key { my $self = shift; croak 'delete_deploy_key must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_deploy_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($key_id) to delete_deploy_key must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/deploy_keys/:key_id', [@_], $options ); return; } =item enable_deploy_key my $key = $api->enable_deploy_key( $project_id, $key_id, ); Sends a C request to C and returns the decoded response content. =cut sub enable_deploy_key { my $self = shift; croak 'enable_deploy_key must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to enable_deploy_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($key_id) to enable_deploy_key must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/deploy_keys/:key_id/enable', [@_], $options ); } =back =head2 Environments See L. =over =item environments my $environments = $api->environments( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub environments { my $self = shift; croak 'environments must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to environments must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to environments must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/environments', [@_], $options ); } =item create_environment my $environment = $api->create_environment( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_environment { my $self = shift; croak 'create_environment must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_environment must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_environment must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/environments', [@_], $options ); } =item edit_environment my $environment = $api->edit_environment( $project_id, $environments_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_environment { my $self = shift; croak 'edit_environment must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_environment must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($environments_id) to edit_environment must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_environment must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/environments/:environments_id', [@_], $options ); } =item delete_environment $api->delete_environment( $project_id, $environment_id, ); Sends a C request to C. =cut sub delete_environment { my $self = shift; croak 'delete_environment must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_environment must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($environment_id) to delete_environment must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/environments/:environment_id', [@_], $options ); return; } =item stop_environment my $environment = $api->stop_environment( $project_id, $environment_id, ); Sends a C request to C and returns the decoded response content. =cut sub stop_environment { my $self = shift; croak 'stop_environment must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to stop_environment must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($environment_id) to stop_environment must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/environments/:environment_id/stop', [@_], $options ); } =back =head2 Events See L. =over =item all_events my $events = $api->all_events( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub all_events { my $self = shift; croak 'all_events must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to all_events must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'events', [@_], $options ); } =item user_events my $events = $api->user_events( $user_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub user_events { my $self = shift; croak 'user_events must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to user_events must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to user_events must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'users/:user_id/events', [@_], $options ); } =item project_events my $events = $api->project_events( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_events { my $self = shift; croak 'project_events must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_events must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_events must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/events', [@_], $options ); } =back =head2 Feature flags See L. =over =item features my $features = $api->features(); Sends a C request to C and returns the decoded response content. =cut sub features { my $self = shift; croak "The features method does not take any arguments" if @_; my $options = {}; return $self->_call_rest_client( 'GET', 'features', [@_], $options ); } =item set_feature my $feature = $api->set_feature( $name, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub set_feature { my $self = shift; croak 'set_feature must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($name) to set_feature must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to set_feature must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'features/:name', [@_], $options ); } =back =head2 Gitignores See L. =over =item gitignores_templates my $templates = $api->gitignores_templates( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub gitignores_templates { my $self = shift; croak 'gitignores_templates must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to gitignores_templates must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'templates/gitignores', [@_], $options ); } =item gitignores_template my $template = $api->gitignores_template( $template_key, ); Sends a C request to C and returns the decoded response content. =cut sub gitignores_template { my $self = shift; croak 'gitignores_template must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($template_key) to gitignores_template must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'templates/gitignores/:template_key', [@_], $options ); } =back =head2 GitLab CI YMLs See L. =over =item gitlab_ci_ymls_templates my $templates = $api->gitlab_ci_ymls_templates( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub gitlab_ci_ymls_templates { my $self = shift; croak 'gitlab_ci_ymls_templates must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to gitlab_ci_ymls_templates must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'templates/gitlab_ci_ymls', [@_], $options ); } =item gitlab_ci_ymls_template my $template = $api->gitlab_ci_ymls_template( $template_key, ); Sends a C request to C and returns the decoded response content. =cut sub gitlab_ci_ymls_template { my $self = shift; croak 'gitlab_ci_ymls_template must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($template_key) to gitlab_ci_ymls_template must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'templates/gitlab_ci_ymls/:template_key', [@_], $options ); } =back =head2 Groups See L. =over =item groups my $groups = $api->groups( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub groups { my $self = shift; croak 'groups must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to groups must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups', [@_], $options ); } =item group_subgroups my $subgroups = $api->group_subgroups( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub group_subgroups { my $self = shift; croak 'group_subgroups must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group_subgroups must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group_subgroups must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:group_id/subgroups', [@_], $options ); } =item group_projects my $projects = $api->group_projects( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub group_projects { my $self = shift; croak 'group_projects must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group_projects must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group_projects must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:group_id/projects', [@_], $options ); } =item group my $group = $api->group( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub group { my $self = shift; croak 'group must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:group_id', [@_], $options ); } =item create_group $api->create_group( \%params, ); Sends a C request to C. =cut sub create_group { my $self = shift; croak 'create_group must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_group must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'groups', [@_], $options ); return; } =item transfer_project_to_group $api->transfer_project_to_group( $group_id, $project_id, ); Sends a C request to C. =cut sub transfer_project_to_group { my $self = shift; croak 'transfer_project_to_group must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to transfer_project_to_group must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($project_id) to transfer_project_to_group must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'POST', 'groups/:group_id/projects/:project_id', [@_], $options ); return; } =item edit_group my $group = $api->edit_group( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_group { my $self = shift; croak 'edit_group must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to edit_group must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to edit_group must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'groups/:group_id', [@_], $options ); } =item delete_group $api->delete_group( $group_id, ); Sends a C request to C. =cut sub delete_group { my $self = shift; croak 'delete_group must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to delete_group must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'groups/:group_id', [@_], $options ); return; } =item sync_group_with_ldap $api->sync_group_with_ldap( $group_id, ); Sends a C request to C. =cut sub sync_group_with_ldap { my $self = shift; croak 'sync_group_with_ldap must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to sync_group_with_ldap must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'POST', 'groups/:group_id/ldap_sync', [@_], $options ); return; } =item create_ldap_group_link $api->create_ldap_group_link( $group_id, \%params, ); Sends a C request to C. =cut sub create_ldap_group_link { my $self = shift; croak 'create_ldap_group_link must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to create_ldap_group_link must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_ldap_group_link must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'groups/:group_id/ldap_group_links', [@_], $options ); return; } =item delete_ldap_group_link $api->delete_ldap_group_link( $group_id, $cn, ); Sends a C request to C. =cut sub delete_ldap_group_link { my $self = shift; croak 'delete_ldap_group_link must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to delete_ldap_group_link must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($cn) to delete_ldap_group_link must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'groups/:group_id/ldap_group_links/:cn', [@_], $options ); return; } =item delete_ldap_provider_group_link $api->delete_ldap_provider_group_link( $group_id, $provider, $cn, ); Sends a C request to C. =cut sub delete_ldap_provider_group_link { my $self = shift; croak 'delete_ldap_provider_group_link must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($group_id) to delete_ldap_provider_group_link must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($provider) to delete_ldap_provider_group_link must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($cn) to delete_ldap_provider_group_link must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'groups/:group_id/ldap_group_links/:provider/:cn', [@_], $options ); return; } =back =head2 Group access requests See L. =over =item group_access_requests my $requests = $api->group_access_requests( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub group_access_requests { my $self = shift; croak 'group_access_requests must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group_access_requests must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group_access_requests must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:group_id/access_requests', [@_], $options ); } =item request_group_access my $request = $api->request_group_access( $group_id, ); Sends a C request to C and returns the decoded response content. =cut sub request_group_access { my $self = shift; croak 'request_group_access must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to request_group_access must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'POST', 'groups/:group_id/access_requests', [@_], $options ); } =item approve_group_access my $request = $api->approve_group_access( $group_id, $user_id, ); Sends a C request to C and returns the decoded response content. =cut sub approve_group_access { my $self = shift; croak 'approve_group_access must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to approve_group_access must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to approve_group_access must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'PUT', 'groups/:group_id/access_requests/:user_id/approve', [@_], $options ); } =item deny_group_access $api->deny_group_access( $group_id, $user_id, ); Sends a C request to C. =cut sub deny_group_access { my $self = shift; croak 'deny_group_access must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to deny_group_access must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to deny_group_access must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'groups/:group_id/access_requests/:user_id', [@_], $options ); return; } =back =head2 Group badges See L. =over =item group_badges my $badges = $api->group_badges( $group_id, ); Sends a C request to C and returns the decoded response content. =cut sub group_badges { my $self = shift; croak 'group_badges must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to group_badges must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'groups/:group_id/badges', [@_], $options ); } =item group_badge my $badge = $api->group_badge( $group_id, $badge_id, ); Sends a C request to C and returns the decoded response content. =cut sub group_badge { my $self = shift; croak 'group_badge must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to group_badge must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($badge_id) to group_badge must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'groups/:group_id/badges/:badge_id', [@_], $options ); } =item create_group_badge my $badge = $api->create_group_badge( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_group_badge { my $self = shift; croak 'create_group_badge must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to create_group_badge must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_group_badge must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'groups/:group_id/badges', [@_], $options ); } =item edit_group_badge my $badge = $api->edit_group_badge( $group_id, $badge_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_group_badge { my $self = shift; croak 'edit_group_badge must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($group_id) to edit_group_badge must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($badge_id) to edit_group_badge must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_group_badge must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'groups/:group_id/badges/:badge_id', [@_], $options ); } =item delete_group_badge $api->delete_group_badge( $group_id, $badge_id, ); Sends a C request to C. =cut sub delete_group_badge { my $self = shift; croak 'delete_group_badge must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to delete_group_badge must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($badge_id) to delete_group_badge must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'groups/:group_id/badges/:badge_id', [@_], $options ); return; } =item preview_group_badge my $preview = $api->preview_group_badge( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub preview_group_badge { my $self = shift; croak 'preview_group_badge must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to preview_group_badge must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to preview_group_badge must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:group_id/badges/render', [@_], $options ); } =back =head2 Group members See L. =over =item group_members my $members = $api->group_members( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub group_members { my $self = shift; croak 'group_members must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group_members must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group_members must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:group_id/members', [@_], $options ); } =item all_group_members my $members = $api->all_group_members( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub all_group_members { my $self = shift; croak 'all_group_members must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to all_group_members must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to all_group_members must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:group_id/members/all', [@_], $options ); } =item group_member my $member = $api->group_member( $project_id, $user_id, ); Sends a C request to C and returns the decoded response content. =cut sub group_member { my $self = shift; croak 'group_member must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to group_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to group_member must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'groups/:project_id/members/:user_id', [@_], $options ); } =item add_group_member my $member = $api->add_group_member( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub add_group_member { my $self = shift; croak 'add_group_member must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to add_group_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to add_group_member must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'groups/:group_id/members', [@_], $options ); } =item update_group_member my $member = $api->update_group_member( $group_id, $user_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub update_group_member { my $self = shift; croak 'update_group_member must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($group_id) to update_group_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to update_group_member must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to update_group_member must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'groups/:group_id/members/:user_id', [@_], $options ); } =item remove_group_member $api->remove_group_member( $group_id, $user_id, ); Sends a C request to C. =cut sub remove_group_member { my $self = shift; croak 'remove_group_member must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to remove_group_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to remove_group_member must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'groups/:group_id/members/:user_id', [@_], $options ); return; } =back =head2 Issues See L. =over =item global_issues my $issues = $api->global_issues( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub global_issues { my $self = shift; croak 'global_issues must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to global_issues must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'issues', [@_], $options ); } =item group_issues my $issues = $api->group_issues( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub group_issues { my $self = shift; croak 'group_issues must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group_issues must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group_issues must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:group_id/issues', [@_], $options ); } =item issues my $issues = $api->issues( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub issues { my $self = shift; croak 'issues must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to issues must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to issues must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues', [@_], $options ); } =item issue my $issue = $api->issue( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded response content. =cut sub issue { my $self = shift; croak 'issue must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid', [@_], $options ); } =item create_issue my $issue = $api->create_issue( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_issue { my $self = shift; croak 'create_issue must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_issue must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues', [@_], $options ); } =item edit_issue my $issue = $api->edit_issue( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_issue { my $self = shift; croak 'edit_issue must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to edit_issue must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_issue must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/issues/:issue_iid', [@_], $options ); } =item delete_issue $api->delete_issue( $project_id, $issue_iid, ); Sends a C request to C. =cut sub delete_issue { my $self = shift; croak 'delete_issue must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to delete_issue must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/issues/:issue_iid', [@_], $options ); return; } =item move_issue my $issue = $api->move_issue( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub move_issue { my $self = shift; croak 'move_issue must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to move_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to move_issue must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to move_issue must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/move', [@_], $options ); } =item subscribe_to_issue my $issue = $api->subscribe_to_issue( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded response content. =cut sub subscribe_to_issue { my $self = shift; croak 'subscribe_to_issue must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to subscribe_to_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to subscribe_to_issue must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/subscribe', [@_], $options ); } =item unsubscribe_from_issue my $issue = $api->unsubscribe_from_issue( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded response content. =cut sub unsubscribe_from_issue { my $self = shift; croak 'unsubscribe_from_issue must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to unsubscribe_from_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to unsubscribe_from_issue must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/unsubscribe', [@_], $options ); } =item create_issue_todo my $todo = $api->create_issue_todo( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded response content. =cut sub create_issue_todo { my $self = shift; croak 'create_issue_todo must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to create_issue_todo must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to create_issue_todo must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/todo', [@_], $options ); } =item set_issue_time_estimate my $tracking = $api->set_issue_time_estimate( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub set_issue_time_estimate { my $self = shift; croak 'set_issue_time_estimate must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to set_issue_time_estimate must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to set_issue_time_estimate must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to set_issue_time_estimate must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/time_estimate', [@_], $options ); } =item reset_issue_time_estimate my $tracking = $api->reset_issue_time_estimate( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded response content. =cut sub reset_issue_time_estimate { my $self = shift; croak 'reset_issue_time_estimate must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to reset_issue_time_estimate must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to reset_issue_time_estimate must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/reset_time_estimate', [@_], $options ); } =item add_issue_spent_time my $tracking = $api->add_issue_spent_time( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub add_issue_spent_time { my $self = shift; croak 'add_issue_spent_time must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to add_issue_spent_time must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to add_issue_spent_time must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to add_issue_spent_time must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/add_spent_time', [@_], $options ); } =item reset_issue_spent_time my $tracking = $api->reset_issue_spent_time( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded response content. =cut sub reset_issue_spent_time { my $self = shift; croak 'reset_issue_spent_time must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to reset_issue_spent_time must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to reset_issue_spent_time must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/reset_spent_time', [@_], $options ); } =item issue_time_stats my $tracking = $api->issue_time_stats( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded response content. =cut sub issue_time_stats { my $self = shift; croak 'issue_time_stats must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to issue_time_stats must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_time_stats must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/time_stats', [@_], $options ); } =item issue_closed_by my $merge_requests = $api->issue_closed_by( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded response content. =cut sub issue_closed_by { my $self = shift; croak 'issue_closed_by must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to issue_closed_by must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_closed_by must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/closed_by', [@_], $options ); } =item issue_user_agent_detail my $user_agent = $api->issue_user_agent_detail( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded response content. =cut sub issue_user_agent_detail { my $self = shift; croak 'issue_user_agent_detail must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to issue_user_agent_detail must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_user_agent_detail must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/user_agent_detail', [@_], $options ); } =back =head2 Issue Boards See L. =over =item project_boards my $boards = $api->project_boards( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_boards { my $self = shift; croak 'project_boards must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_boards must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_boards must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/boards', [@_], $options ); } =item project_board_lists my $lists = $api->project_board_lists( $project_id, $board_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_board_lists { my $self = shift; croak 'project_board_lists must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to project_board_lists must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to project_board_lists must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to project_board_lists must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/boards/:board_id/lists', [@_], $options ); } =item project_board_list my $list = $api->project_board_list( $project_id, $board_id, $list_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_board_list { my $self = shift; croak 'project_board_list must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to project_board_list must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to project_board_list must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($list_id) to project_board_list must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/boards/:board_id/lists/:list_id', [@_], $options ); } =item create_project_board_list my $list = $api->create_project_board_list( $project_id, $board_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_project_board_list { my $self = shift; croak 'create_project_board_list must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_project_board_list must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to create_project_board_list must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_project_board_list must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/boards/:board_id/lists', [@_], $options ); } =item edit_project_board_list my $list = $api->edit_project_board_list( $project_id, $board_id, $list_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_project_board_list { my $self = shift; croak 'edit_project_board_list must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to edit_project_board_list must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to edit_project_board_list must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($list_id) to edit_project_board_list must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to edit_project_board_list must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/boards/:board_id/lists/:list_id', [@_], $options ); } =item delete_project_board_list $api->delete_project_board_list( $project_id, $board_id, $list_id, ); Sends a C request to C. =cut sub delete_project_board_list { my $self = shift; croak 'delete_project_board_list must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_project_board_list must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to delete_project_board_list must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($list_id) to delete_project_board_list must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/boards/:board_id/lists/:list_id', [@_], $options ); return; } =back =head2 Group Issue Boards See L. =over =item group_boards my $boards = $api->group_boards( $group_id, ); Sends a C request to C and returns the decoded response content. =cut sub group_boards { my $self = shift; croak 'group_boards must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to group_boards must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'groups/:group_id/boards', [@_], $options ); } =item group_board my $board = $api->group_board( $group_id, $board_id, ); Sends a C request to C and returns the decoded response content. =cut sub group_board { my $self = shift; croak 'group_board must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to group_board must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to group_board must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'groups/:group_id/boards/:board_id', [@_], $options ); } =item group_board_lists my $lists = $api->group_board_lists( $group_id, $board_id, ); Sends a C request to C and returns the decoded response content. =cut sub group_board_lists { my $self = shift; croak 'group_board_lists must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to group_board_lists must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to group_board_lists must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'groups/:group_id/boards/:board_id/lists', [@_], $options ); } =item group_board_list my $list = $api->group_board_list( $group_id, $board_id, $list_id, ); Sends a C request to C and returns the decoded response content. =cut sub group_board_list { my $self = shift; croak 'group_board_list must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($group_id) to group_board_list must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to group_board_list must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($list_id) to group_board_list must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'groups/:group_id/boards/:board_id/lists/:list_id', [@_], $options ); } =item create_group_board_list my $list = $api->create_group_board_list( $group_id, $board_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_group_board_list { my $self = shift; croak 'create_group_board_list must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($group_id) to create_group_board_list must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to create_group_board_list must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_group_board_list must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'groups/:group_id/boards/:board_id/lists', [@_], $options ); } =item edit_group_board_list my $list = $api->edit_group_board_list( $group_id, $board_id, $list_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_group_board_list { my $self = shift; croak 'edit_group_board_list must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($group_id) to edit_group_board_list must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to edit_group_board_list must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($list_id) to edit_group_board_list must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to edit_group_board_list must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'groups/:group_id/boards/:board_id/lists/:list_id', [@_], $options ); } =item delete_group_board_list $api->delete_group_board_list( $group_id, $board_id, $list_id, ); Sends a C request to C. =cut sub delete_group_board_list { my $self = shift; croak 'delete_group_board_list must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($group_id) to delete_group_board_list must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to delete_group_board_list must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($list_id) to delete_group_board_list must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'groups/:group_id/boards/:board_id/lists/:list_id', [@_], $options ); return; } =back =head2 Jobs See L. =over =item jobs my $jobs = $api->jobs( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub jobs { my $self = shift; croak 'jobs must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to jobs must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to jobs must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/jobs', [@_], $options ); } =item pipeline_jobs my $jobs = $api->pipeline_jobs( $project_id, $pipeline_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub pipeline_jobs { my $self = shift; croak 'pipeline_jobs must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to pipeline_jobs must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_id) to pipeline_jobs must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to pipeline_jobs must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/pipelines/:pipeline_id/jobs', [@_], $options ); } =item job my $job = $api->job( $project_id, $job_id, ); Sends a C request to C and returns the decoded response content. =cut sub job { my $self = shift; croak 'job must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to job must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to job must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/jobs/:job_id', [@_], $options ); } =item job_artifacts my $artifacts = $api->job_artifacts( $project_id, $job_id, ); Sends a C request to C and returns the decoded response content. =cut sub job_artifacts { my $self = shift; croak 'job_artifacts must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to job_artifacts must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to job_artifacts must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/jobs/:job_id/artifacts', [@_], $options ); } =item job_artifacts_archive my $archive = $api->job_artifacts_archive( $project_id, $ref_name, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub job_artifacts_archive { my $self = shift; croak 'job_artifacts_archive must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to job_artifacts_archive must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($ref_name) to job_artifacts_archive must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to job_artifacts_archive must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/jobs/artifacts/:ref_name/download', [@_], $options ); } =item job_artifacts_file my $file = $api->job_artifacts_file( $project_id, $job_id, $artifact_path, ); Sends a C request to C and returns the decoded response content. =cut sub job_artifacts_file { my $self = shift; croak 'job_artifacts_file must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to job_artifacts_file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to job_artifacts_file must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($artifact_path) to job_artifacts_file must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/jobs/:job_id/artifacts/:artifact_path', [@_], $options ); } =item job_trace_file my $file = $api->job_trace_file( $project_id, $job_id, ); Sends a C request to C and returns the decoded response content. =cut sub job_trace_file { my $self = shift; croak 'job_trace_file must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to job_trace_file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to job_trace_file must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/jobs/:job_id/trace', [@_], $options ); } =item cancel_job my $job = $api->cancel_job( $project_id, $job_id, ); Sends a C request to C and returns the decoded response content. =cut sub cancel_job { my $self = shift; croak 'cancel_job must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to cancel_job must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to cancel_job must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/jobs/:job_id/cancel', [@_], $options ); } =item retry_job my $job = $api->retry_job( $project_id, $job_id, ); Sends a C request to C and returns the decoded response content. =cut sub retry_job { my $self = shift; croak 'retry_job must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to retry_job must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to retry_job must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/jobs/:job_id/retry', [@_], $options ); } =item erase_job my $job = $api->erase_job( $project_id, $job_id, ); Sends a C request to C and returns the decoded response content. =cut sub erase_job { my $self = shift; croak 'erase_job must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to erase_job must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to erase_job must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/jobs/:job_id/erase', [@_], $options ); } =item keep_job_artifacts my $job = $api->keep_job_artifacts( $project_id, $job_id, ); Sends a C request to C and returns the decoded response content. =cut sub keep_job_artifacts { my $self = shift; croak 'keep_job_artifacts must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to keep_job_artifacts must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to keep_job_artifacts must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/jobs/:job_id/artifacts/keep', [@_], $options ); } =item play_job my $job = $api->play_job( $project_id, $job_id, ); Sends a C request to C and returns the decoded response content. =cut sub play_job { my $self = shift; croak 'play_job must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to play_job must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to play_job must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/jobs/:job_id/play', [@_], $options ); } =back =head2 Keys See L. =over =item key my $key = $api->key( $key_id, ); Sends a C request to C and returns the decoded response content. =cut sub key { my $self = shift; croak 'key must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($key_id) to key must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'keys/:key_id', [@_], $options ); } =back =head2 Labels See L. =over =item labels my $labels = $api->labels( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub labels { my $self = shift; croak 'labels must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to labels must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to labels must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/labels', [@_], $options ); } =item create_label my $label = $api->create_label( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_label { my $self = shift; croak 'create_label must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_label must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_label must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/labels', [@_], $options ); } =item delete_label $api->delete_label( $project_id, \%params, ); Sends a C request to C. =cut sub delete_label { my $self = shift; croak 'delete_label must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to delete_label must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to delete_label must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'DELETE', 'projects/:project_id/labels', [@_], $options ); return; } =item edit_label my $label = $api->edit_label( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_label { my $self = shift; croak 'edit_label must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to edit_label must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to edit_label must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/labels', [@_], $options ); } =item subscribe_to_label my $label = $api->subscribe_to_label( $project_id, $label_id, ); Sends a C request to C and returns the decoded response content. =cut sub subscribe_to_label { my $self = shift; croak 'subscribe_to_label must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to subscribe_to_label must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($label_id) to subscribe_to_label must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/labels/:label_id/subscribe', [@_], $options ); } =item unsubscribe_from_label $api->unsubscribe_from_label( $project_id, $label_id, ); Sends a C request to C. =cut sub unsubscribe_from_label { my $self = shift; croak 'unsubscribe_from_label must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to unsubscribe_from_label must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($label_id) to unsubscribe_from_label must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'POST', 'projects/:project_id/labels/:label_id/unsubscribe', [@_], $options ); return; } =back =head2 Markdown See L. =over =item markdown my $html = $api->markdown( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub markdown { my $self = shift; croak 'markdown must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to markdown must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'markdown', [@_], $options ); } =back =head2 Merge requests See L. =over =item global_merge_requests my $merge_requests = $api->global_merge_requests( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub global_merge_requests { my $self = shift; croak 'global_merge_requests must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to global_merge_requests must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'merge_requests', [@_], $options ); } =item merge_requests my $merge_requests = $api->merge_requests( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub merge_requests { my $self = shift; croak 'merge_requests must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to merge_requests must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to merge_requests must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests', [@_], $options ); } =item merge_request my $merge_request = $api->merge_request( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request { my $self = shift; croak 'merge_request must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid', [@_], $options ); } =item merge_request_commits my $commits = $api->merge_request_commits( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_commits { my $self = shift; croak 'merge_request_commits must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request_commits must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_commits must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/commits', [@_], $options ); } =item merge_request_with_changes my $merge_request = $api->merge_request_with_changes( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_with_changes { my $self = shift; croak 'merge_request_with_changes must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request_with_changes must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_with_changes must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/changes', [@_], $options ); } =item create_merge_request my $merge_request = $api->create_merge_request( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_merge_request { my $self = shift; croak 'create_merge_request must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_merge_request must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests', [@_], $options ); } =item edit_merge_request my $merge_request = $api->edit_merge_request( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_merge_request { my $self = shift; croak 'edit_merge_request must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to edit_merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_merge_request must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/merge_requests/:merge_request_iid', [@_], $options ); } =item delete_merge_request $api->delete_merge_request( $project_id, $merge_request_iid, ); Sends a C request to C. =cut sub delete_merge_request { my $self = shift; croak 'delete_merge_request must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to delete_merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/merge_requests/:merge_request_iid', [@_], $options ); return; } =item accept_merge_request my $merge_request = $api->accept_merge_request( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub accept_merge_request { my $self = shift; croak 'accept_merge_request must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to accept_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to accept_merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to accept_merge_request must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/merge_requests/:merge_request_iid/merge', [@_], $options ); } =item cancel_merge_when_pipeline_succeeds my $merge_request = $api->cancel_merge_when_pipeline_succeeds( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded response content. =cut sub cancel_merge_when_pipeline_succeeds { my $self = shift; croak 'cancel_merge_when_pipeline_succeeds must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to cancel_merge_when_pipeline_succeeds must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to cancel_merge_when_pipeline_succeeds must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'PUT', 'projects/:project_id/merge_requests/:merge_request_iid/cancel_merge_when_pipeline_succeeds', [@_], $options ); } =item merge_request_closes_issues my $issues = $api->merge_request_closes_issues( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_closes_issues { my $self = shift; croak 'merge_request_closes_issues must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to merge_request_closes_issues must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_closes_issues must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to merge_request_closes_issues must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/closes_issues', [@_], $options ); } =item subscribe_to_merge_request my $merge_request = $api->subscribe_to_merge_request( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded response content. =cut sub subscribe_to_merge_request { my $self = shift; croak 'subscribe_to_merge_request must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to subscribe_to_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to subscribe_to_merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests/:merge_request_iid/subscribe', [@_], $options ); } =item unsubscribe_from_merge_request my $merge_request = $api->unsubscribe_from_merge_request( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded response content. =cut sub unsubscribe_from_merge_request { my $self = shift; croak 'unsubscribe_from_merge_request must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to unsubscribe_from_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to unsubscribe_from_merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests/:merge_request_iid/unsubscribe', [@_], $options ); } =item create_merge_request_todo my $todo = $api->create_merge_request_todo( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded response content. =cut sub create_merge_request_todo { my $self = shift; croak 'create_merge_request_todo must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to create_merge_request_todo must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to create_merge_request_todo must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests/:merge_request_iid/todo', [@_], $options ); } =item merge_request_diff_versions my $versions = $api->merge_request_diff_versions( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_diff_versions { my $self = shift; croak 'merge_request_diff_versions must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request_diff_versions must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_diff_versions must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/versions', [@_], $options ); } =item merge_request_diff_version my $version = $api->merge_request_diff_version( $project_id, $merge_request_iid, $version_id, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_diff_version { my $self = shift; croak 'merge_request_diff_version must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to merge_request_diff_version must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_diff_version must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($version_id) to merge_request_diff_version must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/versions/:version_id', [@_], $options ); } =item set_merge_request_time_estimate my $tracking = $api->set_merge_request_time_estimate( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub set_merge_request_time_estimate { my $self = shift; croak 'set_merge_request_time_estimate must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to set_merge_request_time_estimate must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to set_merge_request_time_estimate must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to set_merge_request_time_estimate must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests/:merge_request_iid/time_estimate', [@_], $options ); } =item reset_merge_request_time_estimate my $tracking = $api->reset_merge_request_time_estimate( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded response content. =cut sub reset_merge_request_time_estimate { my $self = shift; croak 'reset_merge_request_time_estimate must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to reset_merge_request_time_estimate must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to reset_merge_request_time_estimate must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests/:merge_request_iid/reset_time_estimate', [@_], $options ); } =item add_merge_request_spent_time my $tracking = $api->add_merge_request_spent_time( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub add_merge_request_spent_time { my $self = shift; croak 'add_merge_request_spent_time must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to add_merge_request_spent_time must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to add_merge_request_spent_time must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to add_merge_request_spent_time must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests/:merge_request_iid/add_spent_time', [@_], $options ); } =item reset_merge_request_spent_time my $tracking = $api->reset_merge_request_spent_time( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded response content. =cut sub reset_merge_request_spent_time { my $self = shift; croak 'reset_merge_request_spent_time must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to reset_merge_request_spent_time must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to reset_merge_request_spent_time must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests/:merge_request_iid/reset_spent_time', [@_], $options ); } =item merge_request_time_stats my $tracking = $api->merge_request_time_stats( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_time_stats { my $self = shift; croak 'merge_request_time_stats must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request_time_stats must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_time_stats must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/time_stats', [@_], $options ); } =back =head2 Milestones See L. =over =item project_milestones my $milestones = $api->project_milestones( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_milestones { my $self = shift; croak 'project_milestones must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_milestones must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_milestones must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/milestones', [@_], $options ); } =item project_milestone my $milestone = $api->project_milestone( $project_id, $milestone_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_milestone { my $self = shift; croak 'project_milestone must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to project_milestone must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/milestones/:milestone_id', [@_], $options ); } =item create_project_milestone my $milestone = $api->create_project_milestone( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_project_milestone { my $self = shift; croak 'create_project_milestone must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_project_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_project_milestone must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/milestones', [@_], $options ); } =item edit_project_milestone my $milestone = $api->edit_project_milestone( $project_id, $milestone_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_project_milestone { my $self = shift; croak 'edit_project_milestone must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_project_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to edit_project_milestone must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_project_milestone must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/milestones/:milestone_id', [@_], $options ); } =item project_milestone_issues my $issues = $api->project_milestone_issues( $project_id, $milestone_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_milestone_issues { my $self = shift; croak 'project_milestone_issues must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to project_milestone_issues must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to project_milestone_issues must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to project_milestone_issues must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/milestones/:milestone_id/issues', [@_], $options ); } =item project_milestone_merge_requests my $merge_requests = $api->project_milestone_merge_requests( $project_id, $milestone_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_milestone_merge_requests { my $self = shift; croak 'project_milestone_merge_requests must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to project_milestone_merge_requests must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to project_milestone_merge_requests must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to project_milestone_merge_requests must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/milestones/:milestone_id/merge_requests', [@_], $options ); } =back =head2 Group milestones See L. =over =item group_milestones my $milestones = $api->group_milestones( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub group_milestones { my $self = shift; croak 'group_milestones must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group_milestones must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group_milestones must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:group_id/milestones', [@_], $options ); } =item group_milestone my $milestone = $api->group_milestone( $group_id, $milestone_id, ); Sends a C request to C and returns the decoded response content. =cut sub group_milestone { my $self = shift; croak 'group_milestone must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to group_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to group_milestone must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'groups/:group_id/milestones/:milestone_id', [@_], $options ); } =item create_group_milestone my $milestone = $api->create_group_milestone( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_group_milestone { my $self = shift; croak 'create_group_milestone must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to create_group_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_group_milestone must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'groups/:group_id/milestones', [@_], $options ); } =item edit_group_milestone my $milestone = $api->edit_group_milestone( $group_id, $milestone_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_group_milestone { my $self = shift; croak 'edit_group_milestone must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($group_id) to edit_group_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to edit_group_milestone must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_group_milestone must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'groups/:group_id/milestones/:milestone_id', [@_], $options ); } =item group_milestone_issues my $issues = $api->group_milestone_issues( $group_id, $milestone_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub group_milestone_issues { my $self = shift; croak 'group_milestone_issues must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($group_id) to group_milestone_issues must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to group_milestone_issues must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to group_milestone_issues must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:group_id/milestones/:milestone_id/issues', [@_], $options ); } =item group_milestone_merge_requests my $merge_requests = $api->group_milestone_merge_requests( $group_id, $milestone_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub group_milestone_merge_requests { my $self = shift; croak 'group_milestone_merge_requests must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($group_id) to group_milestone_merge_requests must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to group_milestone_merge_requests must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to group_milestone_merge_requests must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'groups/:group_id/milestones/:milestone_id/merge_requests', [@_], $options ); } =back =head2 Namespaces See L. =over =item namespaces my $namespaces = $api->namespaces( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub namespaces { my $self = shift; croak 'namespaces must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to namespaces must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'namespaces', [@_], $options ); } =item namespace my $namespace = $api->namespace( $namespace_id, ); Sends a C request to C and returns the decoded response content. =cut sub namespace { my $self = shift; croak 'namespace must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($namespace_id) to namespace must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'namespaces/:namespace_id', [@_], $options ); } =back =head2 Notes See L. =over =item issue_notes my $notes = $api->issue_notes( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub issue_notes { my $self = shift; croak 'issue_notes must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to issue_notes must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_notes must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to issue_notes must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/notes', [@_], $options ); } =item issue_note my $note = $api->issue_note( $project_id, $issue_iid, $note_id, ); Sends a C request to C and returns the decoded response content. =cut sub issue_note { my $self = shift; croak 'issue_note must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to issue_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to issue_note must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/notes/:note_id', [@_], $options ); } =item create_issue_note my $note = $api->create_issue_note( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_issue_note { my $self = shift; croak 'create_issue_note must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_issue_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to create_issue_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_issue_note must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/notes', [@_], $options ); } =item edit_issue_note $api->edit_issue_note( $project_id, $issue_iid, $note_id, \%params, ); Sends a C request to C. =cut sub edit_issue_note { my $self = shift; croak 'edit_issue_note must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to edit_issue_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to edit_issue_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to edit_issue_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to edit_issue_note must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id/issues/:issue_iid/notes/:note_id', [@_], $options ); return; } =item delete_issue_note $api->delete_issue_note( $project_id, $issue_iid, $note_id, ); Sends a C request to C. =cut sub delete_issue_note { my $self = shift; croak 'delete_issue_note must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_issue_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to delete_issue_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to delete_issue_note must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/issues/:issue_iid/notes/:note_id', [@_], $options ); return; } =item snippet_notes my $notes = $api->snippet_notes( $project_id, $snippet_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub snippet_notes { my $self = shift; croak 'snippet_notes must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to snippet_notes must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to snippet_notes must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to snippet_notes must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/snippets/:snippet_id/notes', [@_], $options ); } =item snippet_note my $note = $api->snippet_note( $project_id, $snippet_id, $note_id, ); Sends a C request to C and returns the decoded response content. =cut sub snippet_note { my $self = shift; croak 'snippet_note must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to snippet_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to snippet_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to snippet_note must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/snippets/:snippet_id/notes/:note_id', [@_], $options ); } =item create_snippet_note my $note = $api->create_snippet_note( $project_id, $snippet_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_snippet_note { my $self = shift; croak 'create_snippet_note must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_snippet_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to create_snippet_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_snippet_note must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/snippets/:snippet_id/notes', [@_], $options ); } =item edit_snippet_note $api->edit_snippet_note( $project_id, $snippet_id, $note_id, \%params, ); Sends a C request to C. =cut sub edit_snippet_note { my $self = shift; croak 'edit_snippet_note must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to edit_snippet_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to edit_snippet_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to edit_snippet_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to edit_snippet_note must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id/snippets/:snippet_id/notes/:note_id', [@_], $options ); return; } =item delete_snippet_note $api->delete_snippet_note( $project_id, $snippet_id, $note_id, ); Sends a C request to C. =cut sub delete_snippet_note { my $self = shift; croak 'delete_snippet_note must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_snippet_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to delete_snippet_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to delete_snippet_note must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/snippets/:snippet_id/notes/:note_id', [@_], $options ); return; } =item merge_request_notes my $notes = $api->merge_request_notes( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_notes { my $self = shift; croak 'merge_request_notes must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to merge_request_notes must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_notes must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to merge_request_notes must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/notes', [@_], $options ); } =item merge_request_note my $note = $api->merge_request_note( $project_id, $merge_request_iid, $note_id, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_note { my $self = shift; croak 'merge_request_note must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to merge_request_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to merge_request_note must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id', [@_], $options ); } =item create_merge_request_note my $note = $api->create_merge_request_note( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_merge_request_note { my $self = shift; croak 'create_merge_request_note must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_merge_request_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to create_merge_request_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_merge_request_note must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests/:merge_request_iid/notes', [@_], $options ); } =item edit_merge_request_note $api->edit_merge_request_note( $project_id, $merge_request_iid, $note_id, \%params, ); Sends a C request to C. =cut sub edit_merge_request_note { my $self = shift; croak 'edit_merge_request_note must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to edit_merge_request_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to edit_merge_request_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to edit_merge_request_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to edit_merge_request_note must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id', [@_], $options ); return; } =item delete_merge_request_note $api->delete_merge_request_note( $project_id, $merge_request_iid, $note_id, ); Sends a C request to C. =cut sub delete_merge_request_note { my $self = shift; croak 'delete_merge_request_note must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_merge_request_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to delete_merge_request_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to delete_merge_request_note must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/merge_requests/:merge_request_iid/notes/:note_id', [@_], $options ); return; } =back =head2 Discussions See L. =over =item issue_discussions my $discussions = $api->issue_discussions( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub issue_discussions { my $self = shift; croak 'issue_discussions must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to issue_discussions must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_discussions must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to issue_discussions must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/discussions', [@_], $options ); } =item issue_discussion my $discussion = $api->issue_discussion( $project_id, $issue_iid, $discussion_id, ); Sends a C request to C and returns the decoded response content. =cut sub issue_discussion { my $self = shift; croak 'issue_discussion must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to issue_discussion must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_discussion must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to issue_discussion must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/discussions/:discussion_id', [@_], $options ); } =item create_issue_discussion my $discussion = $api->create_issue_discussion( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_issue_discussion { my $self = shift; croak 'create_issue_discussion must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_issue_discussion must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to create_issue_discussion must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_issue_discussion must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/discussions', [@_], $options ); } =item create_issue_discussion_note $api->create_issue_discussion_note( $project_id, $issue_iid, $discussion_id, \%params, ); Sends a C request to C. =cut sub create_issue_discussion_note { my $self = shift; croak 'create_issue_discussion_note must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to create_issue_discussion_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to create_issue_discussion_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to create_issue_discussion_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to create_issue_discussion_note must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'projects/:project_id/issues/:issue_iid/discussions/:discussion_id/notes', [@_], $options ); return; } =item edit_issue_discussion_note $api->edit_issue_discussion_note( $project_id, $issue_iid, $discussion_id, $note_id, \%params, ); Sends a C request to C. =cut sub edit_issue_discussion_note { my $self = shift; croak 'edit_issue_discussion_note must be called with 4 to 5 arguments' if @_ < 4 or @_ > 5; croak 'The #1 argument ($project_id) to edit_issue_discussion_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to edit_issue_discussion_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to edit_issue_discussion_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($note_id) to edit_issue_discussion_note must be a scalar' if ref($_[3]) or (!defined $_[3]); croak 'The last argument (\%params) to edit_issue_discussion_note must be a hash ref' if defined($_[4]) and ref($_[4]) ne 'HASH'; my $params = (@_ == 5) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id', [@_], $options ); return; } =item delete_issue_discussion_note $api->delete_issue_discussion_note( $project_id, $issue_iid, $discussion_id, $note_id, ); Sends a C request to C. =cut sub delete_issue_discussion_note { my $self = shift; croak 'delete_issue_discussion_note must be called with 4 arguments' if @_ != 4; croak 'The #1 argument ($project_id) to delete_issue_discussion_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to delete_issue_discussion_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to delete_issue_discussion_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($note_id) to delete_issue_discussion_note must be a scalar' if ref($_[3]) or (!defined $_[3]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id', [@_], $options ); return; } =item project_snippet_discussions my $discussions = $api->project_snippet_discussions( $project_id, $snippet_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_snippet_discussions { my $self = shift; croak 'project_snippet_discussions must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to project_snippet_discussions must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to project_snippet_discussions must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to project_snippet_discussions must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/snippets/:snippet_id/discussions', [@_], $options ); } =item project_snippet_discussion my $discussion = $api->project_snippet_discussion( $project_id, $snippet_id, $discussion_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_snippet_discussion { my $self = shift; croak 'project_snippet_discussion must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to project_snippet_discussion must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to project_snippet_discussion must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to project_snippet_discussion must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/snippets/:snippet_id/discussions/:discussion_id', [@_], $options ); } =item create_project_snippet_discussion my $discussion = $api->create_project_snippet_discussion( $project_id, $snippet_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_project_snippet_discussion { my $self = shift; croak 'create_project_snippet_discussion must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_project_snippet_discussion must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to create_project_snippet_discussion must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_project_snippet_discussion must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/snippets/:snippet_id/discussions', [@_], $options ); } =item create_project_snippet_discussion_note $api->create_project_snippet_discussion_note( $project_id, $snippet_id, $discussion_id, \%params, ); Sends a C request to C. =cut sub create_project_snippet_discussion_note { my $self = shift; croak 'create_project_snippet_discussion_note must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to create_project_snippet_discussion_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to create_project_snippet_discussion_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to create_project_snippet_discussion_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to create_project_snippet_discussion_note must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'projects/:project_id/snippets/:snippet_id/discussions/:discussion_id/notes', [@_], $options ); return; } =item edit_project_snippet_discussion_note $api->edit_project_snippet_discussion_note( $project_id, $snippet_id, $discussion_id, $note_id, \%params, ); Sends a C request to C. =cut sub edit_project_snippet_discussion_note { my $self = shift; croak 'edit_project_snippet_discussion_note must be called with 4 to 5 arguments' if @_ < 4 or @_ > 5; croak 'The #1 argument ($project_id) to edit_project_snippet_discussion_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to edit_project_snippet_discussion_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to edit_project_snippet_discussion_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($note_id) to edit_project_snippet_discussion_note must be a scalar' if ref($_[3]) or (!defined $_[3]); croak 'The last argument (\%params) to edit_project_snippet_discussion_note must be a hash ref' if defined($_[4]) and ref($_[4]) ne 'HASH'; my $params = (@_ == 5) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id/snippets/:snippet_id/discussions/:discussion_id/notes/:note_id', [@_], $options ); return; } =item delete_project_snippet_discussion_note $api->delete_project_snippet_discussion_note( $project_id, $snippet_id, $discussion_id, $note_id, ); Sends a C request to C. =cut sub delete_project_snippet_discussion_note { my $self = shift; croak 'delete_project_snippet_discussion_note must be called with 4 arguments' if @_ != 4; croak 'The #1 argument ($project_id) to delete_project_snippet_discussion_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to delete_project_snippet_discussion_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to delete_project_snippet_discussion_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($note_id) to delete_project_snippet_discussion_note must be a scalar' if ref($_[3]) or (!defined $_[3]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/snippets/:snippet_id/discussions/:discussion_id/notes/:note_id', [@_], $options ); return; } =item merge_request_discussions my $discussions = $api->merge_request_discussions( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_discussions { my $self = shift; croak 'merge_request_discussions must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to merge_request_discussions must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_discussions must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to merge_request_discussions must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/discussions', [@_], $options ); } =item merge_request_discussion my $discussion = $api->merge_request_discussion( $project_id, $merge_request_iid, $discussion_id, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_discussion { my $self = shift; croak 'merge_request_discussion must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to merge_request_discussion must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_discussion must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to merge_request_discussion must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id', [@_], $options ); } =item create_merge_request_discussion my $discussion = $api->create_merge_request_discussion( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_merge_request_discussion { my $self = shift; croak 'create_merge_request_discussion must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_merge_request_discussion must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to create_merge_request_discussion must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_merge_request_discussion must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests/:merge_request_iid/discussions', [@_], $options ); } =item resolve_merge_request_discussion $api->resolve_merge_request_discussion( $project_id, $merge_request_iid, $discussion_id, \%params, ); Sends a C request to C. =cut sub resolve_merge_request_discussion { my $self = shift; croak 'resolve_merge_request_discussion must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to resolve_merge_request_discussion must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to resolve_merge_request_discussion must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to resolve_merge_request_discussion must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to resolve_merge_request_discussion must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id', [@_], $options ); return; } =item create_merge_request_discussion_note $api->create_merge_request_discussion_note( $project_id, $merge_request_iid, $discussion_id, \%params, ); Sends a C request to C. =cut sub create_merge_request_discussion_note { my $self = shift; croak 'create_merge_request_discussion_note must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to create_merge_request_discussion_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to create_merge_request_discussion_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to create_merge_request_discussion_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to create_merge_request_discussion_note must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes', [@_], $options ); return; } =item edit_merge_request_discussion_note $api->edit_merge_request_discussion_note( $project_id, $merge_request_iid, $discussion_id, $note_id, \%params, ); Sends a C request to C. =cut sub edit_merge_request_discussion_note { my $self = shift; croak 'edit_merge_request_discussion_note must be called with 4 to 5 arguments' if @_ < 4 or @_ > 5; croak 'The #1 argument ($project_id) to edit_merge_request_discussion_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to edit_merge_request_discussion_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to edit_merge_request_discussion_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($note_id) to edit_merge_request_discussion_note must be a scalar' if ref($_[3]) or (!defined $_[3]); croak 'The last argument (\%params) to edit_merge_request_discussion_note must be a hash ref' if defined($_[4]) and ref($_[4]) ne 'HASH'; my $params = (@_ == 5) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes/:note_id', [@_], $options ); return; } =item delete_merge_request_discussion_note $api->delete_merge_request_discussion_note( $project_id, $merge_request_iid, $discussion_id, $note_id, ); Sends a C request to C. =cut sub delete_merge_request_discussion_note { my $self = shift; croak 'delete_merge_request_discussion_note must be called with 4 arguments' if @_ != 4; croak 'The #1 argument ($project_id) to delete_merge_request_discussion_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to delete_merge_request_discussion_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to delete_merge_request_discussion_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($note_id) to delete_merge_request_discussion_note must be a scalar' if ref($_[3]) or (!defined $_[3]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes/:note_id', [@_], $options ); return; } =item commit_discussions my $discussions = $api->commit_discussions( $project_id, $commit_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub commit_discussions { my $self = shift; croak 'commit_discussions must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to commit_discussions must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_id) to commit_discussions must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to commit_discussions must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/commits/:commit_id/discussions', [@_], $options ); } =item commit_discussion my $discussion = $api->commit_discussion( $project_id, $commit_id, $discussion_id, ); Sends a C request to C and returns the decoded response content. =cut sub commit_discussion { my $self = shift; croak 'commit_discussion must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to commit_discussion must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_id) to commit_discussion must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to commit_discussion must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/commits/:commit_id/discussions/:discussion_id', [@_], $options ); } =item create_commit_discussion my $discussion = $api->create_commit_discussion( $project_id, $commit_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_commit_discussion { my $self = shift; croak 'create_commit_discussion must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_commit_discussion must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_id) to create_commit_discussion must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_commit_discussion must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/commits/:commit_id/discussions', [@_], $options ); } =item create_commit_discussion_note $api->create_commit_discussion_note( $project_id, $commit_id, $discussion_id, \%params, ); Sends a C request to C. =cut sub create_commit_discussion_note { my $self = shift; croak 'create_commit_discussion_note must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to create_commit_discussion_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_id) to create_commit_discussion_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to create_commit_discussion_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to create_commit_discussion_note must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'projects/:project_id/commits/:commit_id/discussions/:discussion_id/notes', [@_], $options ); return; } =item edit_commit_discussion_note $api->edit_commit_discussion_note( $project_id, $commit_id, $discussion_id, $note_id, \%params, ); Sends a C request to C. =cut sub edit_commit_discussion_note { my $self = shift; croak 'edit_commit_discussion_note must be called with 4 to 5 arguments' if @_ < 4 or @_ > 5; croak 'The #1 argument ($project_id) to edit_commit_discussion_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_id) to edit_commit_discussion_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to edit_commit_discussion_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($note_id) to edit_commit_discussion_note must be a scalar' if ref($_[3]) or (!defined $_[3]); croak 'The last argument (\%params) to edit_commit_discussion_note must be a hash ref' if defined($_[4]) and ref($_[4]) ne 'HASH'; my $params = (@_ == 5) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id/commits/:commit_id/discussions/:discussion_id/notes/:note_id', [@_], $options ); return; } =item delete_commit_discussion_note $api->delete_commit_discussion_note( $project_id, $commit_id, $discussion_id, $note_id, ); Sends a C request to C. =cut sub delete_commit_discussion_note { my $self = shift; croak 'delete_commit_discussion_note must be called with 4 arguments' if @_ != 4; croak 'The #1 argument ($project_id) to delete_commit_discussion_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_id) to delete_commit_discussion_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($discussion_id) to delete_commit_discussion_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($note_id) to delete_commit_discussion_note must be a scalar' if ref($_[3]) or (!defined $_[3]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/commits/:commit_id/discussions/:discussion_id/notes/:note_id', [@_], $options ); return; } =back =head2 Resource label events See L. =over =item issue_resource_label_events my $events = $api->issue_resource_label_events( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded response content. =cut sub issue_resource_label_events { my $self = shift; croak 'issue_resource_label_events must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to issue_resource_label_events must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_resource_label_events must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/resource_label_events', [@_], $options ); } =item issue_resource_label_event my $event = $api->issue_resource_label_event( $project_id, $issue_iid, $resource_label_event_id, ); Sends a C request to C and returns the decoded response content. =cut sub issue_resource_label_event { my $self = shift; croak 'issue_resource_label_event must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to issue_resource_label_event must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_resource_label_event must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($resource_label_event_id) to issue_resource_label_event must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/issues/:issue_iid/resource_label_events/:resource_label_event_id', [@_], $options ); } =item merge_request_resource_label_events my $events = $api->merge_request_resource_label_events( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_resource_label_events { my $self = shift; croak 'merge_request_resource_label_events must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request_resource_label_events must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_resource_label_events must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/resource_label_events', [@_], $options ); } =item merge_request_resource_label_event my $event = $api->merge_request_resource_label_event( $project_id, $merge_request_iid, $resource_label_event_id, ); Sends a C request to C and returns the decoded response content. =cut sub merge_request_resource_label_event { my $self = shift; croak 'merge_request_resource_label_event must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to merge_request_resource_label_event must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_resource_label_event must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($resource_label_event_id) to merge_request_resource_label_event must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/merge_requests/:merge_request_iid/resource_label_events/:resource_label_event_id', [@_], $options ); } =back =head2 Notification settings See L. =over =item global_notification_settings my $settings = $api->global_notification_settings(); Sends a C request to C and returns the decoded response content. =cut sub global_notification_settings { my $self = shift; croak "The global_notification_settings method does not take any arguments" if @_; my $options = {}; return $self->_call_rest_client( 'GET', 'notification_settings', [@_], $options ); } =item set_global_notification_settings my $settings = $api->set_global_notification_settings( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub set_global_notification_settings { my $self = shift; croak 'set_global_notification_settings must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to set_global_notification_settings must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'notification_settings', [@_], $options ); } =item group_notification_settings my $settings = $api->group_notification_settings( $group_id, ); Sends a C request to C and returns the decoded response content. =cut sub group_notification_settings { my $self = shift; croak 'group_notification_settings must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to group_notification_settings must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'groups/:group_id/notification_settings', [@_], $options ); } =item project_notification_settings my $settings = $api->project_notification_settings( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_notification_settings { my $self = shift; croak 'project_notification_settings must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_notification_settings must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/notification_settings', [@_], $options ); } =item set_group_notification_settings my $settings = $api->set_group_notification_settings( $group_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub set_group_notification_settings { my $self = shift; croak 'set_group_notification_settings must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to set_group_notification_settings must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to set_group_notification_settings must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'groups/:group_id/notification_settings', [@_], $options ); } =item set_project_notification_settings my $settings = $api->set_project_notification_settings( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub set_project_notification_settings { my $self = shift; croak 'set_project_notification_settings must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to set_project_notification_settings must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to set_project_notification_settings must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/notification_settings', [@_], $options ); } =back =head2 Licenses See L. =over =item license_templates my $templates = $api->license_templates( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub license_templates { my $self = shift; croak 'license_templates must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to license_templates must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'templates/licenses', [@_], $options ); } =item license_template my $template = $api->license_template( $template_key, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub license_template { my $self = shift; croak 'license_template must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($template_key) to license_template must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to license_template must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'templates/licenses/:template_key', [@_], $options ); } =back =head2 Pages domains See L. =over =item global_pages_domains my $domains = $api->global_pages_domains( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub global_pages_domains { my $self = shift; croak 'global_pages_domains must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to global_pages_domains must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'pages/domains', [@_], $options ); } =item pages_domains my $domains = $api->pages_domains( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub pages_domains { my $self = shift; croak 'pages_domains must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to pages_domains must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to pages_domains must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/pages/domains', [@_], $options ); } =item pages_domain my $domain = $api->pages_domain( $project_id, $domain, ); Sends a C request to C and returns the decoded response content. =cut sub pages_domain { my $self = shift; croak 'pages_domain must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to pages_domain must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($domain) to pages_domain must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/pages/domains/:domain', [@_], $options ); } =item create_pages_domain my $domain = $api->create_pages_domain( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_pages_domain { my $self = shift; croak 'create_pages_domain must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_pages_domain must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_pages_domain must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/pages/domains', [@_], $options ); } =item edit_pages_domain my $domain = $api->edit_pages_domain( $project_id, $domain, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_pages_domain { my $self = shift; croak 'edit_pages_domain must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_pages_domain must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($domain) to edit_pages_domain must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_pages_domain must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/pages/domains/:domain', [@_], $options ); } =item delete_pages_domain $api->delete_pages_domain( $project_id, $domain, ); Sends a C request to C. =cut sub delete_pages_domain { my $self = shift; croak 'delete_pages_domain must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_pages_domain must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($domain) to delete_pages_domain must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/pages/domains/:domain', [@_], $options ); return; } =back =head2 Pipelines See L. =over =item pipelines my $pipelines = $api->pipelines( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub pipelines { my $self = shift; croak 'pipelines must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to pipelines must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to pipelines must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/pipelines', [@_], $options ); } =item pipeline my $pipeline = $api->pipeline( $project_id, $pipeline_id, ); Sends a C request to C and returns the decoded response content. =cut sub pipeline { my $self = shift; croak 'pipeline must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to pipeline must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_id) to pipeline must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/pipelines/:pipeline_id', [@_], $options ); } =item create_pipeline my $pipeline = $api->create_pipeline( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. Git ref (branch or tag) name must be specified in the C field of the C<%params> hash. It's also possible to pass variables to a pipeline in the C field like in the following example: my $pipeline = $api->create_pipeline( $project_id, { 'ref' => 'master', variables => [ { 'key' => 'VARIABLE1', 'value' => 'VALUE1' }, { 'key' => 'VARIABLE2', 'value' => 'VALUE2' }, ], }, ); =cut sub create_pipeline { my $self = shift; croak 'create_pipeline must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_pipeline must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_pipeline must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/pipeline', [@_], $options ); } =item retry_pipeline_jobs my $pipeline = $api->retry_pipeline_jobs( $project_id, $pipeline_id, ); Sends a C request to C and returns the decoded response content. =cut sub retry_pipeline_jobs { my $self = shift; croak 'retry_pipeline_jobs must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to retry_pipeline_jobs must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_id) to retry_pipeline_jobs must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/pipelines/:pipeline_id/retry', [@_], $options ); } =item cancel_pipeline_jobs my $pipeline = $api->cancel_pipeline_jobs( $project_id, $pipeline_id, ); Sends a C request to C and returns the decoded response content. =cut sub cancel_pipeline_jobs { my $self = shift; croak 'cancel_pipeline_jobs must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to cancel_pipeline_jobs must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_id) to cancel_pipeline_jobs must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/pipelines/:pipeline_id/cancel', [@_], $options ); } =item delete_pipeline $api->delete_pipeline( $project_id, $pipeline_id, ); Sends a C request to C. =cut sub delete_pipeline { my $self = shift; croak 'delete_pipeline must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_pipeline must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_id) to delete_pipeline must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/pipelines/:pipeline_id', [@_], $options ); return; } =back =head2 Pipeline triggers See L. =over =item triggers my $triggers = $api->triggers( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub triggers { my $self = shift; croak 'triggers must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to triggers must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to triggers must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/triggers', [@_], $options ); } =item trigger my $trigger = $api->trigger( $project_id, $trigger_id, ); Sends a C request to C and returns the decoded response content. =cut sub trigger { my $self = shift; croak 'trigger must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($trigger_id) to trigger must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/triggers/:trigger_id', [@_], $options ); } =item create_trigger my $trigger = $api->create_trigger( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_trigger { my $self = shift; croak 'create_trigger must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_trigger must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/triggers', [@_], $options ); } =item edit_trigger my $trigger = $api->edit_trigger( $project_id, $trigger_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_trigger { my $self = shift; croak 'edit_trigger must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($trigger_id) to edit_trigger must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_trigger must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/triggers/:trigger_id', [@_], $options ); } =item take_ownership_of_trigger my $trigger = $api->take_ownership_of_trigger( $project_id, $trigger_id, ); Sends a C request to C and returns the decoded response content. =cut sub take_ownership_of_trigger { my $self = shift; croak 'take_ownership_of_trigger must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to take_ownership_of_trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($trigger_id) to take_ownership_of_trigger must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/triggers/:trigger_id/take_ownership', [@_], $options ); } =item delete_trigger $api->delete_trigger( $project_id, $trigger_id, ); Sends a C request to C. =cut sub delete_trigger { my $self = shift; croak 'delete_trigger must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($trigger_id) to delete_trigger must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/triggers/:trigger_id', [@_], $options ); return; } =item trigger_pipeline my $pipeline = $api->trigger_pipeline( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. The API authentication token (L or L parameters in a constructor) is not needed when using this method, however You must pass trigger token (generated at the trigger creation) as C field and git ref name as C field in the C<%params> hash. You can also pass variables to be set in a pipeline in the C field. Example: my $pipeline = $api->trigger_pipeline( $project_id, { token => 'd69dba9162ab6ac72fa0993496286ada', 'ref' => 'master', variables => { variable1 => 'value1', variable2 => 'value2', }, }, ); Read more at L. =cut sub trigger_pipeline { my $self = shift; croak 'trigger_pipeline must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to trigger_pipeline must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to trigger_pipeline must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/trigger/pipeline', [@_], $options ); } =back =head2 Pipeline schedules See L. =over =item pipeline_schedules my $schedules = $api->pipeline_schedules( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub pipeline_schedules { my $self = shift; croak 'pipeline_schedules must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to pipeline_schedules must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to pipeline_schedules must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/pipeline_schedules', [@_], $options ); } =item pipeline_schedule my $schedule = $api->pipeline_schedule( $project_id, $pipeline_schedule_id, ); Sends a C request to C and returns the decoded response content. =cut sub pipeline_schedule { my $self = shift; croak 'pipeline_schedule must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to pipeline_schedule must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to pipeline_schedule must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/pipeline_schedules/:pipeline_schedule_id', [@_], $options ); } =item create_pipeline_schedule my $schedule = $api->create_pipeline_schedule( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_pipeline_schedule { my $self = shift; croak 'create_pipeline_schedule must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_pipeline_schedule must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_pipeline_schedule must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/pipeline_schedules', [@_], $options ); } =item edit_pipeline_schedule my $schedule = $api->edit_pipeline_schedule( $project_id, $pipeline_schedule_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_pipeline_schedule { my $self = shift; croak 'edit_pipeline_schedule must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_pipeline_schedule must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to edit_pipeline_schedule must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_pipeline_schedule must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/pipeline_schedules/:pipeline_schedule_id', [@_], $options ); } =item take_ownership_of_pipeline_schedule my $schedule = $api->take_ownership_of_pipeline_schedule( $project_id, $pipeline_schedule_id, ); Sends a C request to C and returns the decoded response content. =cut sub take_ownership_of_pipeline_schedule { my $self = shift; croak 'take_ownership_of_pipeline_schedule must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to take_ownership_of_pipeline_schedule must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to take_ownership_of_pipeline_schedule must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/pipeline_schedules/:pipeline_schedule_id/take_ownership', [@_], $options ); } =item delete_pipeline_schedule my $schedule = $api->delete_pipeline_schedule( $project_id, $pipeline_schedule_id, ); Sends a C request to C and returns the decoded response content. =cut sub delete_pipeline_schedule { my $self = shift; croak 'delete_pipeline_schedule must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_pipeline_schedule must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to delete_pipeline_schedule must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'DELETE', 'projects/:project_id/pipeline_schedules/:pipeline_schedule_id', [@_], $options ); } =item create_pipeline_schedule_variable my $variable = $api->create_pipeline_schedule_variable( $project_id, $pipeline_schedule_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_pipeline_schedule_variable { my $self = shift; croak 'create_pipeline_schedule_variable must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_pipeline_schedule_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to create_pipeline_schedule_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_pipeline_schedule_variable must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/pipeline_schedules/:pipeline_schedule_id/variables', [@_], $options ); } =item edit_pipeline_schedule_variable my $variable = $api->edit_pipeline_schedule_variable( $project_id, $pipeline_schedule_id, $variable_key, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_pipeline_schedule_variable { my $self = shift; croak 'edit_pipeline_schedule_variable must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to edit_pipeline_schedule_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to edit_pipeline_schedule_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($variable_key) to edit_pipeline_schedule_variable must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to edit_pipeline_schedule_variable must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/pipeline_schedules/:pipeline_schedule_id/variables/:variable_key', [@_], $options ); } =item delete_pipeline_schedule_variable my $variable = $api->delete_pipeline_schedule_variable( $project_id, $pipeline_schedule_id, $variable_key, ); Sends a C request to C and returns the decoded response content. =cut sub delete_pipeline_schedule_variable { my $self = shift; croak 'delete_pipeline_schedule_variable must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_pipeline_schedule_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to delete_pipeline_schedule_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($variable_key) to delete_pipeline_schedule_variable must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'DELETE', 'projects/:project_id/pipeline_schedules/:pipeline_schedule_id/variables/:variable_key', [@_], $options ); } =back =head2 Projects See L. =over =item projects my $projects = $api->projects( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub projects { my $self = shift; croak 'projects must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to projects must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects', [@_], $options ); } =item user_projects my $projects = $api->user_projects( $user_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub user_projects { my $self = shift; croak 'user_projects must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to user_projects must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to user_projects must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'users/:user_id/projects', [@_], $options ); } =item project my $project = $api->project( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project { my $self = shift; croak 'project must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id', [@_], $options ); } =item project_users my $users = $api->project_users( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_users { my $self = shift; croak 'project_users must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_users must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_users must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/users', [@_], $options ); } =item create_project my $project = $api->create_project( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_project { my $self = shift; croak 'create_project must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_project must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects', [@_], $options ); } =item create_project_for_user $api->create_project_for_user( $user_id, \%params, ); Sends a C request to C. =cut sub create_project_for_user { my $self = shift; croak 'create_project_for_user must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to create_project_for_user must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_project_for_user must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'projects/user/:user_id', [@_], $options ); return; } =item edit_project $api->edit_project( $project_id, \%params, ); Sends a C request to C. =cut sub edit_project { my $self = shift; croak 'edit_project must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to edit_project must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to edit_project must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id', [@_], $options ); return; } =item fork_project $api->fork_project( $project_id, \%params, ); Sends a C request to C. =cut sub fork_project { my $self = shift; croak 'fork_project must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to fork_project must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to fork_project must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'projects/:project_id/fork', [@_], $options ); return; } =item project_forks my $forks = $api->project_forks( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_forks { my $self = shift; croak 'project_forks must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_forks must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_forks must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/forks', [@_], $options ); } =item start_project my $project = $api->start_project( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub start_project { my $self = shift; croak 'start_project must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to start_project must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/star', [@_], $options ); } =item unstar_project my $project = $api->unstar_project( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub unstar_project { my $self = shift; croak 'unstar_project must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to unstar_project must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/unstar', [@_], $options ); } =item project_languages my $languages = $api->project_languages( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_languages { my $self = shift; croak 'project_languages must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_languages must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/languages', [@_], $options ); } =item archive_project my $project = $api->archive_project( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub archive_project { my $self = shift; croak 'archive_project must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to archive_project must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/archive', [@_], $options ); } =item unarchive_project my $project = $api->unarchive_project( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub unarchive_project { my $self = shift; croak 'unarchive_project must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to unarchive_project must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/unarchive', [@_], $options ); } =item delete_project $api->delete_project( $project_id, ); Sends a C request to C. =cut sub delete_project { my $self = shift; croak 'delete_project must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to delete_project must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id', [@_], $options ); return; } =item upload_file_to_project my $upload = $api->upload_file_to_project( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. The C parameter must point to a readable file on the local filesystem. =cut sub upload_file_to_project { my $self = shift; croak 'upload_file_to_project must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to upload_file_to_project must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to upload_file_to_project must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/uploads', [@_], $options ); } =item share_project_with_group $api->share_project_with_group( $project_id, \%params, ); Sends a C request to C. =cut sub share_project_with_group { my $self = shift; croak 'share_project_with_group must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to share_project_with_group must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to share_project_with_group must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'projects/:project_id/share', [@_], $options ); return; } =item unshare_project_with_group $api->unshare_project_with_group( $project_id, $group_id, ); Sends a C request to C. =cut sub unshare_project_with_group { my $self = shift; croak 'unshare_project_with_group must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to unshare_project_with_group must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($group_id) to unshare_project_with_group must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/share/:group_id', [@_], $options ); return; } =item project_hooks my $hooks = $api->project_hooks( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_hooks { my $self = shift; croak 'project_hooks must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_hooks must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/hooks', [@_], $options ); } =item project_hook my $hook = $api->project_hook( $project_id, $hook_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_hook { my $self = shift; croak 'project_hook must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($hook_id) to project_hook must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/hooks/:hook_id', [@_], $options ); } =item create_project_hook my $hook = $api->create_project_hook( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_project_hook { my $self = shift; croak 'create_project_hook must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_project_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_project_hook must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/hooks', [@_], $options ); } =item edit_project_hook my $hook = $api->edit_project_hook( $project_id, $hook_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_project_hook { my $self = shift; croak 'edit_project_hook must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_project_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($hook_id) to edit_project_hook must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_project_hook must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/hooks/:hook_id', [@_], $options ); } =item delete_project_hook $api->delete_project_hook( $project_id, $hook_id, ); Sends a C request to C. =cut sub delete_project_hook { my $self = shift; croak 'delete_project_hook must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_project_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($hook_id) to delete_project_hook must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/hooks/:hook_id', [@_], $options ); return; } =item set_project_fork $api->set_project_fork( $project_id, $from_project_id, ); Sends a C request to C. =cut sub set_project_fork { my $self = shift; croak 'set_project_fork must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to set_project_fork must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($from_project_id) to set_project_fork must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'POST', 'projects/:project_id/fork/:from_project_id', [@_], $options ); return; } =item clear_project_fork $api->clear_project_fork( $project_id, ); Sends a C request to C. =cut sub clear_project_fork { my $self = shift; croak 'clear_project_fork must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to clear_project_fork must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/fork', [@_], $options ); return; } =item start_housekeeping $api->start_housekeeping( $project_id, ); Sends a C request to C. =cut sub start_housekeeping { my $self = shift; croak 'start_housekeeping must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to start_housekeeping must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'POST', 'projects/:project_id/housekeeping', [@_], $options ); return; } =item transfer_project_to_namespace $api->transfer_project_to_namespace( $project_id, \%params, ); Sends a C request to C. =cut sub transfer_project_to_namespace { my $self = shift; croak 'transfer_project_to_namespace must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to transfer_project_to_namespace must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to transfer_project_to_namespace must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id/transfer', [@_], $options ); return; } =back =head2 Project access requests See L. =over =item project_access_requests my $requests = $api->project_access_requests( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_access_requests { my $self = shift; croak 'project_access_requests must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_access_requests must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_access_requests must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/access_requests', [@_], $options ); } =item request_project_access my $request = $api->request_project_access( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub request_project_access { my $self = shift; croak 'request_project_access must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to request_project_access must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'POST', 'projects/:project_id/access_requests', [@_], $options ); } =item approve_project_access my $request = $api->approve_project_access( $project_id, $user_id, ); Sends a C request to C and returns the decoded response content. =cut sub approve_project_access { my $self = shift; croak 'approve_project_access must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to approve_project_access must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to approve_project_access must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'PUT', 'projects/:project_id/access_requests/:user_id/approve', [@_], $options ); } =item deny_project_access $api->deny_project_access( $project_id, $user_id, ); Sends a C request to C. =cut sub deny_project_access { my $self = shift; croak 'deny_project_access must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to deny_project_access must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to deny_project_access must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/access_requests/:user_id', [@_], $options ); return; } =back =head2 Project badges See L. =over =item project_badges my $badges = $api->project_badges( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_badges { my $self = shift; croak 'project_badges must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_badges must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/badges', [@_], $options ); } =item project_badge my $badge = $api->project_badge( $project_id, $badge_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_badge { my $self = shift; croak 'project_badge must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_badge must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($badge_id) to project_badge must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/badges/:badge_id', [@_], $options ); } =item create_project_badge my $badge = $api->create_project_badge( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_project_badge { my $self = shift; croak 'create_project_badge must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_project_badge must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_project_badge must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/badges', [@_], $options ); } =item edit_project_badge my $badge = $api->edit_project_badge( $project_id, $badge_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_project_badge { my $self = shift; croak 'edit_project_badge must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_project_badge must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($badge_id) to edit_project_badge must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_project_badge must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/badges/:badge_id', [@_], $options ); } =item delete_project_badge $api->delete_project_badge( $project_id, $badge_id, ); Sends a C request to C. =cut sub delete_project_badge { my $self = shift; croak 'delete_project_badge must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_project_badge must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($badge_id) to delete_project_badge must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/badges/:badge_id', [@_], $options ); return; } =item preview_project_badge my $preview = $api->preview_project_badge( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub preview_project_badge { my $self = shift; croak 'preview_project_badge must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to preview_project_badge must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to preview_project_badge must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/badges/render', [@_], $options ); } =back =head2 Project import/export See L. =over =item schedule_project_export $api->schedule_project_export( $project_id, \%params, ); Sends a C request to C. =cut sub schedule_project_export { my $self = shift; croak 'schedule_project_export must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to schedule_project_export must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to schedule_project_export must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'projects/:project_id/export', [@_], $options ); return; } =item project_export_status my $status = $api->project_export_status( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_export_status { my $self = shift; croak 'project_export_status must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_export_status must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/export', [@_], $options ); } =item download_project_export my $download = $api->download_project_export( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub download_project_export { my $self = shift; croak 'download_project_export must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to download_project_export must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/export/download', [@_], $options ); } =item schedule_project_import $api->schedule_project_import( \%params, ); Sends a C request to C. =cut sub schedule_project_import { my $self = shift; croak 'schedule_project_import must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to schedule_project_import must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'projects/import', [@_], $options ); return; } =item project_import_status my $status = $api->project_import_status( $project_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_import_status { my $self = shift; croak 'project_import_status must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_import_status must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/import', [@_], $options ); } =back =head2 Project members See L. =over =item project_members my $members = $api->project_members( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_members { my $self = shift; croak 'project_members must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_members must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_members must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/members', [@_], $options ); } =item all_project_members my $members = $api->all_project_members( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub all_project_members { my $self = shift; croak 'all_project_members must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to all_project_members must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to all_project_members must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/members/all', [@_], $options ); } =item project_member my $member = $api->project_member( $project_id, $user_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_member { my $self = shift; croak 'project_member must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to project_member must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/members/:user_id', [@_], $options ); } =item add_project_member my $member = $api->add_project_member( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub add_project_member { my $self = shift; croak 'add_project_member must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to add_project_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to add_project_member must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/members', [@_], $options ); } =item update_project_member my $member = $api->update_project_member( $project_id, $user_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub update_project_member { my $self = shift; croak 'update_project_member must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to update_project_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to update_project_member must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to update_project_member must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/members/:user_id', [@_], $options ); } =item remove_project_member $api->remove_project_member( $project_id, $user_id, ); Sends a C request to C. =cut sub remove_project_member { my $self = shift; croak 'remove_project_member must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to remove_project_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to remove_project_member must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/members/:user_id', [@_], $options ); return; } =back =head2 Project snippets See L. =over =item project_snippets my $snippets = $api->project_snippets( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_snippets { my $self = shift; croak 'project_snippets must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_snippets must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_snippets must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/snippets', [@_], $options ); } =item project_snippet my $snippet = $api->project_snippet( $project_id, $snippet_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_snippet { my $self = shift; croak 'project_snippet must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to project_snippet must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/snippets/:snippet_id', [@_], $options ); } =item create_project_snippet $api->create_project_snippet( $project_id, \%params, ); Sends a C request to C. =cut sub create_project_snippet { my $self = shift; croak 'create_project_snippet must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_project_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_project_snippet must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'projects/:project_id/snippets', [@_], $options ); return; } =item edit_project_snippet $api->edit_project_snippet( $project_id, $snippet_id, \%params, ); Sends a C request to C. =cut sub edit_project_snippet { my $self = shift; croak 'edit_project_snippet must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_project_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to edit_project_snippet must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_project_snippet must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id/snippets/:snippet_id', [@_], $options ); return; } =item delete_project_snippet $api->delete_project_snippet( $project_id, $snippet_id, ); Sends a C request to C. =cut sub delete_project_snippet { my $self = shift; croak 'delete_project_snippet must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_project_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to delete_project_snippet must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/snippets/:snippet_id', [@_], $options ); return; } =item project_snippet_content my $content = $api->project_snippet_content( $project_id, $snippet_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_snippet_content { my $self = shift; croak 'project_snippet_content must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_snippet_content must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to project_snippet_content must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/snippets/:snippet_id/raw', [@_], $options ); } =item project_snippet_user_agent_detail my $user_agent = $api->project_snippet_user_agent_detail( $project_id, $snippet_id, ); Sends a C request to C and returns the decoded response content. =cut sub project_snippet_user_agent_detail { my $self = shift; croak 'project_snippet_user_agent_detail must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_snippet_user_agent_detail must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to project_snippet_user_agent_detail must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/snippets/:snippet_id/user_agent_detail', [@_], $options ); } =back =head2 Protected branches See L. =over =item protected_branches my $branches = $api->protected_branches( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub protected_branches { my $self = shift; croak 'protected_branches must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to protected_branches must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to protected_branches must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/protected_branches', [@_], $options ); } =item protected_branch my $branch = $api->protected_branch( $project_id, $branch_name, ); Sends a C request to C and returns the decoded response content. =cut sub protected_branch { my $self = shift; croak 'protected_branch must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to protected_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($branch_name) to protected_branch must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/protected_branches/:branch_name', [@_], $options ); } =item protect_branch my $branch = $api->protect_branch( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub protect_branch { my $self = shift; croak 'protect_branch must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to protect_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to protect_branch must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/protected_branches', [@_], $options ); } =item unprotect_branch $api->unprotect_branch( $project_id, $branch_name, ); Sends a C request to C. =cut sub unprotect_branch { my $self = shift; croak 'unprotect_branch must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to unprotect_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($branch_name) to unprotect_branch must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/protected_branches/:branch_name', [@_], $options ); return; } =back =head2 Protected tags See L. =over =item protected_tags my $tags = $api->protected_tags( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub protected_tags { my $self = shift; croak 'protected_tags must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to protected_tags must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to protected_tags must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/protected_tags', [@_], $options ); } =item protected_tag my $tag = $api->protected_tag( $project_id, $tag_name, ); Sends a C request to C and returns the decoded response content. =cut sub protected_tag { my $self = shift; croak 'protected_tag must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to protected_tag must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to protected_tag must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/protected_tags/:tag_name', [@_], $options ); } =item protect_tag my $tag = $api->protect_tag( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub protect_tag { my $self = shift; croak 'protect_tag must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to protect_tag must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to protect_tag must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/protected_tags', [@_], $options ); } =item unprotect_tag $api->unprotect_tag( $project_id, $tag_name, ); Sends a C request to C. =cut sub unprotect_tag { my $self = shift; croak 'unprotect_tag must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to unprotect_tag must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to unprotect_tag must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/protected_tags/:tag_name', [@_], $options ); return; } =back =head2 Releases See L. =over =item releases my $releases = $api->releases( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub releases { my $self = shift; croak 'releases must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to releases must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to releases must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/releases', [@_], $options ); } =item release my $release = $api->release( $project_id, $tag_name, ); Sends a C request to C and returns the decoded response content. =cut sub release { my $self = shift; croak 'release must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to release must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to release must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/releases/:tag_name', [@_], $options ); } =item create_release my $release = $api->create_release( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_release { my $self = shift; croak 'create_release must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_release must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_release must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/releases', [@_], $options ); } =item update_release my $release = $api->update_release( $project_id, $tag_name, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub update_release { my $self = shift; croak 'update_release must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to update_release must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to update_release must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to update_release must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/releases/:tag_name', [@_], $options ); } =item delete_release my $release = $api->delete_release( $project_id, $tag_name, ); Sends a C request to C and returns the decoded response content. =cut sub delete_release { my $self = shift; croak 'delete_release must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_release must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to delete_release must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'DELETE', 'projects/:project_id/releases/:tag_name', [@_], $options ); } =back =head2 Release Links See L. =over =item release_links my $links = $api->release_links( $project_id, $tag_name, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub release_links { my $self = shift; croak 'release_links must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to release_links must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to release_links must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to release_links must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/releases/:tag_name/assets/links', [@_], $options ); } =item release_link my $link = $api->release_link( $project_id, $tag_name, $link_id, ); Sends a C request to C and returns the decoded response content. =cut sub release_link { my $self = shift; croak 'release_link must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to release_link must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to release_link must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($link_id) to release_link must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/releases/:tag_name/assets/links/:link_id', [@_], $options ); } =item create_release_link my $link = $api->create_release_link( $project_id, $tag_name, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_release_link { my $self = shift; croak 'create_release_link must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_release_link must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to create_release_link must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_release_link must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/releases/:tag_name/assets/links', [@_], $options ); } =item update_release_link my $link = $api->update_release_link( $project_id, $tag_name, $link_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub update_release_link { my $self = shift; croak 'update_release_link must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to update_release_link must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to update_release_link must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($link_id) to update_release_link must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to update_release_link must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/releases/:tag_name/assets/links/:link_id', [@_], $options ); } =item delete_release_link my $link = $api->delete_release_link( $project_id, $tag_name, $link_id, ); Sends a C request to C and returns the decoded response content. =cut sub delete_release_link { my $self = shift; croak 'delete_release_link must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_release_link must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to delete_release_link must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($link_id) to delete_release_link must be a scalar' if ref($_[2]) or (!defined $_[2]); my $options = {}; return $self->_call_rest_client( 'DELETE', 'projects/:project_id/releases/:tag_name/assets/links/:link_id', [@_], $options ); } =back =head2 Repositories See L. =over =item tree my $tree = $api->tree( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub tree { my $self = shift; croak 'tree must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to tree must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to tree must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/tree', [@_], $options ); } =item blob my $blob = $api->blob( $project_id, $sha, ); Sends a C request to C and returns the decoded response content. =cut sub blob { my $self = shift; croak 'blob must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to blob must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($sha) to blob must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/blobs/:sha', [@_], $options ); } =item raw_blob my $raw_blob = $api->raw_blob( $project_id, $sha, ); Sends a C request to C and returns the decoded response content. =cut sub raw_blob { my $self = shift; croak 'raw_blob must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to raw_blob must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($sha) to raw_blob must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/blobs/:sha/raw', [@_], $options ); } =item archive my $archive = $api->archive( $project_id, \%params, ); Sends a C request to C and returns the raw response content. =cut sub archive { my $self = shift; croak 'archive must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to archive must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to archive must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/archive', [@_], $options ); } =item compare my $comparison = $api->compare( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub compare { my $self = shift; croak 'compare must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to compare must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to compare must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/compare', [@_], $options ); } =item contributors my $contributors = $api->contributors( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub contributors { my $self = shift; croak 'contributors must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to contributors must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to contributors must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/contributors', [@_], $options ); } =back =head2 Repository files See L. =over =item file my $file = $api->file( $project_id, $file_path, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub file { my $self = shift; croak 'file must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($file_path) to file must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to file must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/files/:file_path', [@_], $options ); } =item raw_file my $content = $api->raw_file( $project_id, $file_path, \%params, ); Sends a C request to C and returns the raw response content. =cut sub raw_file { my $self = shift; croak 'raw_file must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to raw_file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($file_path) to raw_file must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to raw_file must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/files/:file_path/raw', [@_], $options ); } =item create_file $api->create_file( $project_id, $file_path, \%params, ); Sends a C request to C. =cut sub create_file { my $self = shift; croak 'create_file must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($file_path) to create_file must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_file must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'projects/:project_id/repository/files/:file_path', [@_], $options ); return; } =item edit_file $api->edit_file( $project_id, $file_path, \%params, ); Sends a C request to C. =cut sub edit_file { my $self = shift; croak 'edit_file must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($file_path) to edit_file must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_file must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id/repository/files/:file_path', [@_], $options ); return; } =item delete_file $api->delete_file( $project_id, $file_path, \%params, ); Sends a C request to C. =cut sub delete_file { my $self = shift; croak 'delete_file must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to delete_file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($file_path) to delete_file must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to delete_file must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'DELETE', 'projects/:project_id/repository/files/:file_path', [@_], $options ); return; } =back =head2 Runners See L. =over =item runners my $runners = $api->runners( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub runners { my $self = shift; croak 'runners must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to runners must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'runners', [@_], $options ); } =item all_runners my $runners = $api->all_runners( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub all_runners { my $self = shift; croak 'all_runners must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to all_runners must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'runners/all', [@_], $options ); } =item runner my $runner = $api->runner( $runner_id, ); Sends a C request to C and returns the decoded response content. =cut sub runner { my $self = shift; croak 'runner must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($runner_id) to runner must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'runners/:runner_id', [@_], $options ); } =item update_runner my $runner = $api->update_runner( $runner_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub update_runner { my $self = shift; croak 'update_runner must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($runner_id) to update_runner must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to update_runner must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'runners/:runner_id', [@_], $options ); } =item delete_runner $api->delete_runner( $runner_id, ); Sends a C request to C. =cut sub delete_runner { my $self = shift; croak 'delete_runner must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($runner_id) to delete_runner must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'runners/:runner_id', [@_], $options ); return; } =item runner_jobs my $jobs = $api->runner_jobs( $runner_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub runner_jobs { my $self = shift; croak 'runner_jobs must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($runner_id) to runner_jobs must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to runner_jobs must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'runners/:runner_id/jobs', [@_], $options ); } =item project_runners my $runners = $api->project_runners( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub project_runners { my $self = shift; croak 'project_runners must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_runners must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_runners must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/runners', [@_], $options ); } =item enable_project_runner my $runner = $api->enable_project_runner( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub enable_project_runner { my $self = shift; croak 'enable_project_runner must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to enable_project_runner must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to enable_project_runner must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/runners', [@_], $options ); } =item disable_project_runner my $runner = $api->disable_project_runner( $project_id, $runner_id, ); Sends a C request to C and returns the decoded response content. =cut sub disable_project_runner { my $self = shift; croak 'disable_project_runner must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to disable_project_runner must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($runner_id) to disable_project_runner must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'DELETE', 'projects/:project_id/runners/:runner_id', [@_], $options ); } =back =head2 Search See L. =over =item search my $results = $api->search( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub search { my $self = shift; croak 'search must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to search must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'search', [@_], $options ); } =back =head2 Services See L. =over =item project_service my $service = $api->project_service( $project_id, $service_name, ); Sends a C request to C and returns the decoded response content. =cut sub project_service { my $self = shift; croak 'project_service must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_service must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($service_name) to project_service must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/services/:service_name', [@_], $options ); } =item edit_project_service $api->edit_project_service( $project_id, $service_name, \%params, ); Sends a C request to C. =cut sub edit_project_service { my $self = shift; croak 'edit_project_service must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_project_service must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($service_name) to edit_project_service must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_project_service must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'projects/:project_id/services/:service_name', [@_], $options ); return; } =item delete_project_service $api->delete_project_service( $project_id, $service_name, ); Sends a C request to C. =cut sub delete_project_service { my $self = shift; croak 'delete_project_service must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_project_service must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($service_name) to delete_project_service must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/services/:service_name', [@_], $options ); return; } =back =head2 Application settings See L. =over =item settings my $settings = $api->settings(); Sends a C request to C and returns the decoded response content. =cut sub settings { my $self = shift; croak "The settings method does not take any arguments" if @_; my $options = {}; return $self->_call_rest_client( 'GET', 'application/settings', [@_], $options ); } =item update_settings my $settings = $api->update_settings( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub update_settings { my $self = shift; croak 'update_settings must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to update_settings must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'application/settings', [@_], $options ); } =back =head2 Application statistics See L. =over =item statistics my $statistics = $api->statistics(); Sends a C request to C and returns the decoded response content. =cut sub statistics { my $self = shift; croak "The statistics method does not take any arguments" if @_; my $options = {}; return $self->_call_rest_client( 'GET', 'application/statistics', [@_], $options ); } =back =head2 Sidekiq Metrics See L. =over =item queue_metrics my $metrics = $api->queue_metrics(); Sends a C request to C and returns the decoded response content. =cut sub queue_metrics { my $self = shift; croak "The queue_metrics method does not take any arguments" if @_; my $options = {}; return $self->_call_rest_client( 'GET', 'sidekiq/queue_metrics', [@_], $options ); } =item process_metrics my $metrics = $api->process_metrics(); Sends a C request to C and returns the decoded response content. =cut sub process_metrics { my $self = shift; croak "The process_metrics method does not take any arguments" if @_; my $options = {}; return $self->_call_rest_client( 'GET', 'sidekiq/process_metrics', [@_], $options ); } =item job_stats my $stats = $api->job_stats(); Sends a C request to C and returns the decoded response content. =cut sub job_stats { my $self = shift; croak "The job_stats method does not take any arguments" if @_; my $options = {}; return $self->_call_rest_client( 'GET', 'sidekiq/job_stats', [@_], $options ); } =item compound_metrics my $metrics = $api->compound_metrics(); Sends a C request to C and returns the decoded response content. =cut sub compound_metrics { my $self = shift; croak "The compound_metrics method does not take any arguments" if @_; my $options = {}; return $self->_call_rest_client( 'GET', 'sidekiq/compound_metrics', [@_], $options ); } =back =head2 System hooks See L. =over =item hooks my $hooks = $api->hooks( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub hooks { my $self = shift; croak 'hooks must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to hooks must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'hooks', [@_], $options ); } =item create_hook $api->create_hook( \%params, ); Sends a C request to C. =cut sub create_hook { my $self = shift; croak 'create_hook must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_hook must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'hooks', [@_], $options ); return; } =item test_hook my $hook = $api->test_hook( $hook_id, ); Sends a C request to C and returns the decoded response content. =cut sub test_hook { my $self = shift; croak 'test_hook must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($hook_id) to test_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'hooks/:hook_id', [@_], $options ); } =item delete_hook $api->delete_hook( $hook_id, ); Sends a C request to C. =cut sub delete_hook { my $self = shift; croak 'delete_hook must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($hook_id) to delete_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'hooks/:hook_id', [@_], $options ); return; } =back =head2 Tags See L. =over =item tags my $tags = $api->tags( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub tags { my $self = shift; croak 'tags must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to tags must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to tags must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/tags', [@_], $options ); } =item tag my $tag = $api->tag( $project_id, $tag_name, ); Sends a C request to C and returns the decoded response content. =cut sub tag { my $self = shift; croak 'tag must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to tag must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to tag must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/repository/tags/:tag_name', [@_], $options ); } =item create_tag my $tag = $api->create_tag( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_tag { my $self = shift; croak 'create_tag must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_tag must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_tag must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/repository/tags', [@_], $options ); } =item delete_tag $api->delete_tag( $project_id, $tag_name, ); Sends a C request to C. =cut sub delete_tag { my $self = shift; croak 'delete_tag must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_tag must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to delete_tag must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/repository/tags/:tag_name', [@_], $options ); return; } =item create_tag_release my $release = $api->create_tag_release( $project_id, $tag_name, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_tag_release { my $self = shift; croak 'create_tag_release must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_tag_release must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to create_tag_release must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_tag_release must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/repository/tags/:tag_name/release', [@_], $options ); } =item update_tag_release my $release = $api->update_tag_release( $project_id, $tag_name, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub update_tag_release { my $self = shift; croak 'update_tag_release must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to update_tag_release must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to update_tag_release must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to update_tag_release must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/repository/tags/:tag_name/release', [@_], $options ); } =back =head2 Todos See L. =over =item todos my $todos = $api->todos( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub todos { my $self = shift; croak 'todos must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to todos must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'todos', [@_], $options ); } =item mark_todo_done my $todo = $api->mark_todo_done( $todo_id, ); Sends a C request to C and returns the decoded response content. =cut sub mark_todo_done { my $self = shift; croak 'mark_todo_done must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($todo_id) to mark_todo_done must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'POST', 'todos/:todo_id/mark_as_done', [@_], $options ); } =item mark_all_todos_done $api->mark_all_todos_done(); Sends a C request to C. =cut sub mark_all_todos_done { my $self = shift; croak "The mark_all_todos_done method does not take any arguments" if @_; my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'POST', 'todos/mark_as_done', [@_], $options ); return; } =back =head2 Users See L. =over =item users my $users = $api->users( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub users { my $self = shift; croak 'users must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to users must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'users', [@_], $options ); } =item user my $user = $api->user( $user_id, ); Sends a C request to C and returns the decoded response content. =cut sub user { my $self = shift; croak 'user must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($user_id) to user must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'users/:user_id', [@_], $options ); } =item create_user $api->create_user( \%params, ); Sends a C request to C. =cut sub create_user { my $self = shift; croak 'create_user must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_user must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'users', [@_], $options ); return; } =item edit_user $api->edit_user( $user_id, \%params, ); Sends a C request to C. =cut sub edit_user { my $self = shift; croak 'edit_user must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to edit_user must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to edit_user must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'PUT', 'users/:user_id', [@_], $options ); return; } =item delete_user $api->delete_user( $user_id, \%params, ); Sends a C request to C. =cut sub delete_user { my $self = shift; croak 'delete_user must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to delete_user must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to delete_user must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'DELETE', 'users/:user_id', [@_], $options ); return; } =item current_user my $user = $api->current_user(); Sends a C request to C and returns the decoded response content. =cut sub current_user { my $self = shift; croak "The current_user method does not take any arguments" if @_; my $options = {}; return $self->_call_rest_client( 'GET', 'user', [@_], $options ); } =item current_user_ssh_keys my $keys = $api->current_user_ssh_keys( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub current_user_ssh_keys { my $self = shift; croak 'current_user_ssh_keys must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to current_user_ssh_keys must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'user/keys', [@_], $options ); } =item user_ssh_keys my $keys = $api->user_ssh_keys( $user_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub user_ssh_keys { my $self = shift; croak 'user_ssh_keys must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to user_ssh_keys must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to user_ssh_keys must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'users/:user_id/keys', [@_], $options ); } =item user_ssh_key my $key = $api->user_ssh_key( $key_id, ); Sends a C request to C and returns the decoded response content. =cut sub user_ssh_key { my $self = shift; croak 'user_ssh_key must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($key_id) to user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'user/keys/:key_id', [@_], $options ); } =item create_current_user_ssh_key $api->create_current_user_ssh_key( \%params, ); Sends a C request to C. =cut sub create_current_user_ssh_key { my $self = shift; croak 'create_current_user_ssh_key must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_current_user_ssh_key must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'user/keys', [@_], $options ); return; } =item create_user_ssh_key $api->create_user_ssh_key( $user_id, \%params, ); Sends a C request to C. =cut sub create_user_ssh_key { my $self = shift; croak 'create_user_ssh_key must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to create_user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_user_ssh_key must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'users/:user_id/keys', [@_], $options ); return; } =item delete_current_user_ssh_key $api->delete_current_user_ssh_key( $key_id, ); Sends a C request to C. =cut sub delete_current_user_ssh_key { my $self = shift; croak 'delete_current_user_ssh_key must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($key_id) to delete_current_user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'user/keys/:key_id', [@_], $options ); return; } =item delete_user_ssh_key $api->delete_user_ssh_key( $user_id, $key_id, ); Sends a C request to C. =cut sub delete_user_ssh_key { my $self = shift; croak 'delete_user_ssh_key must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to delete_user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($key_id) to delete_user_ssh_key must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'users/:user_id/keys/:key_id', [@_], $options ); return; } =item current_user_gpg_keys my $keys = $api->current_user_gpg_keys( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub current_user_gpg_keys { my $self = shift; croak 'current_user_gpg_keys must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to current_user_gpg_keys must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'user/gpg_keys', [@_], $options ); } =item current_user_gpg_key my $key = $api->current_user_gpg_key( $key_id, ); Sends a C request to C and returns the decoded response content. =cut sub current_user_gpg_key { my $self = shift; croak 'current_user_gpg_key must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($key_id) to current_user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'user/gpg_keys/:key_id', [@_], $options ); } =item create_current_user_gpg_key $api->create_current_user_gpg_key( \%params, ); Sends a C request to C. =cut sub create_current_user_gpg_key { my $self = shift; croak 'create_current_user_gpg_key must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_current_user_gpg_key must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{decode} = 0; $options->{content} = $params if defined $params; $self->_call_rest_client( 'POST', 'user/gpg_keys', [@_], $options ); return; } =item delete_current_user_gpg_key $api->delete_current_user_gpg_key( $key_id, ); Sends a C request to C. =cut sub delete_current_user_gpg_key { my $self = shift; croak 'delete_current_user_gpg_key must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($key_id) to delete_current_user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'user/gpg_keys/:key_id', [@_], $options ); return; } =item user_gpg_keys my $keys = $api->user_gpg_keys( $user_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub user_gpg_keys { my $self = shift; croak 'user_gpg_keys must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to user_gpg_keys must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to user_gpg_keys must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'users/:user_id/gpg_keys', [@_], $options ); } =item user_gpg_key my $key = $api->user_gpg_key( $user_id, $key_id, ); Sends a C request to C and returns the decoded response content. =cut sub user_gpg_key { my $self = shift; croak 'user_gpg_key must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($key_id) to user_gpg_key must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'users/:user_id/gpg_keys/:key_id', [@_], $options ); } =item create_user_gpg_key my $keys = $api->create_user_gpg_key( $user_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_user_gpg_key { my $self = shift; croak 'create_user_gpg_key must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to create_user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_user_gpg_key must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'users/:user_id/gpg_keys', [@_], $options ); } =item delete_user_gpg_key $api->delete_user_gpg_key( $user_id, $key_id, ); Sends a C request to C. =cut sub delete_user_gpg_key { my $self = shift; croak 'delete_user_gpg_key must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to delete_user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($key_id) to delete_user_gpg_key must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'users/:user_id/gpg_keys/:key_id', [@_], $options ); return; } =item current_user_emails my $emails = $api->current_user_emails( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub current_user_emails { my $self = shift; croak 'current_user_emails must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to current_user_emails must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'user/emails', [@_], $options ); } =item user_emails my $emails = $api->user_emails( $user_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub user_emails { my $self = shift; croak 'user_emails must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to user_emails must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to user_emails must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'users/:user_id/emails', [@_], $options ); } =item current_user_email my $email = $api->current_user_email( $email_id, ); Sends a C request to C and returns the decoded response content. =cut sub current_user_email { my $self = shift; croak 'current_user_email must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($email_id) to current_user_email must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'GET', 'user/emails/:email_id', [@_], $options ); } =item create_current_user_email my $email = $api->create_current_user_email( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_current_user_email { my $self = shift; croak 'create_current_user_email must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_current_user_email must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'user/emails', [@_], $options ); } =item create_user_email my $email = $api->create_user_email( $user_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_user_email { my $self = shift; croak 'create_user_email must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to create_user_email must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_user_email must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'users/:user_id/emails', [@_], $options ); } =item delete_current_user_email $api->delete_current_user_email( $email_id, ); Sends a C request to C. =cut sub delete_current_user_email { my $self = shift; croak 'delete_current_user_email must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($email_id) to delete_current_user_email must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'user/emails/:email_id', [@_], $options ); return; } =item delete_user_email $api->delete_user_email( $user_id, $email_id, ); Sends a C request to C. =cut sub delete_user_email { my $self = shift; croak 'delete_user_email must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to delete_user_email must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($email_id) to delete_user_email must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'users/:user_id/emails/:email_id', [@_], $options ); return; } =item block_user my $success = $api->block_user( $user_id, ); Sends a C request to C and returns the decoded response content. =cut sub block_user { my $self = shift; croak 'block_user must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($user_id) to block_user must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'POST', 'users/:user_id/block', [@_], $options ); } =item unblock_user my $success = $api->unblock_user( $user_id, ); Sends a C request to C and returns the decoded response content. =cut sub unblock_user { my $self = shift; croak 'unblock_user must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($user_id) to unblock_user must be a scalar' if ref($_[0]) or (!defined $_[0]); my $options = {}; return $self->_call_rest_client( 'POST', 'users/:user_id/unblock', [@_], $options ); } =item user_impersonation_tokens my $tokens = $api->user_impersonation_tokens( $user_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub user_impersonation_tokens { my $self = shift; croak 'user_impersonation_tokens must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to user_impersonation_tokens must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to user_impersonation_tokens must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'users/:user_id/impersonation_tokens', [@_], $options ); } =item user_impersonation_token my $token = $api->user_impersonation_token( $user_id, $impersonation_token_id, ); Sends a C request to C and returns the decoded response content. =cut sub user_impersonation_token { my $self = shift; croak 'user_impersonation_token must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to user_impersonation_token must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($impersonation_token_id) to user_impersonation_token must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'users/:user_id/impersonation_tokens/:impersonation_token_id', [@_], $options ); } =item create_user_impersonation_token my $token = $api->create_user_impersonation_token( $user_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_user_impersonation_token { my $self = shift; croak 'create_user_impersonation_token must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to create_user_impersonation_token must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_user_impersonation_token must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'users/:user_id/impersonation_tokens', [@_], $options ); } =item delete_user_impersonation_token $api->delete_user_impersonation_token( $user_id, $impersonation_token_id, ); Sends a C request to C. =cut sub delete_user_impersonation_token { my $self = shift; croak 'delete_user_impersonation_token must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to delete_user_impersonation_token must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($impersonation_token_id) to delete_user_impersonation_token must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'users/:user_id/impersonation_tokens/:impersonation_token_id', [@_], $options ); return; } =item all_user_activities my $activities = $api->all_user_activities( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub all_user_activities { my $self = shift; croak 'all_user_activities must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to all_user_activities must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'user/activities', [@_], $options ); } =back =head2 Validate the .gitlab-ci.yml See L. =over =item lint my $result = $api->lint( \%params, ); Sends a C request to C and returns the decoded response content. =cut sub lint { my $self = shift; croak 'lint must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to lint must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'lint', [@_], $options ); } =back =head2 Version See L. =over =item version my $version = $api->version(); Sends a C request to C and returns the decoded response content. =cut sub version { my $self = shift; croak "The version method does not take any arguments" if @_; my $options = {}; return $self->_call_rest_client( 'GET', 'version', [@_], $options ); } =back =head2 Wikis See L. =over =item wiki_pages my $pages = $api->wiki_pages( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub wiki_pages { my $self = shift; croak 'wiki_pages must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to wiki_pages must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to wiki_pages must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{query} = $params if defined $params; return $self->_call_rest_client( 'GET', 'projects/:project_id/wikis', [@_], $options ); } =item wiki_page my $pages = $api->wiki_page( $project_id, $slug, ); Sends a C request to C and returns the decoded response content. =cut sub wiki_page { my $self = shift; croak 'wiki_page must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to wiki_page must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($slug) to wiki_page must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; return $self->_call_rest_client( 'GET', 'projects/:project_id/wikis/:slug', [@_], $options ); } =item create_wiki_page my $page = $api->create_wiki_page( $project_id, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub create_wiki_page { my $self = shift; croak 'create_wiki_page must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_wiki_page must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_wiki_page must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'POST', 'projects/:project_id/wikis', [@_], $options ); } =item edit_wiki_page my $page = $api->edit_wiki_page( $project_id, $slug, \%params, ); Sends a C request to C and returns the decoded response content. =cut sub edit_wiki_page { my $self = shift; croak 'edit_wiki_page must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_wiki_page must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($slug) to edit_wiki_page must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_wiki_page must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $options = {}; $options->{content} = $params if defined $params; return $self->_call_rest_client( 'PUT', 'projects/:project_id/wikis/:slug', [@_], $options ); } =item delete_wiki_page $api->delete_wiki_page( $project_id, $slug, ); Sends a C request to C. =cut sub delete_wiki_page { my $self = shift; croak 'delete_wiki_page must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_wiki_page must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($slug) to delete_wiki_page must be a scalar' if ref($_[1]) or (!defined $_[1]); my $options = {}; $options->{decode} = 0; $self->_call_rest_client( 'DELETE', 'projects/:project_id/wikis/:slug', [@_], $options ); return; } =back =cut 1; __END__ =head1 CONTRIBUTING This module is auto-generated from a set of YAML files defining the interface of GitLab's API. If you'd like to contribute to this module then please feel free to make a L and submit a pull request, just make sure you edit the files in the C directory instead of C directly. Please see L for more information. Alternatively, you can L. =head1 SUPPORT Please submit bugs and feature requests to the GitLab-API-v4 GitHub issue tracker: L =head1 ACKNOWLEDGEMENTS Thanks to L for encouraging their employees to contribute back to the open source ecosystem. Without their dedication to quality software development this distribution would not exist. =head1 AUTHORS Aran Clary Deltac Dotan Dimet Nigel Gregoire trunov-ms Marek R. Sotola José Joaquín Atria Dave Webb Simon Ruderich royce55 gregor herrmann Luc Didry Kieren Diment Dmitry Frolov Thomas Klausner =head1 COPYRIGHT AND LICENSE Copyright (C) 2014 Aran Clary Deltac This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see L. =cut Config.pm100644000766000024 1316413621075102 17466 0ustar00aranstaff000000000000GitLab-API-v4-0.25/lib/GitLab/API/v4package GitLab::API::v4::Config; our $VERSION = '0.25'; =encoding utf8 =head1 NAME GitLab::API::v4::Config - Load configuration from a file, environment, and/or CLI options. =head1 SYNOPSIS use GitLab::API::v4; use GitLab::API::v4::Config; my $config = GitLab::API::v4::Config->new(); my $api = GitLab::API::v4->new( $config->args() ); =head1 DESCRIPTION This module is used by L to load configuration. If you are using L directly then this module will not be automatically used, but you are welcome to explicitly use it as shown in the L. =cut use Getopt::Long; use IO::Prompter; use JSON; use Log::Any qw( $log ); use Path::Tiny; use Types::Common::String -types; use Types::Standard -types; use Moo; use strictures 2; use namespace::clean; sub _filter_args { my ($self, $args) = @_; return { map { $_ => $args->{$_} } grep { $args->{$_} } keys %$args }; } =head1 ARGUMENTS =head2 file The file to load configuration from. The file should hold valid JSON. By default this will be set to C<.gitlab-api-v4-config> in the current user's home directory. This can be overridden with the C environment variable or the C<--config-file=...> command line argument. =cut has file => ( is => 'lazy', isa => NonEmptySimpleStr, ); sub _build_file { my ($self) = @_; my $file = $self->opt_args->{config_file} || $self->env_args->{config_file}; return $file if $file; my ($home) = ( getpwuid($<) )[7]; return '' . path( $home )->child('.gitlab-api-v4-config'); } =head1 ATTRIBUTES =head2 opt_args Returns a hashref of arguments derived from command line options. Supported options are: --config_file=... --url=... --private-token=... --access-token=... --retries=... Note that the options are read from, and removed from, C<@ARGV>. Due to this the arguments are saved internally and re-used for all instances of this class so that there are no weird race conditions. =cut has opt_args => ( is => 'rwp', isa => HashRef, default => sub{ {} }, ); =head2 env_args Returns a hashref of arguments derived from environment variables. Supported environment variables are: GITLAB_API_V4_CONFIG_FILE GITLAB_API_V4_URL GITLAB_API_V4_PRIVATE_TOKEN GITLAB_API_V4_ACCESS_TOKEN GITLAB_API_V4_RETRIES =cut has env_args => ( is => 'lazy', isa => HashRef, ); sub _build_env_args { my ($self) = @_; return $self->_filter_args({ config_file => $ENV{GITLAB_API_V4_CONFIG_FILE}, url => $ENV{GITLAB_API_V4_URL}, private_token => $ENV{GITLAB_API_V4_PRIVATE_TOKEN}, access_token => $ENV{GITLAB_API_V4_ACCESS_TOKEN}, retries => $ENV{GITLAB_API_V4_RETRIES}, }); } =head2 file_args Returns a hashref of arguments gotten by decoding the JSON in the L. =cut has file_args => ( is => 'lazy', isa => HashRef, ); sub _build_file_args { my ($self) = @_; my $file = $self->file(); return {} if !-r $file; $file = path( $file ); $log->debugf( 'Loading configuration for GitLab::API::v4 from: %s', $file->absolute() ); my $json = $file->slurp(); my $data = decode_json( $json ); return $self->_filter_args( $data ); } =head2 args Returns a final, combined, hashref of arguments containing everything in L, L, and L. If there are any duplicate arguments then L has highest precedence, L is next, and at the bottom is L. =cut sub args { my ($self) = @_; return { %{ $self->file_args() }, %{ $self->env_args() }, %{ $self->opt_args() }, }; } =head1 METHODS =head2 get_options =cut sub get_options { my ($self, @extra) = @_; Getopt::Long::Configure(qw( gnu_getopt no_ignore_case )); my $opt_args = {}; GetOptions( 'config-file=s' => \$opt_args->{config_file}, 'url=s' => \$opt_args->{url}, 'private-token=s' => \$opt_args->{private_token}, 'access-token=s' => \$opt_args->{access_token}, 'retries=i' => \$opt_args->{retries}, @extra, ) or die('Unable to process options!'); $opt_args = $self->_filter_args( $opt_args ); $self->_set_opt_args( $opt_args ); return; } =head2 configure When called this method interactively prompts the user for argument values and then encodes them as JSON and stores them in L. The file will be chmod'ed C<0600> so that only the current user may read or write to the file. =cut sub configure { my ($self) = @_; my $url = prompt( 'Full URL to a v4 GitLab API:', '-stdio', '-verbatim', ); my $private_token = prompt( 'Private Token:', -echo=>'', '-stdio', '-verbatim', ); my $access_token = prompt( 'Access Token:', -echo=>'', '-stdio', '-verbatim', ); my $json = JSON->new ->pretty ->canonical ->encode({ $url ? (url=>$url) : (), $private_token ? (private_token=>$private_token) : (), $access_token ? (access_token=>$access_token) : (), }); my $file = path( $self->file() ); $file->touch(); $file->chmod( 0600 ); $file->append( {truncate=>1}, $json ); $log->infof( 'Configuration for GitLab::API::v4 saved to: %s', $file->absolute() ); return; } 1; __END__ =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 COPYRIGHT AND LICENSE See L. =cut Constants.pm100644000766000024 605213621075102 20213 0ustar00aranstaff000000000000GitLab-API-v4-0.25/lib/GitLab/API/v4package GitLab::API::v4::Constants; our $VERSION = '0.25'; =encoding utf8 =head1 NAME GitLab::API::v4::Constants - GitLab API v4 constants. =head1 SYNOPSIS use GitLab::API::v4::Constants qw( :all ); print $GITLAB_ACCESS_LEVEL_GUEST; # 10 =cut use Const::Fast; use strictures 2; use namespace::clean; use Exporter qw( import ); our @EXPORT_OK; our %EXPORT_TAGS = ( all => \@EXPORT_OK ); =head1 CONSTANTS =head2 $GITLAB_ACCESS_LEVEL_NO_ACCESS C<0> =cut const our $GITLAB_ACCESS_LEVEL_NO_ACCESS => 0; push @EXPORT_OK, '$GITLAB_ACCESS_LEVEL_NO_ACCESS'; =head2 $GITLAB_ACCESS_LEVEL_GUEST C<10> =cut const our $GITLAB_ACCESS_LEVEL_GUEST => 10; push @EXPORT_OK, '$GITLAB_ACCESS_LEVEL_GUEST'; =head2 $GITLAB_ACCESS_LEVEL_REPORTER C<20> =cut const our $GITLAB_ACCESS_LEVEL_REPORTER => 20; push @EXPORT_OK, '$GITLAB_ACCESS_LEVEL_REPORTER'; =head2 $GITLAB_ACCESS_LEVEL_DEVELOPER C<30> =cut const our $GITLAB_ACCESS_LEVEL_DEVELOPER => 30; push @EXPORT_OK, '$GITLAB_ACCESS_LEVEL_DEVELOPER'; =head2 $GITLAB_ACCESS_LEVEL_MASTER C<40> =cut const our $GITLAB_ACCESS_LEVEL_MASTER => 40; push @EXPORT_OK, '$GITLAB_ACCESS_LEVEL_MASTER'; =head2 $GITLAB_ACCESS_LEVEL_OWNER C<50> =cut const our $GITLAB_ACCESS_LEVEL_OWNER => 50; push @EXPORT_OK, '$GITLAB_ACCESS_LEVEL_OWNER'; =head2 @GITLAB_ACCESS_LEVELS An array containing the values for L, L, L, L, L, and L. =cut const our @GITLAB_ACCESS_LEVELS => ( $GITLAB_ACCESS_LEVEL_NO_ACCESS, $GITLAB_ACCESS_LEVEL_GUEST, $GITLAB_ACCESS_LEVEL_REPORTER, $GITLAB_ACCESS_LEVEL_DEVELOPER, $GITLAB_ACCESS_LEVEL_MASTER, $GITLAB_ACCESS_LEVEL_OWNER, ); push @EXPORT_OK, '@GITLAB_ACCESS_LEVELS'; =head2 $GITLAB_SNIPPET_VISIBILITY_LEVEL_PRIVATE C =cut const our $GITLAB_SNIPPET_VISIBILITY_LEVEL_PRIVATE => 'private'; push @EXPORT_OK, '$GITLAB_SNIPPET_VISIBILITY_LEVEL_PRIVATE'; =head2 $GITLAB_SNIPPET_VISIBILITY_LEVEL_INTERNAL C =cut const our $GITLAB_SNIPPET_VISIBILITY_LEVEL_INTERNAL => 'internal'; push @EXPORT_OK, '$GITLAB_SNIPPET_VISIBILITY_LEVEL_INTERNAL'; =head2 $GITLAB_SNIPPET_VISIBILITY_LEVEL_PUBLIC C =cut const our $GITLAB_SNIPPET_VISIBILITY_LEVEL_PUBLIC => 'public'; push @EXPORT_OK, '$GITLAB_SNIPPET_VISIBILITY_LEVEL_PUBLIC'; =head2 @GITLAB_SNIPPET_VISIBILITY_LEVELS An array containing the values for L, L, and L. =cut const our @GITLAB_SNIPPET_VISIBILITY_LEVELS => ( $GITLAB_SNIPPET_VISIBILITY_LEVEL_PRIVATE, $GITLAB_SNIPPET_VISIBILITY_LEVEL_INTERNAL, $GITLAB_SNIPPET_VISIBILITY_LEVEL_PUBLIC, ); push @EXPORT_OK, '@GITLAB_SNIPPET_VISIBILITY_LEVELS'; 1; __END__ =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 COPYRIGHT AND LICENSE See L. =cut Mock.pm100755000766000024 233213621075102 17130 0ustar00aranstaff000000000000GitLab-API-v4-0.25/lib/GitLab/API/v4package GitLab::API::v4::Mock; our $VERSION = '0.25'; =encoding utf8 =head1 NAME GitLab::API::v4::Mock - Mock API object for testing. =head1 SYNOPSIS use GitLab::API::v4::Mock; my $api = GitLab::API::v4::Mock->new(); =head1 DESCRIPTION This module is a subclass of L. It modifies it to mock the REST client via L. This module is meant to be used for writing unit tests. =cut use GitLab::API::v4::Mock::RESTClient; use Moo; use strictures 2; use namespace::clean; extends 'GitLab::API::v4'; =head1 ATTRIBUTES =head2 url This attribute is altered from L to default to C and to not be required. =cut has '+url' => ( required => 0, default => 'https://example.com/api/v4', ); =head2 rest_client_class This attribute is altered from L to default to L. =cut sub _build_rest_client_class { return 'GitLab::API::v4::Mock::RESTClient'; } 1; __END__ =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 COPYRIGHT AND LICENSE See L. =cut Engine.pm100755000766000024 704213621075102 20340 0ustar00aranstaff000000000000GitLab-API-v4-0.25/lib/GitLab/API/v4/Mockpackage GitLab::API::v4::Mock::Engine; our $VERSION = '0.25'; =encoding utf8 =head1 NAME GitLab::API::v4::Mock::Engine - Mocking the internals of a GitLab server. =head1 SYNOPSIS use GitLab::API::v4::Mock::Engine; my $engine = GitLab::API::v4::Mock::Engine->new(); my $user = $engine->create_user({ email => $email, username => $username, name => $name, ..., }); print "User created with ID: $user->{id}\n"; =head1 DESCRIPTION This module provides the tooling to run a mock of the internal state of a GitLab server. At this time very little is validated. For example, when you create a user with L there is no logic which double checks that you specify the required C field or that you don't put in fields that are unexpected. =cut use Moo; use strictures 2; use namespace::clean; =head1 ATTRIBUTES =head2 next_ids my $ids = $engine->next_ids(); A hash reference containing object types to the next ID. Used by L. =cut has next_ids => ( is => 'ro', init_arg => undef, default => sub{ {} }, ); =head2 users my $users = $engine->users(); foreach my $user (@$users) { ... } Returns the full array reference of all users hash references. =cut has users => ( is => 'ro', init_arg => undef, default => sub{ [] }, ); =head1 METHODS =head2 next_id_for my $id = $engine->next_id_for( 'user' ); Given an object type this will return the next unused ID. =cut sub next_id_for { my ($self, $for) = @_; my $next_id = $self->next_ids->{$for} || 1; $self->next_ids->{$for} = $next_id + 1; return $next_id; } =head1 USER METHODS =head2 user my $user = $engine->user( $id ); Returns a user hash reference for the given ID. If no user is found with the ID then C is returned. =cut sub user { my ($self, $id) = @_; foreach my $user (@{ $self->users() }) { return $user if $user->{id} == $id; } return undef; } =head2 create_user my $user = $engine->create_user( $user ); my $id = $user->{id}; Takes a user hash reference, sets the C field, and stores it in L. Returns the updated user hash reference. =cut sub create_user { my ($self, $user) = @_; $user->{id} = $self->next_id_for( 'user' ); push @{ $self->users() }, $user; return $user; } =head2 update_user my $user = $engine->update_user( $id, $new_user_data ); Takes the ID of the user to update and a hash reference of fields to update. Returns the updated user hash reference. =cut sub update_user { my ($self, $id, $data) = @_; my $user = $self->user( $id ); return undef if !$user; %$user = ( %$user, %$data, ); return $user; } =head2 delete_user my $user = $engine->delete_user( $id ); Deletes the user with the specified ID from L. If no user is found with the ID then C is returned. Otherwise the user hash reference is returned. =cut sub delete_user { my ($self, $id) = @_; my $users = $self->users(); my @new; my $found_user; foreach my $user (@$users) { if ($user->{id} == $id and !$found_user) { $found_user = $user; next; } push @new, $user; } return undef if !$found_user; @$users = @new; return $found_user; } 1; __END__ =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 COPYRIGHT AND LICENSE See L. =cut RESTClient.pm100755000766000024 642513621075102 21053 0ustar00aranstaff000000000000GitLab-API-v4-0.25/lib/GitLab/API/v4/Mockpackage GitLab::API::v4::Mock::RESTClient; our $VERSION = '0.25'; =encoding utf8 =head1 NAME GitLab::API::v4::Mock::RESTClient - Mocked REST client that doesn't actually make HTTP requests. =head1 DESCRIPTION This module is a subclass of L. It modifies it to divert HTTP requests to L rather than making live requests. This module is used by L. =cut use GitLab::API::v4::Mock::Engine; use JSON; use URI; use Moo; use strictures 2; use namespace::clean; extends 'GitLab::API::v4::RESTClient'; my @ENDPOINTS; sub has_endpoint { my ($method, $path_re, $sub) = @_; push @ENDPOINTS, [ $method, $path_re, $sub, ]; return; } sub _http_tiny_request { my ($self, $req_method, $req) = @_; die "req_method may only be 'request' at this time" if $req_method ne 'request'; my ($http_method, $url, $options) = @$req; my $path = URI->new( $url )->path(); $path =~ s{^.*api/v4/}{}; foreach my $endpoint (@ENDPOINTS) { my ($endpoint_method, $path_re, $sub) = @$endpoint; next if $endpoint_method ne $http_method; next if $path !~ $path_re; my @captures = ($path =~ $path_re); my ($status, $content) = $sub->( $self, [$http_method, $url, $options], @captures, ); $content = encode_json( $content ) if ref $content; return { status => $status, success => ($status =~ m{^2\d\d$}) ? 1 : 0, defined( $content ) ? (content=>$content) : (), }; } die "No endpoint matched the $http_method '$path' endpoint"; } =head1 ATTRIBUTES =head2 engine The L used behind the hood. =cut has engine => ( is => 'lazy', init_arg => undef, ); sub _build_engine { return GitLab::API::v4::Mock::Engine->new(); } =head1 USER ENDPOINTS =head2 GET users Handles L. =cut has_endpoint GET => qr{^users$}, sub{ my ($self) = @_; return 200, $self->engine->users(); }; =head2 GET user/:id Handles L. =cut has_endpoint GET => qr{^users/(\d+)$}, sub{ my ($self, $req, $id) = @_; my $user = $self->engine->user( $id ); return 404 if !$user; return 200, $user; }; =head2 POST users Handles L. =cut has_endpoint POST => qr{^users$}, sub{ my ($self, $req) = @_; my $user = decode_json( $req->[2]->{content} ); $self->engine->create_user( $user ); return 204; }; =head2 PUT user/:id Handles L. =cut has_endpoint PUT => qr{^users/(\d+)$}, sub{ my ($self, $req, $id) = @_; my $data = decode_json( $req->[2]->{content} ); my $user = $self->engine->update_user( $id, $data ); return 404 if !$user; return 204; }; =head2 DELETE user/:id Handles L. =cut has_endpoint DELETE => qr{^users/(\d+)$}, sub{ my ($self, $req, $id) = @_; my $user = $self->engine->delete_user( $id ); return 404 if !$user; return 204; }; 1; __END__ =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 COPYRIGHT AND LICENSE See L. =cut Paginator.pm100644000766000024 757513621075102 20176 0ustar00aranstaff000000000000GitLab-API-v4-0.25/lib/GitLab/API/v4package GitLab::API::v4::Paginator; our $VERSION = '0.25'; =encoding utf8 =head1 NAME GitLab::API::v4::Paginator - Iterate through paginated GitLab v4 API records. =head1 DESCRIPTION There should be no need to create objects of this type directly, instead use L which simplifies things a bit. =cut use Carp qw( croak ); use Types::Common::String -types; use Types::Standard -types; use Moo; use strictures 2; use namespace::clean; =head1 REQUIRED ARGUMENTS =head2 method The name of the method subroutine to call on the L object to get records from. This method must accept a hash ref of parameters as the last argument, adhere to the C and C parameters, and return an array ref. =cut has method => ( is => 'ro', isa => NonEmptySimpleStr, required => 1, ); =head2 api The L object. =cut has api => ( is => 'ro', isa => InstanceOf[ 'GitLab::API::v4' ], required => 1, ); =head1 OPTIONAL ARGUMENTS =head2 args The arguments to use when calling the L, the same arguments you would use when you call the method yourself on the L object, minus the C<\%params> hash ref. =cut has args => ( is => 'ro', isa => ArrayRef, default => sub{ [] }, ); =head2 params The C<\%params> hash ref argument. =cut has params => ( is => 'ro', isa => HashRef, default => sub{ {} }, ); =head1 METHODS =cut has _records => ( is => 'rw', init_arg => undef, default => sub{ [] }, ); has _page => ( is => 'rw', init_arg => undef, default => 0, ); has _last_page => ( is => 'rw', init_arg => undef, default => 0, ); =head2 next_page while (my $records = $paginator->next_page()) { ... } Returns an array ref of records for the next page. =cut sub next_page { my ($self) = @_; return if $self->_last_page(); my $page = $self->_page() + 1; my $params = $self->params(); my $per_page = $params->{per_page} || 20; $params = { %$params, page => $page, per_page => $per_page, }; my $method = $self->method(); my $records = $self->api->$method( @{ $self->args() }, $params, ); croak("The $method method returned a non array ref value") if ref($records) ne 'ARRAY'; $self->_page( $page ); $self->_last_page( 1 ) if @$records < $per_page; $self->_records( [ @$records ] ); return if !@$records; return $records; } =head2 next while (my $record = $paginator->next()) { ... } Returns the next record in the current page. If all records have been exhausted then L will automatically be called. This way if you want to ignore pagination you can just call C over and over again to walk through all the records. =cut sub next { my ($self) = @_; my $records = $self->_records(); return shift(@$records) if @$records; return if $self->_last_page(); $self->next_page(); $records = $self->_records(); return shift(@$records) if @$records; return; } =head2 all my $records = $paginator->all(); This is just an alias for calling L over and over again to build an array ref of all records. =cut sub all { my ($self) = @_; $self->reset(); my @records; while (my $page = $self->next_page()) { push @records, @$page; } return \@records; } =head2 reset $paginator->reset(); Reset the paginator back to its original state on the first page with no records retrieved yet. =cut sub reset { my ($self) = @_; $self->_records( [] ); $self->_page( 0 ); $self->_last_page( 0 ); return; } 1; __END__ =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 COPYRIGHT AND LICENSE See L. =cut RESTClient.pm100644000766000024 1601413621075102 20172 0ustar00aranstaff000000000000GitLab-API-v4-0.25/lib/GitLab/API/v4package GitLab::API::v4::RESTClient; our $VERSION = '0.25'; =encoding utf8 =head1 NAME GitLab::API::v4::RESTClient - The HTTP client that does the heavy lifting. =head1 DESCRIPTION Currently this class uses L and L to do its job. This may change, and the interface may change, so documentation is lacking in order to not mislead people. If you do want to customize how this class works then take a look at the source. =head1 ATTRIBUTES =head1 http_tiny_request my $req = $api->rest_client->http_tiny_request(); The most recent request arrayref as passed to L. If this is C then no request has been made. =head1 http_tiny_response my $res = $api->rest_client->http_tiny_response(); The most recent response hashref as passed back from L. If this is C and L is defined then no response was received and you will have encountered an error when making the request =cut use Carp qw(); use HTTP::Tiny::Multipart; use HTTP::Tiny; use JSON; use Log::Any qw( $log ); use Path::Tiny; use Try::Tiny; use Types::Common::Numeric -types; use Types::Common::String -types; use Types::Standard -types; use URI::Escape; use URI; use Moo; use strictures 2; use namespace::clean; sub croak { local $Carp::Internal{ 'GitLab::API::v4' } = 1; local $Carp::Internal{ 'GitLab::API::v4::RESTClient' } = 1; return Carp::croak( @_ ); } sub croakf { my $msg = shift; $msg = sprintf( $msg, @_ ); return croak( $msg ); } has _clean_base_url => ( is => 'lazy', init_arg => undef, builder => '_build_clean_base_url', ); sub _build_clean_base_url { my ($self) = @_; my $url = $self->base_url(); # Remove any leading slash so that request() does not build URLs # with double slashes when joining the base_url with the path. # If double slashes were allowed then extra unecessary redirects # could happen. $url =~ s{/+$}{}; return URI->new( $url )->canonical(); } has base_url => ( is => 'ro', isa => NonEmptySimpleStr, required => 1, ); has retries => ( is => 'ro', isa => PositiveOrZeroInt, default => 0, ); has http_tiny => ( is => 'lazy', isa => InstanceOf[ 'HTTP::Tiny' ], ); sub _build_http_tiny { return HTTP::Tiny->new(); } has json => ( is => 'lazy', isa => HasMethods[ 'encode', 'decode' ], ); sub _build_json { return JSON->new->utf8->allow_nonref(); } has http_tiny_request => ( is => 'ro', writer => '_set_request', clearer => '_clear_request', init_arg => undef, ); has http_tiny_response => ( is => 'ro', writer => '_set_response', clearer => '_clear_response', init_arg => undef, ); # The purpose of this method is for tests to have a place to inject themselves. sub _http_tiny_request { my ($self, $req_method, $req) = @_; return $self->http_tiny->$req_method( @$req ); } sub request { my ($self, $verb, $raw_path, $path_vars, $options) = @_; $self->_clear_request(); $self->_clear_response(); $options = { %{ $options || {} } }; my $query = delete $options->{query}; my $content = delete $options->{content}; my $headers = $options->{headers} = { %{ $options->{headers} || {} } }; # Convert foo/:bar/baz into foo/%s/baz. my $path = $raw_path; $path =~ s{:[^/]+}{%s}g; # sprintf will throw if the number of %s doesn't match the size of @$path_vars. # Might be nice to catch that and provide a better error message, but that should # never happen as the API methods verify the argument size before we get here. $path = sprintf($path, (map { uri_escape($_) } @$path_vars)) if @$path_vars; $log->tracef( 'Making %s request against %s', $verb, $path ); my $url = $self->_clean_base_url->clone(); $url->path( $url->path() . '/' . $path ); $url->query_form( $query ) if defined $query; $url = "$url"; # No more changes to the url from this point forward. my $req_method = 'request'; my $req = [ $verb, $url, $options ]; if ($verb eq 'POST' and ref($content) eq 'HASH' and $content->{file}) { $content = { %$content }; my $file = path( delete $content->{file} ); unless (-f $file and -r $file) { local $Carp::Internal{ 'GitLab::API::v4' } = 1; local $Carp::Internal{ 'GitLab::API::v4::RESTClient' } = 1; croak "File $file is not readable"; } # Might as well mask the filename, but leave the extension. my $filename = $file->basename(); # foo/bar.txt => bar.txt $filename =~ s{^.*?(\.[^.]+|)}{upload$1}; # bar.txt => upload.txt my $data = { file => { filename => $filename, content => $file->slurp(), }, }; $req->[0] = $req->[1]; # Replace method with url. $req->[1] = $data; # Put data where url was. # So, req went from [$verb,$url,$options] to [$url,$data,$options], # per the post_multipart interface. $req_method = 'post_multipart'; $content = undef if ! %$content; } if (ref $content) { $content = $self->json->encode( $content ); $headers->{'content-type'} = 'application/json'; $headers->{'content-length'} = length( $content ); } $options->{content} = $content if defined $content; $self->_set_request( $req ); my $res; my $tries_left = $self->retries(); do { $res = $self->_http_tiny_request( $req_method, $req ); if ($res->{status} =~ m{^5}) { $tries_left--; $log->warn('Request failed; retrying...') if $tries_left > 0; } else { $tries_left = 0 } } while $tries_left > 0; $self->_set_response( $res ); if ($res->{status} eq '404' and $verb eq 'GET') { return undef; } # Special case for: # https://github.com/bluefeet/GitLab-API-v4/issues/35#issuecomment-515533017 if ($res->{status} eq '403' and $verb eq 'GET' and $raw_path eq 'projects/:project_id/releases/:tag_name') { return undef; } if ($res->{success}) { return undef if $res->{status} eq '204'; my $decode = $options->{decode}; $decode = 1 if !defined $decode; return $res->{content} if !$decode; return try{ $self->json->decode( $res->{content} ); } catch { croakf( 'Error decoding JSON (%s %s %s): ', $verb, $url, $res->{status}, $_, ); }; } my $glimpse = $res->{content} || ''; $glimpse =~ s{\s+}{ }g; if ( length($glimpse) > 50 ) { $glimpse = substr( $glimpse, 0, 50 ); $glimpse .= '...'; } croakf( 'Error %sing %s (HTTP %s): %s %s', $verb, $url, $res->{status}, ($res->{reason} || 'Unknown'), $glimpse, ); } 1; __END__ =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 COPYRIGHT AND LICENSE See L. =cut WWWClient.pm100644000766000024 753313621075102 20067 0ustar00aranstaff000000000000GitLab-API-v4-0.25/lib/GitLab/API/v4package GitLab::API::v4::WWWClient; our $VERSION = '0.25'; =encoding utf8 =head1 NAME GitLab::API::v4::WWWClient - A client that works against the GitLab web site. =head1 SYNOPSIS use GitLab::API::v4::WWWClient; my $client = GitLab::API::v4::WWWClient->new( url => 'https://git.example.com/', ); $client->sign_in( $username, $password ); my $res = $client->get( $path ); =head1 DESCRIPTION This class makes it possible to interact with the GitLab web site. =cut use Carp qw( croak ); use HTTP::Tiny; use Types::Common::String qw( NonEmptySimpleStr ); use Moo; use strictures 2; use namespace::clean; has _session => ( is => 'rw', init_arg => undef, ); sub _croak_res { my ($verb, $url, $res) = @_; return if $res->{status} !~ m{^5}; local $Carp::Internal{ 'GitLab::API::v4::WWWClient' } = 1; croak sprintf( 'Error %sing %s (HTTP %s): %s', uc($verb), $url, $res->{status}, ($res->{reason} || 'Unknown'), ); } =head1 REQUIRED ARGUMENTS =head2 url This is the base URL to your GitLab web site. =cut has url => ( is => 'ro', isa => NonEmptySimpleStr, required => 1, ); =head1 METHODS =head2 sign_in $client->sign_in( $username, $password ); Signs in the client given the username and password. =cut sub sign_in { my ($self, $username, $password) = @_; my $tiny = HTTP::Tiny->new( max_redirect => 0, ); my $base_url = $self->url(); $base_url =~ s{/$}{}; my $sign_in_url = "$base_url/users/sign_in"; my $load_res = $tiny->get( $sign_in_url ); _croak_res( 'get', $sign_in_url, $load_res ); my $token = ( $load_res->{content} =~ m{name="authenticity_token" value="(.+?)"} )[0]; my $first_session = ( $load_res->{headers}->{'set-cookie'} =~ m{_gitlab_session=(.+?);} )[0]; my $submit_res = $tiny->post_form( $sign_in_url, { 'utf8' => '✓', 'authenticity_token' => $token, 'user[login]' => $username, 'user[password]' => $password, 'user[remember_me]' => 0, }, { headers => { 'Referer' => $sign_in_url, 'Cookie' => "_gitlab_session=$first_session", 'Cookie2' => '$Version="1"', }, }, ); _croak_res( 'post', $sign_in_url, $submit_res ); my $second_session = ( $submit_res->{headers}->{'set-cookie'} =~ m{_gitlab_session=(.+?);} )[0]; my $home_res = $tiny->get( $base_url, { headers => { 'Referer' => $sign_in_url, 'Cookie' => "_gitlab_session=$second_session", 'Cookie2' => '$Version="1"', }, }, ); _croak_res( 'get', $base_url, $home_res ); my $ok = ( $home_res->{content} =~ m{sign-out-link} ) ? 1 : 0; croak 'Failed to sign in' if !$ok; $self->_session( $second_session ); return; } =head2 get my $res = $client->get( $path ); Gets the path and returns the L response hash. =cut sub get { my ($self, $path) = @_; my $tiny = HTTP::Tiny->new( max_redirect => 0, ); my $base_url = $self->url(); $base_url =~ s{/$}{}; $path =~ s{^/}{}; my $url = "$base_url/$path"; my $session = $self->_session(); my $headers = $session ? { 'Cookie' => "_gitlab_session=$session", 'Cookie2' => '$Version="1"', } : {}; my $res = $tiny->get( $url, { headers=>$headers }, ); _croak_res( 'get', $url, $res ); return $res; } 1; __END__ =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 COPYRIGHT AND LICENSE See L. =cut minil.toml100644000766000024 15413621075102 15011 0ustar00aranstaff000000000000GitLab-API-v4-0.25name = "GitLab-API-v4" authority="cpan:BLUEFEET" markdown_maker = "Pod::Markdown::Github" license = "gpl_3" gitlab-api-v4100755000766000024 1222113621075102 16634 0ustar00aranstaff000000000000GitLab-API-v4-0.25/script#!/usr/bin/env perl use strictures 2; use GitLab::API::v4::Config; use GitLab::API::v4::Constants qw( :all ); use GitLab::API::v4; use JSON; use Log::Any qw( $log ); use Log::Any::Adapter::Screen; use Log::Any::Adapter; use Pod::Usage qw( pod2usage ); use Try::Tiny; if (!@ARGV) { print "USAGE: gitlab-api-v4 help\n"; exit 0; } my $config = GitLab::API::v4::Config->new(); $config->get_options( 'a|all' => \my $all, 'p|pretty' => \my $pretty, 'c|canonical' => \my $canonical, 'h|help' => \my $help, 'v|verbose' => \my $verbose, 'q|quiet' => \my $quiet, ); if ($help or (@ARGV and $ARGV[0] eq 'help')) { pod2usage( -verbose => 2 ); exit 0; } if (@ARGV and $ARGV[0] eq 'configure') { $config->configure(); exit 0; } my $min_level = 'info'; $min_level = 'trace' if $verbose; $min_level = 'error' if $quiet; Log::Any::Adapter->set( 'Screen', min_level => $min_level, stderr => 1, ); my $method = shift @ARGV; die "ERROR: No API method specified.\n" if !$method; my $orig_method = $method; $method =~ s{-}{_}g; die "ERROR: Unknown API method \"$orig_method\".\n" if !GitLab::API::v4->can( $method ); my @args; while (@ARGV and $ARGV[0] !~ m{:}) { my $arg = shift @ARGV; next if $arg eq '--'; push @args, $arg; } my $aliases = { access_level => { guest => $GITLAB_ACCESS_LEVEL_GUEST, reporter => $GITLAB_ACCESS_LEVEL_REPORTER, developer => $GITLAB_ACCESS_LEVEL_DEVELOPER, master => $GITLAB_ACCESS_LEVEL_MASTER, owner => $GITLAB_ACCESS_LEVEL_OWNER, }, }; my $params = {}; while (@ARGV) { my $arg = shift @ARGV; next if $arg eq '--'; if ($arg =~ m{^([^:]+):(.*)$}) { my ($key, $value) = ($1, $2); $key =~ s{-}{_}g; if ($aliases->{$key} and exists $aliases->{$key}->{$value}) { $value = $aliases->{$key}->{$value}; } $params->{$key} = $value; } else { die "ERROR: Invalid API parameter \"$arg\".\n"; } } # Make sure we don't leak tokens in the logs. my $debug_config = { %{ $config->args() } }; $debug_config->{private_token} = 'xxxx' if $debug_config->{private_token}; $debug_config->{access_token} = 'xxxx' if $debug_config->{access_token}; $log->debug('config: ' . encode_json($debug_config)); $log->debug("method: $method"); $log->debug('arguments: ' . encode_json(\@args)); $log->debug('params: ' . encode_json($params)); my $api = GitLab::API::v4->new( $config->args() ); if ($all) { unshift @args, $method; $method = 'paginator'; } my $data = $api->$method( @args, %$params ? $params : (), ); $data = $data->all() if $all; binmode STDOUT, ':utf8'; my $json = JSON->new->allow_nonref(); $json->pretty() if $pretty; $json->canonical() if $canonical; print $json->encode( $data ); __END__ =encoding utf8 =head1 NAME gitlab-api-v4 - Command line interface to the GitLab API v4. =head1 SYNOPSIS # Generally: gitlab-api-v4 [] [ ...] [: ...] # List all groups: gitlab-api-v4 groups # List information about a project: gitlab-api-v4 project # Create an admin user: gitlab-api-v4 create-user \ username:foo \ password:xxxxxxxx \ email:user@example.com \ "name:Foo Smith" \ admin:1 =head1 CONFIGURING You may configure this module with environment variables, command line options, and a configuration file. To setup the configuration file run: gitlab-api-v4 configure This will ask several interactive questions to help you configure this script. The information, which may include GitLab authentication tokens, is stored in C<~/.gitlab-api-v4.json>. Read more at L. =head1 OPTIONS =head2 url --url= Sets L. =head2 access-token --access-token= Sets L. =head2 private-token --private-token= Sets L. =head2 retries --retries= Sets L. =head2 all --all -a Retrieves all results when the results would normally be paged. See L for details. =head2 pretty --pretty -p Enables the L feature. =head2 canonical --canonical -c Enables the L feature. =head1 API METHOD The API method to call - one of the methods documented in L. =head1 API ARGUMENTS ... Any arguments that the L requires. =head1 API PARAMETERS : ... Any parameters that the L accepts. =head2 access-level access-level:guest access-level:reporter access-level:developer access-level:master access-level:owner There are mappings setup for the various C parameters so that you can, for example, specify C and it will be automatically converted to C. =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 COPYRIGHT AND LICENSE See L. =cut gitlab-api-v4.t100755000766000024 115113621075102 16015 0ustar00aranstaff000000000000GitLab-API-v4-0.25/t#!/usr/bin/env perl use strictures 2; use Test2::Require::AuthorTesting; use Test2::V0; use IPC::Cmd qw(); use JSON qw(); my $json = JSON->new->allow_nonref(); my $project = run('create-project', 'name:test-gitlab-api-v4'); run('delete-project', $project->{id}); ok( 1, 'made it to the end' ); done_testing; sub run { local $ENV{PERL5LIB} = 'lib'; my($ok, $error, $full, $stdout, $stderr) = IPC::Cmd::run( command => ['script/gitlab-api-v4', @_] ); if ($ok) { $stdout = join('',@$stdout); return $json->decode( $stdout ); } die join('', @$stderr) . $error; } 1; regression.t100755000766000024 1423113621075102 15660 0ustar00aranstaff000000000000GitLab-API-v4-0.25/t#!/usr/bin/env perl use strictures 2; use Test2::Require::AuthorTesting; use Test2::V0; use Log::Any::Adapter 'TAP'; use MIME::Base64 qw( decode_base64 ); use Path::Tiny; use GitLab::API::v4::Config; use GitLab::API::v4::WWWClient; use GitLab::API::v4; my $config = GitLab::API::v4::Config->new(); my $api = GitLab::API::v4->new( $config->args() ); subtest projects => sub{ my $stamp = time(); my $project_name = "gitlab-api-v4-test-$stamp"; my $created_project = $api->create_project( { name=>$project_name }, ); ok( $created_project, 'project created' ); my $project_id = $created_project->{id}; my $project = $api->project( $project_id ); ok( $project, 'project found' ); subtest upload_file_to_project => sub{ my $file = Path::Tiny->tempfile( SUFFIX => '.txt' ); my $file_content = 'Hello GitLab, this is a test of ' . ref($api) . '.'; $file->spew( $file_content ); my $upload = $api->upload_file_to_project( $project_id, { file=>"$file" }, ); ok( $upload->{url}, 'got an upload response' ); my $www_base_url = $api->url(); $www_base_url =~ s{/api/v4.*$}{}; my $www_client = GitLab::API::v4::WWWClient->new( url => $www_base_url, ); $www_client->sign_in( 'root', $ENV{GITLAB_API_V4_ROOT_PASSWORD}, ); my $project_path = $project->{path_with_namespace}; my $upload_path = $upload->{url}; my $download_path = "$project_path/$upload_path"; my $res = $www_client->get( $download_path ); is( $res->{content}, $file_content, 'upload_file_to_project worked' ); }; subtest 'file methods' => sub{ $api->create_file( $project_id, 'foo/bar.txt', { branch => 'master', content => 'Test of create file.', commit_message => 'This is a commit.', }, ); my $file = $api->file( $project_id, 'foo/bar.txt', { ref=>'master' }, ); is( decode_base64( $file->{content} ), 'Test of create file.', 'created file is there; and looks right', ); my $content = $api->raw_file( $project_id, 'foo/bar.txt', { ref=>'master' }, ); is( $content, 'Test of create file.', 'able to retrieve the file raw', ); $api->edit_file( $project_id, 'foo/bar.txt', { branch => 'master', content => 'Test of edit file.', commit_message => 'This is the next commit.', }, ); my $edited_file = $api->file( $project_id, 'foo/bar.txt', { ref=>'master' }, ); is( decode_base64( $edited_file->{content} ), 'Test of edit file.', 'editing a file worked', ); $api->delete_file( $project_id, 'foo/bar.txt', { branch => 'master', commit_message => 'This is the last commit.', }, ); $file = $api->file( $project_id, 'foo/bar.txt', { ref=>'master' }, ); is( $file, undef, 'file was deleted', ); }; subtest hooks => sub{ my $hook = $api->create_project_hook( $project->{id}, { url=>'http://example.com/gitlab-hook-1' }, ); ok( $hook, 'create_project_hook returned the hook' ); $hook = $api->edit_project_hook( $project->{id}, $hook->{id}, { url=>'http://example.com/gitlab-hook-2' }, ); ok( $hook, 'edit_project_hook returned the hook' ); my $hook_id = $hook->{id}; $hook = $api->project_hook( $project->{id}, $hook_id ); ok( $hook, 'project_hook returned the hook' ); is( $hook->{url}, 'http://example.com/gitlab-hook-2', 'hook looks right' ); $api->delete_project_hook( $project->{id}, $hook_id ); $hook = $api->project_hook( $project->{id}, $hook_id ); ok( (!$hook), 'delete_project_hook seems to have worked' ); like( dies { $api->delete_project_hook( $project->{id}, $hook_id ) }, qr{\b404\b}, 'a subsequent delete_project_hook throws', ); }; $api->delete_project( $project_id ); pass 'project deleted'; }; subtest users => sub{ my $stamp = time(); my $username = "gitlab-api-v4-test-$stamp"; $api->create_user({ username => $username, email => "$username\@example.com", password => 'd5fzHF7tfgh', name => 'GitLabAPIv4 Test', }); pass 'user created'; my $users = $api->users({ username => $username }); is( @$users+0, 1, 'one user found' ); my $user = shift @$users; is( $user->{username}, $username, 'user has correct username' ); die 'Incorrect user found' if $user->{username} ne $username; my $user_id = $user->{id}; ok( $api->block_user($user_id), 'user blocked' ); ok( (!$api->block_user($user_id)), 'user cannot be blocked again' ); ok( $api->unblock_user($user_id), 'user unblocked' ); ok( (!$api->unblock_user($user_id)), 'user cannot be unblocked again' ); $api->delete_user($user_id); pass 'user deleted'; }; subtest failures => sub{ is( $api->user( 12345678 ), undef, 'GETing an unknown entity returns undef' ); my $err_re = qr{^Error PUTing \S+/users/12345678 \(HTTP 404\): Not Found \{"message":"404 User Not Found"\}}; like( dies{ $api->edit_user( 12345678, {} ) }, $err_re, 'POSTing an unknown entity throws a specific exception' ); }; done_testing; sub join_paths { my @paths = @_; return() if !@paths; return @paths if @paths==1; my $first = shift @paths; $first =~ s{/$}{}; my $last = pop @paths; $last =~ s{^/}{}; @paths = ( map { $_ =~ s{^/?(.*?)/?$}{$1}; $_ } @paths ); return join('/', $first, @paths, $last); } unit.t100755000766000024 257313621075102 14445 0ustar00aranstaff000000000000GitLab-API-v4-0.25/t#!/usr/bin/env perl use strictures 2; use Test2::V0; use GitLab::API::v4::Mock; subtest users => sub{ my @users = (); my $next_id = 1; my $api = GitLab::API::v4::Mock->new(); my @expected; is( $api->users(), \@expected, 'users is empty' ); $api->create_user({}); push @expected, {id=>1}; is( $api->users(), \@expected, 'one user created' ); $api->create_user({}); push @expected, {id=>2}; $api->create_user({}); push @expected, {id=>3}; is( $api->users(), \@expected, 'two more users created' ); $api->edit_user( 3, {name=>'foo'}); $expected[2]->{name} = 'foo'; is( $api->users(), \@expected, 'user was updated' ); $api->delete_user( 2 ); splice @expected, 1, 1; is( $api->users(), \@expected, 'user was deleted' ); }; subtest reqres => sub{ my $api = GitLab::API::v4::Mock->new(); is( $api->rest_client->http_tiny_request(), undef, 'no request' ); is( $api->rest_client->http_tiny_response(), undef, 'no response' ); $api->users(); is( $api->rest_client->http_tiny_request(), [ 'GET', 'https://example.com/api/v4/users', {headers=>{}} ], 'recorded request arrayref looks great', ); is( $api->rest_client->http_tiny_response(), { success=>1, status=>200, content=>'[]' }, 'recorded response hashref looks great', ); }; done_testing; META.yml100644000766000024 536013621075102 14301 0ustar00aranstaff000000000000GitLab-API-v4-0.25--- abstract: 'A complete GitLab API v4 client.' author: - 'Aran Clary Deltac ' build_requires: Log::Any::Adapter::TAP: '0.003003' MIME::Base64: '3.15' Test2::V0: '0.000094' configure_requires: Module::Build::Tiny: '0.035' dynamic_config: 0 generated_by: 'Minilla/v3.1.4, CPAN::Meta::Converter version 2.150010' license: gpl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: GitLab-API-v4 no_index: directory: - t - xt - inc - share - eg - examples - author - builder provides: GitLab::API::v4: file: lib/GitLab/API/v4.pm version: '0.25' GitLab::API::v4::Config: file: lib/GitLab/API/v4/Config.pm version: '0.25' GitLab::API::v4::Constants: file: lib/GitLab/API/v4/Constants.pm version: '0.25' GitLab::API::v4::Mock: file: lib/GitLab/API/v4/Mock.pm version: '0.25' GitLab::API::v4::Mock::Engine: file: lib/GitLab/API/v4/Mock/Engine.pm version: '0.25' GitLab::API::v4::Mock::RESTClient: file: lib/GitLab/API/v4/Mock/RESTClient.pm version: '0.25' GitLab::API::v4::Paginator: file: lib/GitLab/API/v4/Paginator.pm version: '0.25' GitLab::API::v4::RESTClient: file: lib/GitLab/API/v4/RESTClient.pm version: '0.25' GitLab::API::v4::WWWClient: file: lib/GitLab/API/v4/WWWClient.pm version: '0.25' requires: Carp: '0' Const::Fast: '0.014' Exporter: '0' Getopt::Long: '0' HTTP::Tiny: '0.059' HTTP::Tiny::Multipart: '0.05' IO::Prompter: '0.004014' JSON: '2.59' Log::Any: '1.703' Log::Any::Adapter: '1.703' Log::Any::Adapter::Screen: '0.13' Moo: '2.003000' Path::Tiny: '0.079' Pod::Usage: '0' Try::Tiny: '0.28' Types::Common::Numeric: '1.002001' Types::Common::String: '1.002001' Types::Standard: '1.002001' URI: '1.62' URI::Escape: '1.72' namespace::clean: '0.27' perl: '5.010001' strictures: '2.000003' resources: bugtracker: https://github.com/bluefeet/GitLab-API-v4/issues homepage: https://github.com/bluefeet/GitLab-API-v4 repository: git://github.com/bluefeet/GitLab-API-v4.git version: '0.25' x_authority: cpan:BLUEFEET x_contributors: - 'Dave Webb ' - 'Dmitry Frolov ' - 'Dotan Dimet ' - 'José Joaquín Atria ' - 'Kieren Diment ' - 'Luc Didry ' - 'Marek R. Sotola ' - 'Nigel Gregoire ' - 'Simon Ruderich ' - 'Thomas Klausner ' - 'gregor herrmann ' - 'royce55 ' - 'trunov-ms ' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' x_static_install: 1 MANIFEST100644000766000024 516213621075102 14161 0ustar00aranstaff000000000000GitLab-API-v4-0.25Build.PL Changes LICENSE META.json README.md author/README.pod author/config.yml author/footer.pm author/generate.pl author/header.pm author/sections/award_emoji.yml author/sections/boards.yml author/sections/branches.yml author/sections/broadcast_messages.yml author/sections/commits.yml author/sections/container_registry.yml author/sections/custom_attributes.yml author/sections/deploy_keys.yml author/sections/deployments.yml author/sections/discussions.yml author/sections/environments.yml author/sections/events.yml author/sections/features.yml author/sections/gitignores_templates.yml author/sections/gitlab_ci_ymls_templates.yml author/sections/group_access_requests.yml author/sections/group_badges.yml author/sections/group_boards.yml author/sections/group_level_variables.yml author/sections/group_members.yml author/sections/group_milestones.yml author/sections/groups.yml author/sections/issues.yml author/sections/jobs.yml author/sections/keys.yml author/sections/labels.yml author/sections/licenses_templates.yml author/sections/lint.yml author/sections/markdown.yml author/sections/merge_requests.yml author/sections/milestones.yml author/sections/namespaces.yml author/sections/notes.yml author/sections/notification_settings.yml author/sections/page_domains.yml author/sections/pipeline_schedules.yml author/sections/pipeline_triggers.yml author/sections/pipelines.yml author/sections/project_access_requests.yml author/sections/project_badges.yml author/sections/project_import_export.yml author/sections/project_level_variables.yml author/sections/project_members.yml author/sections/project_snippets.yml author/sections/projects.yml author/sections/protected_branches.yml author/sections/protected_tags.yml author/sections/release_links.yml author/sections/releases.yml author/sections/repositories.yml author/sections/repository_files.yml author/sections/resource_label_events.yml author/sections/runners.yml author/sections/search.yml author/sections/services.yml author/sections/settings.yml author/sections/sidekiq_metrics.yml author/sections/snippets.yml author/sections/statistics.yml author/sections/system_hooks.yml author/sections/tags.yml author/sections/todos.yml author/sections/users.yml author/sections/version.yml author/sections/wikis.yml author/setup-test-container cpanfile lib/GitLab/API/v4.pm lib/GitLab/API/v4/Config.pm lib/GitLab/API/v4/Constants.pm lib/GitLab/API/v4/Mock.pm lib/GitLab/API/v4/Mock/Engine.pm lib/GitLab/API/v4/Mock/RESTClient.pm lib/GitLab/API/v4/Paginator.pm lib/GitLab/API/v4/RESTClient.pm lib/GitLab/API/v4/WWWClient.pm minil.toml script/gitlab-api-v4 t/gitlab-api-v4.t t/regression.t t/unit.t META.yml MANIFEST