/AWS1/IF_BLD=>UPDATEWEBHOOK()¶
About UpdateWebhook¶
Updates the webhook associated with an CodeBuild build project.
If you use Bitbucket for your repository, rotateSecret is ignored.
Method Signature¶
METHODS /AWS1/IF_BLD~UPDATEWEBHOOK
IMPORTING
!IV_PROJECTNAME TYPE /AWS1/BLDPROJECTNAME OPTIONAL
!IV_BRANCHFILTER TYPE /AWS1/BLDSTRING OPTIONAL
!IV_ROTATESECRET TYPE /AWS1/BLDBOOLEAN OPTIONAL
!IT_FILTERGROUPS TYPE /AWS1/CL_BLDWEBHOOKFILTER=>TT_FILTERGROUPS OPTIONAL
!IV_BUILDTYPE TYPE /AWS1/BLDWEBHOOKBUILDTYPE OPTIONAL
!IO_PULLREQUESTBUILDPOLICY TYPE REF TO /AWS1/CL_BLDPULLREQBUILDPOLICY OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bldupdwebhookoutput
RAISING
/AWS1/CX_BLDINVALIDINPUTEX
/AWS1/CX_BLDOAUTHPROVIDEREX
/AWS1/CX_BLDRESOURCENOTFOUNDEX
/AWS1/CX_BLDCLIENTEXC
/AWS1/CX_BLDSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_projectname TYPE /AWS1/BLDPROJECTNAME /AWS1/BLDPROJECTNAME¶
The name of the CodeBuild project.
Optional arguments:¶
iv_branchfilter TYPE /AWS1/BLDSTRING /AWS1/BLDSTRING¶
A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If
branchFilteris empty, then all branches are built.It is recommended that you use
filterGroupsinstead ofbranchFilter.
iv_rotatesecret TYPE /AWS1/BLDBOOLEAN /AWS1/BLDBOOLEAN¶
A boolean value that specifies whether the associated GitHub repository's secret token should be updated. If you use Bitbucket for your repository,
rotateSecretis ignored.
it_filtergroups TYPE /AWS1/CL_BLDWEBHOOKFILTER=>TT_FILTERGROUPS TT_FILTERGROUPS¶
An array of arrays of
WebhookFilterobjects used to determine if a webhook event can trigger a build. A filter group must contain at least oneEVENTWebhookFilter.
iv_buildtype TYPE /AWS1/BLDWEBHOOKBUILDTYPE /AWS1/BLDWEBHOOKBUILDTYPE¶
Specifies the type of build this webhook will trigger.
RUNNER_BUILDKITE_BUILDis only available forNO_SOURCEsource type projects configured for Buildkite runner builds. For more information about CodeBuild-hosted Buildkite runner builds, see Tutorial: Configure a CodeBuild-hosted Buildkite runner in the CodeBuild user guide.
io_pullrequestbuildpolicy TYPE REF TO /AWS1/CL_BLDPULLREQBUILDPOLICY /AWS1/CL_BLDPULLREQBUILDPOLICY¶
A PullRequestBuildPolicy object that defines comment-based approval requirements for triggering builds on pull requests. This policy helps control when automated builds are executed based on contributor permissions and approval workflows.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_bldupdwebhookoutput /AWS1/CL_BLDUPDWEBHOOKOUTPUT¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->updatewebhook(
io_pullrequestbuildpolicy = new /aws1/cl_bldpullreqbuildpolicy(
it_approverroles = VALUE /aws1/cl_bldpullreqbldapprro00=>tt_pullreqbuildapproverroles(
( new /aws1/cl_bldpullreqbldapprro00( |string| ) )
)
iv_requirescommentapproval = |string|
)
it_filtergroups = VALUE /aws1/cl_bldwebhookfilter=>tt_filtergroups(
(
VALUE /aws1/cl_bldwebhookfilter=>tt_filtergroup(
(
new /aws1/cl_bldwebhookfilter(
iv_excludematchedpattern = ABAP_TRUE
iv_pattern = |string|
iv_type = |string|
)
)
)
)
)
iv_branchfilter = |string|
iv_buildtype = |string|
iv_projectname = |string|
iv_rotatesecret = ABAP_TRUE
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lo_webhook = lo_result->get_webhook( ).
IF lo_webhook IS NOT INITIAL.
lv_nonemptystring = lo_webhook->get_url( ).
lv_nonemptystring = lo_webhook->get_payloadurl( ).
lv_nonemptystring = lo_webhook->get_secret( ).
lv_string = lo_webhook->get_branchfilter( ).
LOOP AT lo_webhook->get_filtergroups( ) into lt_row.
LOOP AT lt_row into lo_row_1.
lo_row_2 = lo_row_1.
IF lo_row_2 IS NOT INITIAL.
lv_webhookfiltertype = lo_row_2->get_type( ).
lv_string = lo_row_2->get_pattern( ).
lv_wrapperboolean = lo_row_2->get_excludematchedpattern( ).
ENDIF.
ENDLOOP.
ENDLOOP.
lv_webhookbuildtype = lo_webhook->get_buildtype( ).
lv_wrapperboolean = lo_webhook->get_manualcreation( ).
lv_timestamp = lo_webhook->get_lastmodifiedsecret( ).
lo_scopeconfiguration = lo_webhook->get_scopeconfiguration( ).
IF lo_scopeconfiguration IS NOT INITIAL.
lv_string = lo_scopeconfiguration->get_name( ).
lv_string = lo_scopeconfiguration->get_domain( ).
lv_webhookscopetype = lo_scopeconfiguration->get_scope( ).
ENDIF.
lv_webhookstatus = lo_webhook->get_status( ).
lv_string = lo_webhook->get_statusmessage( ).
lo_pullrequestbuildpolicy = lo_webhook->get_pullrequestbuildpolicy( ).
IF lo_pullrequestbuildpolicy IS NOT INITIAL.
lv_pullrequestbuildcomment = lo_pullrequestbuildpolicy->get_requirescommentapproval( ).
LOOP AT lo_pullrequestbuildpolicy->get_approverroles( ) into lo_row_3.
lo_row_4 = lo_row_3.
IF lo_row_4 IS NOT INITIAL.
lv_pullrequestbuildapprove = lo_row_4->get_value( ).
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.