Search in sources :

Example 6 with Attribute

use of com.marketo.mktows.Attribute in project components by Talend.

the class MarketoSOAPClientTest method getGetLeadResult.

public SuccessGetLead getGetLeadResult() {
    SuccessGetLead result = new SuccessGetLead();
    ResultGetLead res = new ResultGetLead();
    res.setCount(1);
    ArrayOfLeadRecord leadrecords = new ArrayOfLeadRecord();
    LeadRecord r = new LeadRecord();
    r.setId(objectFactory.createLeadRecordId(12345));
    r.setEmail(objectFactory.createLeadRecordEmail("email@email.com"));
    r.setForeignSysPersonId(objectFactory.createLeadRecordForeignSysPersonId("foreignSysPersonId"));
    r.setForeignSysType(objectFactory.createLeadRecordForeignSysType(ForeignSysType.SFDC));
    ArrayOfAttribute aoa = objectFactory.createArrayOfAttribute();
    Attribute attr = new Attribute();
    attr.setAttrName("attrName");
    attr.setAttrValue("attrValue");
    aoa.getAttributes().add(attr);
    r.setLeadAttributeList(objectFactory.createActivityRecordActivityAttributes(aoa));
    leadrecords.getLeadRecords().add(r);
    QName qname = new QName("http://www.marketo.com/mktows/", "leadAttributeList");
    JAXBElement<ArrayOfLeadRecord> attrList = new JAXBElement(qname, LeadRecord.class, leadrecords);
    res.setLeadRecordList(attrList);
    result.setResult(res);
    return result;
}
Also used : ArrayOfLeadRecord(com.marketo.mktows.ArrayOfLeadRecord) ArrayOfAttribute(com.marketo.mktows.ArrayOfAttribute) ArrayOfLeadRecord(com.marketo.mktows.ArrayOfLeadRecord) LeadRecord(com.marketo.mktows.LeadRecord) ArrayOfAttribute(com.marketo.mktows.ArrayOfAttribute) Attribute(com.marketo.mktows.Attribute) QName(javax.xml.namespace.QName) SuccessGetLead(com.marketo.mktows.SuccessGetLead) ResultGetLead(com.marketo.mktows.ResultGetLead) JAXBElement(javax.xml.bind.JAXBElement)

Example 7 with Attribute

use of com.marketo.mktows.Attribute in project components by Talend.

the class MarketoSOAPClientTest method getLeadChangeResult.

public SuccessGetLeadChanges getLeadChangeResult() {
    SuccessGetLeadChanges result = new SuccessGetLeadChanges();
    ResultGetLeadChanges res = new ResultGetLeadChanges();
    res.setReturnCount(1);
    res.setRemainingCount(0);
    StreamPosition sp = new StreamPosition();
    sp.setOffset(objectFactory.createStreamPositionOffset(""));
    res.setNewStartPosition(sp);
    // 
    ArrayOfLeadChangeRecord lcr = new ArrayOfLeadChangeRecord();
    LeadChangeRecord lc = new LeadChangeRecord();
    lc.setId(objectFactory.createLeadChangeRecordId(123456L));
    lc.setMarketoGUID("ABC-123-DEF");
    lc.setMktgAssetName(objectFactory.createLeadChangeRecordMktgAssetName("mktgAssetName"));
    lc.setActivityDateTime(factory.newXMLGregorianCalendar(gcDateTest));
    lc.setActivityType("activityType");
    lc.setCampaign("campaign");
    lc.setMktPersonId("mktPersonId");
    ArrayOfAttribute aoa = objectFactory.createArrayOfAttribute();
    Attribute attr = new Attribute();
    attr.setAttrName("attrName");
    attr.setAttrValue("attrValue");
    aoa.getAttributes().add(attr);
    lc.setActivityAttributes(objectFactory.createActivityRecordActivityAttributes(aoa));
    lcr.getLeadChangeRecords().add(lc);
    // 
    res.setLeadChangeRecordList(objectFactory.createResultGetLeadChangesLeadChangeRecordList(lcr));
    result.setResult(res);
    return result;
}
Also used : ArrayOfAttribute(com.marketo.mktows.ArrayOfAttribute) ArrayOfAttribute(com.marketo.mktows.ArrayOfAttribute) Attribute(com.marketo.mktows.Attribute) SuccessGetLeadChanges(com.marketo.mktows.SuccessGetLeadChanges) ResultGetLeadChanges(com.marketo.mktows.ResultGetLeadChanges) StreamPosition(com.marketo.mktows.StreamPosition) ArrayOfLeadChangeRecord(com.marketo.mktows.ArrayOfLeadChangeRecord) ArrayOfLeadChangeRecord(com.marketo.mktows.ArrayOfLeadChangeRecord) LeadChangeRecord(com.marketo.mktows.LeadChangeRecord)

Aggregations

ArrayOfAttribute (com.marketo.mktows.ArrayOfAttribute)7 Attribute (com.marketo.mktows.Attribute)7 ArrayOfLeadRecord (com.marketo.mktows.ArrayOfLeadRecord)5 LeadRecord (com.marketo.mktows.LeadRecord)5 ActivityRecord (com.marketo.mktows.ActivityRecord)4 ArrayOfString (com.marketo.mktows.ArrayOfString)4 LeadChangeRecord (com.marketo.mktows.LeadChangeRecord)4 Field (org.apache.avro.Schema.Field)4 ArrayList (java.util.ArrayList)3 Record (org.apache.avro.generic.GenericData.Record)3 IndexedRecord (org.apache.avro.generic.IndexedRecord)3 StreamPosition (com.marketo.mktows.StreamPosition)2 JAXBElement (javax.xml.bind.JAXBElement)2 QName (javax.xml.namespace.QName)2 ArrayOfActivityRecord (com.marketo.mktows.ArrayOfActivityRecord)1 ArrayOfLeadChangeRecord (com.marketo.mktows.ArrayOfLeadChangeRecord)1 LeadActivityList (com.marketo.mktows.LeadActivityList)1 ResultGetLead (com.marketo.mktows.ResultGetLead)1 ResultGetLeadChanges (com.marketo.mktows.ResultGetLeadChanges)1 SuccessGetLead (com.marketo.mktows.SuccessGetLead)1