-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql -- https://github.com/dillonkearns/elm-graphql module Github.Object.ProtectedBranch exposing (PushAllowancesOptionalArguments, ReviewDismissalAllowancesOptionalArguments, creator, hasDismissableStaleReviews, hasRequiredReviews, hasRequiredStatusChecks, hasRestrictedPushes, hasRestrictedReviewDismissals, hasStrictRequiredStatusChecks, id, isAdminEnforced, name, pushAllowances, repository, requiredStatusCheckContexts, reviewDismissalAllowances, selection) import Github.InputObject import Github.Interface import Github.Object import Github.Scalar import Github.Union import Graphql.Field as Field exposing (Field) import Graphql.Internal.Builder.Argument as Argument exposing (Argument) import Graphql.Internal.Builder.Object as Object import Graphql.Internal.Encode as Encode exposing (Value) import Graphql.OptionalArgument exposing (OptionalArgument(..)) import Graphql.SelectionSet exposing (SelectionSet) import Json.Decode as Decode {-| Select fields to build up a SelectionSet for this object. -} selection : (a -> constructor) -> SelectionSet (a -> constructor) Github.Object.ProtectedBranch selection constructor = Object.selection constructor {-| The actor who created this protected branch. -} creator : SelectionSet decodesTo Github.Interface.Actor -> Field (Maybe decodesTo) Github.Object.ProtectedBranch creator object_ = Object.selectionField "creator" [] object_ (identity >> Decode.nullable) {-| Will new commits pushed to this branch dismiss pull request review approvals. -} hasDismissableStaleReviews : Field Bool Github.Object.ProtectedBranch hasDismissableStaleReviews = Object.fieldDecoder "hasDismissableStaleReviews" [] Decode.bool {-| Are reviews required to update this branch. -} hasRequiredReviews : Field Bool Github.Object.ProtectedBranch hasRequiredReviews = Object.fieldDecoder "hasRequiredReviews" [] Decode.bool {-| Are status checks required to update this branch. -} hasRequiredStatusChecks : Field Bool Github.Object.ProtectedBranch hasRequiredStatusChecks = Object.fieldDecoder "hasRequiredStatusChecks" [] Decode.bool {-| Is pushing to this branch restricted. -} hasRestrictedPushes : Field Bool Github.Object.ProtectedBranch hasRestrictedPushes = Object.fieldDecoder "hasRestrictedPushes" [] Decode.bool {-| Is dismissal of pull request reviews restricted. -} hasRestrictedReviewDismissals : Field Bool Github.Object.ProtectedBranch hasRestrictedReviewDismissals = Object.fieldDecoder "hasRestrictedReviewDismissals" [] Decode.bool {-| Are branches required to be up to date before merging. -} hasStrictRequiredStatusChecks : Field Bool Github.Object.ProtectedBranch hasStrictRequiredStatusChecks = Object.fieldDecoder "hasStrictRequiredStatusChecks" [] Decode.bool id : Field Github.Scalar.Id Github.Object.ProtectedBranch id = Object.fieldDecoder "id" [] (Decode.oneOf [ Decode.string, Decode.float |> Decode.map Debug.toString, Decode.int |> Decode.map Debug.toString, Decode.bool |> Decode.map Debug.toString ] |> Decode.map Github.Scalar.Id) {-| Can admins overwrite branch protection. -} isAdminEnforced : Field Bool Github.Object.ProtectedBranch isAdminEnforced = Object.fieldDecoder "isAdminEnforced" [] Decode.bool {-| Identifies the name of the protected branch. -} name : Field String Github.Object.ProtectedBranch name = Object.fieldDecoder "name" [] Decode.string type alias PushAllowancesOptionalArguments = { first : OptionalArgument Int, after : OptionalArgument String, last : OptionalArgument Int, before : OptionalArgument String } {-| A list push allowances for this protected branch. - first - Returns the first _n_ elements from the list. - after - Returns the elements in the list that come after the specified global ID. - last - Returns the last _n_ elements from the list. - before - Returns the elements in the list that come before the specified global ID. -} pushAllowances : (PushAllowancesOptionalArguments -> PushAllowancesOptionalArguments) -> SelectionSet decodesTo Github.Object.PushAllowanceConnection -> Field decodesTo Github.Object.ProtectedBranch pushAllowances fillInOptionals object_ = let filledInOptionals = fillInOptionals { first = Absent, after = Absent, last = Absent, before = Absent } optionalArgs = [ Argument.optional "first" filledInOptionals.first Encode.int, Argument.optional "after" filledInOptionals.after Encode.string, Argument.optional "last" filledInOptionals.last Encode.int, Argument.optional "before" filledInOptionals.before Encode.string ] |> List.filterMap identity in Object.selectionField "pushAllowances" optionalArgs object_ identity {-| The repository associated with this protected branch. -} repository : SelectionSet decodesTo Github.Object.Repository -> Field decodesTo Github.Object.ProtectedBranch repository object_ = Object.selectionField "repository" [] object_ identity {-| List of required status check contexts that must pass for commits to be accepted to this branch. -} requiredStatusCheckContexts : Field (Maybe (List (Maybe String))) Github.Object.ProtectedBranch requiredStatusCheckContexts = Object.fieldDecoder "requiredStatusCheckContexts" [] (Decode.string |> Decode.nullable |> Decode.list |> Decode.nullable) type alias ReviewDismissalAllowancesOptionalArguments = { first : OptionalArgument Int, after : OptionalArgument String, last : OptionalArgument Int, before : OptionalArgument String } {-| A list review dismissal allowances for this protected branch. - first - Returns the first _n_ elements from the list. - after - Returns the elements in the list that come after the specified global ID. - last - Returns the last _n_ elements from the list. - before - Returns the elements in the list that come before the specified global ID. -} reviewDismissalAllowances : (ReviewDismissalAllowancesOptionalArguments -> ReviewDismissalAllowancesOptionalArguments) -> SelectionSet decodesTo Github.Object.ReviewDismissalAllowanceConnection -> Field decodesTo Github.Object.ProtectedBranch reviewDismissalAllowances fillInOptionals object_ = let filledInOptionals = fillInOptionals { first = Absent, after = Absent, last = Absent, before = Absent } optionalArgs = [ Argument.optional "first" filledInOptionals.first Encode.int, Argument.optional "after" filledInOptionals.after Encode.string, Argument.optional "last" filledInOptionals.last Encode.int, Argument.optional "before" filledInOptionals.before Encode.string ] |> List.filterMap identity in Object.selectionField "reviewDismissalAllowances" optionalArgs object_ identity