Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GroupCmd = &cobra.Command{ Use: "feedback", Short: "Feedback commands", Args: cobra.ArbitraryArgs, RunE: utils.GroupRunE, }
View Source
var SubmitCmd = &cobra.Command{ Use: "submit <mailbox-resource-id>", Short: "Submit feedback", Long: "Send the user's feedback about the Hostinger Email API to the Hostinger mail team.\n\nOnly call this when the user explicitly asks to send feedback, report a problem, or request a feature. Send the user's own words; never include tokens, passwords or email contents. The message is capped at 2000 characters.\n\nA `429` (`ERR_FEEDBACK_RATE_LIMIT`) means feedback for this customer was submitted less than ten seconds ago; wait and retry.", Example: " hostinger-mail feedback submit my-mailbox-resource-id --message 'Sending a message with a 10 MB attachment fails with a timeout.' --score 3", ValidArgsFunction: cobra.NoFileCompletions, RunE: func(cmd *cobra.Command, args []string) error { args = utils.PromptedArgs(cmd, args) body, err := submitBody(cmd) if err != nil { return err } payload, err := json.Marshal(body) if err != nil { return err } call := func(ctx context.Context) ([]byte, int, error) { r, err := api.Request().SubmitFeedbackWithBodyWithResponse(ctx, args[0], "application/json", bytes.NewReader(payload)) if err != nil { return nil, 0, err } return r.Body, r.StatusCode(), nil } respBody, status, err := call(cmd.Context()) if err != nil { return err } return output.Format(cmd, respBody, status) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.