예제 #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)
}
예제 #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)
}
예제 #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)
}
예제 #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)
}