gitlab-faraday 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/gitlab/api.rb +16 -0
- data/lib/gitlab/client/access_requests.rb +103 -0
- data/lib/gitlab/client/application_settings.rb +172 -0
- data/lib/gitlab/client/avatar.rb +21 -0
- data/lib/gitlab/client/award_emojis.rb +137 -0
- data/lib/gitlab/client/boards.rb +146 -0
- data/lib/gitlab/client/branches.rb +135 -0
- data/lib/gitlab/client/broadcast_messages.rb +75 -0
- data/lib/gitlab/client/build_variables.rb +135 -0
- data/lib/gitlab/client/builds.rb +108 -0
- data/lib/gitlab/client/commits.rb +216 -0
- data/lib/gitlab/client/container_registry.rb +90 -0
- data/lib/gitlab/client/deployments.rb +34 -0
- data/lib/gitlab/client/environments.rb +89 -0
- data/lib/gitlab/client/epic_issues.rb +23 -0
- data/lib/gitlab/client/epics.rb +73 -0
- data/lib/gitlab/client/events.rb +60 -0
- data/lib/gitlab/client/features.rb +48 -0
- data/lib/gitlab/client/group_badges.rb +88 -0
- data/lib/gitlab/client/group_boards.rb +141 -0
- data/lib/gitlab/client/group_labels.rb +88 -0
- data/lib/gitlab/client/group_milestones.rb +94 -0
- data/lib/gitlab/client/groups.rb +526 -0
- data/lib/gitlab/client/issue_links.rb +48 -0
- data/lib/gitlab/client/issues.rb +242 -0
- data/lib/gitlab/client/jobs.rb +250 -0
- data/lib/gitlab/client/keys.rb +29 -0
- data/lib/gitlab/client/labels.rb +88 -0
- data/lib/gitlab/client/lint.rb +19 -0
- data/lib/gitlab/client/markdown.rb +23 -0
- data/lib/gitlab/client/merge_request_approvals.rb +265 -0
- data/lib/gitlab/client/merge_requests.rb +415 -0
- data/lib/gitlab/client/merge_trains.rb +55 -0
- data/lib/gitlab/client/milestones.rb +106 -0
- data/lib/gitlab/client/namespaces.rb +22 -0
- data/lib/gitlab/client/notes.rb +313 -0
- data/lib/gitlab/client/packages.rb +95 -0
- data/lib/gitlab/client/pipeline_schedules.rb +159 -0
- data/lib/gitlab/client/pipeline_triggers.rb +103 -0
- data/lib/gitlab/client/pipelines.rb +130 -0
- data/lib/gitlab/client/project_badges.rb +85 -0
- data/lib/gitlab/client/project_clusters.rb +83 -0
- data/lib/gitlab/client/project_exports.rb +54 -0
- data/lib/gitlab/client/project_release_links.rb +76 -0
- data/lib/gitlab/client/project_releases.rb +90 -0
- data/lib/gitlab/client/projects.rb +792 -0
- data/lib/gitlab/client/protected_tags.rb +59 -0
- data/lib/gitlab/client/remote_mirrors.rb +90 -0
- data/lib/gitlab/client/repositories.rb +130 -0
- data/lib/gitlab/client/repository_files.rb +131 -0
- data/lib/gitlab/client/repository_submodules.rb +27 -0
- data/lib/gitlab/client/resource_label_events.rb +82 -0
- data/lib/gitlab/client/resource_state_events.rb +57 -0
- data/lib/gitlab/client/runners.rb +278 -0
- data/lib/gitlab/client/search.rb +66 -0
- data/lib/gitlab/client/services.rb +53 -0
- data/lib/gitlab/client/sidekiq.rb +39 -0
- data/lib/gitlab/client/snippets.rb +95 -0
- data/lib/gitlab/client/system_hooks.rb +64 -0
- data/lib/gitlab/client/tags.rb +97 -0
- data/lib/gitlab/client/templates.rb +100 -0
- data/lib/gitlab/client/todos.rb +46 -0
- data/lib/gitlab/client/user_snippets.rb +114 -0
- data/lib/gitlab/client/users.rb +521 -0
- data/lib/gitlab/client/versions.rb +18 -0
- data/lib/gitlab/client/wikis.rb +79 -0
- data/lib/gitlab/client.rb +96 -0
- data/lib/gitlab/configuration.rb +36 -0
- data/lib/gitlab/error.rb +114 -0
- data/lib/gitlab/file_response.rb +43 -0
- data/lib/gitlab/headers/page_links.rb +32 -0
- data/lib/gitlab/headers/total.rb +24 -0
- data/lib/gitlab/objectified_hash.rb +44 -0
- data/lib/gitlab/paginated_response.rb +114 -0
- data/lib/gitlab/request.rb +144 -0
- data/lib/gitlab/version.rb +5 -0
- data/lib/gitlab.rb +36 -0
- metadata +156 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 341ff7d2c12878a07ebc08373296cef724797ccd2d40bcb1ca067ae0d3c4d638
|
|
4
|
+
data.tar.gz: 1df380f8368fbd5cc88f7b5d98472feaced020e6743b3331f3abafd5353078bc
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 9f8ff9078d5c7a55d37b4efb9b87cc598b8dc84a2b5060bb1e8ae89203da362b05e5024e098abde0bc461a6a68fe833ac907769becdb006af8295fe28307482a
|
|
7
|
+
data.tar.gz: 252a5b7129e76b38b74a6be6d201f3853297a0ba49730b37c7319b9d51a82ad0789574b2df9db7bf3df299de04cfd358738167302098fca76e73fe6532f6d0dd
|
data/lib/gitlab/api.rb
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Gitlab
|
|
4
|
+
class API < Request
|
|
5
|
+
attr_accessor(*Configuration::VALID_OPTIONS_KEYS)
|
|
6
|
+
alias auth_token= private_token=
|
|
7
|
+
|
|
8
|
+
def initialize(options = {})
|
|
9
|
+
options = Gitlab.options.merge(options)
|
|
10
|
+
(Configuration::VALID_OPTIONS_KEYS + [:auth_token]).each do |key|
|
|
11
|
+
send("#{key}=", options[key]) if options[key]
|
|
12
|
+
end
|
|
13
|
+
request_defaults(sudo)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Gitlab::Client
|
|
4
|
+
# Defines methods related to Award Emojis.
|
|
5
|
+
# @see https://docs.gitlab.com/ce/api/access_requests.html
|
|
6
|
+
module AccessRequests
|
|
7
|
+
# Gets a list of access requests for a project viewable by the authenticated user.
|
|
8
|
+
#
|
|
9
|
+
# @example
|
|
10
|
+
# Gitlab.project_access_requests(1)
|
|
11
|
+
#
|
|
12
|
+
# @param [Integer, String] :project(required) The ID or name of a project.
|
|
13
|
+
# @return [Array<Gitlab::ObjectifiedHash>] List of project access requests
|
|
14
|
+
def project_access_requests(project)
|
|
15
|
+
get("/projects/#{url_encode project}/access_requests")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Gets a list of access requests for a group viewable by the authenticated user.
|
|
19
|
+
#
|
|
20
|
+
# @example
|
|
21
|
+
# Gitlab.group_access_requests(1)
|
|
22
|
+
#
|
|
23
|
+
# @param [Integer, String] :group(required) The ID or name of a group.
|
|
24
|
+
# @return [Array<Gitlab::ObjectifiedHash>] List of group access requests
|
|
25
|
+
def group_access_requests(group)
|
|
26
|
+
get("/groups/#{url_encode group}/access_requests")
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Requests access for the authenticated user to a project.
|
|
30
|
+
#
|
|
31
|
+
# @example
|
|
32
|
+
# Gitlab.request_project_access(1)
|
|
33
|
+
#
|
|
34
|
+
# @param [Integer, String] :project(required) The ID or name of a project.
|
|
35
|
+
# @return <Gitlab::ObjectifiedHash] Information about the requested project access
|
|
36
|
+
def request_project_access(project)
|
|
37
|
+
post("/projects/#{url_encode project}/access_requests")
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Requests access for the authenticated user to a group.
|
|
41
|
+
#
|
|
42
|
+
# @example
|
|
43
|
+
# Gitlab.request_group_access(1)
|
|
44
|
+
#
|
|
45
|
+
# @param [Integer, String] :group(required) The ID or name of a group.
|
|
46
|
+
# @return <Gitlab::ObjectifiedHash] Information about the requested group access
|
|
47
|
+
def request_group_access(group)
|
|
48
|
+
post("/groups/#{url_encode group}/access_requests")
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Approves a project access request for the given user.
|
|
52
|
+
#
|
|
53
|
+
# @example
|
|
54
|
+
# Gitlab.approve_project_access_request(1, 1)
|
|
55
|
+
# Gitlab.approve_project_access_request(1, 1, {access_level: '30'})
|
|
56
|
+
#
|
|
57
|
+
# @param [Integer, String] :project(required) The ID or name of a project.
|
|
58
|
+
# @param [Integer] :user_id(required) The user ID of the access requester
|
|
59
|
+
# @option options [Integer] :access_level(optional) A valid access level (defaults: 30, developer access level)
|
|
60
|
+
# @return <Gitlab::ObjectifiedHash] Information about the approved project access request
|
|
61
|
+
def approve_project_access_request(project, user_id, options = {})
|
|
62
|
+
put("/projects/#{url_encode project}/access_requests/#{user_id}/approve", body: options)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Approves a group access request for the given user.
|
|
66
|
+
#
|
|
67
|
+
# @example
|
|
68
|
+
# Gitlab.approve_group_access_request(1, 1)
|
|
69
|
+
# Gitlab.approve_group_access_request(1, 1, {access_level: '30'})
|
|
70
|
+
#
|
|
71
|
+
# @param [Integer, String] :group(required) The ID or name of a group.
|
|
72
|
+
# @param [Integer] :user_id(required) The user ID of the access requester
|
|
73
|
+
# @option options [Integer] :access_level(optional) A valid access level (defaults: 30, developer access level)
|
|
74
|
+
# @return <Gitlab::ObjectifiedHash] Information about the approved group access request
|
|
75
|
+
def approve_group_access_request(group, user_id, options = {})
|
|
76
|
+
put("/groups/#{url_encode group}/access_requests/#{user_id}/approve", body: options)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Denies a project access request for the given user.
|
|
80
|
+
#
|
|
81
|
+
# @example
|
|
82
|
+
# Gitlab.deny_project_access_request(1, 1)
|
|
83
|
+
#
|
|
84
|
+
# @param [Integer, String] :project(required) The ID or name of a project.
|
|
85
|
+
# @param [Integer] :user_id(required) The user ID of the access requester
|
|
86
|
+
# @return [void] This API call returns an empty response body.
|
|
87
|
+
def deny_project_access_request(project, user_id)
|
|
88
|
+
delete("/projects/#{url_encode project}/access_requests/#{user_id}")
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Denies a group access request for the given user.
|
|
92
|
+
#
|
|
93
|
+
# @example
|
|
94
|
+
# Gitlab.deny_group_access_request(1, 1)
|
|
95
|
+
#
|
|
96
|
+
# @param [Integer, String] :group(required) The ID or name of a group.
|
|
97
|
+
# @param [Integer] :user_id(required) The user ID of the access requester
|
|
98
|
+
# @return [void] This API call returns an empty response body.
|
|
99
|
+
def deny_group_access_request(group, user_id)
|
|
100
|
+
delete("/groups/#{url_encode group}/access_requests/#{user_id}")
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Gitlab::Client
|
|
4
|
+
# Defines methods related to application settings.
|
|
5
|
+
# @see https://docs.gitlab.com/ee/api/settings.html
|
|
6
|
+
module ApplicationSettings
|
|
7
|
+
# Retrives the application settings of Gitlab.
|
|
8
|
+
#
|
|
9
|
+
# @example
|
|
10
|
+
# Gitlab.application_settings
|
|
11
|
+
#
|
|
12
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
|
13
|
+
def application_settings
|
|
14
|
+
get('/application/settings')
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Edit the applications settings of Gitlab.
|
|
18
|
+
#
|
|
19
|
+
# @example
|
|
20
|
+
# Gitlab.edit_application_settings({ signup_enabled: false })
|
|
21
|
+
#
|
|
22
|
+
# @param [Hash] options A customizable set of options.
|
|
23
|
+
# @option options [String] :admin_notification_email
|
|
24
|
+
# @option options [String] :after_sign_out_path
|
|
25
|
+
# @option options [String] :after_sign_up_text
|
|
26
|
+
# @option options [String] :akismet_api_key
|
|
27
|
+
# @option options [Boolean] :akismet_enabled
|
|
28
|
+
# @option options [Boolean] :allow_group_owners_to_manage_ldap
|
|
29
|
+
# @option options [Boolean] :allow_local_requests_from_hooks_and_services
|
|
30
|
+
# @option options [Boolean] :authorized_keys_enabled
|
|
31
|
+
# @option options [String] :auto_devops_domain
|
|
32
|
+
# @option options [Boolean] :auto_devops_enabled
|
|
33
|
+
# @option options [Boolean] :check_namespace_plan
|
|
34
|
+
# @option options [String] :clientside_sentry_dsn
|
|
35
|
+
# @option options [Boolean] :clientside_sentry_enabled
|
|
36
|
+
# @option options [Integer] :container_registry_token_expire_delay
|
|
37
|
+
# @option options [String] :default_artifacts_expire_in
|
|
38
|
+
# @option options [Integer] :default_branch_protection
|
|
39
|
+
# @option options [String] :default_group_visibility
|
|
40
|
+
# @option options [String] :default_project_visibility
|
|
41
|
+
# @option options [Integer] :default_projects_limit
|
|
42
|
+
# @option options [String] :default_snippet_visibility
|
|
43
|
+
# @option options [Array<String>] :disabled_oauth_sign_in_sources
|
|
44
|
+
# @option options [Array<String>] :domain_blacklist
|
|
45
|
+
# @option options [Boolean] :domain_blacklist_enabled
|
|
46
|
+
# @option options [Array<String>] :domain_whitelist
|
|
47
|
+
# @option options [Integer] :dsa_key_restriction
|
|
48
|
+
# @option options [Integer] :ecdsa_key_restriction
|
|
49
|
+
# @option options [Integer] :ed25519_key_restriction
|
|
50
|
+
# @option options [Boolean] :elasticsearch_aws
|
|
51
|
+
# @option options [String] :elasticsearch_aws_access_key
|
|
52
|
+
# @option options [String] :elasticsearch_aws_region
|
|
53
|
+
# @option options [String] :elasticsearch_aws_secret_access_key
|
|
54
|
+
# @option options [Boolean] :elasticsearch_experimental_indexer
|
|
55
|
+
# @option options [Boolean] :elasticsearch_indexing
|
|
56
|
+
# @option options [Boolean] :elasticsearch_search
|
|
57
|
+
# @option options [String] :elasticsearch_url
|
|
58
|
+
# @option options [Boolean] :elasticsearch_limit_indexing
|
|
59
|
+
# @option options [Array<Integer>] :elasticsearch_project_ids
|
|
60
|
+
# @option options [Array<Integer>] :elasticsearch_namespace_ids
|
|
61
|
+
# @option options [String] :email_additional_text
|
|
62
|
+
# @option options [Boolean] :email_author_in_body
|
|
63
|
+
# @option options [String] :enabled_git_access_protocol
|
|
64
|
+
# @option options [Boolean] :enforce_terms
|
|
65
|
+
# @option options [String] :external_auth_client_cert
|
|
66
|
+
# @option options [String] :external_auth_client_key
|
|
67
|
+
# @option options [String] :external_auth_client_key_pass
|
|
68
|
+
# @option options [Boolean] :external_authorization_service_enabled
|
|
69
|
+
# @option options [String] :external_authorization_service_default_label
|
|
70
|
+
# @option options [Float] :external_authorization_service_timeout float
|
|
71
|
+
# @option options [String] :external_authorization_service_url
|
|
72
|
+
# @option options [Integer] :file_template_project_id
|
|
73
|
+
# @option options [Integer] :first_day_of_week
|
|
74
|
+
# @option options [Integer] :geo_status_timeout
|
|
75
|
+
# @option options [Integer] :gitaly_timeout_default
|
|
76
|
+
# @option options [Integer] :gitaly_timeout_fast
|
|
77
|
+
# @option options [Integer] :gitaly_timeout_medium
|
|
78
|
+
# @option options [Boolean] :gravatar_enabled
|
|
79
|
+
# @option options [Boolean] :hashed_storage_enabled
|
|
80
|
+
# @option options [Boolean] :help_page_hide_commercial_content
|
|
81
|
+
# @option options [String] :help_page_support_url
|
|
82
|
+
# @option options [String] :help_page_text
|
|
83
|
+
# @option options [String] :help_text
|
|
84
|
+
# @option options [Boolean] :hide_third_party_offers
|
|
85
|
+
# @option options [String] :home_page_url
|
|
86
|
+
# @option options [Boolean] :housekeeping_bitmaps_enabled
|
|
87
|
+
# @option options [Boolean] :housekeeping_enabled
|
|
88
|
+
# @option options [Integer] :housekeeping_full_repack_period
|
|
89
|
+
# @option options [Integer] :housekeeping_gc_period
|
|
90
|
+
# @option options [Integer] :housekeeping_incremental_repack_period
|
|
91
|
+
# @option options [Boolean] :html_emails_enabled
|
|
92
|
+
# @option options [Boolean] :instance_statistics_visibility_private
|
|
93
|
+
# @option options [Array<String>] :import_sources
|
|
94
|
+
# @option options [Integer] :max_artifacts_size
|
|
95
|
+
# @option options [Integer] :max_attachment_size
|
|
96
|
+
# @option options [Integer] :max_pages_size
|
|
97
|
+
# @option options [Boolean] :metrics_enabled
|
|
98
|
+
# @option options [String] :metrics_host
|
|
99
|
+
# @option options [Integer] :metrics_method_call_threshold
|
|
100
|
+
# @option options [Integer] :metrics_packet_size
|
|
101
|
+
# @option options [Integer] :metrics_pool_size
|
|
102
|
+
# @option options [Integer] :metrics_port
|
|
103
|
+
# @option options [Integer] :metrics_sample_interval
|
|
104
|
+
# @option options [Integer] :metrics_timeout
|
|
105
|
+
# @option options [Boolean] :mirror_available
|
|
106
|
+
# @option options [Integer] :mirror_capacity_threshold
|
|
107
|
+
# @option options [Integer] :mirror_max_capacity
|
|
108
|
+
# @option options [Integer] :mirror_max_delay
|
|
109
|
+
# @option options [Boolean] :pages_domain_verification_enabled
|
|
110
|
+
# @option options [Boolean] :password_authentication_enabled_for_git
|
|
111
|
+
# @option options [Boolean] :password_authentication_enabled_for_web
|
|
112
|
+
# @option options [String] :performance_bar_allowed_group_id
|
|
113
|
+
# @option options [String] :performance_bar_allowed_group_path
|
|
114
|
+
# @option options [Boolean] :performance_bar_enabled
|
|
115
|
+
# @option options [Boolean] :plantuml_enabled
|
|
116
|
+
# @option options [String] :plantuml_url
|
|
117
|
+
# @option options [Float] :polling_interval_multiplier
|
|
118
|
+
# @option options [Boolean] :project_export_enabled
|
|
119
|
+
# @option options [Boolean] :prometheus_metrics_enabled
|
|
120
|
+
# @option options [Boolean] :pseudonymizer_enabled
|
|
121
|
+
# @option options [Boolean] :recaptcha_enabled
|
|
122
|
+
# @option options [String] :recaptcha_private_key
|
|
123
|
+
# @option options [String] :recaptcha_site_key
|
|
124
|
+
# @option options [Boolean] :repository_checks_enabled
|
|
125
|
+
# @option options [Integer] :repository_size_limit
|
|
126
|
+
# @option options [Array<String>] :repository_storages
|
|
127
|
+
# @option options [Boolean] :require_two_factor_authentication
|
|
128
|
+
# @option options [Array<String>] :restricted_visibility_levels
|
|
129
|
+
# @option options [Integer] :rsa_key_restriction
|
|
130
|
+
# @option options [Boolean] :send_user_confirmation_email
|
|
131
|
+
# @option options [String] :sentry_dsn
|
|
132
|
+
# @option options [Boolean] :sentry_enabled
|
|
133
|
+
# @option options [Integer] :session_expire_delay
|
|
134
|
+
# @option options [Boolean] :shared_runners_enabled
|
|
135
|
+
# @option options [Integer] :shared_runners_minutes
|
|
136
|
+
# @option options [String] :shared_runners_text
|
|
137
|
+
# @option options [String] :sign_in_text
|
|
138
|
+
# @option options [String] :signin_enabled
|
|
139
|
+
# @option options [Boolean] :signup_enabled
|
|
140
|
+
# @option options [Boolean] :slack_app_enabled
|
|
141
|
+
# @option options [String] :slack_app_id
|
|
142
|
+
# @option options [String] :slack_app_secret
|
|
143
|
+
# @option options [String] :slack_app_verification_token
|
|
144
|
+
# @option options [Integer] :terminal_max_session_time
|
|
145
|
+
# @option options [String] :terms
|
|
146
|
+
# @option options [Boolean] :throttle_authenticated_api_enabled
|
|
147
|
+
# @option options [Integer] :throttle_authenticated_api_period_in_seconds
|
|
148
|
+
# @option options [Integer] :throttle_authenticated_api_requests_per_period
|
|
149
|
+
# @option options [Boolean] :throttle_authenticated_web_enabled
|
|
150
|
+
# @option options [Integer] :throttle_authenticated_web_period_in_seconds
|
|
151
|
+
# @option options [Integer] :throttle_authenticated_web_requests_per_period
|
|
152
|
+
# @option options [Boolean] :throttle_unauthenticated_enabled
|
|
153
|
+
# @option options [Integer] :throttle_unauthenticated_period_in_seconds
|
|
154
|
+
# @option options [Integer] :throttle_unauthenticated_requests_per_period
|
|
155
|
+
# @option options [Integer] :two_factor_grace_period
|
|
156
|
+
# @option options [Boolean] :unique_ips_limit_enabled
|
|
157
|
+
# @option options [Integer] :unique_ips_limit_per_user
|
|
158
|
+
# @option options [Integer] :unique_ips_limit_time_window
|
|
159
|
+
# @option options [Boolean] :usage_ping_enabled
|
|
160
|
+
# @option options [Boolean] :user_default_external
|
|
161
|
+
# @option options [Boolean] :user_oauth_applications
|
|
162
|
+
# @option options [Boolean] :user_show_add_ssh_key_message
|
|
163
|
+
# @option options [Boolean] :version_check_enabled
|
|
164
|
+
# @option options [Integer] :local_markdown_version
|
|
165
|
+
# @option options [String] :geo_node_allowed_ips
|
|
166
|
+
#
|
|
167
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
|
168
|
+
def edit_application_settings(options = {})
|
|
169
|
+
put('/application/settings', body: options)
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Gitlab::Client
|
|
4
|
+
# Defines methods related to avatar.
|
|
5
|
+
# @see https://docs.gitlab.com/ce/api/avatar.html
|
|
6
|
+
module Avatar
|
|
7
|
+
# Get a single avatar URL for a user with the given email address.
|
|
8
|
+
#
|
|
9
|
+
# @example
|
|
10
|
+
# Gitlab.avatar(email: 'admin@example.com')
|
|
11
|
+
# Gitlab.avatar(email: 'admin@example.com', size: 32)
|
|
12
|
+
#
|
|
13
|
+
# @param [Hash] options A customizable set of options.
|
|
14
|
+
# @option options [String] :email(required) Public email address of the user.
|
|
15
|
+
# @option options [Integer] :size(optional) Single pixel dimension (since images are squares). Only used for avatar lookups at Gravatar or at the configured Libravatar server.
|
|
16
|
+
# @return <Gitlab::ObjectifiedHash>
|
|
17
|
+
def avatar(options = {})
|
|
18
|
+
get('/avatar', query: options)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Gitlab::Client
|
|
4
|
+
# Defines methods related to Award Emojis.
|
|
5
|
+
# @see https://docs.gitlab.com/ce/api/award_emoji.html
|
|
6
|
+
module AwardEmojis
|
|
7
|
+
# Gets a list of all award emoji for an awardable(issue, merge request or snippet)
|
|
8
|
+
#
|
|
9
|
+
# @example
|
|
10
|
+
# Gitlab.award_emojis(1, 80, 'issue')
|
|
11
|
+
# Gitlab.award_emojis(1, 60, 'merge_request')
|
|
12
|
+
# Gitlab.award_emojis(1, 40, 'snippet')
|
|
13
|
+
#
|
|
14
|
+
# @param [Integer] project The ID of a project.
|
|
15
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
|
16
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
|
17
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
|
18
|
+
def award_emojis(project, awardable_id, awardable_type)
|
|
19
|
+
get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Gets a list of all award emoji for a single note on an awardable(issue, merge request or snippet)
|
|
23
|
+
#
|
|
24
|
+
# @example
|
|
25
|
+
# Gitlab.note_award_emojis(1, 80, 'issue', 1)
|
|
26
|
+
# Gitlab.note_award_emojis(1, 60, 'merge_request', 1)
|
|
27
|
+
# Gitlab.note_award_emojis(1, 40, 'snippet', 1)
|
|
28
|
+
#
|
|
29
|
+
# @param [Integer] project The ID of a project.
|
|
30
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
|
31
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
|
32
|
+
# @param [Integer] note_id The ID of a note.
|
|
33
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
|
34
|
+
def note_award_emojis(project, awardable_id, awardable_type, note_id)
|
|
35
|
+
get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/notes/#{note_id}/award_emoji")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Gets a single award emoji for an awardable(issue, merge request or snippet)
|
|
39
|
+
#
|
|
40
|
+
# @example
|
|
41
|
+
# Gitlab.award_emoji(1, 80, 'issue', 4)
|
|
42
|
+
# Gitlab.award_emoji(1, 60, 'merge_request', 4)
|
|
43
|
+
# Gitlab.award_emoji(1, 40, 'snippet', 4)
|
|
44
|
+
#
|
|
45
|
+
# @param [Integer] project The ID of a project.
|
|
46
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
|
47
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
|
48
|
+
# @param [Integer] award_id The ID of an award emoji.
|
|
49
|
+
# @return [Gitlab::ObjectifiedHash]
|
|
50
|
+
def award_emoji(project, awardable_id, awardable_type, award_id)
|
|
51
|
+
get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji/#{award_id}")
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Gets a single award emoji from a single note on an awardable(issue, merge request or snippet)
|
|
55
|
+
#
|
|
56
|
+
# @example
|
|
57
|
+
# Gitlab.note_award_emoji(1, 80, 'issue', 1, 4)
|
|
58
|
+
# Gitlab.note_award_emoji(1, 60, 'merge_request', 1, 4)
|
|
59
|
+
# Gitlab.note_award_emoji(1, 40, 'snippet', 1, 4)
|
|
60
|
+
#
|
|
61
|
+
# @param [Integer] project The ID of a project.
|
|
62
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
|
63
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
|
64
|
+
# @param [Integer] note_id The ID of a note.
|
|
65
|
+
# @param [Integer] award_id The ID of an award emoji.
|
|
66
|
+
# @return [Gitlab::ObjectifiedHash]
|
|
67
|
+
def note_award_emoji(project, awardable_id, awardable_type, note_id, award_id)
|
|
68
|
+
get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/notes/#{note_id}/award_emoji/#{award_id}")
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Awards a new emoji to an awardable(issue, merge request or snippet)
|
|
72
|
+
#
|
|
73
|
+
# @example
|
|
74
|
+
# Gitlab.create_award_emoji(1, 80, 'issue', 'blowfish')
|
|
75
|
+
# Gitlab.create_award_emoji(1, 80, 'merge_request', 'blowfish')
|
|
76
|
+
# Gitlab.create_award_emoji(1, 80, 'snippet', 'blowfish')
|
|
77
|
+
#
|
|
78
|
+
# @param [Integer] project The ID of a project.
|
|
79
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
|
80
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
|
81
|
+
# @param [String] emoji_name The name of the emoji, without colons.
|
|
82
|
+
# @return [Gitlab::ObjectifiedHash]
|
|
83
|
+
def create_award_emoji(project, awardable_id, awardable_type, emoji_name)
|
|
84
|
+
post("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji", body: { name: emoji_name })
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Awards a new emoji to a note on an awardable(issue, merge request or snippet)
|
|
88
|
+
#
|
|
89
|
+
# @example
|
|
90
|
+
# Gitlab.create_note_award_emoji(1, 80, 'issue', 1, 'blowfish')
|
|
91
|
+
# Gitlab.create_note_award_emoji(1, 80, 'merge_request', 1, 'blowfish')
|
|
92
|
+
# Gitlab.create_note_award_emoji(1, 80, 'snippet', 1, 'blowfish')
|
|
93
|
+
#
|
|
94
|
+
# @param [Integer] project The ID of a project.
|
|
95
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
|
96
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
|
97
|
+
# @param [Integer] note_id The ID of a note.
|
|
98
|
+
# @param [String] emoji_name The name of the emoji, without colons.
|
|
99
|
+
# @return [Gitlab::ObjectifiedHash]
|
|
100
|
+
def create_note_award_emoji(project, awardable_id, awardable_type, note_id, emoji_name)
|
|
101
|
+
post("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/notes/#{note_id}/award_emoji", body: { name: emoji_name })
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Deletes a single award emoji from an awardable(issue, merge request or snippet)
|
|
105
|
+
#
|
|
106
|
+
# @example
|
|
107
|
+
# Gitlab.delete_award_emoji(1, 80, 'issue', 4)
|
|
108
|
+
# Gitlab.delete_award_emoji(1, 60, 'merge_request', 4)
|
|
109
|
+
# Gitlab.delete_award_emoji(1, 40, 'snippet', 4)
|
|
110
|
+
#
|
|
111
|
+
# @param [Integer] project The ID of a project.
|
|
112
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
|
113
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
|
114
|
+
# @param [Integer] award_id The ID of an award emoji.
|
|
115
|
+
# @return [void] This API call returns an empty response body.
|
|
116
|
+
def delete_award_emoji(project, awardable_id, awardable_type, award_id)
|
|
117
|
+
delete("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji/#{award_id}")
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Deletes a single award emoji from a single note on an awardable(issue, merge request or snippet)
|
|
121
|
+
#
|
|
122
|
+
# @example
|
|
123
|
+
# Gitlab.delete_note_award_emoji(1, 80, 'issue', 1, 4)
|
|
124
|
+
# Gitlab.delete_note_award_emoji(1, 60, 'merge_request', 1, 4)
|
|
125
|
+
# Gitlab.delete_note_award_emoji(1, 40, 'snippet', 1, 4)
|
|
126
|
+
#
|
|
127
|
+
# @param [Integer] project The ID of a project.
|
|
128
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
|
129
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
|
130
|
+
# @param [Integer] note_id The ID of a note.
|
|
131
|
+
# @param [Integer] award_id The ID of an award emoji.
|
|
132
|
+
# @return [void] This API call returns an empty response body.
|
|
133
|
+
def delete_note_award_emoji(project, awardable_id, awardable_type, note_id, award_id)
|
|
134
|
+
delete("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/notes/#{note_id}/award_emoji/#{award_id}")
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
end
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Gitlab::Client
|
|
4
|
+
# Defines methods related to issue boards.
|
|
5
|
+
# @see https://docs.gitlab.com/ce/api/boards.html
|
|
6
|
+
module Boards
|
|
7
|
+
# Gets a list of project's boards.
|
|
8
|
+
#
|
|
9
|
+
# @example
|
|
10
|
+
# Gitlab.boards(5)
|
|
11
|
+
# Gitlab.boards({ per_page: 40 })
|
|
12
|
+
#
|
|
13
|
+
# @param [Integer, String] project The ID or name of a project.
|
|
14
|
+
# @param [Hash] options A customizable set of options.
|
|
15
|
+
# @option options [Integer] :page The page number.
|
|
16
|
+
# @option options [Integer] :per_page The number of results per page.
|
|
17
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
|
18
|
+
def boards(project, options = {})
|
|
19
|
+
get("/projects/#{url_encode project}/boards", query: options)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Get a single board.
|
|
23
|
+
#
|
|
24
|
+
# @example
|
|
25
|
+
# Gitlab.board(5, 1)
|
|
26
|
+
#
|
|
27
|
+
# @param [Integer, String] project The ID or name of a project.
|
|
28
|
+
# @param [Integer] id The ID of a board.
|
|
29
|
+
# @return [Gitlab::ObjectifiedHash] Returns information about the board
|
|
30
|
+
def board(project, id)
|
|
31
|
+
get("/projects/#{url_encode project}/boards/#{id}")
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Creates a new board.
|
|
35
|
+
#
|
|
36
|
+
# @example
|
|
37
|
+
# Gitlab.create_board(5, 'newboard')
|
|
38
|
+
#
|
|
39
|
+
# @param [Integer, String] project The ID or name of a project.
|
|
40
|
+
# @param [String] name The name of the new board.
|
|
41
|
+
# @return [Gitlab::ObjectifiedHash] Information about created board.
|
|
42
|
+
def create_board(project, name)
|
|
43
|
+
body = { name: name }
|
|
44
|
+
post("/projects/#{url_encode project}/boards", body: body)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Updates a board.
|
|
48
|
+
#
|
|
49
|
+
# @example
|
|
50
|
+
# Gitlab.edit_board(5, 1, name: 'new_name')
|
|
51
|
+
# Gitlab.edit_board(5, 1, name: 'new_name', assignee_id: 1, milestone_id: 1)
|
|
52
|
+
#
|
|
53
|
+
# @param [Integer, String] project The ID or name of a project.
|
|
54
|
+
# @param [Integer] id The ID of a board.
|
|
55
|
+
# @param [Hash] options A customizable set of options.
|
|
56
|
+
# @option options [String] :name(optional) The new name of the board.
|
|
57
|
+
# @option options [Integer] :assignee_id(optional) The assignee the board should be scoped to.
|
|
58
|
+
# @option options [Integer] :milestone_id(optional) The milestone the board should be scoped to.
|
|
59
|
+
# @option options [String] :labels(optional) Comma-separated list of label names which the board should be scoped to.
|
|
60
|
+
# @option options [Integer] :weight(optional) The weight range from 0 to 9, to which the board should be scoped to.
|
|
61
|
+
# @return [Gitlab::ObjectifiedHash] Information about updated board.
|
|
62
|
+
def edit_board(project, id, options = {})
|
|
63
|
+
put("/projects/#{url_encode project}/boards/#{id}", body: options)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Deletes a board.
|
|
67
|
+
#
|
|
68
|
+
# @example
|
|
69
|
+
# Gitlab.delete_board(5, 1)
|
|
70
|
+
#
|
|
71
|
+
# @param [Integer, String] project The ID or name of a project.
|
|
72
|
+
# @param [Integer] id The ID of a board.
|
|
73
|
+
# @return [void] This API call returns an empty response body.
|
|
74
|
+
def delete_board(project, id)
|
|
75
|
+
delete("/projects/#{url_encode project}/boards/#{id}")
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Gets a board lists
|
|
79
|
+
#
|
|
80
|
+
# @example
|
|
81
|
+
# Gitlab.board_lists(5, 42)
|
|
82
|
+
#
|
|
83
|
+
# @param [Integer, String] project The ID or name of a project.
|
|
84
|
+
# @param [Integer] id The ID of a board.
|
|
85
|
+
# @return [Gitlab::ObjectifiedHash]
|
|
86
|
+
def board_lists(project, id)
|
|
87
|
+
get("/projects/#{url_encode project}/boards/#{id}/lists")
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
#
|
|
91
|
+
# Gets a single board list
|
|
92
|
+
#
|
|
93
|
+
# @example
|
|
94
|
+
# Gitlab.board_list(5, 42, 25)
|
|
95
|
+
#
|
|
96
|
+
# @param [Integer, String] project The ID or name of a project.
|
|
97
|
+
# @param [Integer] board_id The ID of a board.
|
|
98
|
+
# @param [Integer] id The ID of a list.
|
|
99
|
+
# @return [Gitlab::ObjectifiedHash]
|
|
100
|
+
def board_list(project, board_id, id)
|
|
101
|
+
get("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}")
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Creates a new board list.
|
|
105
|
+
# Only for admins and project owners
|
|
106
|
+
#
|
|
107
|
+
# @example
|
|
108
|
+
# Gitlab.create_board_list(5, 42, 25)
|
|
109
|
+
#
|
|
110
|
+
# @param [Integer, String] project The ID or name of a project.
|
|
111
|
+
# @param [Integer] id The ID of a board.
|
|
112
|
+
# @param [Integer] label_id The ID of a label.
|
|
113
|
+
# @return [Gitlab::ObjectifiedHash] Information about created list.
|
|
114
|
+
def create_board_list(project, board_id, label_id)
|
|
115
|
+
post("/projects/#{url_encode project}/boards/#{board_id}/lists", body: { label_id: label_id })
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Updates a board list.
|
|
119
|
+
# Only for admins and project owners
|
|
120
|
+
#
|
|
121
|
+
# @example
|
|
122
|
+
# Gitlab.edit_board_list(6, 1, 12, 5)
|
|
123
|
+
#
|
|
124
|
+
# @param [Integer, String] project The ID or name of a project.
|
|
125
|
+
# @param [Integer] board_id The ID of a board.
|
|
126
|
+
# @param [Integer] id The ID of a list.
|
|
127
|
+
# @return [Gitlab::ObjectifiedHash] Information about updated board list.
|
|
128
|
+
def edit_board_list(project, board_id, id, position)
|
|
129
|
+
put("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}", body: { position: position })
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Deletes a board list.
|
|
133
|
+
# Only for admins and project owners
|
|
134
|
+
#
|
|
135
|
+
# @example
|
|
136
|
+
# Gitlab.delete_board_list(3, 42, 32)
|
|
137
|
+
#
|
|
138
|
+
# @param [Integer, String] project The ID or name of a project.
|
|
139
|
+
# @param [Integer] board_id The ID of a board.
|
|
140
|
+
# @param [Integer] id The ID of a list.
|
|
141
|
+
# @return [Gitlab::ObjectifiedHash] Information about deleted board list.
|
|
142
|
+
def delete_board_list(project, board_id, id)
|
|
143
|
+
delete("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}")
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|