com.microsoft.bingads.v13.bulk.entities.BulkAssetGroupListingGroup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of microsoft.bingads Show documentation
Show all versions of microsoft.bingads Show documentation
The Bing Ads Java SDK is a library improving developer experience when working with the Bing Ads services by providing high-level access to features such as Bulk API, OAuth Authorization and SOAP API.
package com.microsoft.bingads.v13.bulk.entities;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.microsoft.bingads.internal.functionalinterfaces.BiConsumer;
import com.microsoft.bingads.internal.functionalinterfaces.Function;
import com.microsoft.bingads.v13.bulk.BulkFileReader;
import com.microsoft.bingads.v13.bulk.BulkFileWriter;
import com.microsoft.bingads.v13.bulk.BulkOperation;
import com.microsoft.bingads.v13.bulk.BulkServiceManager;
import com.microsoft.bingads.v13.campaignmanagement.AssetGroupListingGroup;
import com.microsoft.bingads.v13.campaignmanagement.AssetGroupListingType;
import com.microsoft.bingads.v13.campaignmanagement.ProductCondition;
import com.microsoft.bingads.v13.internal.bulk.BulkMapping;
import com.microsoft.bingads.v13.internal.bulk.MappingHelpers;
import com.microsoft.bingads.v13.internal.bulk.RowValues;
import com.microsoft.bingads.v13.internal.bulk.SimpleBulkMapping;
import com.microsoft.bingads.v13.internal.bulk.StringExtensions;
import com.microsoft.bingads.v13.internal.bulk.StringTable;
import com.microsoft.bingads.v13.internal.bulk.entities.SingleRecordBulkEntity;
/**
* Represents an Asset Group Listing Group.
*
*
* This class exposes the {@link #setAssetGroupListingGroup} and {@link #getAssetGroupListingGroup} that can be used to read and write
* fields of the Audience Group Asset Group Association record in a bulk file.
*
*
*
* For more information, see Asset Group Listing Group at
* https://go.microsoft.com/fwlink/?linkid=846127.
*
*
* @see BulkServiceManager
* @see BulkOperation
* @see BulkFileReader
* @see BulkFileWriter
*/
public class BulkAssetGroupListingGroup extends SingleRecordBulkEntity {
private Status status;
private String assetGroupName;
private String campaignName;
private AssetGroupListingGroup AssetGroupListingGroup;
private static final List> MAPPINGS;
static {
List> m = new ArrayList>();
m.add(new SimpleBulkMapping(StringTable.Status,
new Function() {
@Override
public String apply(BulkAssetGroupListingGroup c) {
return c.getStatus() != null ? c.getStatus().value() : null;
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkAssetGroupListingGroup c) {
c.setStatus(StringExtensions.parseOptional(v, new Function() {
@Override
public Status apply(String value) {
return Status.fromValue(value);
}
}));
}
}
));
m.add(new SimpleBulkMapping(StringTable.Id,
new Function() {
@Override
public Long apply(BulkAssetGroupListingGroup c) {
return c.getAssetGroupListingGroup().getId();
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkAssetGroupListingGroup c) {
c.getAssetGroupListingGroup().setId(StringExtensions.nullOrLong(v));
}
}
));
m.add(new SimpleBulkMapping(StringTable.ParentId,
new Function() {
@Override
public Long apply(BulkAssetGroupListingGroup c) {
return c.getAssetGroupListingGroup().getAssetGroupId();
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkAssetGroupListingGroup c) {
c.getAssetGroupListingGroup().setAssetGroupId(StringExtensions.nullOrLong(v));
}
}
));
m.add(new SimpleBulkMapping(StringTable.AssetGroup,
new Function() {
@Override
public String apply(BulkAssetGroupListingGroup c) {
return c.getAssetGroupName();
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkAssetGroupListingGroup c) {
c.setAssetGroupName(v);
}
}
));
m.add(new SimpleBulkMapping(StringTable.Campaign,
new Function() {
@Override
public String apply(BulkAssetGroupListingGroup c) {
return c.getCampaignName();
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkAssetGroupListingGroup c) {
c.setCampaignName(v);
}
}
));
m.add(new SimpleBulkMapping(StringTable.IsExcluded,
new Function() {
@Override
public String apply(BulkAssetGroupListingGroup c) {
return StringExtensions.toBooleanBulkString(c.getAssetGroupListingGroup().getIsExcluded());
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkAssetGroupListingGroup c) {
c.getAssetGroupListingGroup().setIsExcluded(StringExtensions.parseOptional(v, new Function() {
@Override
public Boolean apply(String value) {
return Boolean.parseBoolean(value);
}
}));
}
}
));
m.add(new SimpleBulkMapping(StringTable.ParentListingGroupId,
new Function() {
@Override
public Long apply(BulkAssetGroupListingGroup c) {
return c.getAssetGroupListingGroup().getParentListingGroupId();
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkAssetGroupListingGroup c) {
c.getAssetGroupListingGroup().setParentListingGroupId(StringExtensions.nullOrLong(v));
}
}
));
m.add(new SimpleBulkMapping(StringTable.SubType,
new Function() {
@Override
public String apply(BulkAssetGroupListingGroup c) {
return c.getAssetGroupListingGroup().getAssetGroupListingType() != null ? c.getAssetGroupListingGroup().getAssetGroupListingType().value() : null;
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkAssetGroupListingGroup c) {
c.getAssetGroupListingGroup().setAssetGroupListingType(StringExtensions.parseOptional(v, new Function() {
@Override
public AssetGroupListingType apply(String value) {
return AssetGroupListingType.fromValue(value);
}
}));
}
}
));
m.add(new SimpleBulkMapping(StringTable.ProductCondition1,
new Function() {
@Override
public String apply(BulkAssetGroupListingGroup c) {
ProductCondition productCondition = c.getAssetGroupListingGroup().getDimension();
return productCondition == null ? null : productCondition.getOperand();
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkAssetGroupListingGroup c) {
c.getAssetGroupListingGroup().getDimension().setOperand(v);
}
}
));
m.add(new SimpleBulkMapping(StringTable.ProductValue1,
new Function() {
@Override
public String apply(BulkAssetGroupListingGroup c) {
ProductCondition productCondition = c.getAssetGroupListingGroup().getDimension();
return productCondition == null ? null : productCondition.getAttribute();
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkAssetGroupListingGroup c) {
c.getAssetGroupListingGroup().getDimension().setAttribute(v);
}
}
));
MAPPINGS = Collections.unmodifiableList(m);
}
@Override
public void processMappingsFromRowValues(RowValues values) {
AssetGroupListingGroup assetGroupListingGroup = new AssetGroupListingGroup();
assetGroupListingGroup.setDimension(new ProductCondition());
this.setAssetGroupListingGroup(assetGroupListingGroup);
MappingHelpers.convertToEntity(values, MAPPINGS, this);
}
@Override
public void processMappingsToRowValues(RowValues values, boolean excludeReadonlyData) {
validatePropertyNotNull(getAssetGroupListingGroup(), "AssetGroupListingGroup");
MappingHelpers.convertToValues(this, values, MAPPINGS);
}
public AssetGroupListingGroup getAssetGroupListingGroup() {
return AssetGroupListingGroup;
}
public void setAssetGroupListingGroup(AssetGroupListingGroup AssetGroupListingGroup) {
this.AssetGroupListingGroup = AssetGroupListingGroup;
}
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
public String getAssetGroupName() {
return assetGroupName;
}
public void setAssetGroupName(String assetGroupName) {
this.assetGroupName = assetGroupName;
}
public String getCampaignName() {
return campaignName;
}
public void setCampaignName(String campaignName) {
this.campaignName = campaignName;
}
}