This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var client = new HttpClient(); | |
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "<token>"); | |
var xml = "<xml>"; | |
var soapAction = "<soap-action>"; | |
var httpContent = new StringContent(xml, Encoding.UTF8, "text/xml"); | |
var request = new HttpRequestMessage(new HttpMethod("POST"), url) | |
{ | |
Content = httpContent | |
}; | |
request.Headers.Add("SOAPAction", soapAction); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class TaskExtensions | |
{ | |
public static Task Ignore<TException>(this Task task) where TException : Exception | |
{ | |
return task.ContinueWith(x => | |
{ | |
if (x.IsCanceled || !x.IsFaulted) | |
{ | |
return Task.CompletedTask; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: master | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: windows-latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mid 0001 Start Communication | |
I: "00200001001 " | |
Mid 0002 Start Communication Acknowledge | |
C: "00570002001 010001020103Airbag1 " | |
Mid 0060 Last tightening result data subscribe (Receive every new tightening in real time) | |
I: "00200060001 " | |
Mid 0005 Command accepted (notice that the last 4 characters are the mid you send) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Route("api/[controller]")] | |
[ApiController] | |
public class ReportController : ControllerBase | |
{ | |
private readonly GoogleAdWordsService _service; | |
public ReportController(GoogleAdWordsService service) | |
{ | |
_service = service; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GoogleAdWordsService | |
{ | |
private readonly AdWordsAppConfig _config; | |
public GoogleAdWordsService(AdWordsAppConfig config) | |
{ | |
_config = config; | |
} | |
public async Task<object> GetReport(string customerId) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='UTF-8' standalone='yes'?> | |
<report> | |
<report-name name='MyReportName'/> | |
<date-range date='Aug 12, 2019-Aug 13, 2019'/> | |
<table> | |
<columns> | |
<column name='campaign' display='Campaign'/> | |
<column name='adGroup' display='Ad group'/> | |
<column name='day' display='Day'/> | |
<column name='cost' display='Cost'/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Startup | |
{ | |
public Startup(IConfiguration configuration) | |
{ | |
Configuration = configuration; | |
} | |
public IConfiguration Configuration { get; } | |
// This method gets called by the runtime. Use this method to add services to the container. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AdWordsApi": { | |
"client_id": "CLIENT_ID", | |
"project_id": "PROJECT_ID", | |
"auth_uri": "https://accounts.google.com/o/oauth2/auth", | |
"token_uri": "https://oauth2.googleapis.com/token", | |
"auth_provider_x509_cert_url": "\"", | |
"https": null, | |
"redirect_uris": [ "https://developers.google.com/oauthplayground" ], | |
"UserAgent": "AdWordsApiExample", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
public string Surname { get; set; } | |
public int Age { get; set; } | |
public string Document { get; set; } | |
public DateTime BornAt { get; set; } | |
} |