|
| 1 | +from bingads.service_client import _CAMPAIGN_OBJECT_FACTORY_V13 |
| 2 | + |
| 3 | +from bingads.v13.internal.bulk.string_table import _StringTable |
| 4 | +from bingads.v13.internal.bulk.entities.single_record_bulk_entity import _SingleRecordBulkEntity |
| 5 | +from bingads.v13.internal.bulk.mappings import _SimpleBulkMapping, _ComplexBulkMapping |
| 6 | +from bingads.v13.internal.extensions import * |
| 7 | + |
| 8 | +class BulkAssetGroupUrlTarget(_SingleRecordBulkEntity): |
| 9 | + """ Represents an asset group url target. |
| 10 | +
|
| 11 | + This class exposes the property :attr:`asset_group_url_target` that can be read and written as fields of the asset group url target record |
| 12 | + in a bulk file. |
| 13 | +
|
| 14 | + For more information, see Asset Group at https://go.microsoft.com/fwlink/?linkid=846127. |
| 15 | +
|
| 16 | + *See also:* |
| 17 | +
|
| 18 | + * :class:`.BulkServiceManager` |
| 19 | + * :class:`.BulkOperation` |
| 20 | + * :class:`.BulkFileReader` |
| 21 | + * :class:`.BulkFileWriter` |
| 22 | + """ |
| 23 | + |
| 24 | + def __init__(self, status=None): |
| 25 | + super(BulkAssetGroupUrlTarget, self).__init__() |
| 26 | + |
| 27 | + self._status = status |
| 28 | + self._id = None |
| 29 | + self._asset_group_id = None |
| 30 | + self._target_condition1 = None |
| 31 | + self._target_condition2 = None |
| 32 | + self._target_condition3 = None |
| 33 | + self._target_condition_operator1 = None |
| 34 | + self._target_condition_operator2 = None |
| 35 | + self._target_condition_operator3 = None |
| 36 | + self._target_value1 = None |
| 37 | + self._target_value2 = None |
| 38 | + self._target_value3 = None |
| 39 | + |
| 40 | + @property |
| 41 | + def status(self): |
| 42 | + return self._status |
| 43 | + |
| 44 | + @status.setter |
| 45 | + def status(self, status): |
| 46 | + self._status = status |
| 47 | + |
| 48 | + @property |
| 49 | + def id(self): |
| 50 | + return self._id |
| 51 | + |
| 52 | + @id.setter |
| 53 | + def id(self, id): |
| 54 | + self._id = id |
| 55 | + |
| 56 | + @property |
| 57 | + def asset_group_id(self): |
| 58 | + return self._asset_group_id |
| 59 | + |
| 60 | + @asset_group_id.setter |
| 61 | + def asset_group_id(self, asset_group_id): |
| 62 | + self._asset_group_id = asset_group_id |
| 63 | + |
| 64 | + @property |
| 65 | + def target_condition1(self): |
| 66 | + return self._target_condition1 |
| 67 | + |
| 68 | + @target_condition1.setter |
| 69 | + def target_condition1(self, target_condition1): |
| 70 | + self._target_condition1 = target_condition1 |
| 71 | + |
| 72 | + @property |
| 73 | + def target_condition2(self): |
| 74 | + return self._target_condition2 |
| 75 | + |
| 76 | + @target_condition2.setter |
| 77 | + def target_condition2(self, target_condition2): |
| 78 | + self._target_condition2 = target_condition2 |
| 79 | + |
| 80 | + @property |
| 81 | + def target_condition3(self): |
| 82 | + return self._target_condition3 |
| 83 | + |
| 84 | + @target_condition3.setter |
| 85 | + def target_condition3(self, target_condition3): |
| 86 | + self._target_condition3 = target_condition3 |
| 87 | + |
| 88 | + @property |
| 89 | + def target_condition_operator1(self): |
| 90 | + return self._target_condition_operator1 |
| 91 | + |
| 92 | + @target_condition_operator1.setter |
| 93 | + def target_condition_operator1(self, target_condition_operator1): |
| 94 | + self._target_condition_operator1 = target_condition_operator1 |
| 95 | + |
| 96 | + @property |
| 97 | + def target_condition_operator2(self): |
| 98 | + return self._target_condition_operator2 |
| 99 | + |
| 100 | + @target_condition_operator2.setter |
| 101 | + def target_condition_operator2(self, target_condition_operator2): |
| 102 | + self._target_condition_operator2 = target_condition_operator2 |
| 103 | + |
| 104 | + @property |
| 105 | + def target_condition_operator3(self): |
| 106 | + return self._target_condition_operator3 |
| 107 | + |
| 108 | + @target_condition_operator3.setter |
| 109 | + def target_condition_operator3(self, target_condition_operator3): |
| 110 | + self._target_condition_operator3 = target_condition_operator3 |
| 111 | + |
| 112 | + @property |
| 113 | + def target_value1(self): |
| 114 | + return self._target_value1 |
| 115 | + |
| 116 | + @target_value1.setter |
| 117 | + def target_value1(self, target_value1): |
| 118 | + self._target_value1 = target_value1 |
| 119 | + |
| 120 | + @property |
| 121 | + def target_value2(self): |
| 122 | + return self._target_value2 |
| 123 | + |
| 124 | + @target_value2.setter |
| 125 | + def target_value2(self, target_value2): |
| 126 | + self._target_value2 = target_value2 |
| 127 | + |
| 128 | + @property |
| 129 | + def target_value3(self): |
| 130 | + return self._target_value3 |
| 131 | + |
| 132 | + @target_value3.setter |
| 133 | + def target_value3(self, target_value3): |
| 134 | + self._target_value3 = target_value3 |
| 135 | + |
| 136 | + _MAPPINGS = [ |
| 137 | + _SimpleBulkMapping( |
| 138 | + header=_StringTable.Id, |
| 139 | + field_to_csv=lambda c: bulk_str(c.id), |
| 140 | + csv_to_field=lambda c, v: setattr(c, 'id', int(v) if v else None) |
| 141 | + ), |
| 142 | + _SimpleBulkMapping( |
| 143 | + header=_StringTable.Status, |
| 144 | + field_to_csv=lambda c: bulk_str(c.status), |
| 145 | + csv_to_field=lambda c, v: setattr(c, 'status', v if v else None) |
| 146 | + ), |
| 147 | + _SimpleBulkMapping( |
| 148 | + header=_StringTable.ParentId, |
| 149 | + field_to_csv=lambda c: bulk_str(c.asset_group_id), |
| 150 | + csv_to_field=lambda c, v: setattr(c, 'asset_group_id', int(v) if v else None) |
| 151 | + ), |
| 152 | + _SimpleBulkMapping( |
| 153 | + header=_StringTable.AssetGroupTargetCondition1, |
| 154 | + field_to_csv=lambda c: c.target_condition1, |
| 155 | + csv_to_field=lambda c, v: setattr(c, 'target_condition1', v) |
| 156 | + ), |
| 157 | + _SimpleBulkMapping( |
| 158 | + header=_StringTable.AssetGroupTargetCondition2, |
| 159 | + field_to_csv=lambda c: c.target_condition2, |
| 160 | + csv_to_field=lambda c, v: setattr(c, 'target_condition2', v) |
| 161 | + ), |
| 162 | + _SimpleBulkMapping( |
| 163 | + header=_StringTable.AssetGroupTargetCondition3, |
| 164 | + field_to_csv=lambda c: c.target_condition3, |
| 165 | + csv_to_field=lambda c, v: setattr(c, 'target_condition3', v) |
| 166 | + ), |
| 167 | + _SimpleBulkMapping( |
| 168 | + header=_StringTable.AssetGroupTargetConditionOperator1, |
| 169 | + field_to_csv=lambda c: c.target_condition_operator1, |
| 170 | + csv_to_field=lambda c, v: setattr(c, 'target_condition_operator1', v) |
| 171 | + ), |
| 172 | + _SimpleBulkMapping( |
| 173 | + header=_StringTable.AssetGroupTargetConditionOperator2, |
| 174 | + field_to_csv=lambda c: c.target_condition_operator2, |
| 175 | + csv_to_field=lambda c, v: setattr(c, 'target_condition_operator2', v) |
| 176 | + ),_SimpleBulkMapping( |
| 177 | + header=_StringTable.AssetGroupTargetConditionOperator3, |
| 178 | + field_to_csv=lambda c: c.target_condition_operator3, |
| 179 | + csv_to_field=lambda c, v: setattr(c, 'target_condition_operator3', v) |
| 180 | + ), |
| 181 | + _SimpleBulkMapping( |
| 182 | + header=_StringTable.AssetGroupTargetValue1, |
| 183 | + field_to_csv=lambda c: c.target_value1, |
| 184 | + csv_to_field=lambda c, v: setattr(c, 'target_value1', v) |
| 185 | + ), |
| 186 | + _SimpleBulkMapping( |
| 187 | + header=_StringTable.AssetGroupTargetValue2, |
| 188 | + field_to_csv=lambda c: c.target_value2, |
| 189 | + csv_to_field=lambda c, v: setattr(c, 'target_value2', v) |
| 190 | + ),_SimpleBulkMapping( |
| 191 | + header=_StringTable.AssetGroupTargetValue3, |
| 192 | + field_to_csv=lambda c: c.target_value3, |
| 193 | + csv_to_field=lambda c, v: setattr(c, 'target_value3', v) |
| 194 | + ), |
| 195 | + ] |
| 196 | + |
| 197 | + |
| 198 | + def process_mappings_from_row_values(self, row_values): |
| 199 | + row_values.convert_to_entity(self, BulkAssetGroupUrlTarget._MAPPINGS) |
| 200 | + |
| 201 | + def process_mappings_to_row_values(self, row_values, exclude_readonly_data): |
| 202 | + self.convert_to_values(row_values, BulkAssetGroupUrlTarget._MAPPINGS) |
| 203 | + |
| 204 | + def read_additional_data(self, stream_reader): |
| 205 | + super(BulkAssetGroupUrlTarget, self).read_additional_data(stream_reader) |
0 commit comments