Class: Ghub::Endpoints::Branches::Protection::Models::Show

Inherits:
Struct
  • Object
show all
Defined in:
lib/ghub/endpoints/branches/protection/models/show.rb

Overview

Defines branch protection.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeShow

Returns a new instance of Show.



40
41
42
43
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 40

def initialize(**)
  super
  freeze
end

Instance Attribute Details

#allow_deletionsObject

Returns the value of attribute allow_deletions

Returns:

  • (Object)

    the current value of allow_deletions



9
10
11
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 9

def allow_deletions
  @allow_deletions
end

#allow_force_pushesObject

Returns the value of attribute allow_force_pushes

Returns:

  • (Object)

    the current value of allow_force_pushes



9
10
11
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 9

def allow_force_pushes
  @allow_force_pushes
end

#block_creationsObject

Returns the value of attribute block_creations

Returns:

  • (Object)

    the current value of block_creations



9
10
11
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 9

def block_creations
  @block_creations
end

#enforce_adminsObject

Returns the value of attribute enforce_admins

Returns:

  • (Object)

    the current value of enforce_admins



9
10
11
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 9

def enforce_admins
  @enforce_admins
end

#required_conversation_resolutionObject

Returns the value of attribute required_conversation_resolution

Returns:

  • (Object)

    the current value of required_conversation_resolution



9
10
11
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 9

def required_conversation_resolution
  @required_conversation_resolution
end

#required_linear_historyObject

Returns the value of attribute required_linear_history

Returns:

  • (Object)

    the current value of required_linear_history



9
10
11
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 9

def required_linear_history
  @required_linear_history
end

#required_pull_request_reviewsObject

Returns the value of attribute required_pull_request_reviews

Returns:

  • (Object)

    the current value of required_pull_request_reviews



9
10
11
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 9

def required_pull_request_reviews
  @required_pull_request_reviews
end

#required_signaturesObject

Returns the value of attribute required_signatures

Returns:

  • (Object)

    the current value of required_signatures



9
10
11
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 9

def required_signatures
  @required_signatures
end

#required_status_checksObject

Returns the value of attribute required_status_checks

Returns:

  • (Object)

    the current value of required_status_checks



9
10
11
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 9

def required_status_checks
  @required_status_checks
end

#restrictionsObject

Returns the value of attribute restrictions

Returns:

  • (Object)

    the current value of restrictions



9
10
11
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 9

def restrictions
  @restrictions
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



9
10
11
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 9

def url
  @url
end

Class Method Details

.for(**attributes) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/ghub/endpoints/branches/protection/models/show.rb', line 22

def self.for(**attributes)
  new(
    **attributes.merge!(
      enforce_admins: Ghub::Models::BooleanLink[**attributes[:enforce_admins]],
      required_signatures: Ghub::Models::BooleanLink[
        **Hash(attributes[:required_signatures])
      ],
      required_status_checks: Ghub::Models::StatusCheck.for(
        **Hash(attributes[:required_status_checks])
      ),
      required_pull_request_reviews: Ghub::Models::Review.for(
        **Hash(attributes[:required_pull_request_reviews])
      ),
      restrictions: Ghub::Models::Restriction.for(**Hash(attributes[:restrictions]))
    )
  )
end