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

Application v2 - DO NOT MERGE #156

Merged
merged 9 commits into from
Jun 11, 2019
Merged

Application v2 - DO NOT MERGE #156

merged 9 commits into from
Jun 11, 2019

Conversation

judy2k
Copy link

@judy2k judy2k commented Jun 5, 2019

No description provided.

@judy2k judy2k added the feature label Jun 5, 2019
Copy link
Author

@judy2k judy2k left a comment

Choose a reason for hiding this comment

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

I know there's a couple of compromises in here - although I dislike the || uri.AbsolutePath.StartsWith("/v2/applications")) more than the use of WebClient :)

It looks pretty good apart from a couple of typos. I've also highlighted some concern about both stopping Application from working and deprecating it. Those are really two conflicting actions: deprecation means "this will be removed in the future", removal obviously means it won't work now.

@@ -61,10 +62,10 @@ public class KeyPair

public class VoiceHooks
{
public Webhook[] webhooks { get; set; }
Copy link
Author

Choose a reason for hiding this comment

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

I hate to say it, but 'webhook' is generally one word these days, so the previous version was probably more correct.

https://en.wikipedia.org/wiki/Webhook

Copy link
Author

Choose a reason for hiding this comment

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

OK, just did a bit more research, and Microsoft seem to consistently use WebHooks, so this is fine as it is. Microsoft! 🤦‍♂

@@ -98,6 +99,7 @@ public class ApplicationList
public class ApplicationListResponse : PaginatedResponse<ApplicationList>
{}

[Obsolete("This version of the API has been depricated", true)]
Copy link
Author

Choose a reason for hiding this comment

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

"deprecated"

Copy link
Contributor

Choose a reason for hiding this comment

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

🤦

/// The private and public keys to be used with the Application.
/// </summary>
[JsonProperty("keys")]
public Keys Keyes { get; set; }
Copy link
Author

Choose a reason for hiding this comment

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

Typo.

Copy link
Contributor

Choose a reason for hiding this comment

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

🤦

/// The public key used to validate the jwt in a https://en.wikipedia.org/wiki/JSON_Web_Token.
/// </summary>
[JsonProperty("private_key")]
public string Private_key { get; set; }
Copy link
Author

Choose a reason for hiding this comment

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

This combination of snake case and camel case seems odd to me - would it be better as PrivateKey?

Copy link
Contributor

Choose a reason for hiding this comment

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

public ClientMethods.Application Application { get; private set; }
public ClientMethods.ApplicationV2 ApplicationV2 { get; private set; }
Copy link
Author

Choose a reason for hiding this comment

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

It looks like you're no longer initialising Application, but you're leaving the accessor there. I assume this means that if the user tries to access ClientMethods.Application they'll get null?

This seems like a really bad idea. I'd recommend: Either deprecate Application and leave it working, or remove it entirely, so the user's code won't compile if they're accessing it.

Copy link
Contributor

Choose a reason for hiding this comment

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

When a class is marked as obsolete, you can't instantiate it anymore, it throws a compiling error. I'll completely remove it from Client. Leaving the class becomes irrelevant also but i'm not sure if completely removing the code is the best decision

Copy link
Author

Choose a reason for hiding this comment

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

👍

string url = ApiRequest.GetBaseUriFor(typeof(ApplicationV2), $"/v2/applications/{appId}").ToString();
string result;
var authBytes = Encoding.UTF8.GetBytes(credentials.ApiKey + ":" + credentials.ApiSecret);
using (WebClient client = new WebClient())
Copy link
Author

Choose a reason for hiding this comment

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

🤷‍♂ 😄

//return response._embedded.Applications;
}

public static List<AppResponse> List()
Copy link
Author

Choose a reason for hiding this comment

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

Are you missing some docs for this method?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, meant to be like this :

public static List<AppResponse> List()
        {
            return List(10, 0);
        }

@RabebOthmani RabebOthmani merged commit 369cc93 into master Jun 11, 2019
Copy link
Author

@judy2k judy2k left a comment

Choose a reason for hiding this comment

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

Ignore the 'Webhook' suggestion.

public ClientMethods.Application Application { get; private set; }
public ClientMethods.ApplicationV2 ApplicationV2 { get; private set; }
Copy link
Author

Choose a reason for hiding this comment

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

👍

using Nexmo.Api.Request;

namespace Nexmo.Api.ClientMethods
{
[Obsolete("This version of the API has been deprecated", true)]
Copy link
Author

Choose a reason for hiding this comment

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

Should probably say " ... use ApplicationV2 instead"

@@ -61,10 +62,10 @@ public class KeyPair

public class VoiceHooks
{
public Webhook[] webhooks { get; set; }
Copy link
Author

Choose a reason for hiding this comment

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

OK, just did a bit more research, and Microsoft seem to consistently use WebHooks, so this is fine as it is. Microsoft! 🤦‍♂

@slorello89 slorello89 deleted the ApplicationV2 branch March 12, 2021 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants