regressivetech / terraform-provider-contentful

Terraform provider for Contentful
MIT License
1 stars 0 forks source link

Webhook filters #6

Open alexandradeas opened 3 years ago

alexandradeas commented 3 years ago

Contentful's webhook API supports filtering based on Environment, Entity, and Content Type however the provider does not currently support filtering of the contentful_webhook resource in contentful besides space_id. The contentful_webhook resource should be updated to include an optional filter field that accepts a list of Environment, Entity, or Content Type IDs to be applied to the webhook.

As the handling of environments differs from the majority of other resources specific mention should be made of this in the documentation.

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhooks/webhook

alexandradeas commented 2 years ago

Filters are represented in the API as:

      "filters": [
        {
          "not": {
            "equals": [
              {
                "doc": "sys.environment.sys.id"
              },
              "foo"
            ]
          }
        },
        {
          "equals": [
            {
              "doc": "sys.contentType.sys.id"
            },
            "bar"
          ]
        },
        {
          "equals": [
            {
              "doc": "sys.id"
            },
            "baz"
          ]
        },
        {
          "equals": [
            {
              "doc": "sys.createdBy.sys.id"
            },
            "created-user"
          ]
        },
        {
          "equals": [
            {
              "doc": "sys.updatedBy.sys.id"
            },
            "updated-user"
          ]
        }
      ],