Skip to content

Fix notifications entry layout #917

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

Merged
merged 2 commits into from
Apr 13, 2023
Merged

Fix notifications entry layout #917

merged 2 commits into from
Apr 13, 2023

Conversation

jreiberkyle
Copy link
Contributor

Related Issue(s):

Closes #916

Proposed Changes:

For inclusion in changelog (if applicable):

  1. Fix order request notification entry layout.

Not intended for changelog:

Diff of User Interface

Script:

import json

from planet import order_request

notification = True
order_uuid = 'test_order'
products = [
        order_request.product(['20230412_054952_10_24cc'], item_type='psscene', product_bundle='analytic_udm2')]
tools = None

if notification:
    notifications = order_request.notifications(
        webhook_per_order=True,
        webhook_url="http://webhookurl",
        email=False,
    )

request = order_request.build_request(
    order_uuid,
    products=products,
    tools=tools,
    notifications=notifications if notifications else None,
)

print(json.dumps(request))

Old behavior:

notifications entry is incorrect:

{
  "name": "test_order",
  "products": [
    {
      "item_ids": [
        "20230412_054952_10_24cc"
      ],
      "item_type": "PSScene",
      "product_bundle": "analytic_udm2"
    }
  ],
  "notifications": {
    "webhook_url": "http://webhookurl",
    "webhook_per_order": true
  }
}

New behavior:

notifications entry is corrected:

{
  "name": "test_order",
  "products": [
    {
      "item_ids": [
        "20230412_054952_10_24cc"
      ],
      "item_type": "PSScene",
      "product_bundle": "analytic_udm2"
    }
  ],
  "notifications": {
    "webhook": {
      "url": "http://webhookurl",
      "per_order": true
    },
    "email": false
  }
}

PR Checklist:

  • [] This PR is as small and focused as possible
  • [] If this PR includes proposed changes for inclusion in the changelog, the title of this PR summarizes those changes and is ready for inclusion in the Changelog.
  • [] I have updated docstrings for function changes and docs in the 'docs' folder for user interface / behavior changes
  • [] This PR does not break any examples or I have updated them

(Optional) @mentions for Notifications:

@jreiberkyle jreiberkyle self-assigned this Apr 12, 2023
Copy link
Contributor

@kevinlacaille kevinlacaille left a comment

Choose a reason for hiding this comment

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

Looks great! Great catch, @julianblue!

@jreiberkyle jreiberkyle merged commit d4fd250 into main Apr 13, 2023
@jreiberkyle jreiberkyle deleted the webhook-916 branch April 13, 2023 21:28
@jreiberkyle jreiberkyle mentioned this pull request Apr 14, 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.

Webhook configurations removed
2 participants