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

Adding SendGridApi interface. #224

Merged
merged 8 commits into from
Oct 31, 2017
Merged

Conversation

sccalabr
Copy link
Contributor

@sccalabr sccalabr commented Oct 1, 2017

@SendGridDX
Copy link
Collaborator

SendGridDX commented Oct 1, 2017

CLA assistant check
All committers have signed the CLA.

@thinkingserious thinkingserious added status: code review request requesting a community code review or review from Twilio difficulty: medium fix is medium in difficulty hacktoberfest labels Oct 1, 2017
@thinkingserious
Copy link
Contributor

Hi @sccalabr,

In order to merge your work, we need you to sign our CLA. It's a quick web form.

Thanks!

With Best Regards,

Elmer

@@ -7,7 +7,7 @@
/**
* Class SendGrid allows for quick and easy access to the SendGrid API.
*/
public class SendGrid {
public class SendGrid implements SendGridApi{
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a space before the bracket.

import java.io.IOException;
import java.util.Map;

public interface SendGridApi {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename to SendGridAPI.


public interface SendGridApi {

public void initializeSendGrid(String apiKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs Javadoc comments.


public void initializeSendGrid(String apiKey);

public String getLibraryVersion();
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs Javadoc comments.


public String getLibraryVersion();

public String getVersion();
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs Javadoc ... you know.


public Map<String,String> addRequestHeader(String key, String value);

public Map<String,String> removeRequestHeader(String key);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a new line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andy-trimble I addressed the comments.

@thinkingserious
Copy link
Contributor

Thanks for taking the time to review @andy-trimble!

* Initializes SendGrid
* @param apiKey is your SendGrid API Key: https://app.sendgrid.com/settings/api_keys
*/
public void initializeSendGrid(String apiKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the tabs from this file and replace with spaces. This is causing the formatting to be off.

*/
public void initializeSendGrid(String apiKey);

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

Incorrect Javadoc comments.

public String getLibraryVersion();

/**
* Gets the version.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add @return documentation.



/**
* Gets the request headers.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add @return documentation.


/**
* Removes a request headers.
* @param key the key
Copy link
Contributor

Choose a reason for hiding this comment

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

Add @return documentation.

public Map<String,String> removeRequestHeader(String key);

/**
* Gets the host.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add @return documentation.

public void setHost(String host);

/**
* Class makeCall makes the call to the SendGrid API, override this method for testing.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add @param, @return, and @throws documentation.

public Response makeCall(Request request) throws IOException;

/**
* Class api sets up the request to the SendGrid API, this is main interface.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add @param, @return, and @throws documentation.

public void initializeSendGrid(String apiKey);

/**
* Initializes SendGrid
Copy link
Contributor

Choose a reason for hiding this comment

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

This method returns the library version. Please update the documentation to reflect this.

/**
* Gets the version.
*
* @return
Copy link
Contributor

Choose a reason for hiding this comment

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

Please specify the return value. For example, @return the library version.


/**
* Gets the request headers.
* @return
Copy link
Contributor

Choose a reason for hiding this comment

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

Please specify the return value.

*
* @param keythe key
* @param valuethe value
* @return
Copy link
Contributor

Choose a reason for hiding this comment

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

Please specify the return value.

/**
* Adds a request headers.
*
* @param keythe key
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a space between "key" and "the"

/**
* Gets the host.
*
* @return
Copy link
Contributor

Choose a reason for hiding this comment

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

Please specify the return value.

* testing.
*
* @param request
* @return
Copy link
Contributor

Choose a reason for hiding this comment

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

Please specify the return value.

* Class api sets up the request to the SendGrid API, this is main interface.
*
* @param request
* @return
Copy link
Contributor

Choose a reason for hiding this comment

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

Please specify the return value.

/**
* Class api sets up the request to the SendGrid API, this is main interface.
*
* @param request
Copy link
Contributor

Choose a reason for hiding this comment

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

Please define the parameter.

*
* @param request
* @return
* @throws IOException
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add "in case of network or marshal error."

@mbernier
Copy link
Contributor

Merged all recent changes, to rebuild at Travis.

@thinkingserious thinkingserious merged commit 7637df1 into sendgrid:master Oct 31, 2017
@thinkingserious
Copy link
Contributor

Hello @sccalabr,

Thanks again for the PR!

We want to show our appreciation by sending you some swag. Could you please fill out this form so we can send it to you? Thanks!

Team SendGrid DX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium fix is medium in difficulty status: code review request requesting a community code review or review from Twilio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants