Repository: sendgrid/sendgrid-java
Pull request #306 (2017-10-23 17:00:31)

Fix java package names
Java packages were not corresponding to the actual location of classes,
all packages were update to match class location.


Patch:
diff --git a/src/main/java/com/sendgrid/helpers/mail/Mail.java b/src/main/java/com/sendgrid/helpers/mail/Mail.java
index b9d46fb..ef87419 100644
--- a/src/main/java/com/sendgrid/helpers/mail/Mail.java
+++ b/src/main/java/com/sendgrid/helpers/mail/Mail.java
@@ -1,16 +1,11 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail;
 
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
-
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.ObjectWriter;
 import com.fasterxml.jackson.databind.SerializationFeature;
+import com.sendgrid.helpers.mail.objects.*;
 
 import java.io.IOException;
 import java.util.ArrayList;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/ASM.java b/src/main/java/com/sendgrid/helpers/mail/objects/ASM.java
index 29952ae..a34895f 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/ASM.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/ASM.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/Attachments.java b/src/main/java/com/sendgrid/helpers/mail/objects/Attachments.java
index fae247b..969c163 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/Attachments.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/Attachments.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonIgnoreType;
 import com.fasterxml.jackson.annotation.JsonInclude;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/BccSettings.java b/src/main/java/com/sendgrid/helpers/mail/objects/BccSettings.java
index 3b98229..f43803f 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/BccSettings.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/BccSettings.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/ClickTrackingSetting.java b/src/main/java/com/sendgrid/helpers/mail/objects/ClickTrackingSetting.java
index 07c07f8..ee12fc0 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/ClickTrackingSetting.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/ClickTrackingSetting.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/Content.java b/src/main/java/com/sendgrid/helpers/mail/objects/Content.java
index 0d6c73b..0a7a655 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/Content.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/Content.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/Email.java b/src/main/java/com/sendgrid/helpers/mail/objects/Email.java
index cbfce55..537b27b 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/Email.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/Email.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/FooterSetting.java b/src/main/java/com/sendgrid/helpers/mail/objects/FooterSetting.java
index 2f62ccf..905436e 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/FooterSetting.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/FooterSetting.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/GoogleAnalyticsSetting.java b/src/main/java/com/sendgrid/helpers/mail/objects/GoogleAnalyticsSetting.java
index cef2ce8..a01d4df 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/GoogleAnalyticsSetting.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/GoogleAnalyticsSetting.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/MailSettings.java b/src/main/java/com/sendgrid/helpers/mail/objects/MailSettings.java
index 0590b22..5175642 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/MailSettings.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/MailSettings.java
@@ -1,9 +1,15 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
 import com.fasterxml.jackson.annotation.JsonProperty;
 
+/**
+ * An object representing a collection of different mail
+ * settings that you can use to specify how you would
+ * like this email to be handled.
+ */
+
 @JsonInclude(Include.NON_DEFAULT)
 public class MailSettings {
   @JsonProperty("bcc") private BccSettings bccSettings;
@@ -16,11 +22,24 @@ public class MailSettings {
   public BccSettings getBccSettings() {
     return bccSettings;
   }
-  
+
+  /**
+   * Set the BCC settings.
+   * @param bccSettings the BCC settings.
+   */
   public void setBccSettings(BccSettings bccSettings) {
     this.bccSettings = bccSettings;
   }
-  
+
+  /**
+   * A setting that allows you to bypass all unsubscribe
+   * groups and suppressions to ensure that the email is
+   * delivered to every single recipient. This should only
+   * be used in emergencies when it is absolutely necessary
+   * that every recipient receives your email.
+   * @return the bypass list setting.
+   */
+
   @JsonProperty("bypass_list_management")
   public Setting getBypassListManagement() {
     return bypassListManagement;
@@ -29,30 +48,62 @@ public class MailSettings {
   public void setBypassListManagement(Setting bypassListManagement) {
     this.bypassListManagement = bypassListManagement;
   }
-  
+
+  /**
+   * Get the the footer settings that you would like included on every email.
+   * @return the setting.
+   */
+
   @JsonProperty("footer")
   public FooterSetting getFooterSetting() {
     return footerSetting;
   }
-  
+
+  /**
+   * Set the the footer settings that you would like included on every email.
+   * @param footerSetting the setting.
+   */
   public void setFooterSetting(FooterSetting footerSetting) {
     this.footerSetting = footerSetting;
   }
-  
+
+  /**
+   * Get sandbox mode. This allows you to send a test email to
+   * ensure that your request body is valid and formatted correctly.
+   * @return the sandbox mode setting.
+   */
+
   @JsonProperty("sandbox_mode")
   public Setting getSandBoxMode() {
     return sandBoxMode;
   }
-  
+
+  /**
+   * Set sandbox mode.
+   * @param sandBoxMode the sandbox mode setting.
+   */
+  @JsonProperty("sandbox_mode")
   public void setSandboxMode(Setting sandBoxMode) {
     this.sandBoxMode = sandBoxMode;
   }
-  
+
+  /**
+   * Get the spam check setting. This allows you to test the
+   * content of your email for spam.
+   * @return the spam check setting.
+   */
+
   @JsonProperty("spam_check")
   public SpamCheckSetting getSpamCheck() {
     return spamCheckSetting;
   }
-  
+
+  /**
+   * Set the spam check setting. This allows you to test the
+   * content of your email for spam.
+   * @param spamCheckSetting the spam check setting.
+   */
+
   public void setSpamCheckSetting(SpamCheckSetting spamCheckSetting) {
     this.spamCheckSetting = spamCheckSetting;
   }
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/OpenTrackingSetting.java b/src/main/java/com/sendgrid/helpers/mail/objects/OpenTrackingSetting.java
index e3337f9..e4497d9 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/OpenTrackingSetting.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/OpenTrackingSetting.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/Personalization.java b/src/main/java/com/sendgrid/helpers/mail/objects/Personalization.java
index e364645..9963495 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/Personalization.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/Personalization.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/Setting.java b/src/main/java/com/sendgrid/helpers/mail/objects/Setting.java
index 2fab69e..45bef3b 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/Setting.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/Setting.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/SpamCheckSetting.java b/src/main/java/com/sendgrid/helpers/mail/objects/SpamCheckSetting.java
index 4a4a1be..d2cd79c 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/SpamCheckSetting.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/SpamCheckSetting.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/SubscriptionTrackingSetting.java b/src/main/java/com/sendgrid/helpers/mail/objects/SubscriptionTrackingSetting.java
index a777b19..6c438cc 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/SubscriptionTrackingSetting.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/SubscriptionTrackingSetting.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
diff --git a/src/main/java/com/sendgrid/helpers/mail/objects/TrackingSettings.java b/src/main/java/com/sendgrid/helpers/mail/objects/TrackingSettings.java
index 06ff62d..981875c 100644
--- a/src/main/java/com/sendgrid/helpers/mail/objects/TrackingSettings.java
+++ b/src/main/java/com/sendgrid/helpers/mail/objects/TrackingSettings.java
@@ -1,4 +1,4 @@
-package com.sendgrid;
+package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;


Test patch:
diff --git a/src/test/java/com/sendgrid/TestRequiredFilesExist.java b/src/test/java/com/sendgrid/TestRequiredFilesExist.java
index f503c42..928758b 100644
--- a/src/test/java/com/sendgrid/TestRequiredFilesExist.java
+++ b/src/test/java/com/sendgrid/TestRequiredFilesExist.java
@@ -1,3 +1,5 @@
+package com.sendgrid;
+
 import org.junit.Test;
 
 import java.io.File;
diff --git a/src/test/java/com/sendgrid/helpers/AttachmentBuilderTest.java b/src/test/java/com/sendgrid/helpers/AttachmentBuilderTest.java
index 824e814..3ea3f37 100644
--- a/src/test/java/com/sendgrid/helpers/AttachmentBuilderTest.java
+++ b/src/test/java/com/sendgrid/helpers/AttachmentBuilderTest.java
@@ -1,6 +1,6 @@
 package com.sendgrid.helpers;
 
-import com.sendgrid.Attachments;
+import com.sendgrid.helpers.mail.objects.Attachments;
 import org.apache.commons.codec.binary.Base64;
 import org.junit.Assert;
 import org.junit.Test;
diff --git a/src/test/java/com/sendgrid/helpers/ContentTest.java b/src/test/java/com/sendgrid/helpers/ContentTest.java
index 05e2328..c83b0d2 100644
--- a/src/test/java/com/sendgrid/helpers/ContentTest.java
+++ b/src/test/java/com/sendgrid/helpers/ContentTest.java
@@ -1,9 +1,10 @@
-package com.sendgrid;
+package com.sendgrid.helpers;
 
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
+import com.sendgrid.helpers.mail.objects.Content;
 import org.junit.rules.ExpectedException;
 
 import java.util.ArrayList;
diff --git a/src/test/java/com/sendgrid/helpers/MailTest.java b/src/test/java/com/sendgrid/helpers/MailTest.java
index 67d893a..c778ebe 100644
--- a/src/test/java/com/sendgrid/helpers/MailTest.java
+++ b/src/test/java/com/sendgrid/helpers/MailTest.java
@@ -1,9 +1,10 @@
-package com.sendgrid;
+package com.sendgrid.helpers;
 
+import com.sendgrid.helpers.mail.Mail;
+import com.sendgrid.helpers.mail.objects.*;
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import org.junit.Assert;
-import org.junit.Before;
 import org.junit.Test;
 
 import java.io.IOException;
diff --git a/src/test/java/com/sendgrid/helpers/mail/objects/SettingsSerializationTest.java b/src/test/java/com/sendgrid/helpers/mail/objects/SettingsSerializationTest.java
index 74e6c8b..2787816 100644
--- a/src/test/java/com/sendgrid/helpers/mail/objects/SettingsSerializationTest.java
+++ b/src/test/java/com/sendgrid/helpers/mail/objects/SettingsSerializationTest.java
@@ -1,13 +1,13 @@
 package com.sendgrid.helpers.mail.objects;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.sendgrid.BccSettings;
-import com.sendgrid.ClickTrackingSetting;
-import com.sendgrid.FooterSetting;
-import com.sendgrid.GoogleAnalyticsSetting;
-import com.sendgrid.OpenTrackingSetting;
-import com.sendgrid.SpamCheckSetting;
-import com.sendgrid.SubscriptionTrackingSetting;
+import com.sendgrid.helpers.mail.objects.BccSettings;
+import com.sendgrid.helpers.mail.objects.ClickTrackingSetting;
+import com.sendgrid.helpers.mail.objects.FooterSetting;
+import com.sendgrid.helpers.mail.objects.GoogleAnalyticsSetting;
+import com.sendgrid.helpers.mail.objects.OpenTrackingSetting;
+import com.sendgrid.helpers.mail.objects.SpamCheckSetting;
+import com.sendgrid.helpers.mail.objects.SubscriptionTrackingSetting;
 import org.junit.Assert;
 import org.junit.Test;