-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql -- https://github.com/dillonkearns/elm-graphql module Github.Interface.RepositoryOwner exposing (AvatarUrlOptionalArguments, PinnedRepositoriesOptionalArguments, RepositoriesOptionalArguments, RepositoryRequiredArguments, avatarUrl, commonSelection, id, login, onOrganization, onUser, pinnedRepositories, repositories, repository, resourcePath, selection, url) import Github.Enum.RepositoryAffiliation import Github.Enum.RepositoryPrivacy 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 (FragmentSelectionSet(..), SelectionSet(..)) import Json.Decode as Decode {-| Select only common fields from the interface. -} commonSelection : (a -> constructor) -> SelectionSet (a -> constructor) Github.Interface.RepositoryOwner commonSelection constructor = Object.selection constructor {-| Select both common and type-specific fields from the interface. -} selection : (Maybe typeSpecific -> a -> constructor) -> List (FragmentSelectionSet typeSpecific Github.Interface.RepositoryOwner) -> SelectionSet (a -> constructor) Github.Interface.RepositoryOwner selection constructor typeSpecificDecoders = Object.interfaceSelection typeSpecificDecoders constructor onOrganization : SelectionSet decodesTo Github.Object.Organization -> FragmentSelectionSet decodesTo Github.Interface.RepositoryOwner onOrganization (SelectionSet fields decoder) = FragmentSelectionSet "Organization" fields decoder onUser : SelectionSet decodesTo Github.Object.User -> FragmentSelectionSet decodesTo Github.Interface.RepositoryOwner onUser (SelectionSet fields decoder) = FragmentSelectionSet "User" fields decoder type alias AvatarUrlOptionalArguments = { size : OptionalArgument Int } {-| A URL pointing to the owner's public avatar. - size - The size of the resulting square image. -} avatarUrl : (AvatarUrlOptionalArguments -> AvatarUrlOptionalArguments) -> Field Github.Scalar.Uri Github.Interface.RepositoryOwner avatarUrl fillInOptionals = let filledInOptionals = fillInOptionals { size = Absent } optionalArgs = [ Argument.optional "size" filledInOptionals.size Encode.int ] |> List.filterMap identity in Object.fieldDecoder "avatarUrl" optionalArgs (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.Uri) id : Field Github.Scalar.Id Github.Interface.RepositoryOwner 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) {-| The username used to login. -} login : Field String Github.Interface.RepositoryOwner login = Object.fieldDecoder "login" [] Decode.string type alias PinnedRepositoriesOptionalArguments = { first : OptionalArgument Int, after : OptionalArgument String, last : OptionalArgument Int, before : OptionalArgument String, privacy : OptionalArgument Github.Enum.RepositoryPrivacy.RepositoryPrivacy, orderBy : OptionalArgument Github.InputObject.RepositoryOrder, affiliations : OptionalArgument (List (Maybe Github.Enum.RepositoryAffiliation.RepositoryAffiliation)), isLocked : OptionalArgument Bool } {-| A list of repositories this user has pinned to their profile - 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. - privacy - If non-null, filters repositories according to privacy - orderBy - Ordering options for repositories returned from the connection - affiliations - Affiliation options for repositories returned from the connection - isLocked - If non-null, filters repositories according to whether they have been locked -} pinnedRepositories : (PinnedRepositoriesOptionalArguments -> PinnedRepositoriesOptionalArguments) -> SelectionSet decodesTo Github.Object.RepositoryConnection -> Field decodesTo Github.Interface.RepositoryOwner pinnedRepositories fillInOptionals object_ = let filledInOptionals = fillInOptionals { first = Absent, after = Absent, last = Absent, before = Absent, privacy = Absent, orderBy = Absent, affiliations = Absent, isLocked = 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, Argument.optional "privacy" filledInOptionals.privacy (Encode.enum Github.Enum.RepositoryPrivacy.toString), Argument.optional "orderBy" filledInOptionals.orderBy Github.InputObject.encodeRepositoryOrder, Argument.optional "affiliations" filledInOptionals.affiliations (Encode.enum Github.Enum.RepositoryAffiliation.toString |> Encode.maybe |> Encode.list), Argument.optional "isLocked" filledInOptionals.isLocked Encode.bool ] |> List.filterMap identity in Object.selectionField "pinnedRepositories" optionalArgs object_ identity type alias RepositoriesOptionalArguments = { first : OptionalArgument Int, after : OptionalArgument String, last : OptionalArgument Int, before : OptionalArgument String, privacy : OptionalArgument Github.Enum.RepositoryPrivacy.RepositoryPrivacy, orderBy : OptionalArgument Github.InputObject.RepositoryOrder, affiliations : OptionalArgument (List (Maybe Github.Enum.RepositoryAffiliation.RepositoryAffiliation)), isLocked : OptionalArgument Bool, isFork : OptionalArgument Bool } {-| A list of repositories that the user owns. - 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. - privacy - If non-null, filters repositories according to privacy - orderBy - Ordering options for repositories returned from the connection - affiliations - Affiliation options for repositories returned from the connection - isLocked - If non-null, filters repositories according to whether they have been locked - isFork - If non-null, filters repositories according to whether they are forks of another repository -} repositories : (RepositoriesOptionalArguments -> RepositoriesOptionalArguments) -> SelectionSet decodesTo Github.Object.RepositoryConnection -> Field decodesTo Github.Interface.RepositoryOwner repositories fillInOptionals object_ = let filledInOptionals = fillInOptionals { first = Absent, after = Absent, last = Absent, before = Absent, privacy = Absent, orderBy = Absent, affiliations = Absent, isLocked = Absent, isFork = 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, Argument.optional "privacy" filledInOptionals.privacy (Encode.enum Github.Enum.RepositoryPrivacy.toString), Argument.optional "orderBy" filledInOptionals.orderBy Github.InputObject.encodeRepositoryOrder, Argument.optional "affiliations" filledInOptionals.affiliations (Encode.enum Github.Enum.RepositoryAffiliation.toString |> Encode.maybe |> Encode.list), Argument.optional "isLocked" filledInOptionals.isLocked Encode.bool, Argument.optional "isFork" filledInOptionals.isFork Encode.bool ] |> List.filterMap identity in Object.selectionField "repositories" optionalArgs object_ identity type alias RepositoryRequiredArguments = { name : String } {-| Find Repository. - name - Name of Repository to find. -} repository : RepositoryRequiredArguments -> SelectionSet decodesTo Github.Object.Repository -> Field (Maybe decodesTo) Github.Interface.RepositoryOwner repository requiredArgs object_ = Object.selectionField "repository" [ Argument.required "name" requiredArgs.name Encode.string ] object_ (identity >> Decode.nullable) {-| The HTTP URL for the owner. -} resourcePath : Field Github.Scalar.Uri Github.Interface.RepositoryOwner resourcePath = Object.fieldDecoder "resourcePath" [] (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.Uri) {-| The HTTP URL for the owner. -} url : Field Github.Scalar.Uri Github.Interface.RepositoryOwner url = Object.fieldDecoder "url" [] (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.Uri)