-- 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, Fragments, PinnedRepositoriesOptionalArguments, RepositoriesOptionalArguments, RepositoryRequiredArguments, avatarUrl, fragments, id, login, maybeFragments, pinnedRepositories, repositories, repository, resourcePath, url) import Github.Enum.RepositoryAffiliation import Github.Enum.RepositoryPrivacy import Github.InputObject import Github.Interface import Github.Object import Github.Scalar import Github.ScalarCodecs import Github.Union 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.Operation exposing (RootMutation, RootQuery, RootSubscription) import Graphql.OptionalArgument exposing (OptionalArgument(..)) import Graphql.SelectionSet exposing (FragmentSelectionSet(..), SelectionSet(..)) import Json.Decode as Decode type alias Fragments decodesTo = { onOrganization : SelectionSet decodesTo Github.Object.Organization , onUser : SelectionSet decodesTo Github.Object.User } {-| Build an exhaustive selection of type-specific fragments. -} fragments : Fragments decodesTo -> SelectionSet decodesTo Github.Interface.RepositoryOwner fragments selections = Object.exhuastiveFragmentSelection [ Object.buildFragment "Organization" selections.onOrganization , Object.buildFragment "User" selections.onUser ] {-| Can be used to create a non-exhuastive set of fragments by using the record update syntax to add `SelectionSet`s for the types you want to handle. -} maybeFragments : Fragments (Maybe decodesTo) maybeFragments = { onOrganization = Graphql.SelectionSet.empty |> Graphql.SelectionSet.map (\_ -> Nothing) , onUser = Graphql.SelectionSet.empty |> Graphql.SelectionSet.map (\_ -> Nothing) } 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) -> SelectionSet Github.ScalarCodecs.Uri Github.Interface.RepositoryOwner avatarUrl fillInOptionals = let filledInOptionals = fillInOptionals { size = Absent } optionalArgs = [ Argument.optional "size" filledInOptionals.size Encode.int ] |> List.filterMap identity in Object.selectionForField "ScalarCodecs.Uri" "avatarUrl" optionalArgs (Github.ScalarCodecs.codecs |> Github.Scalar.unwrapCodecs |> .codecUri |> .decoder) id : SelectionSet Github.ScalarCodecs.Id Github.Interface.RepositoryOwner id = Object.selectionForField "ScalarCodecs.Id" "id" [] (Github.ScalarCodecs.codecs |> Github.Scalar.unwrapCodecs |> .codecId |> .decoder) {-| The username used to login. -} login : SelectionSet String Github.Interface.RepositoryOwner login = Object.selectionForField "String" "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 -> SelectionSet 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.selectionForCompositeField "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 -> SelectionSet 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.selectionForCompositeField "repositories" optionalArgs object_ identity type alias RepositoryRequiredArguments = { name : String } {-| Find Repository. - name - Name of Repository to find. -} repository : RepositoryRequiredArguments -> SelectionSet decodesTo Github.Object.Repository -> SelectionSet (Maybe decodesTo) Github.Interface.RepositoryOwner repository requiredArgs object_ = Object.selectionForCompositeField "repository" [ Argument.required "name" requiredArgs.name Encode.string ] object_ (identity >> Decode.nullable) {-| The HTTP URL for the owner. -} resourcePath : SelectionSet Github.ScalarCodecs.Uri Github.Interface.RepositoryOwner resourcePath = Object.selectionForField "ScalarCodecs.Uri" "resourcePath" [] (Github.ScalarCodecs.codecs |> Github.Scalar.unwrapCodecs |> .codecUri |> .decoder) {-| The HTTP URL for the owner. -} url : SelectionSet Github.ScalarCodecs.Uri Github.Interface.RepositoryOwner url = Object.selectionForField "ScalarCodecs.Uri" "url" [] (Github.ScalarCodecs.codecs |> Github.Scalar.unwrapCodecs |> .codecUri |> .decoder)