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

Resource: Gmail Send As Aliases #122

Merged
merged 9 commits into from
Jul 27, 2021
Merged

Resource: Gmail Send As Aliases #122

merged 9 commits into from
Jul 27, 2021

Conversation

appilon
Copy link
Contributor

@appilon appilon commented Jul 26, 2021

Adds ability to create send-as aliases, both internal and external to google. However as stated in #117 testing external aliases was not possible due to SMTP relay requirement. primary_email was chosen as the config attribute for what this API refers to as userId this was chosen to maintain consistency across provider resources.

Closes #117

@appilon appilon changed the title Feature: Gmail Send As Aliases Resource: Gmail Send As Aliases Jul 26, 2021
@appilon appilon requested a review from megan07 July 26, 2021 22:16
@@ -20,7 +20,7 @@ func TestAccDataSourcePrivileges_basic(t *testing.T) {
Config: testAccDataSourcePrivileges(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("data.googleworkspace_privileges.test", "etag"),
resource.TestCheckResourceAttr("data.googleworkspace_privileges.test", "items.#", "104"),
resource.TestCheckResourceAttr("data.googleworkspace_privileges.test", "items.#", "107"),
Copy link
Contributor

Choose a reason for hiding this comment

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

is this something we'll need to constantly be updating?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably... I don't really care about getting it exact, maybe we write a custom check that just ensures its > 0?

internal/provider/resource_gmail_send_as_alias.go Outdated Show resolved Hide resolved

log.Printf("[DEBUG] Getting Gmail Send As Alias %q", d.Id())

sendAs, err := sendAsAliasService.Get("me", d.Get("send_as_email").(string)).Do()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is "me" just a placeholder here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, since we impersonated the user getting the changes, you can put "me" as a special "userId".. Ideally this would just work without the impersonation workaround

@appilon appilon merged commit 0645a32 into main Jul 27, 2021
@appilon appilon deleted the alex-gmail-send-as branch July 27, 2021 15:29
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.

Feature Request: Gmail API
2 participants