-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Migrate sendgrid to config-based #15257
Changes from 4 commits
897ecc5
6099e22
aa31326
a05e5b0
b193739
0cb7db5
778e3c3
2675e7d
1d23578
d9ec5b3
a1b2e08
9c8d83f
018d165
6f1fbbd
7342626
b5e5ba6
842f515
c6adde7
2885ab2
53ebb79
8e32764
01a300e
5f0a51e
992f3a8
936ccc6
9ad8824
4b73912
028bdfb
3c76c5a
b9277d0
a584b84
9957303
5f8e7d5
72880ce
4cd75ea
28f0588
99caa58
8d55afa
9b70a3b
4a9876d
016cb69
b984d20
42af817
5f0bcf2
f9c12a0
b36596c
03ed92e
1fcd68f
965b2cb
53f3e68
30920d2
52d28fe
e10d6b9
7975a89
b582e87
1b34c19
3dadc32
ac92374
f94a4a4
6708c46
b0a2d2b
ec94936
ffefa97
8d10fa9
3256a2f
421f72e
b70e518
a5c2734
971ab82
28fec5e
2e103f3
5ef1817
04be9c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
schema_loader: | ||
type: JsonSchema | ||
file_path: "./source_sendgrid/schemas/{{ options.name }}.json" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about calling it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agreed. keeping track of this issue here |
||
result_selector: | ||
type: RecordSelector | ||
extractor: | ||
type: JelloExtractor | ||
transform: "_.result" | ||
requester: | ||
type: HttpRequester | ||
name: "{{ options['name'] }}" | ||
url_base: "https://api.sendgrid.com" | ||
http_method: "GET" | ||
authenticator: | ||
type: "BearerAuthenticator" | ||
token: "{{ config.apikey }}" | ||
cursor_paginator: | ||
type: LimitPaginator | ||
url_base: "*ref(requester.url_base)" | ||
page_size: 100 | ||
limit_option: | ||
inject_into: "request_parameter" | ||
field_name: "page_size" | ||
page_token_option: | ||
inject_into: "path" | ||
pagination_strategy: | ||
type: "CursorPagination" | ||
cursor_value: "{{ response._metadata.next }}" | ||
offset_paginator: | ||
type: LimitPaginator | ||
$options: | ||
url_base: "*ref(requester.url_base)" | ||
page_size: 10 | ||
limit_option: | ||
inject_into: "request_parameter" | ||
field_name: "limit" | ||
page_token_option: | ||
inject_into: "request_parameter" | ||
field_name: "offset" | ||
pagination_strategy: | ||
type: "OffsetIncrement" | ||
retriever: | ||
type: SimpleRetriever | ||
name: "{{ options['name'] }}" | ||
primary_key: "{{ options['primary_key'] }}" | ||
|
||
lists_stream: | ||
type: DeclarativeStream | ||
$options: | ||
name: "lists" | ||
primary_key: "id" | ||
schema_loader: | ||
$ref: "*ref(schema_loader)" | ||
retriever: | ||
$ref: "*ref(retriever)" | ||
record_selector: | ||
$ref: "*ref(result_selector)" | ||
requester: | ||
$ref: "*ref(requester)" | ||
path: "/v3/marketing/lists" | ||
paginator: | ||
$ref: "*ref(cursor_paginator)" | ||
campaigns_stream: | ||
type: DeclarativeStream | ||
$options: | ||
name: "campaigns" | ||
primary_key: "id" | ||
schema_loader: | ||
$ref: "*ref(schema_loader)" | ||
retriever: | ||
$ref: "*ref(retriever)" | ||
record_selector: | ||
$ref: "*ref(result_selector)" | ||
requester: | ||
$ref: "*ref(requester)" | ||
path: "/v3/marketing/campaigns" | ||
paginator: | ||
$ref: "*ref(cursor_paginator)" | ||
contacts_stream: | ||
type: DeclarativeStream | ||
$options: | ||
name: "contacts" | ||
primary_key: "id" | ||
schema_loader: | ||
$ref: "*ref(schema_loader)" | ||
retriever: | ||
$ref: "*ref(retriever)" | ||
record_selector: | ||
$ref: "*ref(result_selector)" | ||
requester: | ||
$ref: "*ref(requester)" | ||
path: "/v3/marketing/contacts" | ||
paginator: | ||
type: "NoPagination" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. contacts pagination has been deprecated https://docs.sendgrid.com/api-reference/contacts/get-sample-contacts |
||
streams: | ||
- "*ref(lists_stream)" | ||
- "*ref(campaigns_stream)" | ||
- "*ref(contacts_stream)" | ||
check: | ||
type: CheckStream | ||
stream_names: ["lists"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an advice here is that you should have a top level
definitions
where you can create your reusable objects. Right now it is polluting the top level "namespace" and that will make it harder to extend it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that could be a part of the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! done