Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for GET/POST/DELETE action association to a service #115

Merged

Conversation

imjaroiswebdev
Copy link
Collaborator

Add support for Automation Actions' Action association with a Service...

  • GET - https://api.pagerduty.com/automation_actions/actions/{id}/services/{team_id}
  • POST - https://api.pagerduty.com/automation_actions/services/{id}/teams
  • DELETE - https://api.pagerduty.com/automation_actions/actions/{id}/services/{team_id}

New tests cases introduced...

make test TESTARGS="-v -run TestAutomationActionsActionServiceAssociation"
==> Testing go-pagerduty
=== RUN   TestAutomationActionsActionServiceAssociationCreate
2023/01/05 16:36:22 ===== PagerDuty Cache Skipping Init =====
--- PASS: TestAutomationActionsActionServiceAssociationCreate (0.00s)
=== RUN   TestAutomationActionsActionServiceAssociationDelete
2023/01/05 16:36:22 ===== PagerDuty Cache Skipping Init =====
--- PASS: TestAutomationActionsActionServiceAssociationDelete (0.00s)
=== RUN   TestAutomationActionsActionServiceAssociationGet
2023/01/05 16:36:22 ===== PagerDuty Cache Skipping Init =====
--- PASS: TestAutomationActionsActionServiceAssociationGet (0.00s)
PASS
ok      github.com/heimweh/go-pagerduty/pagerduty       0.426s

}

// Dissociate an Automation Action with a service
func (s *AutomationActionsActionService) DissociateToService(actionID, serviceID string) (*Response, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DissociateFromService is more correct from the grammar perspective, IMO.

Copy link
Contributor

@mrdubr mrdubr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar suggestion

@imjaroiswebdev imjaroiswebdev requested a review from mrdubr January 6, 2023 16:29
@imjaroiswebdev imjaroiswebdev force-pushed the a2actionsAssociationWithService branch from 30ff84c to fce67f6 Compare January 6, 2023 16:31
Copy link
Contributor

@mrdubr mrdubr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@imjaroiswebdev imjaroiswebdev force-pushed the a2actionsAssociationWithService branch from fce67f6 to b225b61 Compare January 6, 2023 16:37
@imjaroiswebdev imjaroiswebdev merged commit 1866a66 into heimweh:master Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants