From 4adada31b75bb4db447c6420f7f6b6a0edc3df9e Mon Sep 17 00:00:00 2001 From: domwong Date: Wed, 10 Nov 2021 11:03:07 +0000 Subject: [PATCH] Commit from GitHub Actions (Generate Clients & Examples) --- clients/go/image/image.go | 14 +++++++++++++- clients/ts/package.json | 2 +- ...oAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn.go | 2 ++ ...oAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn.js | 2 ++ examples/image/resize/go/base64ToBase64Image.go | 2 ++ .../resize/go/base64ToBase64ImageWithCropping.go | 2 ++ examples/image/resize/go/base64ToHostedImage.go | 2 ++ examples/image/resize/node/base64ToBase64Image.js | 2 ++ .../resize/node/base64ToBase64ImageWithCropping.js | 2 ++ examples/image/resize/node/base64ToHostedImage.js | 2 ++ .../upload/go/uploadABase64ImageToMicrosCdn.go | 2 ++ .../upload/go/uploadAnImageFromAUrlToMicrosCdn.go | 2 ++ .../upload/node/uploadABase64ImageToMicrosCdn.js | 2 ++ .../node/uploadAnImageFromAUrlToMicrosCdn.js | 2 ++ 14 files changed, 38 insertions(+), 2 deletions(-) diff --git a/clients/go/image/image.go b/clients/go/image/image.go index 3c541b5..6ca06ea 100755 --- a/clients/go/image/image.go +++ b/clients/go/image/image.go @@ -18,6 +18,8 @@ type ImageService struct { // Convert an image from one format (jpeg, png etc.) to an other either on the fly (from base64 to base64), // or by uploading the conversion result. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. func (t *ImageService) Convert(request *ConvertRequest) (*ConvertResponse, error) { rsp := &ConvertResponse{} return rsp, t.client.Call("image", "Convert", request, rsp) @@ -32,6 +34,8 @@ func (t *ImageService) Delete(request *DeleteRequest) (*DeleteResponse, error) { // Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters. // If one of width or height is 0, the image aspect ratio is preserved. // Optional cropping. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. func (t *ImageService) Resize(request *ResizeRequest) (*ResizeResponse, error) { rsp := &ResizeResponse{} return rsp, t.client.Call("image", "Resize", request, rsp) @@ -39,6 +43,8 @@ func (t *ImageService) Resize(request *ResizeRequest) (*ResizeResponse, error) { // Upload an image by either sending a base64 encoded image to this endpoint or a URL. // To resize an image before uploading, see the Resize endpoint. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. func (t *ImageService) Upload(request *UploadRequest) (*UploadResponse, error) { rsp := &UploadResponse{} return rsp, t.client.Call("image", "Upload", request, rsp) @@ -47,6 +53,8 @@ func (t *ImageService) Upload(request *UploadRequest) (*UploadResponse, error) { type ConvertRequest struct { // base64 encoded image to resize, Base64 string `json:"base64"` + // The image file to convert + File string `json:"file"` // output name of the image including extension, ie. "cat.png" Name string `json:"name"` // make output a URL and not a base64 response @@ -97,7 +105,9 @@ type ResizeRequest struct { // if provided, after resize, the image // will be cropped CropOptions *CropOptions `json:"cropOptions"` - Height int64 `json:"height,string"` + // The image file to resize + File string `json:"file"` + Height int64 `json:"height,string"` // output name of the image including extension, ie. "cat.png" Name string `json:"name"` // make output a URL and not a base64 response @@ -115,6 +125,8 @@ type ResizeResponse struct { type UploadRequest struct { // Base64 encoded image to upload, Base64 string `json:"base64"` + // The image file to upload + File string `json:"file"` // Output name of the image including extension, ie. "cat.png" Name string `json:"name"` // URL of the image to upload diff --git a/clients/ts/package.json b/clients/ts/package.json index 361211f..ab7e141 100644 --- a/clients/ts/package.json +++ b/clients/ts/package.json @@ -78,5 +78,5 @@ "prepare": "npm run build" }, "types": "index.d.ts", - "version": "1.0.686" + "version": "1.0.689" } \ No newline at end of file diff --git a/examples/image/convert/go/convertAPngImageToAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn.go b/examples/image/convert/go/convertAPngImageToAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn.go index b501011..10f52a9 100755 --- a/examples/image/convert/go/convertAPngImageToAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn.go +++ b/examples/image/convert/go/convertAPngImageToAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn.go @@ -9,6 +9,8 @@ import ( // Convert an image from one format (jpeg, png etc.) to an other either on the fly (from base64 to base64), // or by uploading the conversion result. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. func ConvertApngImageToAjpegTakenFromAurlAndSavedToAurlOnMicrosCdn() { imageService := image.NewImageService(os.Getenv("MICRO_API_TOKEN")) rsp, err := imageService.Convert(&image.ConvertRequest{ diff --git a/examples/image/convert/node/convertAPngImageToAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn.js b/examples/image/convert/node/convertAPngImageToAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn.js index 945a57c..bd822ab 100755 --- a/examples/image/convert/node/convertAPngImageToAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn.js +++ b/examples/image/convert/node/convertAPngImageToAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn.js @@ -2,6 +2,8 @@ const { ImageService } = require("m3o/image"); // Convert an image from one format (jpeg, png etc.) to an other either on the fly (from base64 to base64), // or by uploading the conversion result. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. async function convertApngImageToAjpegTakenFromAurlAndSavedToAurlOnMicrosCdn() { let imageService = new ImageService(process.env.MICRO_API_TOKEN); let rsp = await imageService.convert({ diff --git a/examples/image/resize/go/base64ToBase64Image.go b/examples/image/resize/go/base64ToBase64Image.go index c39dcc0..45c6b16 100755 --- a/examples/image/resize/go/base64ToBase64Image.go +++ b/examples/image/resize/go/base64ToBase64Image.go @@ -10,6 +10,8 @@ import ( // Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters. // If one of width or height is 0, the image aspect ratio is preserved. // Optional cropping. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. func Base64toBase64image() { imageService := image.NewImageService(os.Getenv("MICRO_API_TOKEN")) rsp, err := imageService.Resize(&image.ResizeRequest{ diff --git a/examples/image/resize/go/base64ToBase64ImageWithCropping.go b/examples/image/resize/go/base64ToBase64ImageWithCropping.go index 9b8669c..cf30979 100755 --- a/examples/image/resize/go/base64ToBase64ImageWithCropping.go +++ b/examples/image/resize/go/base64ToBase64ImageWithCropping.go @@ -10,6 +10,8 @@ import ( // Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters. // If one of width or height is 0, the image aspect ratio is preserved. // Optional cropping. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. func Base64toBase64imageWithCropping() { imageService := image.NewImageService(os.Getenv("MICRO_API_TOKEN")) rsp, err := imageService.Resize(&image.ResizeRequest{ diff --git a/examples/image/resize/go/base64ToHostedImage.go b/examples/image/resize/go/base64ToHostedImage.go index f3a194c..11ac211 100755 --- a/examples/image/resize/go/base64ToHostedImage.go +++ b/examples/image/resize/go/base64ToHostedImage.go @@ -10,6 +10,8 @@ import ( // Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters. // If one of width or height is 0, the image aspect ratio is preserved. // Optional cropping. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. func Base64toHostedImage() { imageService := image.NewImageService(os.Getenv("MICRO_API_TOKEN")) rsp, err := imageService.Resize(&image.ResizeRequest{ diff --git a/examples/image/resize/node/base64ToBase64Image.js b/examples/image/resize/node/base64ToBase64Image.js index 5efe39b..4807902 100755 --- a/examples/image/resize/node/base64ToBase64Image.js +++ b/examples/image/resize/node/base64ToBase64Image.js @@ -3,6 +3,8 @@ const { ImageService } = require("m3o/image"); // Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters. // If one of width or height is 0, the image aspect ratio is preserved. // Optional cropping. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. async function base64toBase64image() { let imageService = new ImageService(process.env.MICRO_API_TOKEN); let rsp = await imageService.resize({ diff --git a/examples/image/resize/node/base64ToBase64ImageWithCropping.js b/examples/image/resize/node/base64ToBase64ImageWithCropping.js index 663c575..d8ad4ff 100755 --- a/examples/image/resize/node/base64ToBase64ImageWithCropping.js +++ b/examples/image/resize/node/base64ToBase64ImageWithCropping.js @@ -3,6 +3,8 @@ const { ImageService } = require("m3o/image"); // Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters. // If one of width or height is 0, the image aspect ratio is preserved. // Optional cropping. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. async function base64toBase64imageWithCropping() { let imageService = new ImageService(process.env.MICRO_API_TOKEN); let rsp = await imageService.resize({ diff --git a/examples/image/resize/node/base64ToHostedImage.js b/examples/image/resize/node/base64ToHostedImage.js index 8bc4ac3..3aebf75 100755 --- a/examples/image/resize/node/base64ToHostedImage.js +++ b/examples/image/resize/node/base64ToHostedImage.js @@ -3,6 +3,8 @@ const { ImageService } = require("m3o/image"); // Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters. // If one of width or height is 0, the image aspect ratio is preserved. // Optional cropping. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. async function base64toHostedImage() { let imageService = new ImageService(process.env.MICRO_API_TOKEN); let rsp = await imageService.resize({ diff --git a/examples/image/upload/go/uploadABase64ImageToMicrosCdn.go b/examples/image/upload/go/uploadABase64ImageToMicrosCdn.go index 669262a..421c8cc 100755 --- a/examples/image/upload/go/uploadABase64ImageToMicrosCdn.go +++ b/examples/image/upload/go/uploadABase64ImageToMicrosCdn.go @@ -9,6 +9,8 @@ import ( // Upload an image by either sending a base64 encoded image to this endpoint or a URL. // To resize an image before uploading, see the Resize endpoint. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. func UploadAbase64imageToMicrosCdn() { imageService := image.NewImageService(os.Getenv("MICRO_API_TOKEN")) rsp, err := imageService.Upload(&image.UploadRequest{ diff --git a/examples/image/upload/go/uploadAnImageFromAUrlToMicrosCdn.go b/examples/image/upload/go/uploadAnImageFromAUrlToMicrosCdn.go index 8a8e75d..f516861 100755 --- a/examples/image/upload/go/uploadAnImageFromAUrlToMicrosCdn.go +++ b/examples/image/upload/go/uploadAnImageFromAUrlToMicrosCdn.go @@ -9,6 +9,8 @@ import ( // Upload an image by either sending a base64 encoded image to this endpoint or a URL. // To resize an image before uploading, see the Resize endpoint. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. func UploadAnImageFromAurlToMicrosCdn() { imageService := image.NewImageService(os.Getenv("MICRO_API_TOKEN")) rsp, err := imageService.Upload(&image.UploadRequest{ diff --git a/examples/image/upload/node/uploadABase64ImageToMicrosCdn.js b/examples/image/upload/node/uploadABase64ImageToMicrosCdn.js index a04f0f3..ddd20e6 100755 --- a/examples/image/upload/node/uploadABase64ImageToMicrosCdn.js +++ b/examples/image/upload/node/uploadABase64ImageToMicrosCdn.js @@ -2,6 +2,8 @@ const { ImageService } = require("m3o/image"); // Upload an image by either sending a base64 encoded image to this endpoint or a URL. // To resize an image before uploading, see the Resize endpoint. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. async function uploadAbase64imageToMicrosCdn() { let imageService = new ImageService(process.env.MICRO_API_TOKEN); let rsp = await imageService.upload({ diff --git a/examples/image/upload/node/uploadAnImageFromAUrlToMicrosCdn.js b/examples/image/upload/node/uploadAnImageFromAUrlToMicrosCdn.js index 2317ee7..2b53576 100755 --- a/examples/image/upload/node/uploadAnImageFromAUrlToMicrosCdn.js +++ b/examples/image/upload/node/uploadAnImageFromAUrlToMicrosCdn.js @@ -2,6 +2,8 @@ const { ImageService } = require("m3o/image"); // Upload an image by either sending a base64 encoded image to this endpoint or a URL. // To resize an image before uploading, see the Resize endpoint. +// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json +// with each parameter as a form field. async function uploadAnImageFromAurlToMicrosCdn() { let imageService = new ImageService(process.env.MICRO_API_TOKEN); let rsp = await imageService.upload({