square_api_client/models/create_catalog_image_request.rs
1//! Request struct for the Create Catalog Image API
2
3use serde::Serialize;
4
5use super::CatalogObject;
6
7/// This is a model class for CreateCatalogImageRequest type.
8#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)]
9pub struct CreateCatalogImageRequest {
10 /// A unique string that identifies this CreateCatalogImage request. Keys can be any valid
11 /// string but must be unique for every CreateCatalogImage request.
12 ///
13 /// See [Idempotency keys](https://developer.squareup.com/docs/basics/api101/idempotency) for
14 /// more information.
15 pub idempotency_key: String,
16 /// Unique ID of the `CatalogObject` to attach this `CatalogImage` object to. Leave this field
17 /// empty to create unattached images, for example if you are building an integration where an
18 /// image can be attached to catalog items at a later time.
19 pub object_id: Option<String>,
20 /// The new `CatalogObject` of the `IMAGE` type, namely, a `CatalogImage` object, to encapsulate
21 /// the specified image file.
22 pub image: CatalogObject,
23 /// If this is set to `true`, the image created will be the primary, or first image of the
24 /// object referenced by `object_id`. If the `CatalogObject` already has a primary
25 /// `CatalogImage`, setting this field to `true` will replace the primary image. If this is set
26 /// to `false` and you use the Square API version 2021-12-15 or later, the image id will be
27 /// appended to the list of `image_ids` on the object.
28 ///
29 /// With Square API version 2021-12-15 or later, the default value is `false`. Otherwise, the
30 /// effective default value is `true`.
31 pub is_primary: Option<bool>,
32}