Class: SupportOps::GitLab::Groups

Inherits:
Base
  • Object
show all
Defined in:
lib/support_ops_gitlab/gitlab/groups.rb

Overview

TODO:

A lot of things listed at https://docs.gitlab.com/api/groups

Defines the class Groups within the module SupportOps::GitLab.

Author:

  • Jason Colyer

Since:

  • 1.0.0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#activate!, #approve!, attributes, #ban!, #block!, client, #client=, #commits, configure, #contributors, #create_support_pin!, #deactivate!, define_attributes, #delete!, #disable_2fa!, #discussions, #emails, #events, #find, #find!, #gpg_keys, #hard_delete!, #impersonations, #initialize, #issues, #jobs, #latest_pipeline, #memberships, #move!, #notes, #paid?, #pats, #pipeline_variables, #pipelines, #preferences, readonly_attributes, #reject!, #revoke!, #rotate!, #save!, #ssh_keys, #status, #store_original_attributes, #subscribe!, #support_pin, to_hash, #tokens, #unban!, #unblock!, #unsubscribe!, #webhooks

Constructor Details

This class inherits a constructor from SupportOps::GitLab::Base

Instance Attribute Details

#allowed_email_domains_list ⇒ Array

Comma-separated list of email address domains to allow group access

Returns:

  • (Array) —

    the current value of allowed_email_domains_list



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def allowed_email_domains_list
  @allowed_email_domains_list
end

#auto_ban_user_on_excessive_projects_download ⇒ Boolean

When enabled, users are automatically banned from the group when they download more than the maximum number of unique projects specified by unique_project_download_limit and unique_project_download_limit_interval_in_seconds

Returns:

  • (Boolean) —

    the current value of auto_ban_user_on_excessive_projects_download



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def auto_ban_user_on_excessive_projects_download
  @auto_ban_user_on_excessive_projects_download
end

#auto_devops_enabled ⇒ Boolean

Default to Auto DevOps pipeline for all projects within this group

Returns:

  • (Boolean) —

    the current value of auto_devops_enabled



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def auto_devops_enabled
  @auto_devops_enabled
end

#avatar_url ⇒ String

The URL of the group's avatar

Returns:

  • (String) —

    the current value of avatar_url



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def avatar_url
  @avatar_url
end

#created_at ⇒ String

The timestamp the group was created at

Returns:

  • (String) —

    the current value of created_at



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def created_at
  @created_at
end

#default_branch ⇒ String

The default branch name for group’s projects

Returns:

  • (String) —

    the current value of default_branch



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def default_branch
  @default_branch
end

#default_branch_protection_defaults ⇒ Hash

Describes the default branch protection defaults. See https://docs.gitlab.com/api/groups/#options-for-default_branch_protection_defaults for more info

Returns:

  • (Hash) —

    the current value of default_branch_protection_defaults



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def default_branch_protection_defaults
  @default_branch_protection_defaults
end

#description ⇒ String

The group’s description

Returns:

  • (String) —

    the current value of description



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def description
  @description
end

#duo_availability ⇒ String

Duo availability setting; valid values are: default_on, default_off, never_on

Returns:

  • (String) —

    the current value of duo_availability



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def duo_availability
  @duo_availability
end

#duo_features_enabled ⇒ Boolean

Indicates whether GitLab Duo features are enabled for this group

Returns:

  • (Boolean) —

    the current value of duo_features_enabled



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def duo_features_enabled
  @duo_features_enabled
end

#emails_enabled ⇒ Boolean

Enable email notifications

Returns:

  • (Boolean) —

    the current value of emails_enabled



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def emails_enabled
  @emails_enabled
end

#enabled_git_access_protocol ⇒ String

Enabled protocols for Git access; allowed values are: ssh, http, and all to allow both protocols

Returns:

  • (String) —

    the current value of enabled_git_access_protocol



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def enabled_git_access_protocol
  @enabled_git_access_protocol
end

#experiment_features_enabled ⇒ Boolean

Enable experiment features for this group

Returns:

  • (Boolean) —

    the current value of experiment_features_enabled



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def experiment_features_enabled
  @experiment_features_enabled
end

#extra_shared_runners_minutes_limit ⇒ Integer

Additional compute minutes for this group

Returns:

  • (Integer) —

    the current value of extra_shared_runners_minutes_limit



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def extra_shared_runners_minutes_limit
  @extra_shared_runners_minutes_limit
end

#file_template_project_id ⇒ Integer

The ID of a project to load custom file templates from

Returns:

  • (Integer) —

    the current value of file_template_project_id



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def file_template_project_id
  @file_template_project_id
end

#full_name ⇒ String

The full name of the group

Returns:

  • (String) —

    the current value of full_name



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def full_name
  @full_name
end

#full_path ⇒ String

Full path of group

Returns:

  • (String) —

    the current value of full_path



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def full_path
  @full_path
end

#id ⇒ Integer

ID of the group

Returns:

  • (Integer) —

    the current value of id



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def id
  @id
end

#ip_restriction_ranges ⇒ String

Comma-separated list of IP addresses or subnet masks to restrict group access

Returns:

  • (String) —

    the current value of ip_restriction_ranges



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def ip_restriction_ranges
  @ip_restriction_ranges
end

#lfs_enabled ⇒ Boolean

Enable/disable Large File Storage (LFS) for the projects in this group

Returns:

  • (Boolean) —

    the current value of lfs_enabled



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def lfs_enabled
  @lfs_enabled
end

#lock_duo_features_enabled ⇒ Boolean

Indicates whether the GitLab Duo features enabled setting is enforced for all subgroups

Returns:

  • (Boolean) —

    the current value of lock_duo_features_enabled



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def lock_duo_features_enabled
  @lock_duo_features_enabled
end

#lock_math_rendering_limits_enabled ⇒ Boolean

Indicates if math rendering limits are locked for all descendent groups

Returns:

  • (Boolean) —

    the current value of lock_math_rendering_limits_enabled



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def lock_math_rendering_limits_enabled
  @lock_math_rendering_limits_enabled
end

#marked_for_deletion_on ⇒ String

The date the group is scheduled to be deleted

Returns:

  • (String) —

    the current value of marked_for_deletion_on



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def marked_for_deletion_on
  @marked_for_deletion_on
end

#math_rendering_limits_enabled ⇒ Boolean

Indicates if math rendering limits are used for this group

Returns:

  • (Boolean) —

    the current value of math_rendering_limits_enabled



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def math_rendering_limits_enabled
  @math_rendering_limits_enabled
end

#max_artifacts_size ⇒ Integer

The maximum file size in megabytes for individual job artifacts

Returns:

  • (Integer) —

    the current value of max_artifacts_size



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def max_artifacts_size
  @max_artifacts_size
end

#membership_lock ⇒ Boolean

Users cannot be added to projects in this group

Returns:

  • (Boolean) —

    the current value of membership_lock



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def membership_lock
  @membership_lock
end

#mentions_disabled ⇒ Boolean

Disable the capability of a group from getting mentioned

Returns:

  • (Boolean) —

    the current value of mentions_disabled



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def mentions_disabled
  @mentions_disabled
end

#name ⇒ String

The name of the group

Returns:

  • (String) —

    the current value of name



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def name
  @name
end

#organization_id ⇒ Integer

The organization ID for the group

Returns:

  • (Integer) —

    the current value of organization_id



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def organization_id
  @organization_id
end

#parent_id ⇒ Integer

The parent group ID for creating nested group

Returns:

  • (Integer) —

    the current value of parent_id



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def parent_id
  @parent_id
end

#path ⇒ String

The path of the group

Returns:

  • (String) —

    the current value of path



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def path
  @path
end

#prevent_forking_outside_group ⇒ Boolean

When enabled, users can not fork projects from this group to external namespaces

Returns:

  • (Boolean) —

    the current value of prevent_forking_outside_group



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def prevent_forking_outside_group
  @prevent_forking_outside_group
end

#prevent_sharing_groups_outside_hierarchy ⇒ Boolean

When enabled, top-level group will ensure its subgroups and projects cannot invite other groups outside of the top-level group’s hierarchy

Returns:

  • (Boolean) —

    the current value of prevent_sharing_groups_outside_hierarchy



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def prevent_sharing_groups_outside_hierarchy
  @prevent_sharing_groups_outside_hierarchy
end

#project_creation_level ⇒ String

Determine if developers can create projects in the group; can be noone, maintainer, or developer

Returns:

  • (String) —

    the current value of project_creation_level



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def project_creation_level
  @project_creation_level
end

#repository_storage ⇒ String

Stroage location of repositories

Returns:

  • (String) —

    the current value of repository_storage



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def repository_storage
  @repository_storage
end

#request_access_enabled ⇒ Boolean

Allow users to request member access

Returns:

  • (Boolean) —

    the current value of request_access_enabled



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def request_access_enabled
  @request_access_enabled
end

#require_two_factor_authentication ⇒ Boolean

Require all users in this group to set up two-factor authentication

Returns:

  • (Boolean) —

    the current value of require_two_factor_authentication



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def require_two_factor_authentication
  @require_two_factor_authentication
end

#runners_token ⇒ String

Token of the group's runner

Returns:

  • (String) —

    the current value of runners_token



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def runners_token
  @runners_token
end

#share_with_group_lock ⇒ Boolean

Prevent sharing a project with another group within this group

Returns:

  • (Boolean) —

    the current value of share_with_group_lock



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def share_with_group_lock
  @share_with_group_lock
end

#shared_runners_minutes_limit ⇒ Integer

Maximum number of monthly compute minutes for this group; can be nil, 0, or > 0

Returns:

  • (Integer) —

    the current value of shared_runners_minutes_limit



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def shared_runners_minutes_limit
  @shared_runners_minutes_limit
end

#shared_with_groups ⇒ Array

Groups this group has been shared with

Returns:

  • (Array) —

    the current value of shared_with_groups



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def shared_with_groups
  @shared_with_groups
end

#statistics ⇒ Hash

Group statistics

Returns:

  • (Hash) —

    the current value of statistics



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def statistics
  @statistics
end

#subgroup_creation_level ⇒ String

Allowed to create subgroups; can be owner or maintainer

Returns:

  • (String) —

    the current value of subgroup_creation_level



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def subgroup_creation_level
  @subgroup_creation_level
end

#two_factor_grace_period ⇒ Integer

Time before Two-factor authentication is enforced (in hours)

Returns:

  • (Integer) —

    the current value of two_factor_grace_period



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def two_factor_grace_period
  @two_factor_grace_period
end

#unique_project_download_limit ⇒ Integer

Maximum number of unique projects a user can download in the specified time period before they are banned

Returns:

  • (Integer) —

    the current value of unique_project_download_limit



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def unique_project_download_limit
  @unique_project_download_limit
end

#unique_project_download_limit_alertlist ⇒ Array

List of user IDs that are emailed when the unique project download limit is exceeded

Returns:

  • (Array) —

    the current value of unique_project_download_limit_alertlist



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def unique_project_download_limit_alertlist
  @unique_project_download_limit_alertlist
end

#unique_project_download_limit_allowlist ⇒ Array

List of usernames excluded from the unique project download limit

Returns:

  • (Array) —

    the current value of unique_project_download_limit_allowlist



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def unique_project_download_limit_allowlist
  @unique_project_download_limit_allowlist
end

#unique_project_download_limit_interval_in_seconds ⇒ Integer

Time period during which a user can download a maximum amount of projects before they are banned

Returns:

  • (Integer) —

    the current value of unique_project_download_limit_interval_in_seconds



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def unique_project_download_limit_interval_in_seconds
  @unique_project_download_limit_interval_in_seconds
end

#visibility ⇒ String

The group’s visibility; can be private, internal, or public

Returns:

  • (String) —

    the current value of visibility



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def visibility
  @visibility
end

#web_url ⇒ String

The URL of the group

Returns:

  • (String) —

    the current value of web_url



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def web_url
  @web_url
end

#wiki_access_level ⇒ String

The wiki access level; can be disabled, private, or enabled

Returns:

  • (String) —

    the current value of wiki_access_level



64
65
66
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 64

def wiki_access_level
  @wiki_access_level
end

Class Method Details

.get(object) ⇒ Object

Locates a specific group in the GitLab system

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.url = 'https://gitlab.com/api/v4'
  config.token = 'abc123'
end

group = SupportOps::GitLab::Groups.get(123456)
pp group.name
# => "My Awesome Group"

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



280
281
282
283
284
285
286
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 280

def self.get(object)
  if object.is_a? Groups
    Groups.new(id: id).find
  else
    Groups.new(id: object).find
  end
end

.get!(object) ⇒ Object

Locates a specific group in the GitLab system

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.url = 'https://gitlab.com/api/v4'
  config.token = 'abc123'
end

group = SupportOps::GitLab::Groups.get!(123456)
pp group.name
# => "My Awesome Group"

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



308
309
310
311
312
313
314
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 308

def self.get!(object)
  if object.is_a? Groups
    Groups.new(id: id).find!
  else
    Groups.new(id: object).find!
  end
end

Instance Method Details

#badges ⇒ Boolean

Note:

This is inherited from Base#badges

List badges within a group

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

group = SupportOps::GitLab::Groups.get!(123456)
badges = group.badges
pp badges.count
# => 2

Returns:

  • (Boolean)

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



22
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 22

def badges; end

#encoded_path ⇒ Boolean

Note:

This is inherited from Base#encoded_path

Return the encoded path for a group

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

group = SupportOps::GitLab::Groups.get!(123456)
pp group.encoded_path
# => "test%2Fgroup"

Returns:

  • (Boolean)

Author:

  • Jason Colyer

Since:

  • 1.0.0



18
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 18

def encoded_path; end

#epics ⇒ Boolean

Note:

This is inherited from Base#epics

List epics within a group

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

group = SupportOps::GitLab::Groups.get!(123456)
epics = group.epics
pp epics.count
# => 3

Returns:

  • (Boolean)

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



22
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 22

def epics; end

#members ⇒ Boolean

Note:

This is inherited from Base#members

List members within a group

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

group = SupportOps::GitLab::Groups.get!(123456)
members = group.members
pp members.count
# => 5
members = group.members(all: true)
pp members.count
# => 15

Returns:

  • (Boolean)

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



28
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 28

def members; end

#merge_requests ⇒ Boolean

Note:

This is inherited from Base#merge_requests

List merge requests within a group

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

group = SupportOps::GitLab::Groups.get!(123456)
merge_requests = group.merge_requests
pp merge_requests.count
# => 128

Returns:

  • (Boolean)

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



22
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 22

def merge_requests; end

#milestones ⇒ Boolean

Note:

This is inherited from Base#milestones

List milestones within a group

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

group = SupportOps::GitLab::Groups.get!(123456)
milestones = group.milestones
pp milestones.count
# => 24

Returns:

  • (Boolean)

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



22
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 22

def milestones; end

#projects ⇒ Boolean

Note:

This is inherited from Base#projects

List projects within a group

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

group = SupportOps::GitLab::Groups.get!(123456)
projects = group.projects
pp projects.count
# => 27

Returns:

  • (Boolean)

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



22
# File 'lib/support_ops_gitlab/gitlab/groups.rb', line 22

def projects; end