Repository: amp-labs/connectors
Pull request #123 (2024-03-22 17:58:11)

[ENG-886] feat:Add AWeber connector
## Checklist
- [x] Ran Linter
- [x] Catalog tests passing
- [x] Created PR from non-main branch 

## Catalog variables
None

## Notes
Have a custom rate limit error.

## Testing 
### GET 
Retrive accounts
<img width="1151" alt="Screenshot 2024-03-22 at 18 48 45" src="https://github.com/amp-labs/connectors/assets/52887226/7abb3933-e6d4-463a-aea3-5022fe39b42e">


### POST
Create a subscriber
<img width="1140" alt="Screenshot 2024-03-22 at 18 54 16" src="https://github.com/amp-labs/connectors/assets/52887226/b32317f3-be5f-4ff9-8443-6900f2f6b066">


### PATCH
Update name of a subscriber
<img width="1146" alt="Screenshot 2024-03-22 at 18 59 39" src="https://github.com/amp-labs/connectors/assets/52887226/1d34c0dd-d37d-4c48-86aa-ccc024ceb7da">


## Pagination
Retrieving a paginated list of subscribers
<img width="1140" alt="Screenshot 2024-03-22 at 19 06 35" src="https://github.com/amp-labs/connectors/assets/52887226/9f66e80d-383c-4240-96d1-c780d4909570">

Using the `next_collection_link` to retrieve the next page subscribers.
<img width="1151" alt="Screenshot 2024-03-22 at 19 07 18" src="https://github.com/amp-labs/connectors/assets/52887226/902cd8ac-9c10-4508-a864-ba6c35bf96db">



Jkarage: @RajatPawar 

Patch:
diff --git a/providers/catalog.go b/providers/catalog.go
index 77004bdf..7d150ab7 100644
--- a/providers/catalog.go
+++ b/providers/catalog.go
@@ -26,6 +26,7 @@ const (
 	DocuSign          Provider = "docuSign"
 	DocuSignDeveloper Provider = "docuSignDeveloper"
 	Calendly          Provider = "calendly"
+	AWeber            Provider = "aWeber"
 	GetResponse       Provider = "getResponse"
 )
 
@@ -448,8 +449,8 @@ var catalog = CatalogType{ // nolint:gochecknoglobals
 			Write:     false,
 		},
 	},
-
-	// GetResponse configuration
+  
+  // GetResponse configuration
 	GetResponse: {
 		AuthType: Oauth2,
 		BaseURL:  "https://api.getresponse.com",
@@ -467,4 +468,23 @@ var catalog = CatalogType{ // nolint:gochecknoglobals
 			Write:     false,
 		},
 	},
+  
+  // AWeber configuration
+	AWeber: {
+		AuthType: Oauth2,
+		BaseURL:  "https://api.aweber.com",
+		OauthOpts: OauthOpts{
+			AuthURL:                   "https://auth.aweber.com/oauth2/authorize",
+			TokenURL:                  "https://auth.aweber.com/oauth2/token",
+			ExplicitScopesRequired:    true,
+			ExplicitWorkspaceRequired: false,
+		},
+		Support: Support{
+			BulkWrite: false,
+			Proxy:     false,
+			Read:      false,
+			Subscribe: false,
+			Write:     false,
+		},
+	},
 }


Test patch:
diff --git a/providers/catalog_test.go b/providers/catalog_test.go
index 0b064dae..7ab8e5a0 100644
--- a/providers/catalog_test.go
+++ b/providers/catalog_test.go
@@ -548,6 +548,28 @@ var testCases = []struct { // nolint
 		},
 		expectedErr: nil,
 	},
+  {
+		provider:    AWeber,
+		description: "Valid AWeber provider config with no substitutions",
+		expected: &ProviderInfo{
+			Support: Support{
+				Read:      false,
+				Write:     false,
+				BulkWrite: false,
+				Subscribe: false,
+				Proxy:     false,
+			},
+			AuthType: Oauth2,
+			OauthOpts: OauthOpts{
+				AuthURL:                   "https://auth.aweber.com/oauth2/authorize",
+				TokenURL:                  "https://auth.aweber.com/oauth2/token",
+				ExplicitWorkspaceRequired: false,
+				ExplicitScopesRequired:    true,
+			},
+			BaseURL: "https://api.aweber.com",
+		},
+		expectedErr: nil,
+	},
 }
 
 func TestReadInfo(t *testing.T) { // nolint