Skip to content

Commit a6dc254

Browse files
chore: regenerate CLI from OpenAPI spec
1 parent c939b7d commit a6dc254

3 files changed

Lines changed: 78 additions & 26 deletions

File tree

‎client/client.gen.go‎

Lines changed: 66 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cmd/ecommerce/products/upload_and_attach_image.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
var UploadAndAttachImageCmd = &cobra.Command{
1515
Use: "upload-and-attach-image <store_id> <product_id>",
1616
Short: "Upload and attach a product image",
17-
Long: "Fetch a raster image (JPEG, PNG, GIF or WebP, max 15MB) from a URL and attach it to a product in a\nsingle call. The image is virus-scanned and validated by content, then stored on the CDN. Set\nis_thumbnail to make it the product's primary image.",
17+
Long: "Fetch a raster image (JPEG, PNG, GIF or WebP, max 15MB) from a URL and attach it to a product in a\nsingle call. Image downloads require HTTPS on port 443 without embedded credentials. At most one redirect\nis allowed, and its destination must meet the same requirements. Private or reserved network\ndestinations, unsupported URLs and longer redirect chains are rejected. The image is virus-scanned\nand validated by content, then stored on the CDN. Set is_thumbnail to make it the product's primary image.",
1818
Args: cobra.MatchAll(cobra.ExactArgs(2)),
1919
Run: func(cmd *cobra.Command, args []string) {
2020
payload, err := json.Marshal(uploadAndAttachImageBody(cmd))
@@ -31,7 +31,7 @@ var UploadAndAttachImageCmd = &cobra.Command{
3131
}
3232

3333
func init() {
34-
UploadAndAttachImageCmd.Flags().StringP("image-url", "", "", "Publicly reachable URL of the raster image (JPEG, PNG, GIF or WebP), maximum 15MB. The image is\nfetched, virus-scanned and validated by content, then stored on the CDN. SVG is not accepted.\nProvide either this or object_name.")
34+
UploadAndAttachImageCmd.Flags().StringP("image-url", "", "", "Publicly reachable URL of a raster image (JPEG, PNG, GIF or WebP), maximum 15MB. Fetching\nthe image requires HTTPS on port 443 without embedded credentials. At most one redirect\nis allowed; its destination must meet the same URL requirements. Private or reserved\nnetwork destinations, unsupported URLs and longer redirect chains are rejected. The image\nis fetched, virus-scanned and validated by content, then stored on the CDN. SVG is not\naccepted. Provide either this or object_name.")
3535
UploadAndAttachImageCmd.Flags().BoolP("is-thumbnail", "", false, "When true, the image becomes the product's thumbnail (primary image). When omitted, it becomes the\nthumbnail only if the product does not have one yet.")
3636
UploadAndAttachImageCmd.Flags().StringP("object-name", "", "", "Key returned by the upload-url endpoint. Provide this instead of image_url to attach an uploaded image.")
3737
}

‎docs/hostinger_ecommerce_products_upload-and-attach-image.md‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ Upload and attach a product image
55
### Synopsis
66

77
Fetch a raster image (JPEG, PNG, GIF or WebP, max 15MB) from a URL and attach it to a product in a
8-
single call. The image is virus-scanned and validated by content, then stored on the CDN. Set
9-
is_thumbnail to make it the product's primary image.
8+
single call. Image downloads require HTTPS on port 443 without embedded credentials. At most one redirect
9+
is allowed, and its destination must meet the same requirements. Private or reserved network
10+
destinations, unsupported URLs and longer redirect chains are rejected. The image is virus-scanned
11+
and validated by content, then stored on the CDN. Set is_thumbnail to make it the product's primary image.
1012

1113
```
1214
hostinger ecommerce products upload-and-attach-image <store_id> <product_id> [flags]
@@ -16,9 +18,12 @@ hostinger ecommerce products upload-and-attach-image <store_id> <product_id> [fl
1618

1719
```
1820
-h, --help help for upload-and-attach-image
19-
--image-url string Publicly reachable URL of the raster image (JPEG, PNG, GIF or WebP), maximum 15MB. The image is
20-
fetched, virus-scanned and validated by content, then stored on the CDN. SVG is not accepted.
21-
Provide either this or object_name.
21+
--image-url string Publicly reachable URL of a raster image (JPEG, PNG, GIF or WebP), maximum 15MB. Fetching
22+
the image requires HTTPS on port 443 without embedded credentials. At most one redirect
23+
is allowed; its destination must meet the same URL requirements. Private or reserved
24+
network destinations, unsupported URLs and longer redirect chains are rejected. The image
25+
is fetched, virus-scanned and validated by content, then stored on the CDN. SVG is not
26+
accepted. Provide either this or object_name.
2227
--is-thumbnail When true, the image becomes the product's thumbnail (primary image). When omitted, it becomes the
2328
thumbnail only if the product does not have one yet.
2429
--object-name string Key returned by the upload-url endpoint. Provide this instead of image_url to attach an uploaded image.

0 commit comments

Comments
 (0)