insert method
- CssProductInput request,
- String parent, {
- String? feedId,
- String? $fields,
Uploads a CssProductInput to your CSS Center account.
If an input with the same contentLanguage, identity, feedLabel and feedId already exists, this method replaces that entry. After inserting, updating, or deleting a CSS Product input, it may take several minutes before the processed CSS Product can be retrieved.
request
- The metadata request object.
Request parameters:
parent
- Required. The account where this CSS Product will be inserted.
Format: accounts/{account}
Value must have pattern ^accounts/\[^/\]+$
.
feedId
- Optional. DEPRECATED. Feed id is not required for CSS Products.
The primary or supplemental feed id. If CSS Product already exists and
feed id provided is different, then the CSS Product will be moved to a new
feed. Note: For now, CSSs do not need to provide feed ids as we create
feeds on the fly. We do not have supplemental feed support for CSS
Products yet.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a CssProductInput.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<CssProductInput> insert(
CssProductInput request,
core.String parent, {
core.String? feedId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (feedId != null) 'feedId': [feedId],
if ($fields != null) 'fields': [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$parent') + '/cssProductInputs:insert';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return CssProductInput.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}