public SetField ( string key, object value ) : void | ||
key | string | Key of the field |
value | object | Value of the field |
return | void |
public void SetField(string key, object value)
{
try
{
ValidateKey(key);
if (files.ContainsKey(key))
{
throw new Exceptions.AlreadyDefinedKeyException(key, "files");
}
fields[key] = value;
}
catch (Exceptions.InvalidFieldKeyException e)
{
LoggerFactory.GetLogger().LogError(this.GetType(), e);
throw e;
}
catch (Exceptions.AlreadyDefinedKeyException e)
{
LoggerFactory.GetLogger().LogError(this.GetType(), e);
throw e;
}
}
public void AuthenticateWithExistingAccount() { ITransloadit transloadit = new Transloadit.Transloadit("YOUR-PUBLIC-API-KEY", "YOUR-SECRET-KEY"); IAssemblyBuilder assembly = new Transloadit.Assembly.AssemblyBuilder(); IStep step = new Transloadit.Assembly.Step(); step.SetOption("robot", "/image/resize"); assembly.AddStep("step", step); assembly.SetField("test", "200"); TransloaditResponse response = transloadit.InvokeAssembly(assembly); Assert.IsTrue((string)response.Data["ok"] == "ASSEMBLY_COMPLETED" || (string)response.Data["ok"] == "ASSEMBLY_EXECUTING"); }