Sha256: 7461c4820ea94b30027ba3c30ea14786fd1cefb65edc0b6451845ad9987b60fa

Contents?: true

Size: 1.97 KB

Versions: 2

Compression:

Stored size: 1.97 KB

Contents

module Ecoportal
  module API
    class GraphQL
      module Model
        class Organization < Ecoportal::API::GraphQL::Base::Organization
          DEFAULT_PATH = ["currentOrganization"]

          class << self
            def path(*add)
              DEFAULT_PATH.dup.push(*add)
            end

            #userGroup, userGroups

            # @return [Collection::TagTree, Query::TagTrees]
            def tagTrees(**kargs, &block)
              if kargs.empty? && !block_given?
                tagTreesQuery
              else
                tagTreesQuery.query(**kargs, &block)
              end
            end

            #tagTree

            #register, registers
            #personMembers, attachablePersonMembers
            #contractorEntity,

            # @return [Connection::ContractorEntity, Query::ContractorEntities]
            def contractorEntities(**kargs, &block)
              if kargs.empty? && !block_given?
                contractorEntitiesQuery
              else
                contractorEntitiesQuery.query(**kargs, &block)
              end
            end

            # @return [Connection::Action, Query::Actions]
            def actions(**kargs, &block)
              if kargs.empty? && !block_given?
                actionsQuery
              else
                actionsQuery.query(**kargs, &block)
              end
            end

            #action, actionsByPage, actionsCounter
            #actionCategories

            private

            def tagTreesQuery
              Ecoportal::API::GraphQL::Query::TagTrees.new(client, base_path: path)
            end

            def contractorEntitiesQuery
              Ecoportal::API::GraphQL::Query::ContractorEntities.new(client, base_path: path)
            end

            def actionsQuery
              Ecoportal::API::GraphQL::Query::Actions.new(client, base_path: path)
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ecoportal-api-graphql-0.1.8 lib/ecoportal/api/graphql/model/organization.rb
ecoportal-api-graphql-0.1.7 lib/ecoportal/api/graphql/model/organization.rb