public KeepItUpService(KeepItUpContext keepItUpContext, ETClient etClient, IConfigurationRoot configuration, ILogger <KeepItUpService> logger) { _keepItUpContext = keepItUpContext; _etClient = etClient; _configuration = configuration; _logger = logger; }
private void button1_Click(object sender, EventArgs e) { ETClient myClient = new ETClient(); //Create an instance of the Salesforce Marketing Cloud we want to work with: ETList list = new ETList(); //Associate the ETClient to the object using the client property: list.AuthStub = myClient; //Utilize one of the ETList methods: GetReturn allLists = list.Get(); //Print out the results for viewing Console.WriteLine("Get Status: " + allLists.Status.ToString()); Console.WriteLine("Message: " + allLists.Message.ToString()); Console.WriteLine("Code: " + allLists.Code.ToString()); Console.WriteLine("Results Length: " + allLists.Results.Length); foreach (ETList ResultList in allLists.Results) { Console.WriteLine("--ID: " + ResultList.ID + ", Name: " + ResultList.ListName + ", Description: " + ResultList.Description); } }
public void Setup() { client = new ETClient(); config = new FuelSDKConfigurationSection(); config.AuthorizationCode = "Auth_Code_For_OAuth2_WebApp"; config.RedirectURI = "www.google.com"; config.ClientId = "OAUTH2_CLIENTID"; config.ClientSecret = "OAUTH2_CLIENT_SECRET"; }
public void MultipleETClientInstancesForTheSameClientIdAndSecretWillHaveTheSameStackKey() { ETClient client1 = new ETClient(); ETClient client2 = new ETClient(); Assert.IsNotNull(client1.Stack); Assert.IsNotNull(client2.Stack); Assert.AreEqual(client1.Stack, client2.Stack); }
public void ExceptionOccursIfTSEFormatIsUsedForSoapEndpoint() { var client = new ETClient(); var exception = Assert.Throws <Exception>( () => { var stack = client.Stack; } ); Assert.That(exception.Message, Is.EqualTo(StackKeyErrorMessage)); }
public Salesforce(string clientId, string clientSecret, string authUrl) { //Set TLS to 1.2 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; SFBaseAuthUrl = authUrl; //Build ExactTarget Client SFClient = new ETClient(BuildAuthStub(clientId, clientSecret)); }
public Salesforce(string clientId, string clientSecret) { //Set TLS to 1.2 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; SFBaseAuthUrl = "https://auth.exacttargetapis.com/v1/requestToken?legacy=1"; //Build ExactTarget Client SFClient = new ETClient(BuildAuthStub(clientId, clientSecret)); }
public void Setup() { client = new ETClient(); var campObj = new ETCampaign { AuthStub = client, Name = "Created for testing campaign asset test cases in C#", Description = "Test Description" }; var result = campObj.Post(); campaign = (ETCampaign)result.Results[0].Object; }
public void TestSoapEndpointCaching() { var configSection = (FuelSDKConfigurationSection)ConfigurationManager.GetSection("fuelSDK"); if (!string.IsNullOrEmpty(configSection.UseOAuth2Authentication) && Convert.ToBoolean(configSection.UseOAuth2Authentication) == true) { // Test does not apply for legacy authentication Assert.Pass(); return; } var client1 = new ETClient(); var client2 = new ETClient(); var client1SoapEndpointExpirationField = client1.GetType().GetField("soapEndPointExpiration", BindingFlags.NonPublic | BindingFlags.Static); var client2SoapEndpointExpirationField = client2.GetType().GetField("soapEndPointExpiration", BindingFlags.NonPublic | BindingFlags.Static); var client1SoapEndpointExpiration = (DateTime)client1SoapEndpointExpirationField.GetValue(null); var client2SoapEndpointExpiration = (DateTime)client2SoapEndpointExpirationField.GetValue(null); Assert.IsTrue(client1SoapEndpointExpiration > DateTime.MinValue); Assert.IsTrue(client2SoapEndpointExpiration > DateTime.MinValue); Assert.AreEqual(client1SoapEndpointExpiration, client2SoapEndpointExpiration); }
public void OneTimeSetup() { client = new ETClient(); }
public void Setup() { client1 = new ETClient(); client2 = new ETClient(); }
public void Setup() { client = new ETClient(); }