Exemple #1
0
// Run makes the HTTP request corresponding to the CreateAccountCommand command.
func (cmd *CreateAccountCommand) Run(c *client.Client) (*http.Response, error) {
	var payload client.CreateAccountPayload
	if cmd.Payload != "" {
		err := json.Unmarshal([]byte(cmd.Payload), &payload)
		if err != nil {
			return nil, fmt.Errorf("failed to deserialize payload: %s", err)
		}
	}
	return c.CreateAccount(cmd.Path, &payload)
}
Exemple #2
0
// Run makes the HTTP request corresponding to the DeleteAccountCommand command.
func (cmd *DeleteAccountCommand) Run(c *client.Client) (*http.Response, error) {
	return c.DeleteAccount(cmd.Path)
}
Exemple #3
0
// Run makes the HTTP request corresponding to the ShowBottleCommand command.
func (cmd *ShowBottleCommand) Run(c *client.Client) (*http.Response, error) {
	return c.ShowBottle(cmd.Path)
}
Exemple #4
0
// Run makes the HTTP request corresponding to the ListBottleCommand command.
func (cmd *ListBottleCommand) Run(c *client.Client) (*http.Response, error) {
	return c.ListBottle(cmd.Path, cmd.Years)
}