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

Refactor structure #7

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Refactor structure #7

wants to merge 5 commits into from

Conversation

radumg
Copy link
Owner

@radumg radumg commented Jul 14, 2017

fixes #2
fixes #3

This PR is a major structural change and breaks backwards compatibility.
As such, this will probably bump DynaSlack to 2.0.

Outstanding before merging :

radumg added 2 commits July 2, 2017 18:32
- created `Slack.Client` namespace
- refactored all Slack classes into individual `.cs`
- refactored, renamed & moved `SlackClient` class, removing
`PostWebhookMessage` method
- added `Authentication` class to `SlackClient`, supporting reading API
token from an XML file
- added `SlackRequest` class scaffold
- cleaned up namespaces, removing any traces of `DynaSlack`
- added `Slack.Helpers` namespace and addded `Web` class to it, which is
a refactor of old `Helpers.cs`
- moved Slack responses into `SlackResponse` class, from previous
`Helpers.cs`
changing `SlackRequests` so it :
- uses RestSharp library
- follows a generic `SlackRequest` constructor
- has a generic `Execute`
- has a decoupled `Deserialize`
@radumg radumg added this to the 1.4 RestSharp refactor milestone Jul 14, 2017
@radumg radumg self-assigned this Jul 14, 2017
radumg added 3 commits July 16, 2017 11:05
just clearing my desktop of stuff.
accidentally leaked an OAuth token as Git was still tracking keys.xml file
Bot bot { get; set; }
public Bot bot { get; set; }

public readonly string BaseUrl = "https://slack.com/api/";
Copy link
Owner Author

Choose a reason for hiding this comment

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

should be constant

public string JsonTokenOverride { get; set; }

internal RestClient restClient;
#endregion

/// <summary>
/// Slack client constructor
/// </summary>
/// <param name="token">Optional OAuth token. If not supplied or invalid, posting will only be available as bots or webhooks.</param>
/// <param name="webhook">Optional webhook override. If supplied, this will be used instead of OAuth webhook.</param>
Copy link
Owner Author

Choose a reason for hiding this comment

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

remove old argument description

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<Slack>
<token>Bearer xoxp-43176652978-92379174417-214616878260-6910f9006a1700aad82d546891831fdf</token>
Copy link
Owner Author

Choose a reason for hiding this comment

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

this should not be tracked in git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deserialise response from Slack servers Swap System.Net with RestSharp
1 participant