Skip to content

Commit bc1324a

Browse files
committed
2 parents c9294dd + a9507f9 commit bc1324a

File tree

19 files changed

+1278
-0
lines changed

19 files changed

+1278
-0
lines changed

.github/ISSUE_TEMPLATE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#### Issue Summary
2+
3+
A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, code examples.
4+
5+
6+
#### Steps to Reproduce
7+
8+
1. This is the first step
9+
2. This is the second step
10+
3. Further steps, etc.
11+
12+
Any other information you want to share that is relevant to the issue being reported. Especially, why do you consider this to be a bug? What do you expect to happen instead?
13+
14+
#### Technical details:
15+
16+
* csharp-http-client Version: master (latest commit: [commit number])
17+
* CSharp Version: 4.5

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
language: csharp
2+
solution: CSharpHTTPClient/CSharpHTTPClient.sln
3+
env:
4+
matrix:
5+
secure: KJrQ+NfmzlgCSXRyqeAMDGZUG6GO4/+xk1T0wGy1BgVz8seo/fDWL8osWEljB4Sj05sfFj7CM+rociwL6sdVyqCiHbCAM7XuHs58D+4Tlh5pGHL+G1qOl65/pDl0ulq+M7PwDxHPZ60/oyH2a16t5jtD9e4W31y2fXzEbHGLHXg=
6+
install:
7+
- nuget restore CSharpHTTPClient/CSharpHTTPClient.sln
8+
- nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory testrunner
9+
script:
10+
- xbuild /p:Configuration=Release CSharpHTTPClient/CSharpHTTPClient.sln
11+
- mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe UnitTest/bin/Release/UnitTest.dll -domain:None
12+
notifications:
13+
hipchat:
14+
rooms:
15+
secure: S6y3miMzrvRro+vhiuLjuyDm89l9mLbWbXT9Ak2fYorHWT+tGFrBQgoPB7veePkYkaIDAR5z+WF2amRnfKyesjdrLtJyDxAABKEV3X5ty1sIlaz+KK6QmEyK+krGUkUPAyM/7tZ1U7VDhXgxo0VNYhgT7jmFGQdLzupOdGZ7fI3/BA0kS8mDMNmIxjJyDhUama+P4ENCRMMYOs92McjCWBQe3Yss08gzBAzpnBQs5nBDyziz/Agevg2UVENwCiYX18hcz0xkoE84yKnSs+yrFdrK7fQR54k1wwM5yL3e0akw6BwdxoHcglIqxMIPHzZXAI77dxmDoZwjSCeT9H25FQ2wkIbjiduWhXsD+KFKDfmB3qc0HyU/ZPefUTkZBFtCQh18M0agNBvZ8IJaDDaNK6YnUVQ7RXpVy4TN8nRz4n5pv2w54QXjPtWVA1dU/iSzbKyAvhvourH6fTQs+rnLXzlJDpd96lYV6INNbobMpRAH40n8f/xljWpiwJmNK0QLlae8/RnijJ/nPOykA/ik75+ykxeebAqqvilO9ZKIPqtOR3ZEKmsFqDiOreQ3IVudZEEUj4mn8ysM5fFg1zfRpY6kL1iBhMZFHavRxtGXFIWcqtH1PYB7pi+c7oUAKHo6ntEk9KgQWDhEBXtRtTWGwvGS0lEKi3sNb0g3sZWhwtQ=
16+
template:
17+
- '<a href="https://travis-ci.org/%{repository}/builds/%{build_id}">%{repository}
18+
Build %{build_number}</a> on branch <i>%{branch}</i> by %{author}: <strong>%{message}</strong>
19+
<a href="https://github.com/%{repository}/commits/%{commit}">View on GitHub</a>'
20+
format: html

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
4+
This project adheres to [Semantic Versioning](http://semver.org/).
5+
6+
## [2.0.2] - 2016-06-16
7+
### Added
8+
- Fix async, per https://github.com/sendgrid/sendgrid-csharp/issues/235
9+
10+
## [2.0.1] - 2016-06-03
11+
### Added
12+
- Sign assembly with a strong name
13+
14+
## [2.0.0] - 2016-06-03
15+
### Changed
16+
- Made the Response variables non-redundant. e.g. response.ResponseBody becomes response.Body
17+
18+
## [1.0.2] - 2016-03-17
19+
### Added
20+
- We are live!

CONTRIBUTING.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
Hello! Thank you for choosing to help contribute to one of the SendGrid open source projects. There are many ways you can contribute and help is always welcome. We simply ask that you follow the following contribution policies.
2+
3+
- [CLAs and CCLAs](#cla)
4+
- [Roadmap & Milestones](#roadmap)
5+
- [Feature Request](#feature_request)
6+
- [Submit a Bug Report](#submit_a_bug_report)
7+
- [Improvements to the Codebase](#improvements_to_the_codebase)
8+
- [Understanding the Code Base](#understanding_the_codebase)
9+
- [Testing](#testing)
10+
- [Style Guidelines & Naming Conventions](#style_guidelines_and_naming_conventions)
11+
- [Creating a Pull Request](#creating_a_pull_request)
12+
13+
<a name="roadmap"></a>
14+
We use [Milestones](https://github.com/sendgrid/csharp-http-client/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community review, comments, suggestions and additional PRs are welcomed and encouraged.
15+
16+
<a name="cla"></a>
17+
## CLAs and CCLAs
18+
19+
Before you get started, SendGrid requires that a SendGrid Contributor License Agreement (CLA) or a SendGrid Company Contributor Licensing Agreement (CCLA) be filled out by every contributor to a SendGrid open source project.
20+
21+
Our goal with the CLA and CCLA is to clarify the rights of our contributors and reduce other risks arising from inappropriate contributions. The CLA also clarifies the rights SendGrid holds in each contribution and helps to avoid misunderstandings over what rights each contributor is required to grant to SendGrid when making a contribution. In this way the CLA and CCLA encourage broad participation by our open source community and help us build strong open source projects, free from any individual contributor withholding or revoking rights to any contribution.
22+
23+
SendGrid does not merge a pull request made against a SendGrid open source project until that pull request is associated with a signed CLA (or CCLA). Copies of the CLA and CCLA are available [here](https://drive.google.com/a/sendgrid.com/file/d/0B0PlcM9qA91LN2VEUTJWU2RIVXc/view).
24+
25+
You may submit your completed [CLA or CCLA](https://drive.google.com/a/sendgrid.com/file/d/0B0PlcM9qA91LN2VEUTJWU2RIVXc/view) to SendGrid at [dx@sendgrid.com](mailto:dx@sendgrid.com). SendGrid will then confirm you are ready to begin making contributions.
26+
27+
There are a few ways to contribute, which we'll enumerate below:
28+
29+
<a name="feature_request"></a>
30+
## Feature Request
31+
32+
If you'd like to make a feature request, please read this section.
33+
34+
The GitHub issue tracker is the preferred channel for library feature requests, but please respect the following restrictions:
35+
36+
- Please **search for existing issues** in order to ensure we don't have duplicate bugs/feature requests.
37+
- Please be respectful and considerate of others when commenting on issues
38+
39+
<a name="submit_a_bug_report"></a>
40+
## Submit a Bug Report
41+
42+
Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public.
43+
44+
A software bug is a demonstrable issue in the code base. In order for us to diagnose the issue and respond as quickly as possible, please add as much detail as possible into your bug report.
45+
46+
Before you decide to create a new issue, please try the following:
47+
48+
1. Check the Github issues tab if the identified issue has already been reported, if so, please add a +1 to the existing post.
49+
2. Update to the latest version of this code and check if issue has already been fixed
50+
3. Copy and fill in the Bug Report Template we have provided below
51+
52+
### Please use our Bug Report Template
53+
54+
In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/csharp-http-client/.github/ISSUE_TEMPLATE) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.
55+
56+
<a name="improvements_to_the_codebase"></a>
57+
## Improvements to the Codebase
58+
59+
We welcome direct contributions to the csharp-http-client code base. Thank you!
60+
61+
### Development Environment ###
62+
63+
#### Install and Run Locally ####
64+
65+
##### Prerequisites #####
66+
67+
- Microsoft Visual Studio Community 2015 or greater
68+
69+
##### Initial setup: #####
70+
71+
```bash
72+
git clone https://github.com/sendgrid/csharp-http-client.git
73+
```
74+
75+
Open `csharp-http-client/CSharpHTTPClient/CSharpHTTPClient.sln`
76+
77+
##### Execute: #####
78+
79+
SSee the [Example project](https://github.com/sendgrid/csharp-http-client/tree/master/Example) to get started quickly.
80+
81+
<a name="understanding_the_codebase"></a>
82+
## Understanding the Code Base
83+
84+
**/Example/Example.cs**
85+
86+
Working examples that demonstrate usage.
87+
88+
**/CSharpHTTPClient/Client.cs**
89+
90+
An HTTP client with a fluent interface using method chaining and reflection. By returning a new object on [TryGetMember](https://github.com/sendgrid/csharp-http-client/blob/master/CSharpHTTPClient/Client.cs#L191) and [_()](https://github.com/sendgrid/csharp-http-client/blob/master/CSharpHTTPClient/Client.cs#L180), we can dynamically build the URL using method chaining and [TryGetMember](https://github.com/sendgrid/csharp-http-client/blob/master/CSharpHTTPClient/Client.cs#L191) allows us to dynamically receive the method calls to achieve reflection.
91+
92+
This allows for the following mapping from a URL to a method chain:
93+
94+
`/api_client/{api_key_id}/version` maps to `client.api_client._(api_key_id).version.<method>()` where <method> is a supported [Method](https://github.com/sendgrid/csharp-http-client/blob/master/CSharpHTTPClient/Client.cs#L71).
95+
96+
<a name="testing"></a>
97+
## Testing
98+
99+
All PRs require passing tests before the PR will be reviewed.
100+
101+
All test files are in the [`UnitTest`](https://github.com/sendgrid/csharp-http-client/tree/master/UnitTest) directory.
102+
103+
For the purposes of contributing to this repo, please update the [`UnitTest.cs`](https://github.com/sendgrid/csharp-http-client/blob/master/UnitTest/UnitTest.cs) file with unit tests as you modify the code.
104+
105+
From the Visual Studio menu: `Tests->Run->All Tests`
106+
107+
<a name="style_guidelines_and_naming_conventions"></a>
108+
## Style Guidelines & Naming Conventions
109+
110+
Generally, we follow the style guidelines as suggested by the official language. However, we ask that you conform to the styles that already exist in the library. If you wish to deviate, please explain your reasoning. In this case, we generally follow the [C# Naming Conventions](https://msdn.microsoft.com/library/ms229045(v=vs.100).aspx) and the suggestions provided by the Visual Studio IDE.
111+
112+
## Creating a Pull Request<a name="creating_a_pull_request"></a>
113+
114+
1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork,
115+
and configure the remotes:
116+
117+
```bash
118+
# Clone your fork of the repo into the current directory
119+
git clone https://github.com/sendgrid/csharp-http-client
120+
# Navigate to the newly cloned directory
121+
cd sendgrid-python
122+
# Assign the original repo to a remote called "upstream"
123+
git remote add upstream https://github.com/sendgrid/csharp-http-client
124+
```
125+
126+
2. If you cloned a while ago, get the latest changes from upstream:
127+
128+
```bash
129+
git checkout <dev-branch>
130+
git pull upstream <dev-branch>
131+
```
132+
133+
3. Create a new topic branch (off the main project development branch) to
134+
contain your feature, change, or fix:
135+
136+
```bash
137+
git checkout -b <topic-branch-name>
138+
```
139+
140+
4. Commit your changes in logical chunks. Please adhere to these [git commit
141+
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
142+
or your code is unlikely be merged into the main project. Use Git's
143+
[interactive rebase](https://help.github.com/articles/interactive-rebase)
144+
feature to tidy up your commits before making them public.
145+
146+
4a. Create tests.
147+
148+
4b. Create or update the example code that demonstrates the functionality of this change to the code.
149+
150+
5. Locally merge (or rebase) the upstream development branch into your topic branch:
151+
152+
```bash
153+
git pull [--rebase] upstream master
154+
```
155+
156+
6. Push your topic branch up to your fork:
157+
158+
```bash
159+
git push origin <topic-branch-name>
160+
```
161+
162+
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
163+
with a clear title and description against the `master` branch. All tests must be passing before we will review the PR.
164+
165+
If you have any additional questions, please feel free to [email](mailto:dx@sendgrid.com) us or create an issue in this repo.

CSharpHTTPClient/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
5+
</startup>
6+
</configuration>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{26C4841F-EC62-4EC7-B16E-3A7386EA36DC}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>SendGrid.CSharp.HTTP.Client</RootNamespace>
11+
<AssemblyName>SendGrid.CSharp.HTTP.Client</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15+
<TargetFrameworkProfile />
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<PlatformTarget>AnyCPU</PlatformTarget>
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<PlatformTarget>AnyCPU</PlatformTarget>
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\Release\</OutputPath>
32+
<DefineConstants>TRACE</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
</PropertyGroup>
36+
<PropertyGroup>
37+
<StartupObject />
38+
</PropertyGroup>
39+
<PropertyGroup>
40+
<SignAssembly Condition="Exists('$(AssemblyOriginatorKeyFile)')">true</SignAssembly>
41+
</PropertyGroup>
42+
<PropertyGroup>
43+
<AssemblyOriginatorKeyFile>csharphttpclient.pfx</AssemblyOriginatorKeyFile>
44+
</PropertyGroup>
45+
<ItemGroup>
46+
<Reference Include="System" />
47+
<Reference Include="System.Core" />
48+
<Reference Include="System.Net.Http.Formatting">
49+
<HintPath>..\..\sendgrid-csharp\SendGrid\SendGrid\bin\Debug\System.Net.Http.Formatting.dll</HintPath>
50+
</Reference>
51+
<Reference Include="System.Web" />
52+
<Reference Include="System.Web.Extensions" />
53+
<Reference Include="System.Xml.Linq" />
54+
<Reference Include="System.Data.DataSetExtensions" />
55+
<Reference Include="Microsoft.CSharp" />
56+
<Reference Include="System.Data" />
57+
<Reference Include="System.Net.Http" />
58+
<Reference Include="System.Xml" />
59+
</ItemGroup>
60+
<ItemGroup>
61+
<Compile Include="Client.cs" />
62+
<Compile Include="Properties\AssemblyInfo.cs" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<None Include="App.config" />
66+
<None Include="csharphttpclient.pfx" />
67+
</ItemGroup>
68+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
69+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
70+
Other similar extension points exist, see Microsoft.Common.targets.
71+
<Target Name="BeforeBuild">
72+
</Target>
73+
<Target Name="AfterBuild">
74+
</Target>
75+
-->
76+
</Project>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.23107.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpHTTPClient", "CSharpHTTPClient.csproj", "{26C4841F-EC62-4EC7-B16E-3A7386EA36DC}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example", "..\Example\Example.csproj", "{490AD14D-B821-435A-BEC8-F4DFE34E6556}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTest", "..\UnitTest\UnitTest.csproj", "{DF845C59-4B39-4A8A-AC89-E5336B57076B}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{26C4841F-EC62-4EC7-B16E-3A7386EA36DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{26C4841F-EC62-4EC7-B16E-3A7386EA36DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{26C4841F-EC62-4EC7-B16E-3A7386EA36DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{26C4841F-EC62-4EC7-B16E-3A7386EA36DC}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{490AD14D-B821-435A-BEC8-F4DFE34E6556}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{490AD14D-B821-435A-BEC8-F4DFE34E6556}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{490AD14D-B821-435A-BEC8-F4DFE34E6556}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{490AD14D-B821-435A-BEC8-F4DFE34E6556}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{DF845C59-4B39-4A8A-AC89-E5336B57076B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{DF845C59-4B39-4A8A-AC89-E5336B57076B}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{DF845C59-4B39-4A8A-AC89-E5336B57076B}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{DF845C59-4B39-4A8A-AC89-E5336B57076B}.Release|Any CPU.Build.0 = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
EndGlobal

0 commit comments

Comments
 (0)