Esempio n. 1
0
    ISearchableByQuestionOwner,
    )
from lp.answers.interfaces.questionmessage import IQuestionMessage
from lp.answers.interfaces.questionsperson import IQuestionsPerson
from lp.answers.interfaces.questionsubscription import IQuestionSubscription
from lp.answers.interfaces.questiontarget import IQuestionTarget
from lp.services.webservice.apihelpers import (
    patch_collection_return_type,
    patch_entry_return_type,
    patch_reference_property,
    )


IQuestionSet.queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['collection_entry_schema'] = IQuestion
patch_entry_return_type(IQuestionSet, 'get', IQuestion)
patch_collection_return_type(
    IQuestionTarget, 'findSimilarQuestions', IQuestion)
patch_collection_return_type(
    IQuestionCollection, 'searchQuestions', IQuestion)
patch_collection_return_type(
    ISearchableByQuestionOwner, 'searchQuestions', IQuestion)
patch_reference_property(IQuestionMessage, 'question', IQuestion)
patch_reference_property(IQuestionSubscription, 'question', IQuestion)
patch_collection_return_type(
    IQuestionsPerson, 'getDirectAnswerQuestionTargets', IQuestionTarget)
patch_collection_return_type(
    IQuestionsPerson, 'getTeamAnswerQuestionTargets', IQuestionTarget)
patch_collection_return_type(
    IQuestionsPerson, 'searchQuestions', IQuestion)
IBranch['spec_links'].value_type.schema = ISpecificationBranch
IBranch['subscribe'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['return_type'].schema = IBranchSubscription
IBranch['subscriptions'].value_type.schema = IBranchSubscription
IBranch['unlinkBug'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['bug'].schema = IBug
IBranch['unlinkSpecification'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['spec'].schema = ISpecification

patch_entry_return_type(IBranch, '_createMergeProposal', IBranchMergeProposal)
patch_plain_parameter_type(
    IBranch, '_createMergeProposal', 'target_branch', IBranch)
patch_plain_parameter_type(
    IBranch, '_createMergeProposal', 'prerequisite_branch', IBranch)
patch_collection_return_type(
    IBranch, 'getMergeProposals', IBranchMergeProposal)

patch_collection_return_type(
    IBranchSet, 'getMergeProposals', IBranchMergeProposal)

IBranchMergeProposal['getComment'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['return_type'].schema = ICodeReviewComment
IBranchMergeProposal['createComment'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['parent'].schema = \
        ICodeReviewComment
patch_entry_return_type(
    IBranchMergeProposal, 'createComment', ICodeReviewComment)
IBranchMergeProposal['all_comments'].value_type.schema = ICodeReviewComment
IBranchMergeProposal['nominateReviewer'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['return_type'].schema = ICodeReviewVoteReference
IBranchMergeProposal['votes'].value_type.schema = ICodeReviewVoteReference
from lp.answers.interfaces.questioncollection import (
    IQuestionSet,
    ISearchableByQuestionOwner,
    )
from lp.answers.interfaces.questionmessage import IQuestionMessage
from lp.answers.interfaces.questionsperson import IQuestionsPerson
from lp.answers.interfaces.questionsubscription import IQuestionSubscription
from lp.answers.interfaces.questiontarget import IQuestionTarget
from lp.services.webservice.apihelpers import (
    patch_collection_return_type,
    patch_entry_return_type,
    patch_reference_property,
    )


IQuestionSet.queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['collection_entry_schema'] = IQuestion
patch_entry_return_type(IQuestionSet, 'get', IQuestion)
patch_collection_return_type(
    IQuestionTarget, 'findSimilarQuestions', IQuestion)
patch_collection_return_type(
    ISearchableByQuestionOwner, 'searchQuestions', IQuestion)
patch_reference_property(IQuestionMessage, 'question', IQuestion)
patch_reference_property(IQuestionSubscription, 'question', IQuestion)
patch_collection_return_type(
    IQuestionsPerson, 'getDirectAnswerQuestionTargets', IQuestionTarget)
patch_collection_return_type(
    IQuestionsPerson, 'getTeamAnswerQuestionTargets', IQuestionTarget)
patch_collection_return_type(
    IQuestionsPerson, 'searchQuestions', IQuestion)
IBranch['spec_links'].value_type.schema = ISpecificationBranch
IBranch['subscribe'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['return_type'].schema = IBranchSubscription
IBranch['subscriptions'].value_type.schema = IBranchSubscription
IBranch['unlinkBug'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['bug'].schema = IBug
IBranch['unlinkSpecification'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['spec'].schema = ISpecification

patch_entry_return_type(IBranch, '_createMergeProposal', IBranchMergeProposal)
patch_plain_parameter_type(IBranch, '_createMergeProposal', 'target_branch',
                           IBranch)
patch_plain_parameter_type(IBranch, '_createMergeProposal',
                           'prerequisite_branch', IBranch)
patch_collection_return_type(IBranch, 'getMergeProposals',
                             IBranchMergeProposal)

patch_collection_return_type(IBranchSet, 'getMergeProposals',
                             IBranchMergeProposal)

IBranchMergeProposal['getComment'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['return_type'].schema = ICodeReviewComment
IBranchMergeProposal['createComment'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['parent'].schema = \
        ICodeReviewComment
patch_entry_return_type(IBranchMergeProposal, 'createComment',
                        ICodeReviewComment)
IBranchMergeProposal['all_comments'].value_type.schema = ICodeReviewComment
IBranchMergeProposal['nominateReviewer'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['return_type'].schema = ICodeReviewVoteReference
IBranchMergeProposal['votes'].value_type.schema = ICodeReviewVoteReference
Esempio n. 5
0
    ISnapView,
)
from lp.snappy.interfaces.snapbase import (
    ISnapBase,
    ISnapBaseSet,
)
from lp.snappy.interfaces.snapbuild import (
    ISnapBuild,
    ISnapFile,
)
from lp.snappy.interfaces.snappyseries import (
    ISnappySeries,
    ISnappySeriesSet,
)

# ISnapFile
patch_reference_property(ISnapFile, 'snapbuild', ISnapBuild)

# ISnapBuildRequest
patch_reference_property(ISnapBuildRequest, 'snap', ISnap)
patch_collection_property(ISnapBuildRequest, 'builds', ISnapBuild)

# ISnapView
patch_entry_return_type(ISnapView, 'requestBuild', ISnapBuild)
patch_collection_property(ISnapView, 'builds', ISnapBuild)
patch_collection_property(ISnapView, 'completed_builds', ISnapBuild)
patch_collection_property(ISnapView, 'pending_builds', ISnapBuild)

# ISnapEdit
patch_collection_return_type(ISnapEdit, 'requestAutoBuilds', ISnapBuild)