/// <summary>
 /// Initializes a new instance of the <see cref="TrelloRequest"/> class.
 /// </summary>
 /// <param name="resource">Endpoint resource.</param>
 public TrelloRequest(string resource)
 {
     request = new RestRequest();
     request.AddQueryParameter("key", EnvironmentConfig.GetInstance().GetKey(ApisEnum.Trello));
     request.AddQueryParameter("token", EnvironmentConfig.GetInstance().GetToken(ApisEnum.Trello));
     request.Resource = resource;
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TodoistRequest"/> class.
 /// </summary>
 /// <param name="resource">Endpoint resource.</param>
 public TodoistRequest(string resource)
 {
     request = new RestRequest();
     request.AddHeader(
         "Authorization",
         "Bearer " + EnvironmentConfig.GetInstance().GetToken(ApisEnum.Todoist));
     request.Resource = resource;
 }
        private SalesforceAuthenticator()
        {
            var client =
                new RestClient(EnvironmentConfig.GetInstance().GetConfig(ApisEnum.Salesforce).AuthenticationUrl);
            var request = new RestRequest("/services/oauth2/token", Method.POST);

            request.AddQueryParameter("grant_type", "password");
            request.AddQueryParameter(
                "client_id",
                EnvironmentConfig.GetInstance().GetConfig(ApisEnum.Salesforce).ClientId);
            request.AddQueryParameter(
                "client_secret",
                EnvironmentConfig.GetInstance().GetConfig(ApisEnum.Salesforce).ClientSecret);
            request.AddQueryParameter(
                "username",
                EnvironmentConfig.GetInstance().GetConfig(ApisEnum.Salesforce).Username);
            request.AddQueryParameter(
                "password",
                EnvironmentConfig.GetInstance().GetConfig(ApisEnum.Salesforce).Password + EnvironmentConfig.GetInstance().GetConfig(ApisEnum.Salesforce).SecretToken);
            Response response = new Response(client.Execute(request));

            token       = response.GetValue("access_token");
            instanceUrl = response.GetValue("instance_url");
        }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SalesforceClient"/> class.
 /// </summary>
 private SalesforceClient()
 {
     client = new RestClient(SalesforceAuthenticator.GetInstance().GetInstanceUrl()
                             + EnvironmentConfig.GetInstance().GetBaseUrl(ApisEnum.Salesforce));
 }
Beispiel #5
0
 private PivotalClient()
 {
     client = new RestClient(EnvironmentConfig.GetInstance().GetBaseUrl(ApisEnum.Pivotal));
 }
 private TrelloClient()
 {
     client = new RestClient(EnvironmentConfig.GetInstance().GetBaseUrl(ApisEnum.Trello));
 }
Beispiel #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PivotalRequest"/> class.
 /// </summary>
 /// <param name="resource">Endpoint resource.</param>
 public PivotalRequest(string resource)
 {
     request = new RestRequest();
     request.AddHeader("X-TrackerToken", EnvironmentConfig.GetInstance().GetToken(ApisEnum.Pivotal));
     request.Resource = resource;
 }